diff --git a/Assets/Mirror/Runtime/ClientScene.cs b/Assets/Mirror/Runtime/ClientScene.cs index 8419bdca6..fee75c5f6 100644 --- a/Assets/Mirror/Runtime/ClientScene.cs +++ b/Assets/Mirror/Runtime/ClientScene.cs @@ -106,7 +106,7 @@ public static bool AddPlayer(NetworkConnection readyConn, MessageBase extraMessa { NetworkWriter writer = new NetworkWriter(); extraMessage.Serialize(writer); - msg.msgData = writer.ToArray(); + msg.value = writer.ToArray(); } s_ReadyConnection.Send((short)MsgType.AddPlayer, msg); return true; diff --git a/Assets/Mirror/Runtime/Messages.cs b/Assets/Mirror/Runtime/Messages.cs index 29c42a2f4..0d829b2a1 100644 --- a/Assets/Mirror/Runtime/Messages.cs +++ b/Assets/Mirror/Runtime/Messages.cs @@ -145,20 +145,7 @@ public class ReadyMessage : EmptyMessage {} public class NotReadyMessage : EmptyMessage {} - public class AddPlayerMessage : MessageBase - { - public byte[] msgData; - - public override void Deserialize(NetworkReader reader) - { - msgData = reader.ReadBytesAndSize(); - } - - public override void Serialize(NetworkWriter writer) - { - writer.WriteBytesAndSize(msgData); - } - } + public class AddPlayerMessage : BytesMessage {} public class RemovePlayerMessage : EmptyMessage { diff --git a/Assets/Mirror/Runtime/NetworkManager.cs b/Assets/Mirror/Runtime/NetworkManager.cs index fe2cc2e72..8986b0321 100644 --- a/Assets/Mirror/Runtime/NetworkManager.cs +++ b/Assets/Mirror/Runtime/NetworkManager.cs @@ -510,9 +510,9 @@ internal void OnServerAddPlayerMessageInternal(NetworkMessage netMsg) AddPlayerMessage msg = netMsg.ReadMessage(); - if (msg.msgData != null && msg.msgData.Length > 0) + if (msg.value != null && msg.value.Length > 0) { - NetworkReader reader = new NetworkReader(msg.msgData); + NetworkReader reader = new NetworkReader(msg.value); OnServerAddPlayer(netMsg.conn, reader); } else