public void GetPacket(object obj, PacketBufferEventArg e)
        {
            ServerPacketEnum packetType = (ServerPacketEnum)e.PacketId;
            BigEndianReader  reader     = new BigEndianReader(e.Data);
            NetworkMessage   msg        = MessageReceiver.BuildMessage(e.PacketId, reader);

            if (msg == null)
            {
                ReceiveNullPacket.Raise(this, new NullPacketEventArg(packetType));
            }
            else
            {
                ReceivePacket.Raise(this, new PacketEventArg(msg));
            }
        }
Example #2
0
 protected virtual void OnReceivePacketBuffer(PacketBufferEventArg e)
 {
     ReceivePacketBuffer.Raise(this, e);
 }