Пример #1
0
 //SENDING:
 public void Send(BasePacket packet)
 {
     Console.WriteLine("Sending Packet");
     byte[] d = packet.getBytes();
     byte[] c = new byte[d.Length + 2];
     BitConverter.GetBytes(Convert.ToInt16(d.Length)).CopyTo(c, 0);
     d.CopyTo(c, 2);
     try{
         this.socket.GetStream().Write(c, 0, c.Length);
     }
     catch {
         this.EmitConnectionLostEvent();
     }
 }
Пример #2
0
 public OnPacketEventArgs(PacketTypes t, BasePacket p)
 {
     this._type   = t;
     this._packet = p;
 }