From f43339f9731410c5be95a3c8ea61b88586850961 Mon Sep 17 00:00:00 2001 From: Anubisss Date: Sat, 11 Jul 2009 22:04:01 +0200 Subject: *Correcting account/characters' online value. --HG-- branch : trunk --- src/game/WorldSession.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/game/WorldSession.cpp b/src/game/WorldSession.cpp index 0724aac320e..b35246d1cec 100644 --- a/src/game/WorldSession.cpp +++ b/src/game/WorldSession.cpp @@ -53,6 +53,7 @@ m_latency(0), m_TutorialsChanged(false) { m_Address = sock->GetRemoteAddress (); sock->AddReference (); + LoginDatabase.PExecute("UPDATE account SET online = 1 WHERE id = %u;", GetAccountId()); } } @@ -77,6 +78,8 @@ WorldSession::~WorldSession() WorldPacket *packet = _recvQueue.next (); delete packet; } + LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = %u;", GetAccountId()); + CharacterDatabase.PExecute("UPDATE characters SET online = 0 WHERE account = %u;", GetAccountId()); } void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const @@ -329,11 +332,6 @@ void WorldSession::LogoutPlayer(bool Save) } } - ///- Reset the online field in the account table - // no point resetting online in character table here as Player::SaveToDB() will set it to 1 since player has not been removed from world at this stage - //No SQL injection as AccountID is uint32 - LoginDatabase.PExecute("UPDATE account SET online = 0 WHERE id = '%u'", GetAccountId()); - ///- If the player is in a guild, update the guild roster and broadcast a logout message to other guild members Guild *guild = objmgr.GetGuildById(_player->GetGuildId()); if(guild) -- cgit v1.2.3