Skip to content

Commit

Permalink
perf: AddPlayerMessage is now a value type
Browse files Browse the repository at this point in the history
  • Loading branch information
paulpach committed Jul 30, 2019
1 parent b5b2f3e commit 246a551
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Assets/Mirror/Runtime/Messages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,20 @@ public struct NotReadyMessage : IMessageBase
public void Serialize(NetworkWriter writer) { }
}

public class AddPlayerMessage : BytesMessage {}
public struct AddPlayerMessage : IMessageBase
{
public byte[] value;

public void Deserialize(NetworkReader reader)
{
value = reader.ReadBytesAndSize();
}

public void Serialize(NetworkWriter writer)
{
writer.WriteBytesAndSize(value);
}
}

public struct RemovePlayerMessage : IMessageBase
{
Expand Down

0 comments on commit 246a551

Please sign in to comment.