232 char const* oldtext = text;
233 std::string cmd =
"";
235 while (*text !=
' ' && *text !=
'\0')
241 while (*text ==
' ') ++text;
243 for (
uint32 i = 0; i < table.size(); ++i)
249 if (strlen(table[i].Name) > cmd.length())
251 for (
uint32 j = 0; j < table.size(); ++j)
256 if (strcmp(table[j].Name, cmd.c_str()) == 0)
267 if (!table[i].ChildCommands.empty())
288 if ((table[i].Handler)(
this, table[i].Name[0] !=
'\0' ? text : oldtext))
297 uint32 areaId = player->GetAreaId();
298 std::string areaName =
"Unknown";
299 std::string zoneName =
"Unknown";
302 areaName = area->AreaName_lang;
304 zoneName = zone->AreaName_lang;
307 sLog->outCommand(
m_session->
GetAccountId(),
"Command: %s [Player: %s (%s) (Account: %u) X: %f Y: %f Z: %f Map: %u (%s) Area: %u (%s) Zone: %s Selected: %s (%s)]",
308 fullcmd.c_str(), player->GetName().c_str(), player->GetGUID().ToString().c_str(),
310 player->GetPositionZ(), player->GetMapId(),
311 player->FindMap() ? player->FindMap()->GetMapName() :
"Unknown",
312 areaId, areaName.c_str(), zoneName.c_str(),
313 (player->GetSelectedUnit()) ? player->GetSelectedUnit()->GetName().c_str() :
"",
320 if (!table[i].Help.empty())
Definition: DBCStructure.h:37
void SetSentErrorMessage(bool val)
Definition: Chat.h:138
bool hasStringAbbr(const char *name, const char *part)
Definition: Chat.cpp:127
bool ShowHelpForCommand(std::vector< ChatCommand > const &table, const char *cmd)
Definition: Chat.cpp:522
virtual bool isAvailable(ChatCommand const &cmd) const
Definition: Chat.cpp:72
AccountTypes GetSecurity() const
Definition: WorldSession.h:921
Definition: Language.h:43
#define sLog
Definition: Log.h:154
uint32 GetAccountId() const
Definition: WorldSession.h:922
Player * GetPlayer() const
Definition: WorldSession.h:927
WorldSession * m_session
Definition: Chat.h:150
Definition: Language.h:40
DBCStorage< AreaTableEntry > sAreaTableStore(AreaTablefmt)
uint32_t uint32
Definition: Define.h:150
static bool IsPlayerAccount(uint32 gmlevel)
Definition: AccountMgr.cpp:390
bool ExecuteCommandInTable(std::vector< ChatCommand > const &table, const char *text, std::string const &fullcmd)
Definition: Chat.cpp:230
bool HasSentErrorMessage() const
Definition: Chat.h:137
Definition: ObjectGuid.h:189
virtual void SendSysMessage(char const *str, bool escapeCharacters=false)
Definition: Chat.cpp:152
std::string ToString() const
Definition: ObjectGuid.cpp:99