Beispiel #1
0
 public void WrapSendPacket(short packet_id, IProtoSerializer packet)
 {
     lock (mutex)
     {
         SerializeHelper.WriteByte(buffer, SocketBuffer.PackageBreaker, ref offset);
         SerializeHelper.WriteShort(buffer, packet_id, ref offset);
         SerializeHelper.WriteByte(buffer, 0, ref offset);
         SerializeHelper.WriteInt(buffer, packet.Length(), ref offset);
         packet.Serialize(buffer, ref offset);
         SerializeHelper.WriteUInt32(buffer, 0, ref offset);
         SerializeHelper.WriteByte(buffer, SocketBuffer.PackageBreaker, ref offset);
     }
 }
        public void Send <T>(T msg)
        {
            var data = m_serializer.Serialize(msg as Google.Protobuf.IMessage);

            m_socket.Send(data);
        }
Beispiel #3
0
        public void Send <T>(string sessionID, T msg)
        {
            var data = m_serializer.Serialize(msg as Google.Protobuf.IMessage);

            m_server.Send(sessionID, data);
        }