Minor tidyup of classicube heartbeat code.

This commit is contained in:
UnknownShadow200 2017-08-18 00:17:59 +10:00
parent 15aaf619ca
commit 82ffc8dce5
2 changed files with 2 additions and 11 deletions

View File

@ -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);

View File

@ -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));