aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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)