예제 #1
0
        public void execute(GameSession gameSession, IByteBuffer buffer)
        {
            if (gameSession.Player.UsingNewClient)
            {
                return;
            }

            Packet.Builder.ShipWarpNotAllowedCommand(gameSession);
            return;

            var request = new ShipWarpRequest();

            request.readCommand(buffer);

            Player = gameSession.Player;
            var shipType = request.shipType;

            TargetHangar = Player.Equipment.Hangars.FirstOrDefault(x => x.Value.Ship.Id == shipType).Value;
            if (TargetHangar != null)
            {
                if (Player.Moving || Player.Controller.Attack.Attacking ||
                    Player.Controller.Attack.GetActiveAttackers().Count > 0)
                {
                    Packet.Builder.ShipWarpNotAllowedCommand(gameSession);
                    return;
                }
                Task.Factory.StartNew(HangarSwitchLoop);
            }
        }
        public void execute(GameSession gameSession, byte[] bytes)
        {
            var read = new ShipWarpRequest();

            read.readCommand(bytes);

            ChangeShip(gameSession, read.shipId);
        }