Ejemplo n.º 1
0
        private void OnGameDTO(object gameDTO)
        {
            var game = gameDTO as GameDTO;

            if (Master)
            {
                _currentGame = game;
            }

            if (game.gameState == "CHAMP_SELECT" && _processHelper == null)
            {
                if (Master)
                {
                    Log.Write("[{0}] Entered Champion select", _account.Username);
                }
                _processHelper = new ProcessHelper();
                // Log.Write("[{0}] Starting champion select.", CurrentAccount.Username);
                _client.SetClientReceivedGameMessage(game.id, "CHAMP_SELECT_CLIENT");

                var champ = Globals.RandomInstance.Next(_champions.Count);
                _client.SelectChampion(_champions[champ].ChampionId);

                System.Threading.Thread.Sleep(TimeSpan.FromSeconds(3));

                _client.ChampionSelectCompleted();
            }
            else if (game.gameState == "JOINING_CHAMP_SELECT" && !_accepted)
            {
                _client.AcceptPoppedGame(true);
                _accepted = true;
            }
        }