public void Reply(short msgId, MessageBase msg) { var writer = new NetworkWriter(); writer.WriteInt16(msgId); writer.WriteInt32(callbackId); msg.Serialize(writer); conn.Send(writer.ToArray()); }
public void Reply <T>(T msg) where T : Message, new() { NetworkWriter writer = new NetworkWriter(); int msgType = conn.GetActiveInsight().GetId(default(Message) != null ? typeof(Message) : msg.GetType()); writer.WriteUInt16((ushort)msgType); writer.WriteInt32(callbackId); Writer <T> .write.Invoke(writer, msg); conn.Send(writer.ToArray()); }
public void Reply(MessageBase msg) { NetworkWriter writer = new NetworkWriter(); int msgType = conn.GetActiveInsight().GetId(default(MessageBase) != null ? typeof(MessageBase) : msg.GetType()); writer.WriteUInt16((ushort)msgType); writer.WriteInt32(callbackId); msg.Serialize(writer); conn.Send(writer.ToArray()); }