Beispiel #1
0
        public static ToffeeInternalPacket Create <T>(ToffeeParticipant sender, ushort opCode, T o)
        {
            ToffeeInternalPacket packet = new ToffeeInternalPacket(sender, opCode);

            packet.WriteStruct(o);
            return(packet);
        }
Beispiel #2
0
 /// <summary>
 /// Builds a packet, and sends it to the server.
 /// </summary>
 /// <param name="opCode">The OpCode of the packet to build.</param>
 /// <param name="o">The packet data.</param>
 public void Send <T>(ushort opCode, T o)
 {
     Send(ToffeeInternalPacket.Create(this, opCode, o).BuildPacket());
 }
Beispiel #3
0
 /// <summary>
 /// Sends a packet to the server.
 /// </summary>
 /// <param name="packet">The data to send.</param>
 public void Send(ToffeeInternalPacket packet)
 {
     Send(packet.BuildPacket());
 }