mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 08:39:07 +00:00
dont count bots toward player count, add playerBotCount
This commit is contained in:
@@ -14,7 +14,7 @@ import redone.world.GlobalDropsHandler;
|
|||||||
public class PlayerHandler {
|
public class PlayerHandler {
|
||||||
|
|
||||||
public static Player players[] = new Player[Constants.MAX_PLAYERS];
|
public static Player players[] = new Player[Constants.MAX_PLAYERS];
|
||||||
public static int playerCount = 0;
|
public static int playerCount = 0, playerBotCount = 0;
|
||||||
public static String playersCurrentlyOn[] = new String[Constants.MAX_PLAYERS];
|
public static String playersCurrentlyOn[] = new String[Constants.MAX_PLAYERS];
|
||||||
public static boolean updateAnnounced;
|
public static boolean updateAnnounced;
|
||||||
public static boolean updateRunning;
|
public static boolean updateRunning;
|
||||||
@@ -55,13 +55,21 @@ public class PlayerHandler {
|
|||||||
return playerCount;
|
return playerCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int getPlayerBotCount() {
|
||||||
|
return playerBotCount;
|
||||||
|
}
|
||||||
|
|
||||||
public void updatePlayerNames() {
|
public void updatePlayerNames() {
|
||||||
|
playerBotCount = 0;
|
||||||
playerCount = 0;
|
playerCount = 0;
|
||||||
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
|
for (int i = 0; i < Constants.MAX_PLAYERS; i++) {
|
||||||
if (players[i] != null) {
|
if (players[i] != null) {
|
||||||
playersCurrentlyOn[i] = players[i].playerName;
|
playersCurrentlyOn[i] = players[i].playerName;
|
||||||
if (!players[i].isBot)
|
if (players[i].isBot)
|
||||||
|
playerBotCount++;
|
||||||
|
else
|
||||||
playerCount++;
|
playerCount++;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
playersCurrentlyOn[i] = "";
|
playersCurrentlyOn[i] = "";
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user