using UnityEngine.Networking;
namespace Cyber.Networking.Messages {
///
/// Packet containing a mesasge, that someone has disconnected.
///
public class DisconnectPkt : MessageBase {
///
/// ID of the connection, which disconnected.
///
public int ConnectionID;
///
/// Creates a disconnect package.
///
///
public DisconnectPkt(int connectionID) {
ConnectionID = connectionID;
}
///
/// Creates an empty disconnect package for whatever reason.
///
public DisconnectPkt() { }
///
/// Deserializes the disconnect package.
///
///
public override void Deserialize(NetworkReader reader) {
ConnectionID = reader.ReadInt32();
}
///
/// Serializes the disconnect package for sending!
///
///
public override void Serialize(NetworkWriter writer) {
writer.Write(ConnectionID);
}
}
}