diff options
| author | Aokromes <jipr@hotmail.com> | 2013-04-24 03:02:56 -0700 |
|---|---|---|
| committer | Aokromes <jipr@hotmail.com> | 2013-04-24 03:02:56 -0700 |
| commit | 6dbd574a69071697788632db0d1a2dc662854a18 (patch) | |
| tree | 2aea104425c0b299a3fe0c3e94eb5d340b3c88de /src/server/game/Chat/Chat.cpp | |
| parent | a1c425d7ef06fd5b55eac01ae47b5413435e9c1f (diff) | |
| parent | c7a6c1be84ad3598e586f051d7c6a4d268bfcccf (diff) | |
Merge pull request #9697 from xjose93/ImproveLog3
Core/Log: Added guid (of gm) and zone to gm command log.
Diffstat (limited to 'src/server/game/Chat/Chat.cpp')
| -rw-r--r-- | src/server/game/Chat/Chat.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/server/game/Chat/Chat.cpp b/src/server/game/Chat/Chat.cpp index 7c92af2d67f..f9d8fe9378f 100644 --- a/src/server/game/Chat/Chat.cpp +++ b/src/server/game/Chat/Chat.cpp @@ -369,8 +369,19 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand* table, const char* text, co { Player* p = m_session->GetPlayer(); uint64 sel_guid = p->GetSelection(); - sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Account: %u) X: %f Y: %f Z: %f Map: %u Selected %s: %s (GUID: %u)]", - fullcmd.c_str(), p->GetName().c_str(), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(), + uint32 areaId = p->GetAreaId(); + std::string areaName = "Unknown"; + std::string zoneName = "Unknown"; + if (AreaTableEntry const* area = GetAreaEntryByAreaID(areaId)) + { + int locale = GetSessionDbcLocale(); + areaName = area->area_name[locale]; + if (AreaTableEntry const* zone = GetAreaEntryByAreaID(area->zone)) + zoneName = zone->area_name[locale]; + } + + sLog->outCommand(m_session->GetAccountId(), "Command: %s [Player: %s (Guid: %u) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected %s: %s (GUID: %u)]", + fullcmd.c_str(), p->GetName().c_str(), GUID_LOPART(p->GetGUID()), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(), p->GetMap() ? p->GetMap()->GetMapName() : "Unknown", areaId, areaName.c_str(), zoneName.c_str(), GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName().c_str() : "", GUID_LOPART(sel_guid)); } } |
