Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
0
        public void Send <T>(T msg)
        {
            var data = m_serializer.Serialize(msg as Google.Protobuf.IMessage);

            m_socket.Send(data);
        }
Ejemplo n.º 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);
        }