mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
Fixied crash at .pinfo command use from console.
Also apply mangos code style to related code.
This commit is contained in:
parent
a26b72411a
commit
0bf682fdbd
3 changed files with 54 additions and 52 deletions
|
|
@ -1794,7 +1794,8 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
accId = objmgr.GetPlayerAccountIdByGUID(targetGUID);
|
accId = objmgr.GetPlayerAccountIdByGUID(targetGUID);
|
||||||
Player plr(m_session); // use current session for temporary load
|
WorldSession session(0,NULL,SEC_PLAYER,0,0,LOCALE_enUS);
|
||||||
|
Player plr(&session); // use fake session for temporary load
|
||||||
plr.MinimalLoadFromDB(NULL, targetGUID);
|
plr.MinimalLoadFromDB(NULL, targetGUID);
|
||||||
money = plr.GetMoney();
|
money = plr.GetMoney();
|
||||||
total_player_time = plr.GetTotalPlayedTime();
|
total_player_time = plr.GetTotalPlayedTime();
|
||||||
|
|
|
||||||
|
|
@ -2414,7 +2414,10 @@ void World::UpdateSessions( time_t diff )
|
||||||
|
|
||||||
///- Delete kicked sessions at add new session
|
///- Delete kicked sessions at add new session
|
||||||
for (std::set<WorldSession*>::iterator itr = m_kicked_sessions.begin(); itr != m_kicked_sessions.end(); ++itr)
|
for (std::set<WorldSession*>::iterator itr = m_kicked_sessions.begin(); itr != m_kicked_sessions.end(); ++itr)
|
||||||
|
{
|
||||||
|
RemoveQueuedPlayer (*itr);
|
||||||
delete *itr;
|
delete *itr;
|
||||||
|
}
|
||||||
m_kicked_sessions.clear();
|
m_kicked_sessions.clear();
|
||||||
|
|
||||||
///- Then send an update signal to remaining ones
|
///- Then send an update signal to remaining ones
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ _logoutTime(0), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyL
|
||||||
WorldSession::~WorldSession()
|
WorldSession::~WorldSession()
|
||||||
{
|
{
|
||||||
///- unload player if not unloaded
|
///- unload player if not unloaded
|
||||||
if(_player)
|
if (_player)
|
||||||
LogoutPlayer(true);
|
LogoutPlayer (true);
|
||||||
|
|
||||||
/// - If have unclosed socket, close it
|
/// - If have unclosed socket, close it
|
||||||
if (m_Socket)
|
if (m_Socket)
|
||||||
|
|
@ -72,11 +72,9 @@ WorldSession::~WorldSession()
|
||||||
///- empty incoming packet queue
|
///- empty incoming packet queue
|
||||||
while(!_recvQueue.empty())
|
while(!_recvQueue.empty())
|
||||||
{
|
{
|
||||||
WorldPacket *packet = _recvQueue.next();
|
WorldPacket *packet = _recvQueue.next ();
|
||||||
delete packet;
|
delete packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
sWorld.RemoveQueuedPlayer(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
|
void WorldSession::SizeError(WorldPacket const& packet, uint32 size) const
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue