From 5a5b20aea4691e37e9553691e6def04b6e58caeb Mon Sep 17 00:00:00 2001 From: Bitl Date: Sun, 14 Nov 2021 10:00:39 -0700 Subject: [PATCH] fix bugs --- .../StorageAndFunctions/GlobalFuncs.cs | 5 +-- .../Forms/LauncherForm/LauncherFormShared.cs | 34 ++++++++++++------- .../Stylish/LauncherFormStylishInterface.xaml | 2 +- .../LauncherFormStylishInterface.xaml.cs | 31 ++++++++++++++++- .../NovetusLauncher/Forms/ServerBrowser.cs | 9 ++++- 5 files changed, 62 insertions(+), 19 deletions(-) diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index 3b5162a..d3d38c5 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -2082,10 +2082,7 @@ public class GlobalFuncs break; case ScriptType.Server: #if LAUNCHER - if (box != null) - { - PingMasterServer(1, "Server will now display on the defined master server.", box); - } + PingMasterServer(1, "Server will now display on the defined master server.", box); #elif CMD PingMasterServer(1, "Server will now display on the defined master server."); #endif diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs index f0ec9de..8c2b020 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/LauncherFormShared.cs @@ -42,6 +42,7 @@ namespace NovetusLauncher public List CurrentNodeMatches = new List(); public int LastNodeIndex = 0; public string LastSearchText; + public bool HideMasterAddressWarning; //CONTROLS public Form Parent = null; @@ -200,6 +201,8 @@ namespace NovetusLauncher #region Form Event Functions public void InitForm() { + HideMasterAddressWarning = false; + if (FormStyle != Settings.Style.Stylish) { Parent.Text = "Novetus " + GlobalVars.ProgramInformation.Version; @@ -489,9 +492,9 @@ namespace NovetusLauncher else if (FormStyle != Settings.Style.Stylish && no3d) { DialogResult result = MessageBox.Show("Launching the server without graphics enables better performance.\n" + - "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes. " + - "This feature may also make your server unstable.", - "Novetus - No3D Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); + "However, launching the server with no graphics may cause some elements in later clients may be disabled, such as Dialog boxes. " + + "This feature may also make your server unstable.", + "Novetus - No3D Warning", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); switch (result) { @@ -1342,16 +1345,23 @@ namespace NovetusLauncher public void ShowMasterServerWarning() { - DialogResult res = MessageBox.Show("Due to Novetus' open nature when it comes to hosting master servers, hosting on a public master server may leave your server (and potentially computer) open for security vulnerabilities.\nTo protect yourself against this, host under a VPN, use a host name, or use a trustworthy master server that is hosted privately or an official server.\n\nDo you trust this master server?", "Novetus - Master Server Security Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); - - switch (res) + if (!HideMasterAddressWarning) { - case DialogResult.Yes: - break; - case DialogResult.No: - default: - ServerBrowserAddressBox.Text = "localhost"; - break; + DialogResult res = MessageBox.Show("Due to Novetus' open nature when it comes to hosting master servers, hosting on a public master server may leave your server (and potentially computer) open for security vulnerabilities." + + "\nTo protect yourself against this, host under a VPN, use a host name, or use a trustworthy master server that is hosted privately or an official server." + + "\n\nDo you trust the master server you're about to input in?", "Novetus - Master Server Security Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); + + switch (res) + { + case DialogResult.Yes: + break; + case DialogResult.No: + default: + ServerBrowserAddressBox.Text = "localhost"; + break; + } + + HideMasterAddressWarning = true; } } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml index 1657b54..e369fba 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Stylish/LauncherFormStylishInterface.xaml @@ -797,7 +797,7 @@