Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var lobbyProcesser = new LobbyFileProcessor(args[0], HeroLists.Heroes, MapAttributesDict.MapAttributes);
            var game           = lobbyProcesser.ParseLobbyInfo();

            Console.WriteLine("Game.Region = {0}", game.Region);
            for (int i = 0; i < game.Players.Count; i++)
            {
                Console.WriteLine("Game.Player[{0}]: Team = {1}, Tag = {2}, SelectedHero = {3}", i, game.Players[i].Team, game.Players[i].Tag, game.Players[i].SelectedHero);
            }
            Console.WriteLine("Game.Map: {0}", game.Map);
        }
Exemplo n.º 2
0
        private void WebCallbackListenerOnLobbyRequested(object sender, EventArgs eventArgs)
        {
            if (!File.Exists(Const.BattleLobbyPath))
            {
                return;
            }

            var lobbyProcessor = new LobbyFileProcessor(Const.BattleLobbyPath, App.LobbyHeroes, App.LobbyMaps);
            var game           = lobbyProcessor.ParseLobbyInfo();

            FillMMR(game);
            Show();
        }
Exemplo n.º 3
0
        private async void WebCallbackListenerOnLobbyRequested(object sender, EventArgs eventArgs)
        {
            if (!ShellViewModel.ValidLobbyFilePresent())
            {
                return;
            }

            var lobbyProcessor = new LobbyFileProcessor(Const.BattleLobbyPath);
            var region         = lobbyProcessor.GetRegion();

            if (!_lobbyParameter.ContainsKey(region))
            {
                _lobbyParameter[region] = await _restApi.GetLobbyParameter(region.ToString());
            }

            if (!_lobbyHeroes.ContainsKey(region))
            {
                var result = await _restApi.GetLobbyHeroList(region.ToString());

                _lobbyHeroes[region] = result.Select(h => h.Name).ToList();
            }

            if (!_lobbyMaps.ContainsKey(region))
            {
                var result = await _restApi.GetLobbyMapList(region.ToString());

                _lobbyMaps[region] = result.Select(h => h.Name).ToList();
            }

            var game = lobbyProcessor.ParseLobbyInfo(_lobbyParameter[region], _lobbyHeroes[region], _lobbyMaps[region]);

            Execute.OnUIThread(() =>
            {
                FillMMR(game);
                Show();
            });
        }