mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[8829] some more places where we call redundant SaveToDB
i also added now my assert with which i've found them.. maybe someone want's to look at other cases too :)
This commit is contained in:
parent
37ba6623bb
commit
7a2764e0fe
6 changed files with 13 additions and 8 deletions
|
|
@ -3511,7 +3511,6 @@ bool ChatHandler::HandleReviveCommand(const char* args)
|
|||
{
|
||||
target->ResurrectPlayer(0.5f);
|
||||
target->SpawnCorpseBones();
|
||||
target->SaveToDB();
|
||||
}
|
||||
else
|
||||
// will resurrected at login without corpse
|
||||
|
|
|
|||
|
|
@ -669,8 +669,7 @@ void WorldSession::HandleResurrectResponseOpcode(WorldPacket & recv_data)
|
|||
if(!GetPlayer()->isRessurectRequestedBy(guid))
|
||||
return;
|
||||
|
||||
GetPlayer()->ResurectUsingRequestData();
|
||||
GetPlayer()->SaveToDB();
|
||||
GetPlayer()->ResurectUsingRequestData(); // will call spawncorpsebones
|
||||
}
|
||||
|
||||
void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
|
||||
|
|
|
|||
|
|
@ -4319,6 +4319,7 @@ void Player::CreateCorpse()
|
|||
void Player::SpawnCorpseBones()
|
||||
{
|
||||
if(sObjectAccessor.ConvertCorpseForPlayer(GetGUID()))
|
||||
if (!GetSession()->PlayerLogoutWithSave()) // at logout we will already store the player
|
||||
SaveToDB(); // prevent loading as ghost without corpse
|
||||
}
|
||||
|
||||
|
|
@ -15619,6 +15620,7 @@ bool Player::_LoadHomeBind(QueryResult *result)
|
|||
|
||||
void Player::SaveToDB()
|
||||
{
|
||||
// we should assure this: assert((m_nextSave != sWorld.getConfig(CONFIG_INTERVAL_SAVE)));
|
||||
// delay auto save at any saves (manual, in code, or autosave)
|
||||
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,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(sObjectMgr.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)
|
||||
|
|
@ -292,6 +292,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
HandleMoveWorldportAckOpcode();
|
||||
|
||||
m_playerLogout = true;
|
||||
m_playerSave = Save;
|
||||
|
||||
if (_player)
|
||||
{
|
||||
|
|
@ -454,6 +455,7 @@ void WorldSession::LogoutPlayer(bool Save)
|
|||
}
|
||||
|
||||
m_playerLogout = false;
|
||||
m_playerSave = false;
|
||||
m_playerRecentlyLogout = true;
|
||||
LogoutRequest(0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,6 +113,8 @@ class MANGOS_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;
|
||||
|
||||
|
|
@ -748,6 +750,7 @@ class MANGOS_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;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "8828"
|
||||
#define REVISION_NR "8829"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue