コード例 #1
0
        public void Reply(short msgId, MessageBase msg)
        {
            var writer = new NetworkWriter();

            writer.WriteInt16(msgId);
            writer.WriteInt32(callbackId);
            msg.Serialize(writer);

            conn.Send(writer.ToArray());
        }
コード例 #2
0
        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());
        }
コード例 #3
0
        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());
        }