Core/Logging: Move player delete logging to new type LOG_FILTER_PLAYER_DELETE (34). Also add missing sql from 55ce180f28
This commit is contained in:
1 parent
1bd8cb9a7c
commit
483fb42306
5 files changed
+16
-12
No files matched your search
@@ -687,7 +687,7 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
|
||||
if (sGuildMgr->GetGuildByLeader(guid))
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_DELETE, 1);
|
||||
data << (uint8)CHAR_DELETE_FAILED_GUILD_LEADER;
|
||||
data << uint8(CHAR_DELETE_FAILED_GUILD_LEADER);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
@@ -696,18 +696,15 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
|
||||
if (sArenaTeamMgr->GetArenaTeamByCaptain(guid))
|
||||
{
|
||||
WorldPacket data(SMSG_CHAR_DELETE, 1);
|
||||
data << (uint8)CHAR_DELETE_FAILED_ARENA_CAPTAIN;
|
||||
data << uint8(CHAR_DELETE_FAILED_ARENA_CAPTAIN);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
|
||||
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_ACCOUNT_NAME_BY_GUID);
|
||||
|
||||
stmt->setUInt32(0, GUID_LOPART(guid));
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
|
||||
if (result)
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
accountId = fields[0].GetUInt32();
|
||||
@@ -719,22 +716,21 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket & recv_data)
|
||||
return;
|
||||
|
||||
std::string IP_str = GetRemoteAddress();
|
||||
sLog->outInfo(LOG_FILTER_NETWORKIO, "Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
|
||||
sLog->outDebug(LOG_FILTER_PLAYER, "Account: %d (IP: %s) Delete Character:[%s] (GUID: %u)", GetAccountId(), IP_str.c_str(), name.c_str(), GUID_LOPART(guid));
|
||||
sScriptMgr->OnPlayerDelete(guid);
|
||||
sWorld->DeleteCharaceterNameData(GUID_LOPART(guid));
|
||||
|
||||
if (sLog->ShouldLog(LOG_FILTER_PLAYER, LOG_LEVEL_TRACE)) // optimize GetPlayerDump call
|
||||
if (sLog->ShouldLog(LOG_FILTER_PLAYER_DELETE, LOG_LEVEL_INFO)) // optimize GetPlayerDump call
|
||||
{
|
||||
std::string dump;
|
||||
if (PlayerDumpWriter().GetDump(GUID_LOPART(guid), dump))
|
||||
sLog->outTrace(LOG_FILTER_PLAYER, dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str());
|
||||
sLog->outInfo(LOG_FILTER_PLAYER_DELETE, dump.c_str(), GetAccountId(), GUID_LOPART(guid), name.c_str());
|
||||
}
|
||||
|
||||
Player::DeleteFromDB(guid, GetAccountId());
|
||||
|
||||
WorldPacket data(SMSG_CHAR_DELETE, 1);
|
||||
data << (uint8)CHAR_DELETE_SUCCESS;
|
||||
data << uint8(CHAR_DELETE_SUCCESS);
|
||||
SendPacket(&data);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user