예제 #1
0
 public void update()
 {
     try
     {
         addAPIAccount(RiotAPI.GetAccountFromPuuId <API.APIAccount>(this.server, this.puuId));
         addAPIRank(RiotAPI.GetRankFromId <API.APIRank>(this.server, this.id));
     } catch (Exception) { findNewServer(); }
 }
예제 #2
0
        public Account(string player, string username, string password, string server, string name)
        {
            this.player   = player;
            this.username = username;
            this.password = password;
            this.server   = server;
            this.name     = name;

            try
            {
                addAPIAccount(RiotAPI.GetAccountFromName <API.APIAccount>(server, name));
                addAPIRank(RiotAPI.GetRankFromId <API.APIRank>(server, this.id));
            }
            catch (Exception) { failed = true; }
        }
예제 #3
0
        private void findNewServer()
        {
            List <string> servers = new List <string> {
                "EUW1", "NA1", "EUN1", "TR1", "LA1", "OC", "RU", "KR", "LA2", "JP1", "BR"
            };

            foreach (string server in servers)
            {
                try
                {
                    addAPIAccount(RiotAPI.GetAccountFromPuuId <API.APIAccount>(server, this.puuId));
                }
                catch (Exception) { }

                try
                {
                    addAPIRank(RiotAPI.GetRankFromId <API.APIRank>(this.server, this.id));
                } catch (Exception) { }
            }
        }