Esempio n. 1
0
        public void execute(GameSession gameSession, IByteBuffer buffer)
        {
            var request = new HellstormSelectRocketRequest();

            request.readCommand(buffer);
            var ammo = AmmoConverter.AmmoTypeToString(request.rocketType.type);

            gameSession.Player.RocketLauncher?.ChangeLoad(ammo);
        }
        public void execute(GameSession gameSession, byte[] bytes)
        {
            var read = new HellstormSelectRocketRequest();

            read.readCommand(bytes);

            var player                    = gameSession.Player;
            var settingsManager           = player.SettingsManager;
            var newSelectedRocketLauncher = read.rocketType.typeValue;

            if (settingsManager.SelectedRocketLauncher != newSelectedRocketLauncher)
            {
                settingsManager.SelectedRocketLauncher = newSelectedRocketLauncher;
                player.Settings.ShipSettings.selectedRocketLauncher = newSelectedRocketLauncher;
                player.AttackManager.RocketLauncher.ChangeLoad(settingsManager.SelectedRocketLauncher);

                QueryManager.SavePlayer.Settings(player);
            }
        }