Removed some redundant player->SaveToDB calls, original autor balrok

--HG--
branch : trunk
This commit is contained in:
n0n4m3
2009-12-17 07:56:20 +01:00
parent 2b5151f50c
commit 863fca80eb
8 changed files with 7 additions and 13 deletions
-3
View File
@@ -748,8 +748,6 @@ void WorldSession::HandleReclaimCorpseOpcode(WorldPacket &recv_data)
// spawn bones
GetPlayer()->SpawnCorpseBones();
GetPlayer()->SaveToDB();
}
void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data)
@@ -774,7 +772,6 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data)
return;
GetPlayer()->ResurectUsingRequestData();
GetPlayer()->SaveToDB();
}
void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
-1
View File
@@ -146,7 +146,6 @@ void WorldSession::HandleMoveWorldportAckOpcode()
{
GetPlayer()->ResurrectPlayer(0.5f,false);
GetPlayer()->SpawnCorpseBones();
GetPlayer()->SaveToDB();
}
}
-2
View File
@@ -395,8 +395,6 @@ void WorldSession::SendSpiritResurrect()
else
//ObjectAccessor::UpdateVisibilityForPlayer(_player);
_player->SetToNotify();
_player->SaveToDB();
}
void WorldSession::HandleBinderActivateOpcode( WorldPacket & recv_data )
+2 -1
View File
@@ -4567,7 +4567,8 @@ void Player::CreateCorpse()
void Player::SpawnCorpseBones()
{
if(ObjectAccessor::Instance().ConvertCorpseForPlayer(GetGUID()))
SaveToDB(); // prevent loading as ghost without corpse
if (!GetSession()->PlayerLogoutWithSave()) // at logout we will already store the player
SaveToDB(); // prevent loading as ghost without corpse
}
Corpse* Player::GetCorpse() const
-2
View File
@@ -6694,8 +6694,6 @@ void Spell::EffectSelfResurrect(uint32 i)
plr->SetPower(POWER_ENERGY, plr->GetMaxPower(POWER_ENERGY) );
plr->SpawnCorpseBones();
plr->SaveToDB();
}
void Spell::EffectSkinning(uint32 /*i*/)
-3
View File
@@ -2393,9 +2393,6 @@ void World::UpdateSessions(uint32 diff)
next = itr;
++next;
if (!itr->second)
continue;
///- and remove not active sessions from the list
if (!itr->second->Update(diff)) // As interval = 0
{
+3 -1
View File
@@ -47,7 +47,7 @@ WorldSession::WorldSession(uint32 id, WorldSocket *sock, AccountTypes sec, uint8
LookingForGroup_auto_join(false), LookingForGroup_auto_add(false), m_muteTime(mute_time),
_player(NULL), m_Socket(sock),_security(sec), _accountId(id), m_expansion(expansion),
m_sessionDbcLocale(sWorld.GetAvailableDbcLocale(locale)), m_sessionDbLocaleIndex(objmgr.GetIndexForLocale(locale)),
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false),
_logoutTime(0), m_inQueue(false), m_playerLoading(false), m_playerLogout(false), m_playerRecentlyLogout(false), m_playerSave(false),
m_latency(0), m_TutorialsChanged(false)
{
if (sock)
@@ -299,6 +299,7 @@ void WorldSession::LogoutPlayer(bool Save)
HandleMoveWorldportAckOpcode();
m_playerLogout = true;
m_playerSave = Save;
if (_player)
{
@@ -458,6 +459,7 @@ void WorldSession::LogoutPlayer(bool Save)
Script->OnLogout(_player);
m_playerLogout = false;
m_playerSave = false;
m_playerRecentlyLogout = true;
LogoutRequest(0);
}
+2
View File
@@ -118,6 +118,7 @@ class TRINITY_DLL_SPEC WorldSession
bool PlayerLoading() const { return m_playerLoading; }
bool PlayerLogout() const { return m_playerLogout; }
bool PlayerLogoutWithSave() const { return m_playerLogout && m_playerSave; }
void SizeError(WorldPacket const& packet, uint32 size) const;
@@ -763,6 +764,7 @@ class TRINITY_DLL_SPEC WorldSession
bool m_playerLoading; // code processed in LoginPlayer
bool m_playerLogout; // code processed in LogoutPlayer
bool m_playerRecentlyLogout;
bool m_playerSave;
LocaleConstant m_sessionDbcLocale;
int m_sessionDbLocaleIndex;
uint32 m_latency;