From c7826595cd7266f32d92b877d8be4ee4dffe058b Mon Sep 17 00:00:00 2001 From: Madpeterz <57852827+Madpeterz@users.noreply.github.com> Date: Thu, 17 Dec 2020 22:41:06 +0000 Subject: [PATCH] add support to set the login location of the bot home, last or uri:sim&x&y&z --- BSBshared/BotTypes/BasicBot.cs | 13 +++++++++++++ BSBshared/Json/JsonConfig.cs | 2 ++ BSBshared/Json/JsonConfigApi.cs | 8 +++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/BSBshared/BotTypes/BasicBot.cs b/BSBshared/BotTypes/BasicBot.cs index 498f986..aebeebc 100644 --- a/BSBshared/BotTypes/BasicBot.cs +++ b/BSBshared/BotTypes/BasicBot.cs @@ -215,6 +215,19 @@ namespace BetterSecondBotShared.bottypes { Lp = new LoginParams(Client, bits[0], bits[1], myconfig.Basic_BotPassword, "BetterSecondBot", version); } + if(helpers.notempty(myconfig.Basic_LoginLocation) == true) + { + 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 = myconfig.Basic_LoginLocation; + } + else + { + Info("Basic_LoginLocation: is empty using home!"); + Lp.Start = "home"; + } if (reconnect == false) { BotStartHandler(); diff --git a/BSBshared/Json/JsonConfig.cs b/BSBshared/Json/JsonConfig.cs index 69b56f1..5697944 100644 --- a/BSBshared/Json/JsonConfig.cs +++ b/BSBshared/Json/JsonConfig.cs @@ -15,6 +15,8 @@ namespace BetterSecondBotShared.Json public string Basic_BotPassword { get; set; } public string[] Basic_HomeRegions { get; set; } + public string Basic_LoginLocation { get; set; } + // Security public string Security_MasterUsername { get; set; } public string Security_SubMasters { get; set; } diff --git a/BSBshared/Json/JsonConfigApi.cs b/BSBshared/Json/JsonConfigApi.cs index a35d984..c1aa77c 100644 --- a/BSBshared/Json/JsonConfigApi.cs +++ b/BSBshared/Json/JsonConfigApi.cs @@ -33,6 +33,11 @@ namespace BetterSecondBotShared.Json { return "a CSV of SLURLs that the bot will attempt to return to after avoiding a sim shutdown (In testing)"; } + else if (cmd == "Basic_LoginLocation") + { + return "the location to login to: home or last or a vaild URI encoded string example: uri:simname&X&Y&Z"; + } + return ""; } protected string GetHelp_Security(string cmd) @@ -220,7 +225,8 @@ namespace BetterSecondBotShared.Json // Basic if (cmd == "Basic_BotUserName") { return "Example Resident"; } else if (cmd == "Basic_BotPassword") { return "Pass"; } - else if (cmd == "Basic_HomeRegions") { return "http://maps.secondlife.com/secondlife/Viserion/50/140/23"; } + else if (cmd == "Basic_HomeRegions") { return "http://maps.secondlife.com/secondlife/Viserion/50/140/23"; } + else if (cmd == "Basic_LoginLocation") { return "home"; } return ""; } protected string GetValueHint_Security(string cmd)