t count hidden players for 'users' parameter in server heartbeat.
This commit is contained in:
UnknownShadow200 2016-06-26 13:00:28 +10:00
parent 0d3a6d31c1
commit 0596bf5e01
2 changed files with 11 additions and 2 deletions

View File

@ -38,7 +38,16 @@ namespace MCGalaxy {
"&public=" + Server.pub +
"&version=7" +
"&salt=" + Server.salt +
"&users=" + PlayerInfo.Online.Count + "&software=MCGalaxy";
"&users=" + PlayerCount() + "&software=MCGalaxy";
}
static int PlayerCount() {
Player[] players = PlayerInfo.Online.Items;
int count = 0;
foreach (Player p in players) {
if (!p.hidden) count++;
}
return count;
}
bool UrlSaid = false;

View File

@ -63,7 +63,7 @@ namespace MCGalaxy {
p.SendPos(0xFF, who.pos[0], who.pos[1], who.pos[2], who.rot[0], who.rot[1]);
}
} else if (p.possess != "") {
Player who = PlayerInfo.Find(p.possess);
Player who = PlayerInfo.FindExact(p.possess);
if (who == null || who.level != p.level)
p.possess = "";
}