From d54bd58481bc4720052367208fa814d32736f744 Mon Sep 17 00:00:00 2001 From: Bitl Date: Thu, 4 Aug 2022 15:53:54 -0700 Subject: [PATCH] use string ids --- Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs | 6 +++--- Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs | 2 +- changelog.txt | 6 +++++- delist.php | 2 +- list.php | 2 +- scripts/launcher/info.ini | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs index 5912374..29bee3b 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalFuncs.cs @@ -2345,7 +2345,7 @@ public class GlobalFuncs if (online) { - GlobalVars.ServerID = SecurityFuncs.GenerateRandomNumber(); + GlobalVars.ServerID = SecurityFuncs.RandomString(30) + SecurityFuncs.GenerateRandomNumber(); pingURL = "http://" + GlobalVars.UserConfiguration.ServerBrowserServerAddress + "/list.php?name=" + GlobalVars.UserConfiguration.ServerBrowserServerName + "&ip=" + (!string.IsNullOrWhiteSpace(GlobalVars.UserConfiguration.AlternateServerIP) ? GlobalVars.UserConfiguration.AlternateServerIP : GlobalVars.ExternalIP) + @@ -2358,7 +2358,7 @@ public class GlobalFuncs { pingURL = "http://" + GlobalVars.UserConfiguration.ServerBrowserServerAddress + "/delist.php?id=" + GlobalVars.ServerID; - GlobalVars.ServerID = 0; + GlobalVars.ServerID = "N/A"; } #if LAUNCHER @@ -2375,7 +2375,7 @@ public class GlobalFuncs if (response.Contains("ERROR:")) { - GlobalVars.ServerID = 0; + GlobalVars.ServerID = "N/A"; } } diff --git a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs index 391c208..464df51 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/GlobalVars.cs @@ -96,7 +96,7 @@ public static class GlobalVars public static bool ColorsLoaded = false; public static int ValidatedExtraFiles = 0; public static bool NoFileList = false; - public static int ServerID = 0; + public static string ServerID = "N/A"; #endregion } #endregion diff --git a/changelog.txt b/changelog.txt index a120b00..dd5f6f3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,3 +1,7 @@ +1.3 Snapshot v22.8251.28463.2 +Fixes: +- Replaced numeric IDs and with string IDs. (composed of a random string + random number) +---------------------------------------------------------------------------- 1.3 Snapshot v22.8251.26754.1 Notes: - Add the list.php and delist.php files to your master server if you would like to support future 1.3 versions. @@ -13,7 +17,7 @@ Enhancements: - Made Master Server ping messages more verbose. - Improved the stability of master server pings. - The Master Server has been split into 2 files: list.php and delist.php - - Each server has a randomly generated ID that is only visible to the server host (in the console) and the master server host (in serverlist.txt) +- Each server now has a randomly generated ID that is only visible to the server host (in the console) and the master server host (in serverlist.txt) ---------------------------------------------------------------------------- 1.3 Snapshot v22.8245.27180.1 Notes: diff --git a/delist.php b/delist.php index 8e60e5d..c0267fd 100644 --- a/delist.php +++ b/delist.php @@ -19,7 +19,7 @@ Read it here https://github.com/Novetus/Novetus_src/blob/master/LICENSE-MASTER-S //id $id = $_GET["id"]; -if (!empty($id) and is_numeric($id)) +if (!empty($id)) { $file = 'serverlist.txt'; diff --git a/list.php b/list.php index 60a7ce4..2f9e998 100644 --- a/list.php +++ b/list.php @@ -30,7 +30,7 @@ $version = $_GET["version"]; //id $id = $_GET["id"]; -if (!empty($port) and $port < 65535 and is_numeric($port) and !empty($name) and !empty($client) and !empty($version) and !empty($id) and is_numeric($id)) +if (!empty($port) and $port < 65535 and is_numeric($port) and !empty($name) and !empty($client) and !empty($version) and !empty($id)) { //server ip $ip = $_GET["ip"]; diff --git a/scripts/launcher/info.ini b/scripts/launcher/info.ini index 7f795da..55e3e92 100644 --- a/scripts/launcher/info.ini +++ b/scripts/launcher/info.ini @@ -8,6 +8,6 @@ ExtendedVersionNumber=True ExtendedVersionEditChangelog=True //ExtendedVersionTemplate=%version% v?.2022.%extended-revision%%lite% ExtendedVersionTemplate=%version% Snapshot v22.%build%.%revision%.%extended-revision% -ExtendedVersionRevision=1 +ExtendedVersionRevision=2 IsLite=False InitialBootup=False