aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/Master.cpp
diff options
context:
space:
mode:
authorleak <leak@bitmx.net>2012-03-19 18:08:32 +0100
committerleak <leak@bitmx.net>2012-03-19 18:09:14 +0100
commit4665d5bfc456a49b10b0817db5473c3ee5c86603 (patch)
tree86d6003600d758f4db9f970b6c94620b35858f8a /src/server/worldserver/Master.cpp
parent178c658363bb07084c409f044c87b3073a108068 (diff)
Core/DBLayer: Remnant cleanups
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