Log out everyone on startup

This commit is contained in:
P0nk
2024-10-03 21:36:19 +02:00
parent e295a24d98
commit a4f8086da1
3 changed files with 16 additions and 7 deletions

View File

@@ -731,7 +731,7 @@ public class Server {
final int worldCount = Math.min(GameConstants.WORLD_NAMES.length, YamlConfig.config.server.WORLDS);
try (Connection con = DatabaseConnection.getConnection()) {
setAllLoggedOut(con);
channelDependencies.accountService().setAllLoggedOut();
setAllMerchantsInactive(con);
cleanNxcodeCoupons(con);
loadCouponRates(con);
@@ -873,12 +873,6 @@ public class Server {
return loginServer;
}
private static void setAllLoggedOut(Connection con) throws SQLException {
try (PreparedStatement ps = con.prepareStatement("UPDATE accounts SET loggedin = 0")) {
ps.executeUpdate();
}
}
private static void setAllMerchantsInactive(Connection con) throws SQLException {
try (PreparedStatement ps = con.prepareStatement("UPDATE characters SET HasMerchant = 0")) {
ps.executeUpdate();