From 82ffc8dce59a7770999f8622a16663309f822c4f Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Fri, 18 Aug 2017 00:17:59 +1000 Subject: [PATCH] Minor tidyup of classicube heartbeat code. --- MCGalaxy/Network/Heartbeat/ClassiCube.cs | 10 +--------- MCGalaxy/Server/Tasks/ServerTasks.cs | 3 +-- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/MCGalaxy/Network/Heartbeat/ClassiCube.cs b/MCGalaxy/Network/Heartbeat/ClassiCube.cs index 198441843..26d1c7ac7 100644 --- a/MCGalaxy/Network/Heartbeat/ClassiCube.cs +++ b/MCGalaxy/Network/Heartbeat/ClassiCube.cs @@ -69,18 +69,10 @@ namespace MCGalaxy.Network { "&public=" + ServerConfig.Public + "&version=7" + "&salt=" + Server.salt + - "&users=" + PlayerCount() + + "&users=" + PlayerInfo.NonHiddenCount() + "&software=" + Uri.EscapeDataString(Server.SoftwareNameVersioned); } - static int PlayerCount() { - int count = PlayerInfo.NonHiddenCount(); - // This may happen if a VIP joins an already full server. - if (count > ServerConfig.MaxPlayers) - count = ServerConfig.MaxPlayers; - return count; - } - public override void OnRequest(HttpWebRequest request) { if (proxyUrl == null) return; request.Proxy = new WebProxy(proxyUrl); diff --git a/MCGalaxy/Server/Tasks/ServerTasks.cs b/MCGalaxy/Server/Tasks/ServerTasks.cs index a81767853..9df779339 100644 --- a/MCGalaxy/Server/Tasks/ServerTasks.cs +++ b/MCGalaxy/Server/Tasks/ServerTasks.cs @@ -28,8 +28,7 @@ namespace MCGalaxy.Tasks { internal static class ServerTasks { internal static void QueueTasks() { - Server.MainScheduler.QueueRepeat(CheckState, - null, TimeSpan.FromSeconds(3)); + Server.MainScheduler.QueueRepeat(CheckState, null, TimeSpan.FromSeconds(3)); Server.Background.QueueRepeat(AutoSave, 1, TimeSpan.FromSeconds(ServerConfig.BackupInterval));