private void connection_OnError(object sender, LoLLauncher.Error error)
        {
            if (error.Message.Contains("is not owned by summoner"))
            {
                return;
            }
            else if (error.Message.Contains("Your summoner level is too low to select the spell"))
            {
                var random    = new Random();
                var spellList = new List <int> {
                    13, 6, 7, 10, 1, 11, 21, 12, 3, 14, 2, 4
                };

                int index  = random.Next(spellList.Count);
                int index2 = random.Next(spellList.Count);

                int randomSpell1 = spellList[index];
                int randomSpell2 = spellList[index2];

                if (randomSpell1 == randomSpell2)
                {
                    int index3 = random.Next(spellList.Count);
                    randomSpell2 = spellList[index3];
                }

                int Spell1 = Convert.ToInt32(randomSpell1);
                int Spell2 = Convert.ToInt32(randomSpell2);
                return;
            }
            this.updateStatus("error received:\n" + error.Message, Accountname);
        }
Beispiel #2
0
        private void connection_OnError(object sender, LoLLauncher.Error error)
        {
            if (error.Type == ErrorType.AuthKey || error.Type == ErrorType.General)
            {
                if (reAttempt)
                {
                    return;
                }
                updateStatus("Unable to connect. Try one reconnect.", Accountname);
                reAttempt = true;
                connection.Connect(Accountname, Password, baseRegion.PVPRegion, Config.clientSeason + "." + Config.clientSubVersion);
                return;
            }
            if (error.Message.Contains("is not owned by summoner"))
            {
                return;
            }
            else if (error.Message.Contains("Your summoner level is too low to select the spell"))
            {
                var random    = new Random();
                var spellList = new List <int> {
                    13, 6, 7, 10, 1, 11, 21, 12, 3, 14, 2, 4
                };

                int index  = random.Next(spellList.Count);
                int index2 = random.Next(spellList.Count);

                int randomSpell1 = spellList[index];
                int randomSpell2 = spellList[index2];

                if (randomSpell1 == randomSpell2)
                {
                    int index3 = random.Next(spellList.Count);
                    randomSpell2 = spellList[index3];
                }

                int Spell1 = Convert.ToInt32(randomSpell1);
                int Spell2 = Convert.ToInt32(randomSpell2);
                return;
            }
            if (error.Message.Contains("Unable to get Auth Key"))
            {
                updateStatus("Login Failed", Accountname);
                return;
            }
            updateStatus("[" + error.Type + "]error received:\n" + error.Message, Accountname);
        }
Beispiel #3
0
 private void connection_OnError(object sender, LoLLauncher.Error error)
 {
     if (!m_disposed)
     {
         if (error.Message.Contains("Wrong client version for server"))
         {
             connection.Disconnect();
         }
         else if (error.Message.Contains("Game was not found!"))
         {
             Logger.Push("Somebody broke the game queue.", "info", username);
         }
         else if (error.Message.Contains("Riots servers are currently unavailable"))
         {
             smurf.restart();
         }
         else
         {
             Logger.Push("Unhandled error message recieved from server:" + error.Message, "warning", username);
             Logger.Push("Restarting smurf in hard mode:" + error.Message, "warning", username);
             smurf.restartHard();
         }
     }
 }