aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/Master.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/worldserver/Master.cpp')
-rwxr-xr-xsrc/server/worldserver/Master.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index b2b0b04b63b..45827b10c2c 100755
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -294,7 +294,7 @@ int Master::Run()
rar_thread.wait();
///- Clean database before leaving
- clearOnlineAccounts();
+ ClearOnlineAccounts();
_StopDB();
@@ -454,7 +454,7 @@ bool Master::_StartDB()
sLog->SetRealmID(realmID);
///- Clean the database before starting
- clearOnlineAccounts();
+ ClearOnlineAccounts();
///- Insert version info into DB
WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _HASH); // One-time query
@@ -475,14 +475,12 @@ void Master::_StopDB()
}
/// Clear 'online' status for all accounts with characters in this realm
-void Master::clearOnlineAccounts()
+void Master::ClearOnlineAccounts()
{
- // Cleanup online status for characters hosted at current realm
- /// \todo Only accounts with characters logged on *this* realm should have online status reset. Move the online column from 'account' to 'realmcharacters'?
- LoginDatabase.DirectPExecute(
- "UPDATE account SET online = 0 WHERE online > 0 "
- "AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = '%d')", realmID);
+ // Reset online status for all accounts with characters on the current realm
+ LoginDatabase.DirectPExecute("UPDATE account SET online = 0 WHERE online > 0 AND id IN (SELECT acctid FROM realmcharacters WHERE realmid = %d)", realmID);
+ // Reset online status for all characters
CharacterDatabase.DirectExecute("UPDATE characters SET online = 0 WHERE online <> 0");
// Battleground instance ids reset at server restart