using UnityEngine.Networking;
namespace Cyber.Networking.Messages {
///
/// Contains the Connection ID of the user and weather the ID belongs to the client or not.
///
public class IdentityPkt : MessageBase {
///
/// ID of the Connection
///
public int ConnectionID;
///
/// Weather the recieving client owns this ID or not.
///
public bool Owned;
///
/// Creates a packet containing an ID and the detail weather the recieving client owns this ID.
///
/// ID of the connection.
/// Weather the recieving client owns this ID.
public IdentityPkt(int connectionID, bool owned) {
ConnectionID = connectionID;
Owned = owned;
}
///
/// Parameter-less constructor using when deserializing the message.
///
public IdentityPkt() {
}
///
/// Used to deserialize a message received via networking.
///
///
public override void Deserialize(NetworkReader reader) {
ConnectionID = reader.ReadInt32();
Owned = reader.ReadBoolean();
}
///
/// Used to serialize the message before it is sent.
///
///
public override void Serialize(NetworkWriter writer) {
writer.Write(ConnectionID);
writer.Write(Owned);
}
}
}