|
@ -16,23 +16,23 @@ namespace Multiplayer |
|
|
public class PlayerMsg : MessageBase |
|
|
public class PlayerMsg : MessageBase |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
public ushort playerID; |
|
|
|
|
|
|
|
|
public byte ID; |
|
|
|
|
|
|
|
|
public PlayerMsg() { } |
|
|
public PlayerMsg() { } |
|
|
|
|
|
|
|
|
public PlayerMsg(ushort playerID) |
|
|
|
|
|
|
|
|
public PlayerMsg(byte playerID) |
|
|
{ |
|
|
{ |
|
|
this.playerID = playerID; |
|
|
|
|
|
|
|
|
this.ID = playerID; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public override void Serialize(NetworkWriter writer) |
|
|
public override void Serialize(NetworkWriter writer) |
|
|
{ |
|
|
{ |
|
|
writer.Write(playerID); |
|
|
|
|
|
|
|
|
writer.Write(ID); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public override void Deserialize(NetworkReader reader) |
|
|
public override void Deserialize(NetworkReader reader) |
|
|
{ |
|
|
{ |
|
|
playerID = reader.ReadUInt16(); |
|
|
|
|
|
|
|
|
ID = reader.ReadByte(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
@ -43,7 +43,7 @@ namespace Multiplayer |
|
|
public Vector3 vector; |
|
|
public Vector3 vector; |
|
|
|
|
|
|
|
|
public VectorMsg() { } |
|
|
public VectorMsg() { } |
|
|
public VectorMsg(ushort PlayerID, Vector3 Vector) : base(PlayerID) |
|
|
|
|
|
|
|
|
public VectorMsg(byte PlayerID, Vector3 Vector) : base(PlayerID) |
|
|
{ |
|
|
{ |
|
|
this.vector = Vector; |
|
|
this.vector = Vector; |
|
|
} |
|
|
} |
|
@ -67,7 +67,7 @@ namespace Multiplayer |
|
|
public Quaternion quaternion; |
|
|
public Quaternion quaternion; |
|
|
|
|
|
|
|
|
public QuaternionMsg() { } |
|
|
public QuaternionMsg() { } |
|
|
public QuaternionMsg(ushort PlayerID, Quaternion quaternion) : base(PlayerID) |
|
|
|
|
|
|
|
|
public QuaternionMsg(byte PlayerID, Quaternion quaternion) : base(PlayerID) |
|
|
{ |
|
|
{ |
|
|
this.quaternion = quaternion; |
|
|
this.quaternion = quaternion; |
|
|
} |
|
|
} |
|
@ -95,7 +95,7 @@ namespace Multiplayer |
|
|
|
|
|
|
|
|
public StringMsg() { } |
|
|
public StringMsg() { } |
|
|
|
|
|
|
|
|
public StringMsg(ushort PlayerID, string String) : base(PlayerID) |
|
|
|
|
|
|
|
|
public StringMsg(byte PlayerID, string String) : base(PlayerID) |
|
|
{ |
|
|
{ |
|
|
this.String = String; |
|
|
this.String = String; |
|
|
} |
|
|
} |
|
@ -104,7 +104,6 @@ namespace Multiplayer |
|
|
public override void Serialize(NetworkWriter writer) |
|
|
public override void Serialize(NetworkWriter writer) |
|
|
{ |
|
|
{ |
|
|
base.Serialize(writer); |
|
|
base.Serialize(writer); |
|
|
|
|
|
|
|
|
writer.Write(String); |
|
|
writer.Write(String); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|