Skip to content

Commit

Permalink
fix: Fix Custom Login Location Functionality with --location <string>
Browse files Browse the repository at this point in the history
  • Loading branch information
Epicfisher committed Sep 3, 2021
1 parent beea777 commit 50fc479
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ The Program can be Started through the Command-line with the following Arguments
Additional Optional Command-line Arguments:

```
--location <string> = Set a Custom Login Location
--ignore-warn = Ignores Warning Messages
--disable-lookat = Disables Lookat
Expand Down
30 changes: 28 additions & 2 deletions Radegast/GUI/Consoles/LoginConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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();
Expand All @@ -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")
{
Expand Down

0 comments on commit 50fc479

Please sign in to comment.