diff --git a/Novetus/NovetusCore/Classes/FileFormat.cs b/Novetus/NovetusCore/Classes/FileFormat.cs index b9005e1..8442dc3 100644 --- a/Novetus/NovetusCore/Classes/FileFormat.cs +++ b/Novetus/NovetusCore/Classes/FileFormat.cs @@ -63,7 +63,7 @@ public class FileFormat DisableReshadeDelete = false; ShowServerNotifications = true; ServerBrowserServerName = "Novetus"; - ServerBrowserServerAddress = "localhost:" + RobloxPort; + ServerBrowserServerAddress = "localhost"; } public string SelectedClient { get; set; } diff --git a/Novetus/NovetusCore/StorageAndFunctions/NETExt.cs b/Novetus/NovetusCore/StorageAndFunctions/NETExt.cs index 9e6439f..3c39435 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/NETExt.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/NETExt.cs @@ -8,6 +8,8 @@ using System.Text; using System.IO; using System.Collections.Generic; using System.Linq; +using System.Threading.Tasks; +using System.Net; #endregion #region .NET Extentions @@ -222,5 +224,30 @@ public static class NETExt return files.Where(f => extensions.Contains(f.Extension)); } #endregion + + #region WebClient Extensions + public static Task OpenReadTaskAsync(this WebClient client, Uri uri) + { + var tcs = new TaskCompletionSource(); + + OpenReadCompletedEventHandler openReadEventHandler = null; + openReadEventHandler = (sender, args) => + { + try + { + tcs.SetResult(args.Result); + } + catch (Exception e) + { + tcs.SetException(e); + } + }; + + client.OpenReadCompleted += openReadEventHandler; + client.OpenReadAsync(uri); + + return tcs.Task; + } + #endregion } #endregion \ No newline at end of file diff --git a/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs b/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs index 8bd5615..567e54b 100644 --- a/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs +++ b/Novetus/NovetusCore/StorageAndFunctions/VarStorage.cs @@ -39,22 +39,18 @@ public class VarStorage #region Game Server Definition public class GameServer { - public GameServer(string name, string ip, string port, string client, string players, string maxPlayers) + public GameServer(string name, string ip, string port, string client) { - ServerName = name; - ServerIP = ip; - ServerPort = Convert.ToInt32(port); - ServerClient = client; - ServerPlayers = Convert.ToInt32(players); - ServerMaxPlayers = Convert.ToInt32(maxPlayers); + ServerName = SecurityFuncs.Base64DecodeOld(name); + ServerIP = SecurityFuncs.Base64DecodeOld(ip); + ServerPort = Convert.ToInt32(SecurityFuncs.Base64DecodeOld(port)); + ServerClient = SecurityFuncs.Base64DecodeOld(client); } public string ServerName { get; set; } public string ServerIP { get; set; } public int ServerPort { get; set; } public string ServerClient { get; set; } - public int ServerPlayers { get; set; } - public int ServerMaxPlayers { get; set; } } #endregion } diff --git a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs index 2f41074..2a8f0b6 100644 --- a/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/LauncherForm/Compact/LauncherFormCompact.Designer.cs @@ -611,9 +611,9 @@ namespace NovetusLauncher // this.label30.Font = new System.Drawing.Font("Microsoft Sans Serif", 6.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label30.ForeColor = System.Drawing.Color.Red; - this.label30.Location = new System.Drawing.Point(6, 118); + this.label30.Location = new System.Drawing.Point(6, 105); this.label30.Name = "label30"; - this.label30.Size = new System.Drawing.Size(393, 58); + this.label30.Size = new System.Drawing.Size(393, 71); this.label30.TabIndex = 3; this.label30.TextAlign = System.Drawing.ContentAlignment.TopCenter; this.label30.Visible = false; @@ -623,7 +623,7 @@ namespace NovetusLauncher this.listBox2.FormattingEnabled = true; this.listBox2.Location = new System.Drawing.Point(6, 7); this.listBox2.Name = "listBox2"; - this.listBox2.Size = new System.Drawing.Size(393, 108); + this.listBox2.Size = new System.Drawing.Size(393, 95); this.listBox2.TabIndex = 2; this.listBox2.SelectedIndexChanged += new System.EventHandler(this.ListBox2SelectedIndexChanged); // diff --git a/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs b/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs index d653b2b..fd09429 100644 --- a/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs +++ b/Novetus/NovetusLauncher/Forms/ServerBrowser.Designer.cs @@ -40,7 +40,7 @@ namespace NovetusLauncher // JoinGameButton // this.JoinGameButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.JoinGameButton.Location = new System.Drawing.Point(713, 8); + this.JoinGameButton.Location = new System.Drawing.Point(495, 8); this.JoinGameButton.Name = "JoinGameButton"; this.JoinGameButton.Size = new System.Drawing.Size(75, 23); this.JoinGameButton.TabIndex = 0; @@ -50,24 +50,25 @@ namespace NovetusLauncher // // MasterServerBox // - this.MasterServerBox.Location = new System.Drawing.Point(108, 10); + this.MasterServerBox.Location = new System.Drawing.Point(135, 10); this.MasterServerBox.Name = "MasterServerBox"; this.MasterServerBox.Size = new System.Drawing.Size(131, 20); this.MasterServerBox.TabIndex = 1; + this.MasterServerBox.TextChanged += new System.EventHandler(this.MasterServerBox_TextChanged); // // MasterServerLabel // this.MasterServerLabel.AutoSize = true; this.MasterServerLabel.Location = new System.Drawing.Point(12, 13); this.MasterServerLabel.Name = "MasterServerLabel"; - this.MasterServerLabel.Size = new System.Drawing.Size(89, 13); + this.MasterServerLabel.Size = new System.Drawing.Size(117, 13); this.MasterServerLabel.TabIndex = 2; - this.MasterServerLabel.Text = "Master Server IP:"; + this.MasterServerLabel.Text = "Master Server Address:"; // // MasterServerRefreshButton // this.MasterServerRefreshButton.AutoEllipsis = true; - this.MasterServerRefreshButton.Location = new System.Drawing.Point(245, 8); + this.MasterServerRefreshButton.Location = new System.Drawing.Point(272, 8); this.MasterServerRefreshButton.Name = "MasterServerRefreshButton"; this.MasterServerRefreshButton.Size = new System.Drawing.Size(125, 23); this.MasterServerRefreshButton.TabIndex = 3; @@ -77,10 +78,13 @@ namespace NovetusLauncher // // ServerListView // + this.ServerListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.ServerListView.HideSelection = false; - this.ServerListView.Location = new System.Drawing.Point(15, 36); + this.ServerListView.Location = new System.Drawing.Point(10, 37); this.ServerListView.Name = "ServerListView"; - this.ServerListView.Size = new System.Drawing.Size(773, 408); + this.ServerListView.Size = new System.Drawing.Size(555, 408); this.ServerListView.Sorting = System.Windows.Forms.SortOrder.Ascending; this.ServerListView.TabIndex = 4; this.ServerListView.UseCompatibleStateImageBehavior = false; @@ -92,15 +96,17 @@ namespace NovetusLauncher this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlLightLight; - this.ClientSize = new System.Drawing.Size(800, 456); + this.ClientSize = new System.Drawing.Size(577, 456); this.Controls.Add(this.ServerListView); this.Controls.Add(this.MasterServerRefreshButton); this.Controls.Add(this.MasterServerLabel); this.Controls.Add(this.MasterServerBox); this.Controls.Add(this.JoinGameButton); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MinimumSize = new System.Drawing.Size(593, 495); this.Name = "ServerBrowser"; this.Text = "Server Browser"; + this.Load += new System.EventHandler(this.ServerBrowser_Load); this.ResumeLayout(false); this.PerformLayout(); diff --git a/Novetus/NovetusLauncher/Forms/ServerBrowser.cs b/Novetus/NovetusLauncher/Forms/ServerBrowser.cs index 1cfa9ae..08eb8ae 100644 --- a/Novetus/NovetusLauncher/Forms/ServerBrowser.cs +++ b/Novetus/NovetusLauncher/Forms/ServerBrowser.cs @@ -1,23 +1,32 @@ -using System; +#region Usings +using System; using System.Collections.Generic; using System.IO; using System.Net; +using System.Threading.Tasks; using System.Windows.Forms; using static System.Windows.Forms.ListViewItem; +#endregion namespace NovetusLauncher { + #region Server Browser public partial class ServerBrowser : Form { + #region Private Variables List serverList = new List(); private int selectedServer; + #endregion + #region Constructor public ServerBrowser() { InitializeComponent(); } + #endregion - private void MasterServerRefreshButton_Click(object sender, EventArgs e) + #region Form Events + private async void MasterServerRefreshButton_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(MasterServerBox.Text)) { @@ -25,67 +34,47 @@ namespace NovetusLauncher { serverList.Clear(); - //https://stackoverflow.com/questions/2471209/how-to-read-a-file-from-internet#2471245 - //https://stackoverflow.com/questions/10826260/is-there-a-way-to-read-from-a-website-one-line-at-a-time - WebClient client = new WebClient(); - using (Stream stream = client.OpenRead("http://" + MasterServerBox.Text + "/serverlist.txt")) - { - using (StreamReader reader = new StreamReader(stream)) - { - string line; - while ((line = reader.ReadLine()) != null) - { - string[] serverInfo = line.Split('|'); - VarStorage.GameServer gameServer = new VarStorage.GameServer(serverInfo[0], serverInfo[1], serverInfo[2], serverInfo[3], serverInfo[4], serverInfo[5]); - serverList.Add(gameServer); - } - } - } + await LoadServerInfoFromFile("http://" + MasterServerBox.Text + "/serverlist.txt"); ServerListView.BeginUpdate(); ServerListView.Clear(); - var ColumnName = new ColumnHeader(); - ColumnName.Text = "Name"; - ColumnName.TextAlign = HorizontalAlignment.Center; - ColumnName.Width = 284; - ServerListView.Columns.Add(ColumnName); - - var ColumnClient = new ColumnHeader(); - ColumnClient.Text = "Client"; - ColumnClient.TextAlign = HorizontalAlignment.Center; - ColumnClient.Width = 75; - ServerListView.Columns.Add(ColumnClient); - - var ColumnPlayers = new ColumnHeader(); - ColumnPlayers.Text = "Player Count"; - ColumnPlayers.TextAlign = HorizontalAlignment.Center; - ColumnPlayers.Width = 81; - ServerListView.Columns.Add(ColumnPlayers); - - foreach (var server in serverList) + if (serverList.Count > 0) { - var serverItem = new ListViewItem(server.ServerName); + var ColumnName = new ColumnHeader(); + ColumnName.Text = "Name"; + ColumnName.TextAlign = HorizontalAlignment.Center; + ColumnName.Width = 284; + ServerListView.Columns.Add(ColumnName); - var serverClient = new ListViewSubItem(serverItem, server.ServerClient); - serverItem.SubItems.Add(serverClient); + var ColumnClient = new ColumnHeader(); + ColumnClient.Text = "Client"; + ColumnClient.TextAlign = HorizontalAlignment.Center; + ColumnClient.Width = 75; + ServerListView.Columns.Add(ColumnClient); - var serverPlayers = new ListViewSubItem(serverItem, server.ServerPlayers.ToString() + "/" + server.ServerMaxPlayers.ToString()); - serverItem.SubItems.Add(serverPlayers); + foreach (var server in serverList) + { + var serverItem = new ListViewItem(server.ServerName); - ServerListView.Items.Add(serverItem); + var serverClient = new ListViewSubItem(serverItem, server.ServerClient); + serverItem.SubItems.Add(serverClient); + + ServerListView.Items.Add(serverItem); + } } + else + { + MessageBox.Show("There are no servers available on this master server."); + } + ServerListView.EndUpdate(); } - catch (Exception) + catch (Exception ex) { - + MessageBox.Show("Unable to load servers. (" + ex + ")"); } } - else - { - - } } private void JoinGameButton_Click(object sender, EventArgs e) @@ -110,10 +99,13 @@ namespace NovetusLauncher GlobalVars.JoinPort = oldPort; } } + else + { + MessageBox.Show("Select a server before joining it."); + } } catch (Exception) { - MessageBox.Show("broke (TEMP)"); } } @@ -136,5 +128,40 @@ namespace NovetusLauncher } } + + private void ServerBrowser_Load(object sender, EventArgs e) + { + MasterServerBox.Text = GlobalVars.UserConfiguration.ServerBrowserServerAddress; + } + + private void MasterServerBox_TextChanged(object sender, EventArgs e) + { + GlobalVars.UserConfiguration.ServerBrowserServerAddress = MasterServerBox.Text; + } + #endregion + + #region Functions + async Task LoadServerInfoFromFile(string url) + { + //https://stackoverflow.com/questions/2471209/how-to-read-a-file-from-internet#2471245 + //https://stackoverflow.com/questions/10826260/is-there-a-way-to-read-from-a-website-one-line-at-a-time + WebClient client = new WebClient(); + using (Stream stream = await client.OpenReadTaskAsync(url)) + { + using (StreamReader reader = new StreamReader(stream)) + { + string line; + while ((line = await reader.ReadLineAsync()) != null) + { + string DecodedLine = SecurityFuncs.Base64DecodeOld(line); + string[] serverInfo = DecodedLine.Split('|'); + VarStorage.GameServer gameServer = new VarStorage.GameServer(serverInfo[0], serverInfo[1], serverInfo[2], serverInfo[3]); + serverList.Add(gameServer); + } + } + } + } + #endregion } + #endregion } diff --git a/query.php b/query.php index 33f56b2..7606dae 100644 --- a/query.php +++ b/query.php @@ -9,10 +9,6 @@ $ip = $_GET["ip"]; $port = $_GET["port"]; //client name $client = $_GET["client"]; -//players -$players = $_GET["players"]; -//maxplayers -$maxplayers = $_GET["maxplayers"]; //online status $online = $_GET["online"]; @@ -22,13 +18,13 @@ $status = "Offline"; //ONLY the $name and $client arguments will show up in the master server! $file = 'serverlist.txt'; -$text = "$name|$ip|$port|$client"; +$text = base64_encode(base64_encode($name).'|'.base64_encode($ip).'|'.base64_encode($port).'|'.base64_encode($client))."\r\n"; if ($online == 1) { $deleteentry = 0; - foreach(file($file) as $line) + foreach(file($file) as $line) { if (strpos($line, $text) !== false) { @@ -38,8 +34,7 @@ if ($online == 1) } } - $fulltext = $text."|$players|$maxplayers\r\n"; - file_put_contents($file, $fulltext, FILE_APPEND); + file_put_contents($file, $text, FILE_APPEND); $status = "Online"; } diff --git a/scripts/2006S-Shaders/CSMPFunctions.lua b/scripts/2006S-Shaders/CSMPFunctions.lua index a62d87d..81da67f 100644 --- a/scripts/2006S-Shaders/CSMPFunctions.lua +++ b/scripts/2006S-Shaders/CSMPFunctions.lua @@ -213,8 +213,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:httpGet(pingURL .. "&online=" .. online) end @@ -263,8 +262,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) @@ -287,8 +284,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2006S/CSMPFunctions.lua b/scripts/2006S/CSMPFunctions.lua index 1b249ce..a2f9b86 100644 --- a/scripts/2006S/CSMPFunctions.lua +++ b/scripts/2006S/CSMPFunctions.lua @@ -213,8 +213,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:httpGet(pingURL .. "&online=" .. online) end @@ -263,8 +262,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) @@ -287,8 +284,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2007E/CSMPFunctions.lua b/scripts/2007E/CSMPFunctions.lua index ff93fe8..fb0af55 100644 --- a/scripts/2007E/CSMPFunctions.lua +++ b/scripts/2007E/CSMPFunctions.lua @@ -263,8 +263,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:service("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.numPlayers .. "&maxplayers=" .. PlayerService.maxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:httpGet(pingURL .. "&online=" .. online) end @@ -313,8 +312,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) @@ -337,8 +334,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2007M-Shaders/CSMPFunctions.lua b/scripts/2007M-Shaders/CSMPFunctions.lua index 5bf97cc..f96b20d 100644 --- a/scripts/2007M-Shaders/CSMPFunctions.lua +++ b/scripts/2007M-Shaders/CSMPFunctions.lua @@ -309,8 +309,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:httpGet(pingURL .. "&online=" .. online) end @@ -359,8 +358,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) @@ -383,8 +380,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2007M/CSMPFunctions.lua b/scripts/2007M/CSMPFunctions.lua index 6f130ac..04fbfba 100644 --- a/scripts/2007M/CSMPFunctions.lua +++ b/scripts/2007M/CSMPFunctions.lua @@ -309,8 +309,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:httpGet(pingURL .. "&online=" .. online) end @@ -359,8 +358,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - coroutine.resume(coroutine.create(function() while Player ~= nil do wait(0.1) @@ -383,8 +380,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2008M/CSMPFunctions.lua b/scripts/2008M/CSMPFunctions.lua index 8e0a5c7..c584a81 100644 --- a/scripts/2008M/CSMPFunctions.lua +++ b/scripts/2008M/CSMPFunctions.lua @@ -400,8 +400,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:HttpGet(pingURL .. "&online=" .. online) end @@ -451,8 +450,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - while true do wait(0.001) if (Player.Character ~= nil) then @@ -473,8 +470,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2009E/CSMPFunctions.lua b/scripts/2009E/CSMPFunctions.lua index a97108d..da27547 100644 --- a/scripts/2009E/CSMPFunctions.lua +++ b/scripts/2009E/CSMPFunctions.lua @@ -460,8 +460,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:HttpGet(pingURL .. "&online=" .. online) end @@ -511,8 +510,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti Child.Name = "ServerReplicator" end - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - while true do wait(0.001) if (Player.Character ~= nil) then @@ -533,8 +530,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) InitalizeSecurityValues(game.Lighting,ClientEXEMD5,LauncherMD5,ClientScriptMD5) PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) diff --git a/scripts/2009L/CSMPFunctions.lua b/scripts/2009L/CSMPFunctions.lua index 291c27f..f976ce5 100644 --- a/scripts/2009L/CSMPFunctions.lua +++ b/scripts/2009L/CSMPFunctions.lua @@ -463,8 +463,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:HttpGet(pingURL .. "&online=" .. online) end @@ -511,8 +510,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti for _,Child in pairs(NetworkServer:GetChildren()) do Child.Name = "ServerReplicator" end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) Player.Changed:connect(function(Property) @@ -534,8 +531,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") diff --git a/scripts/2010L/CSMPFunctions.lua b/scripts/2010L/CSMPFunctions.lua index 149fee3..68f08fe 100644 --- a/scripts/2010L/CSMPFunctions.lua +++ b/scripts/2010L/CSMPFunctions.lua @@ -463,8 +463,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:HttpGet(pingURL .. "&online=" .. online) end @@ -511,8 +510,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti for _,Child in pairs(NetworkServer:GetChildren()) do Child.Name = "ServerReplicator" end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) Player.Changed:connect(function(Property) @@ -534,8 +531,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") diff --git a/scripts/2011E/CSMPFunctions.lua b/scripts/2011E/CSMPFunctions.lua index d5826c4..61a2e3a 100644 --- a/scripts/2011E/CSMPFunctions.lua +++ b/scripts/2011E/CSMPFunctions.lua @@ -481,8 +481,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:HttpGet(pingURL .. "&online=" .. online) end @@ -524,8 +523,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (char ~= nil) then LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),char) end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) Player.Changed:connect(function(Property) @@ -547,8 +544,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm") diff --git a/scripts/2011M/CSMPFunctions.lua b/scripts/2011M/CSMPFunctions.lua index 92938e9..0b71e20 100644 --- a/scripts/2011M/CSMPFunctions.lua +++ b/scripts/2011M/CSMPFunctions.lua @@ -472,8 +472,7 @@ function LoadTripcode(Player) end function PingMasterServer(online, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) - local PlayerService = game:GetService("Players") - local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client .. "&players=" .. PlayerService.NumPlayers .. "&maxplayers=" .. PlayerService.MaxPlayers + local pingURL = "http://" .. ServerBrowserAddress .. "/query.php?name=" .. ServerBrowserName .. "&ip=" .. ServerIP .. "&port=" .. Port .. "&client=" .. Client game:HttpGet(pingURL .. "&online=" .. online) end @@ -515,8 +514,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (char ~= nil) then LoadCharacterNew(newWaitForChildSecurity(Player,"Appearance"),char) end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) Player.Changed:connect(function(Property) @@ -538,8 +535,6 @@ function CSServer(Port,PlayerLimit,ClientEXEMD5,LauncherMD5,ClientScriptMD5,Noti if (showServerNotifications) then game.Players:Chat("Player '" .. Player.Name .. "' left") end - - PingMasterServer(1, ServerBrowserAddress, ServerBrowserName, ServerIP, Port, Client) end) RunService:Run() game.Workspace:InsertContent("rbxasset://Fonts//libraries.rbxm")