LocationChecker thread sleeps for a bit longer when no players are online.

This commit is contained in:
UnknownShadow200 2016-07-07 23:15:16 +10:00
parent 9b47c1cb86
commit 220c5b0512

View File

@ -38,8 +38,10 @@ namespace MCGalaxy {
void DoLocationChecks() {
while (true) {
Thread.Sleep(3);
Player[] players = PlayerInfo.Online.Items;
Player[] players = PlayerInfo.Online.Items;
Thread.Sleep(players.Length == 0 ? 16 : 3);
players = PlayerInfo.Online.Items;
for (int i = 0; i < players.Length; i++) {
try {
Player p = players[i];