mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-09 08:17:56 +00:00
fix (core): server.log dump (#10742)
This commit is contained in:
@@ -314,21 +314,6 @@ bool Log::SetLogLevel(std::string const& name, int32 newLeveli, bool isLogger /*
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Log::outCharDump(std::string_view str, uint32 accountId, uint64 guid, std::string_view name)
|
|
||||||
{
|
|
||||||
if (str.empty() || !ShouldLog("entities.player.dump", LOG_LEVEL_INFO))
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string message = Acore::StringFormatFmt("== START DUMP == (account: {} guid: {} name: {})\n {} \n== END DUMP ==\n", accountId, guid, name, str);
|
|
||||||
|
|
||||||
std::unique_ptr<LogMessage> msg(new LogMessage(LOG_LEVEL_INFO, "entities.player.dump", message));
|
|
||||||
msg->param1 = Acore::StringFormatFmt("{}_{}", guid, name);
|
|
||||||
|
|
||||||
write(std::move(msg));
|
|
||||||
}
|
|
||||||
|
|
||||||
void Log::SetRealmId(uint32 id)
|
void Log::SetRealmId(uint32 id)
|
||||||
{
|
{
|
||||||
for (std::pair<uint8 const, std::unique_ptr<Appender>>& appender : appenders)
|
for (std::pair<uint8 const, std::unique_ptr<Appender>>& appender : appenders)
|
||||||
|
|||||||
@@ -77,8 +77,6 @@ public:
|
|||||||
_outCommand(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...), std::to_string(account));
|
_outCommand(Acore::StringFormatFmt(fmt, std::forward<Args>(args)...), std::to_string(account));
|
||||||
}
|
}
|
||||||
|
|
||||||
void outCharDump(std::string_view str, uint32 account_id, uint64 guid, std::string_view name);
|
|
||||||
|
|
||||||
void SetRealmId(uint32 id);
|
void SetRealmId(uint32 id);
|
||||||
|
|
||||||
template<class AppenderImpl>
|
template<class AppenderImpl>
|
||||||
@@ -168,9 +166,6 @@ private:
|
|||||||
#define LOG_TRACE(filterType__, ...) \
|
#define LOG_TRACE(filterType__, ...) \
|
||||||
LOG_MESSAGE_BODY(filterType__, LogLevel::LOG_LEVEL_TRACE, __VA_ARGS__)
|
LOG_MESSAGE_BODY(filterType__, LogLevel::LOG_LEVEL_TRACE, __VA_ARGS__)
|
||||||
|
|
||||||
#define LOG_CHAR_DUMP(message__, accountId__, guid__, name__) \
|
|
||||||
sLog->outCharDump(message__, accountId__, guid__, name__)
|
|
||||||
|
|
||||||
#define LOG_GM(accountId__, ...) \
|
#define LOG_GM(accountId__, ...) \
|
||||||
sLog->outCommand(accountId__, __VA_ARGS__)
|
sLog->outCommand(accountId__, __VA_ARGS__)
|
||||||
|
|
||||||
|
|||||||
@@ -654,15 +654,6 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
|
|||||||
|
|
||||||
// To prevent hook failure, place hook before removing reference from DB
|
// To prevent hook failure, place hook before removing reference from DB
|
||||||
sScriptMgr->OnPlayerDelete(guid, initAccountId); // To prevent race conditioning, but as it also makes sense, we hand the accountId over for successful delete.
|
sScriptMgr->OnPlayerDelete(guid, initAccountId); // To prevent race conditioning, but as it also makes sense, we hand the accountId over for successful delete.
|
||||||
// Shouldn't interfere with character deletion though
|
|
||||||
|
|
||||||
if (sLog->ShouldLog("entities.player.dump", LogLevel::LOG_LEVEL_INFO)) // optimize GetPlayerDump call
|
|
||||||
{
|
|
||||||
std::string dump;
|
|
||||||
if (PlayerDumpWriter().GetDump(guid.GetCounter(), dump))
|
|
||||||
LOG_CHAR_DUMP(dump, accountId, guid.GetRawValue(), name);
|
|
||||||
}
|
|
||||||
|
|
||||||
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
|
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
|
||||||
Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false);
|
Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user