private void SerializedEqualsDeserialized(NetworkMsg msg)
        {
            var serialized = msg.Serialize();
            var newMsg     = NetworkMsg.Deserialize(serialized);

            Assert.AreEqual(msg, newMsg);
        }
示例#2
0
 /// <summary>
 /// Sends the given network message to the client on the other end of the network asynchronously
 /// </summary>
 /// <param name="msg"></param>
 /// <returns></returns>
 public async Task SendMessageAsync(NetworkMsg msg)
 {
     await _streamWriter.WriteAndRewindAsync(msg.Serialize());
 }
示例#3
0
 /// <summary>
 /// Sends the given network message to the client on the other end of the network
 /// </summary>
 /// <param name="msg"></param>
 public void SendMessage(NetworkMsg msg)
 {
     _streamWriter.WriteAndRewind(msg.Serialize());
 }