示例#1
0
文件: GameClient.cs 项目: BjkGkh/Boon
 private void parser_onNewPacket(ClientPacket Message)
 {
     try
     {
         PlusEnvironment.GetGame().GetPacketManager().TryExecutePacket(this, Message);
     }
     catch (Exception e)
     {
         Logging.LogPacketException(Message.ToString(), e.ToString());
     }
 }
示例#2
0
        public void TryExecutePacket(GameClient Session, ClientPacket Packet)
        {
            IPacketEvent Pak = null;

            if (!_incomingPackets.TryGetValue(Packet.Id, out Pak))
            {
                if (System.Diagnostics.Debugger.IsAttached)
                    log.Debug("Unhandled Packet: " + Packet.ToString());
                return;
            }

            if (System.Diagnostics.Debugger.IsAttached)
            {
                if (_packetNames.ContainsKey(Packet.Id))
                    log.Debug("Handled Packet: [" + Packet.Id + "] " + _packetNames[Packet.Id]);
                else
                    log.Debug("Handled Packet: [" + Packet.Id + "] UnnamedPacketEvent");
            }

            if (!IgnoreTasks)
                ExecutePacketAsync(Session, Packet, Pak);
            else
                Pak.Parse(Session, Packet);
        }