Ejemplo n.º 1
0
        public override void OnGameData(BaseSceneGame game, GamePlayer player, GSPacketIn packet)
        {
            TankCmdType type = (TankCmdType)packet.ReadByte();

            try
            {
                if (game.GameState == eGameState.OVER && type != TankCmdType.PICK)
                {
                    return;
                }

                ICommandHandler handleCommand = _commandMgr.LoadCommandHandler((int)type);
                if (handleCommand != null)
                {
                    handleCommand.HandleCommand(this, player, packet);
                }
                else
                {
                    log.Error(string.Format("IP: {0}", player.Client.TcpEndpoint));
                }
            }
            catch (Exception e)
            {
                log.Error(string.Format("IP:{1}, OnGameData is Error: {0}", e.ToString(), player.Client.TcpEndpoint));
            }
        }
Ejemplo n.º 2
0
 public void Execute(BaseGame game, long tick)
 {
     if (m_player.IsActive)
     {
         TankCmdType type = (TankCmdType)m_packet.ReadByte();
         try
         {
             ICommandHandler handleCommand = CommandMgr.LoadCommandHandler((int)type);
             if (handleCommand != null)
             {
                 handleCommand.HandleCommand(game, m_player, m_packet);
             }
             else
             {
                 log.Error(string.Format("IP: {0}", m_player.PlayerDetail.Client.TcpEndpoint));
             }
         }
         catch (Exception e)
         {
             log.Error(string.Format("IP:{1}, OnGameData is Error: {0}", e.ToString(), m_player.PlayerDetail.Client.TcpEndpoint));
         }
     }
 }