diff --git a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs index 6a2ff63..310fe7a 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/NovetusFuncs.cs @@ -7,6 +7,7 @@ using System.Xml; using System.Xml.Linq; using System.Linq; using System.Windows.Forms; +using System.Collections.Generic; #endregion #region Novetus Functions @@ -178,47 +179,53 @@ public class NovetusFuncs GlobalVars.PingURL = ""; } -#if CMD - public static void CreateTXT() + public static string[] LoadServerInformation() { - if (GlobalVars.RequestToOutputInfo) - { - string[] lines1 = { + string[] lines1 = { SecurityFuncs.Base64Encode(!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) }; - string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true); - string[] lines2 = { + string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true); + string[] lines2 = { SecurityFuncs.Base64Encode("localhost"), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) }; - string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); + string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); + string[] text = { + "Client: " + GlobalVars.UserConfiguration.SelectedClient, + "IP: " + (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP), + "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), + "Map: " + GlobalVars.UserConfiguration.Map, + "Players: " + GlobalVars.UserConfiguration.PlayerLimit, + "Version: Novetus " + GlobalVars.ProgramInformation.Version, + "Online URI Link:", + URI, + "Local URI Link:", + URI2 + }; - string[] text = { + return text; + } + + public static void CreateTXT() + { + if (GlobalVars.RequestToOutputInfo) + { + List text = new List(); + text.AddRange(new string[] { "Process ID: " + (GlobalVars.ProcessID == 0 ? "N/A" : GlobalVars.ProcessID.ToString()), "Don't copy the Process ID when sharing the server.", - "--------------------", - "Server Info:", - "Client: " + GlobalVars.UserConfiguration.SelectedClient, - "IP: " + (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP), - "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), - "Map: " + GlobalVars.UserConfiguration.Map, - "Players: " + GlobalVars.UserConfiguration.PlayerLimit, - "Version: Novetus " + GlobalVars.ProgramInformation.Version, - "Online URI Link:", - URI, - "Local URI Link:", - URI2 - }; + "--------------------" + }); + text.AddRange(LoadServerInformation()); string txt = GlobalPaths.BasePath + "\\" + GlobalPaths.ServerInfoFileName; File.WriteAllLines(txt, text); Util.ConsolePrint("Server Information sent to file " + txt, 4); } } -#endif #if LAUNCHER || URI public static void LaunchCharacterCustomization() diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index f364eaa..657d825 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -352,44 +352,7 @@ namespace NovetusLauncher Application.Exit(); } - public static void LoadServerInformation(TextBox box) - { - string[] lines1 = { - SecurityFuncs.Base64Encode(!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) - }; - string URI = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines1), true); - string[] lines2 = { - SecurityFuncs.Base64Encode("localhost"), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.RobloxPort.ToString()), - SecurityFuncs.Base64Encode(GlobalVars.UserConfiguration.SelectedClient) - }; - string URI2 = "novetus://" + SecurityFuncs.Base64Encode(string.Join("|", lines2), true); - string[] text = { - "Client: " + GlobalVars.UserConfiguration.SelectedClient, - "IP: " + (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP), - "Port: " + GlobalVars.UserConfiguration.RobloxPort.ToString(), - "Map: " + GlobalVars.UserConfiguration.Map, - "Players: " + GlobalVars.UserConfiguration.PlayerLimit, - "Version: Novetus " + GlobalVars.ProgramInformation.Version, - "Online URI Link:", - URI, - "Local URI Link:", - URI2 - }; - - foreach (string str in text) - { - if (!string.IsNullOrWhiteSpace(str)) - { - box.AppendText(str + Environment.NewLine); - } - } - - box.SelectionStart = 0; - box.ScrollToCaret(); - } + public void ChangeTabs() { @@ -402,7 +365,17 @@ namespace NovetusLauncher ClientBox.Items.Clear(); ServerBox.Items.Clear(); PortBox.Items.Clear(); - LoadServerInformation(ServerInfo); + string[] text = NovetusFuncs.LoadServerInformation(); + foreach (string str in text) + { + if (!string.IsNullOrWhiteSpace(str)) + { + ServerInfo.AppendText(str + Environment.NewLine); + } + } + + ServerInfo.SelectionStart = 0; + ServerInfo.ScrollToCaret(); break; case TabPage pg3 when pg3 == Tabs.TabPages[TabPageClients]: string clientdir = GlobalPaths.ClientDir; diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs index 3a6343b..06a81ee 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylish.cs @@ -76,8 +76,6 @@ namespace NovetusLauncher } } - launcherFormStylishInterface1.ToggleServerOptions(); - LocalVars.launcherInitState = false; CenterToScreen(); } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml index 9bf04ad..c6d0a94 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml @@ -16,7 +16,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -73,7 +73,7 @@ - + @@ -745,6 +745,12 @@ + + + + @@ -765,42 +771,48 @@