Ejemplo n.º 1
0
        protected override void OnMessage(MessageEventArgs e)
        {
            Console.WriteLine(e.Data);
            DataFetcher dataFetcher = new DataFetcher();

            LoLClient lol = new LoLClient();

            if (e.Data.Contains("#01"))
            {
                Send(lol.GetSummonerIdByName(e.Data.Substring(3)));
            }
            else if (e.Data.Contains("#04"))
            {
                // ↓ Tony, add here the method for ChampionStatisticsActivity
                //Send ($"#05{METHOD NAME)");
                string jsonChampStats = dataFetcher.ChampionStatsData(e.Data.Substring(3));
                Console.WriteLine(jsonChampStats);
                Send($"{jsonChampStats}");
            }
            else if (e.Data.Contains("#06"))
            {
                // ↓ Tony, add here the method for MatchHistory
                //Send ($"#07{METHOD NAME)");
                string jsonMatchesHistory = dataFetcher.MatchHistoryData(e.Data.Substring(3));
                Send($"{jsonMatchesHistory}");
            }
        }