mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-21 09:02:07 -07:00
Update online players when a server starts up (fix flags)
This commit is contained in:
parent
78467f5821
commit
d68c50d983
3 changed files with 6 additions and 2 deletions
|
|
@ -60,10 +60,14 @@ public final class WorldListSQLHandler extends SQLEntryHandler<GameServer> {
|
|||
return;
|
||||
}
|
||||
int players = entry.getPlayerAmount();
|
||||
WorldInfo info = entry.getInfo();
|
||||
if (!entry.isActive()) {
|
||||
players = -1;
|
||||
}
|
||||
WorldInfo info = entry.getInfo();
|
||||
if (players <= 0) {
|
||||
PreparedStatement statement = connection.prepareStatement("UPDATE members SET online='0' WHERE lastWorld='" + value + "'");
|
||||
statement.executeUpdate();
|
||||
}
|
||||
PreparedStatement statement = connection.prepareStatement("UPDATE " + table + " SET players='" + players + "', ip='" + info.getAddress() + "', country='" + info.getCountry().getId() + "', member='" + (info.isMembers() ? 1 : 0) + "', revision='" + info.getRevision() + "' WHERE world='" + value + "'");
|
||||
statement.executeUpdate();
|
||||
SQLManager.close(statement.getConnection());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue