From 50fc4797b3f6bfb51dc6fca0691aa8502d684b2c Mon Sep 17 00:00:00 2001 From: Epicfisher Date: Fri, 3 Sep 2021 05:16:42 +0100 Subject: [PATCH] fix: Fix Custom Login Location Functionality with --location --- README.md | 2 ++ Radegast/GUI/Consoles/LoginConsole.cs | 30 +++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51895b8c..f1137a0a 100755 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ The Program can be Started through the Command-line with the following Arguments Additional Optional Command-line Arguments: ``` +--location = Set a Custom Login Location + --ignore-warn = Ignores Warning Messages --disable-lookat = Disables Lookat diff --git a/Radegast/GUI/Consoles/LoginConsole.cs b/Radegast/GUI/Consoles/LoginConsole.cs index 7ced8c81..198b1b27 100755 --- a/Radegast/GUI/Consoles/LoginConsole.cs +++ b/Radegast/GUI/Consoles/LoginConsole.cs @@ -587,10 +587,9 @@ public void BeginLogin() netcom.LoginOptions.Password = MainProgram.s_CommandLineOpts.Password; netcom.LoginOptions.Channel = Properties.Resources.ProgramName; // Channel netcom.LoginOptions.Version = Properties.Resources.RadegastTitle; // Version - //netcom.AgreeToTos = cbTOS.Checked; netcom.AgreeToTos = true; - netcom.LoginOptions.StartLocation = StartLocationType.Last; + //netcom.LoginOptions.StartLocation = StartLocationType.Last; /* switch (cbxLocation.SelectedIndex) { @@ -608,6 +607,18 @@ public void BeginLogin() break; } */ + // Setup login location either from the last used or + // override from the command line + if (string.IsNullOrEmpty(MainProgram.s_CommandLineOpts.Location)) + { + // Use last location as default + netcom.LoginOptions.StartLocation = StartLocationType.Last; + } + else + { + netcom.LoginOptions.StartLocation = StartLocationType.Custom; + netcom.LoginOptions.StartLocationCustom = MainProgram.s_CommandLineOpts.Location; + } GridManager gm = new GridManager(); gm.LoadGrids(); @@ -629,8 +640,23 @@ public void BeginLogin() netcom.LoginOptions.Grid = cbxGrid.SelectedItem as Grid; } */ + Console.WriteLine("Will Login with Name: " + netcom.loginOptions.FullName); Console.WriteLine("Will Login To URI: " + netcom.LoginOptions.Grid.LoginURI); + string startLocation = "Unknown"; + if (netcom.LoginOptions.StartLocation == StartLocationType.Custom) + { + startLocation = netcom.LoginOptions.StartLocationCustom; + } + if (netcom.LoginOptions.StartLocation == StartLocationType.Last) + { + startLocation = "Last"; + } + if (netcom.LoginOptions.StartLocation == StartLocationType.Home) + { + startLocation = "Home"; + } + Console.WriteLine("Will Login To Region: " + startLocation); if (netcom.LoginOptions.Grid.Platform != "SecondLife") {