quantum-space-buddies/QuantumUNET/QSBPeerAuthorityMessage.cs

27 lines
612 B
C#
Raw Normal View History

2020-12-04 09:29:23 +00:00
using UnityEngine.Networking;
2020-12-04 09:23:27 +00:00
2020-12-04 22:14:53 +00:00
namespace QuantumUNET
2020-12-04 09:23:27 +00:00
{
public class QSBPeerAuthorityMessage : QSBMessageBase
{
public override void Deserialize(QSBNetworkReader reader)
{
this.connectionId = (int)reader.ReadPackedUInt32();
this.netId = reader.ReadNetworkId();
this.authorityState = reader.ReadBoolean();
}
public override void Serialize(QSBNetworkWriter writer)
{
writer.WritePackedUInt32((uint)this.connectionId);
writer.Write(this.netId);
writer.Write(this.authorityState);
}
public int connectionId;
public NetworkInstanceId netId;
public bool authorityState;
}
2020-12-04 09:29:23 +00:00
}