aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnubisss <none@none>2009-07-11 22:04:01 +0200
committerAnubisss <none@none>2009-07-11 22:04:01 +0200
commitf43339f9731410c5be95a3c8ea61b88586850961 (patch)
tree39044b533abba94f5141a0f5c78d5e005726bcb0 /src
parentff7a90db5f8503bbc177f33bbc6221b3dd56bf37 (diff)
*Correcting account/characters' online value.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/WorldSession.cpp8
1 files changed, 3 insertions, 5 deletions
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)