mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Minor tidyup of classicube heartbeat code.
This commit is contained in:
parent
15aaf619ca
commit
82ffc8dce5
@ -69,18 +69,10 @@ namespace MCGalaxy.Network {
|
|||||||
"&public=" + ServerConfig.Public +
|
"&public=" + ServerConfig.Public +
|
||||||
"&version=7" +
|
"&version=7" +
|
||||||
"&salt=" + Server.salt +
|
"&salt=" + Server.salt +
|
||||||
"&users=" + PlayerCount() +
|
"&users=" + PlayerInfo.NonHiddenCount() +
|
||||||
"&software=" + Uri.EscapeDataString(Server.SoftwareNameVersioned);
|
"&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) {
|
public override void OnRequest(HttpWebRequest request) {
|
||||||
if (proxyUrl == null) return;
|
if (proxyUrl == null) return;
|
||||||
request.Proxy = new WebProxy(proxyUrl);
|
request.Proxy = new WebProxy(proxyUrl);
|
||||||
|
@ -28,8 +28,7 @@ namespace MCGalaxy.Tasks {
|
|||||||
internal static class ServerTasks {
|
internal static class ServerTasks {
|
||||||
|
|
||||||
internal static void QueueTasks() {
|
internal static void QueueTasks() {
|
||||||
Server.MainScheduler.QueueRepeat(CheckState,
|
Server.MainScheduler.QueueRepeat(CheckState, null, TimeSpan.FromSeconds(3));
|
||||||
null, TimeSpan.FromSeconds(3));
|
|
||||||
|
|
||||||
Server.Background.QueueRepeat(AutoSave,
|
Server.Background.QueueRepeat(AutoSave,
|
||||||
1, TimeSpan.FromSeconds(ServerConfig.BackupInterval));
|
1, TimeSpan.FromSeconds(ServerConfig.BackupInterval));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user