Update BasicBot.cs
Update the login code to be less bad
This commit is contained in:
parent
16b1cbf959
commit
39710f9e82
1 changed files with 18 additions and 11 deletions
|
|
@ -177,8 +177,11 @@ namespace BetterSecondBotShared.bottypes
|
||||||
bits.Add("Resident");
|
bits.Add("Resident");
|
||||||
}
|
}
|
||||||
string namesubmaster = String.Join(" ", bits);
|
string namesubmaster = String.Join(" ", bits);
|
||||||
SubMasters.Add(namesubmaster);
|
if (namesubmaster != myconfig.Security_MasterUsername)
|
||||||
Info("Sub-Master: " + namesubmaster);
|
{
|
||||||
|
SubMasters.Add(namesubmaster);
|
||||||
|
Info("Sub-Master: " + namesubmaster);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -238,30 +241,34 @@ namespace BetterSecondBotShared.bottypes
|
||||||
{
|
{
|
||||||
if ((myconfig.Basic_LoginLocation != "home") && (myconfig.Basic_LoginLocation != "last"))
|
if ((myconfig.Basic_LoginLocation != "home") && (myconfig.Basic_LoginLocation != "last"))
|
||||||
{
|
{
|
||||||
Info("Basic_LoginLocation: is set to a uri! if login fails try using home or last");
|
Lp.Start = "home";
|
||||||
}
|
Lp.LoginLocation = myconfig.Basic_LoginLocation;
|
||||||
Lp.Start = myconfig.Basic_LoginLocation;
|
Info("Basic_LoginLocation: First login using->" + Lp.LoginLocation);
|
||||||
Info("Basic_LoginLocation: First login using->"+Lp.Start);
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Lp.Start = myconfig.Basic_LoginLocation;
|
|
||||||
if ((myconfig.Basic_LoginLocation != "home") && (myconfig.Basic_LoginLocation != "last"))
|
if ((myconfig.Basic_LoginLocation != "home") && (myconfig.Basic_LoginLocation != "last"))
|
||||||
{
|
{
|
||||||
|
Info("Recovery login: using home not custom location!");
|
||||||
Lp.Start = "home";
|
Lp.Start = "home";
|
||||||
|
myconfig.Basic_LoginLocation = "home";
|
||||||
}
|
}
|
||||||
if (Lp.Start == "home")
|
else if (Lp.Start == "home")
|
||||||
{
|
{
|
||||||
Info("Recovery login: using last location not home!");
|
Info("Recovery login: using last location");
|
||||||
Lp.Start = "last";
|
Lp.Start = "last";
|
||||||
myconfig.Basic_LoginLocation = "last";
|
myconfig.Basic_LoginLocation = "last";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info("Recovery login: using home location not last!");
|
Info("Recovery login: using home location");
|
||||||
Lp.Start = "home";
|
Lp.Start = "home";
|
||||||
myconfig.Basic_LoginLocation = "home";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Lp.Start = myconfig.Basic_LoginLocation;
|
||||||
|
|
||||||
}
|
}
|
||||||
if (reconnect == false)
|
if (reconnect == false)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue