Add spaces after commas
This commit is contained in:
@@ -76,7 +76,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
uint64 banned_guid = atol(*iter);
|
||||
if (banned_guid)
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) loaded banned guid:" UI64FMTD "",name.c_str(), banned_guid);
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) loaded banned guid:" UI64FMTD "", name.c_str(), banned_guid);
|
||||
banned.insert(banned_guid);
|
||||
}
|
||||
}
|
||||
@@ -88,7 +88,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
stmt->setString(0, name);
|
||||
stmt->setUInt32(1, m_Team);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) saved in database", name.c_str());
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) saved in database", name.c_str());
|
||||
}
|
||||
|
||||
m_IsSaved = true;
|
||||
@@ -116,7 +116,7 @@ void Channel::UpdateChannelInDB() const
|
||||
stmt->setUInt32(5, m_Team);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS,"Channel(%s) updated in database", m_name.c_str());
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS, "Channel(%s) updated in database", m_name.c_str());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -137,7 +137,7 @@ void Channel::CleanOldChannelsInDB()
|
||||
stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) * DAY);
|
||||
CharacterDatabase.Execute(stmt);
|
||||
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS,"Cleaned out unused custom chat channels.");
|
||||
sLog->outDebug(LOG_FILTER_CHATSYS, "Cleaned out unused custom chat channels.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,7 +576,7 @@ void Channel::List(Player* player)
|
||||
}
|
||||
}
|
||||
|
||||
data.put<uint32>(pos,count);
|
||||
data.put<uint32>(pos, count);
|
||||
|
||||
SendToOne(&data, p);
|
||||
}
|
||||
|
||||
@@ -44,12 +44,12 @@ ChannelMgr::~ChannelMgr()
|
||||
Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name,wname);
|
||||
Utf8toWStr(name, wname);
|
||||
wstrToLower(wname);
|
||||
|
||||
if (channels.find(wname) == channels.end())
|
||||
{
|
||||
Channel *nchan = new Channel(name,channel_id, team);
|
||||
Channel *nchan = new Channel(name, channel_id, team);
|
||||
channels[wname] = nchan;
|
||||
return nchan;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ Channel *ChannelMgr::GetJoinChannel(std::string name, uint32 channel_id)
|
||||
Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name,wname);
|
||||
Utf8toWStr(name, wname);
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
@@ -70,7 +70,7 @@ Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt)
|
||||
if (pkt)
|
||||
{
|
||||
WorldPacket data;
|
||||
MakeNotOnPacket(&data,name);
|
||||
MakeNotOnPacket(&data, name);
|
||||
p->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ Channel *ChannelMgr::GetChannel(std::string name, Player *p, bool pkt)
|
||||
void ChannelMgr::LeftChannel(std::string name)
|
||||
{
|
||||
std::wstring wname;
|
||||
Utf8toWStr(name,wname);
|
||||
Utf8toWStr(name, wname);
|
||||
wstrToLower(wname);
|
||||
|
||||
ChannelMap::const_iterator i = channels.find(wname);
|
||||
|
||||
@@ -31,7 +31,7 @@ class ChannelMgr
|
||||
{
|
||||
public:
|
||||
uint32 team;
|
||||
typedef std::map<std::wstring,Channel*> ChannelMap;
|
||||
typedef std::map<std::wstring, Channel*> ChannelMap;
|
||||
ChannelMgr() {team = 0;}
|
||||
~ChannelMgr();
|
||||
|
||||
|
||||
@@ -240,28 +240,28 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
|
||||
static ChatCommand serverIdleRestartCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleRestartCommand>, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand serverIdleShutdownCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerIdleShutDownCommand>, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand serverRestartCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerRestartCommand>, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
|
||||
static ChatCommand serverShutdownCommandTable[] =
|
||||
{
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>,"", NULL },
|
||||
{ "cancel", SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCancelCommand>, "", NULL },
|
||||
{ "" , SEC_ADMINISTRATOR, true, OldHandler<&ChatHandler::HandleServerShutDownCommand>, "", NULL },
|
||||
{ NULL, 0, false, NULL, "", NULL }
|
||||
};
|
||||
@@ -401,7 +401,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
{ "cometome", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleComeToMeCommand>, "", NULL },
|
||||
{ "damage", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleDamageCommand>, "", NULL },
|
||||
{ "combatstop", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleCombatStopCommand>, "", NULL },
|
||||
{ "flusharenapoints",SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL },
|
||||
{ "flusharenapoints", SEC_ADMINISTRATOR, false, OldHandler<&ChatHandler::HandleFlushArenaPointsCommand>, "", NULL },
|
||||
{ "repairitems", SEC_GAMEMASTER, true, OldHandler<&ChatHandler::HandleRepairitemsCommand>, "", NULL },
|
||||
{ "waterwalk", SEC_GAMEMASTER, false, OldHandler<&ChatHandler::HandleWaterwalkCommand>, "", NULL },
|
||||
|
||||
@@ -443,7 +443,7 @@ ChatCommand * ChatHandler::getCommandTable()
|
||||
added += appendCommandTable(commandTableCache + added, *it);
|
||||
}
|
||||
|
||||
QueryResult result = WorldDatabase.Query("SELECT name,security,help FROM command");
|
||||
QueryResult result = WorldDatabase.Query("SELECT name, security, help FROM command");
|
||||
if (result)
|
||||
{
|
||||
do
|
||||
@@ -499,7 +499,7 @@ bool ChatHandler::HasLowerSecurity(Player* target, uint64 guid, bool strong)
|
||||
return true;
|
||||
}
|
||||
|
||||
return HasLowerSecurityAccount(target_session,target_account,strong);
|
||||
return HasLowerSecurityAccount(target_session, target_account, strong);
|
||||
}
|
||||
|
||||
bool ChatHandler::HasLowerSecurityAccount(WorldSession* target, uint32 target_account, bool strong)
|
||||
@@ -620,7 +620,7 @@ void ChatHandler::PSendSysMessage(int32 entry, ...)
|
||||
va_list ap;
|
||||
char str [2048];
|
||||
va_start(ap, entry);
|
||||
vsnprintf(str,2048,format, ap);
|
||||
vsnprintf(str, 2048, format, ap);
|
||||
va_end(ap);
|
||||
SendSysMessage(str);
|
||||
}
|
||||
@@ -630,7 +630,7 @@ void ChatHandler::PSendSysMessage(const char *format, ...)
|
||||
va_list ap;
|
||||
char str [2048];
|
||||
va_start(ap, format);
|
||||
vsnprintf(str,2048,format, ap);
|
||||
vsnprintf(str, 2048, format, ap);
|
||||
va_end(ap);
|
||||
SendSysMessage(str);
|
||||
}
|
||||
@@ -661,7 +661,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
|
||||
if (!hasStringAbbr(table[j].Name, cmd.c_str()))
|
||||
continue;
|
||||
|
||||
if (strcmp(table[j].Name,cmd.c_str()) != 0)
|
||||
if (strcmp(table[j].Name, cmd.c_str()) != 0)
|
||||
continue;
|
||||
else
|
||||
{
|
||||
@@ -683,7 +683,7 @@ bool ChatHandler::ExecuteCommandInTable(ChatCommand *table, const char* text, co
|
||||
else
|
||||
SendSysMessage(LANG_CMD_SYNTAX);
|
||||
|
||||
ShowHelpForCommand(table[i].ChildCommands,text);
|
||||
ShowHelpForCommand(table[i].ChildCommands, text);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -704,8 +704,8 @@ 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(),m_session->GetAccountId(),p->GetPositionX(),p->GetPositionY(),p->GetPositionZ(),p->GetMapId(),
|
||||
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(), m_session->GetAccountId(), p->GetPositionX(), p->GetPositionY(), p->GetPositionZ(), p->GetMapId(),
|
||||
GetLogNameForGuid(sel_guid), (p->GetSelectedUnit()) ? p->GetSelectedUnit()->GetName() : "", GUID_LOPART(sel_guid));
|
||||
}
|
||||
}
|
||||
@@ -756,12 +756,12 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
|
||||
// expected subcommand by full name DB content
|
||||
else if (*text)
|
||||
{
|
||||
sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.",text,fullcommand.c_str());
|
||||
sLog->outErrorDb("Table `command` have unexpected subcommand '%s' in command '%s', skip.", text, fullcommand.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
if (table[i].SecurityLevel != security)
|
||||
sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u",fullcommand.c_str(),table[i].SecurityLevel,security);
|
||||
sLog->outDetail("Table `command` overwrite for command '%s' default security (%u) by %u", fullcommand.c_str(), table[i].SecurityLevel, security);
|
||||
|
||||
table[i].SecurityLevel = security;
|
||||
table[i].Help = help;
|
||||
@@ -772,9 +772,9 @@ bool ChatHandler::SetDataForCommandInTable(ChatCommand *table, const char* text,
|
||||
if (!cmd.empty())
|
||||
{
|
||||
if (table == getCommandTable())
|
||||
sLog->outErrorDb("Table `command` have not existed command '%s', skip.",cmd.c_str());
|
||||
sLog->outErrorDb("Table `command` have not existed command '%s', skip.", cmd.c_str());
|
||||
else
|
||||
sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.",cmd.c_str(),fullcommand.c_str());
|
||||
sLog->outErrorDb("Table `command` have not existed subcommand '%s' in command '%s', skip.", cmd.c_str(), fullcommand.c_str());
|
||||
}
|
||||
|
||||
return false;
|
||||
@@ -910,10 +910,10 @@ bool ChatHandler::ShowHelpForSubCommands(ChatCommand *table, char const* cmd, ch
|
||||
if (table == getCommandTable())
|
||||
{
|
||||
SendSysMessage(LANG_AVIABLE_CMD);
|
||||
PSendSysMessage("%s",list.c_str());
|
||||
PSendSysMessage("%s", list.c_str());
|
||||
}
|
||||
else
|
||||
PSendSysMessage(LANG_SUBCMDS_LIST,cmd,list.c_str());
|
||||
PSendSysMessage(LANG_SUBCMDS_LIST, cmd, list.c_str());
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -944,7 +944,7 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd)
|
||||
SendSysMessage(table[i].Help.c_str());
|
||||
|
||||
if (table[i].ChildCommands)
|
||||
if (ShowHelpForSubCommands(table[i].ChildCommands,table[i].Name,subcmd ? subcmd : ""))
|
||||
if (ShowHelpForSubCommands(table[i].ChildCommands, table[i].Name, subcmd ? subcmd : ""))
|
||||
return true;
|
||||
|
||||
return !table[i].Help.empty();
|
||||
@@ -965,14 +965,14 @@ bool ChatHandler::ShowHelpForCommand(ChatCommand *table, const char* cmd)
|
||||
SendSysMessage(table[i].Help.c_str());
|
||||
|
||||
if (table[i].ChildCommands)
|
||||
if (ShowHelpForSubCommands(table[i].ChildCommands,"",""))
|
||||
if (ShowHelpForSubCommands(table[i].ChildCommands, "", ""))
|
||||
return true;
|
||||
|
||||
return !table[i].Help.empty();
|
||||
}
|
||||
}
|
||||
|
||||
return ShowHelpForSubCommands(table,"",cmd);
|
||||
return ShowHelpForSubCommands(table, "", cmd);
|
||||
}
|
||||
|
||||
//Note: target_guid used only in CHAT_MSG_WHISPER_INFORM mode (in this case channelName ignored)
|
||||
@@ -1079,7 +1079,7 @@ Unit* ChatHandler::getSelectedUnit()
|
||||
if (guid == 0)
|
||||
return m_session->GetPlayer();
|
||||
|
||||
return ObjectAccessor::GetUnit(*m_session->GetPlayer(),guid);
|
||||
return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
|
||||
}
|
||||
|
||||
WorldObject *ChatHandler::getSelectedObject()
|
||||
@@ -1092,7 +1092,7 @@ WorldObject *ChatHandler::getSelectedObject()
|
||||
if (guid == 0)
|
||||
return GetNearbyGameObject();
|
||||
|
||||
return ObjectAccessor::GetUnit(*m_session->GetPlayer(),guid);
|
||||
return ObjectAccessor::GetUnit(*m_session->GetPlayer(), guid);
|
||||
}
|
||||
|
||||
Creature* ChatHandler::getSelectedCreature()
|
||||
@@ -1100,7 +1100,7 @@ Creature* ChatHandler::getSelectedCreature()
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
|
||||
return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(),m_session->GetPlayer()->GetSelection());
|
||||
return ObjectAccessor::GetCreatureOrPetOrVehicle(*m_session->GetPlayer(), m_session->GetPlayer()->GetSelection());
|
||||
}
|
||||
|
||||
char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** something1)
|
||||
@@ -1132,9 +1132,9 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
|
||||
if (!cLinkType)
|
||||
return NULL; // end of data
|
||||
|
||||
if (strcmp(cLinkType,linkType) != 0)
|
||||
if (strcmp(cLinkType, linkType) != 0)
|
||||
{
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after retturn from function
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after retturn from function
|
||||
SendSysMessage(LANG_WRONG_LINK_TYPE);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1147,7 +1147,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* linkType, char** s
|
||||
*something1 = strtok(NULL, ":|"); // extract something
|
||||
|
||||
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
|
||||
return cKey;
|
||||
}
|
||||
|
||||
@@ -1193,7 +1193,7 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
||||
|
||||
for (int i = 0; linkTypes[i]; ++i)
|
||||
{
|
||||
if (strcmp(cLinkType,linkTypes[i]) == 0)
|
||||
if (strcmp(cLinkType, linkTypes[i]) == 0)
|
||||
{
|
||||
char* cKeys = strtok(NULL, "|"); // extract keys and values
|
||||
char* cKeysTail = strtok(NULL, "");
|
||||
@@ -1203,14 +1203,14 @@ char* ChatHandler::extractKeyFromLink(char* text, char const* const* linkTypes,
|
||||
*something1 = strtok(NULL, ":|"); // extract something
|
||||
|
||||
strtok(cKeysTail, "]"); // restart scan tail and skip name with possible spaces
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
|
||||
if (found_idx)
|
||||
*found_idx = i;
|
||||
return cKey;
|
||||
}
|
||||
}
|
||||
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL,s) use after return from function
|
||||
strtok(NULL, " "); // skip link tail (to allow continue strtok(NULL, s) use after return from function
|
||||
SendSysMessage(LANG_WRONG_LINK_TYPE);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1228,7 +1228,7 @@ GameObject* ChatHandler::GetNearbyGameObject()
|
||||
return obj;
|
||||
}
|
||||
|
||||
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry)
|
||||
GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry)
|
||||
{
|
||||
if (!m_session)
|
||||
return NULL;
|
||||
@@ -1244,8 +1244,8 @@ GameObject* ChatHandler::GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
|
||||
Trinity::GameObjectWithDbGUIDCheck go_check(*pl,lowguid);
|
||||
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl,obj,go_check);
|
||||
Trinity::GameObjectWithDbGUIDCheck go_check(*pl, lowguid);
|
||||
Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck> checker(pl, obj, go_check);
|
||||
|
||||
TypeContainerVisitor<Trinity::GameObjectSearcher<Trinity::GameObjectWithDbGUIDCheck>, GridTypeMapContainer > object_checker(checker);
|
||||
cell.Visit(p, object_checker, *pl->GetMap());
|
||||
@@ -1278,11 +1278,11 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
|
||||
// number or [name] Shift-click form |color|Henchant:recipe_spell_id|h[prof_name: recipe_name]|h|r
|
||||
// number or [name] Shift-click form |color|Hglyph:glyph_slot_id:glyph_prop_id|h[%s]|h|r
|
||||
// number or [name] Shift-click form |color|Hspell:spell_id|h[name]|h|r
|
||||
// number or [name] Shift-click form |color|Htalent:talent_id,rank|h[name]|h|r
|
||||
// number or [name] Shift-click form |color|Htrade:spell_id,skill_id,max_value,cur_value|h[name]|h|r
|
||||
// number or [name] Shift-click form |color|Htalent:talent_id, rank|h[name]|h|r
|
||||
// number or [name] Shift-click form |color|Htrade:spell_id, skill_id, max_value, cur_value|h[name]|h|r
|
||||
int type = 0;
|
||||
char* param1_str = NULL;
|
||||
char* idS = extractKeyFromLink(text,spellKeys,&type,¶m1_str);
|
||||
char* idS = extractKeyFromLink(text, spellKeys, &type, ¶m1_str);
|
||||
if (!idS)
|
||||
return 0;
|
||||
|
||||
@@ -1330,7 +1330,7 @@ uint32 ChatHandler::extractSpellIdFromLink(char* text)
|
||||
GameTele const* ChatHandler::extractGameTeleFromLink(char* text)
|
||||
{
|
||||
// id, or string, or [name] Shift-click form |color|Htele:id|h[name]|h|r
|
||||
char* cId = extractKeyFromLink(text,"Htele");
|
||||
char* cId = extractKeyFromLink(text, "Htele");
|
||||
if (!cId)
|
||||
return false;
|
||||
|
||||
@@ -1364,7 +1364,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
// |color|Hcreature:creature_guid|h[name]|h|r
|
||||
// |color|Hgameobject:go_guid|h[name]|h|r
|
||||
// |color|Hplayer:name|h[name]|h|r
|
||||
char* idS = extractKeyFromLink(text,guidKeys,&type);
|
||||
char* idS = extractKeyFromLink(text, guidKeys, &type);
|
||||
if (!idS)
|
||||
return 0;
|
||||
|
||||
@@ -1389,7 +1389,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
uint32 lowguid = (uint32)atol(idS);
|
||||
|
||||
if (CreatureData const* data = sObjectMgr->GetCreatureData(lowguid))
|
||||
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_UNIT);
|
||||
return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_UNIT);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -1398,7 +1398,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
uint32 lowguid = (uint32)atol(idS);
|
||||
|
||||
if (GameObjectData const* data = sObjectMgr->GetGOData(lowguid))
|
||||
return MAKE_NEW_GUID(lowguid,data->id,HIGHGUID_GAMEOBJECT);
|
||||
return MAKE_NEW_GUID(lowguid, data->id, HIGHGUID_GAMEOBJECT);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
@@ -1411,7 +1411,7 @@ uint64 ChatHandler::extractGuidFromLink(char* text)
|
||||
std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
||||
{
|
||||
// |color|Hplayer:name|h[name]|h|r
|
||||
char* name_str = extractKeyFromLink(text,"Hplayer");
|
||||
char* name_str = extractKeyFromLink(text, "Hplayer");
|
||||
if (!name_str)
|
||||
return "";
|
||||
|
||||
@@ -1422,7 +1422,7 @@ std::string ChatHandler::extractPlayerNameFromLink(char* text)
|
||||
return name;
|
||||
}
|
||||
|
||||
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/,std::string* player_name /*= NULL*/)
|
||||
bool ChatHandler::extractPlayerTarget(char* args, Player** player, uint64* player_guid /*=NULL*/, std::string* player_name /*= NULL*/)
|
||||
{
|
||||
if (args && *args)
|
||||
{
|
||||
|
||||
@@ -63,14 +63,14 @@ class ChatHandler
|
||||
FillMessageData(data, CHAT_MSG_SYSTEM, LANG_UNIVERSAL, 0, message);
|
||||
}
|
||||
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos,"\n"); pos = NULL; return start; }
|
||||
static char* LineFromMessage(char*& pos) { char* start = strtok(pos, "\n"); pos = NULL; return start; }
|
||||
|
||||
// function with different implementation for chat/console
|
||||
virtual const char *GetTrinityString(int32 entry) const;
|
||||
virtual void SendSysMessage(const char *str);
|
||||
|
||||
void SendSysMessage(int32 entry);
|
||||
void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2,3);
|
||||
void PSendSysMessage(const char *format, ...) ATTR_PRINTF(2, 3);
|
||||
void PSendSysMessage(int32 entry, ...);
|
||||
std::string PGetParseString(int32 entry, ...) const;
|
||||
|
||||
@@ -118,7 +118,7 @@ class ChatHandler
|
||||
std::string GetNameLink(Player* chr) const { return playerLink(chr->GetName()); }
|
||||
|
||||
GameObject* GetNearbyGameObject();
|
||||
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid,uint32 entry);
|
||||
GameObject* GetObjectGlobalyWithGuidOrNearWithDbGuid(uint32 lowguid, uint32 entry);
|
||||
bool HasSentErrorMessage() { return sentErrorMessage;}
|
||||
void SetSentErrorMessage(bool val){ sentErrorMessage = val;};
|
||||
static bool LoadCommandTable() { return load_command_table;}
|
||||
@@ -352,11 +352,11 @@ class ChatHandler
|
||||
// Utility methods for commands
|
||||
bool LookupPlayerSearchCommand(QueryResult result, int32 limit);
|
||||
bool HandleBanListHelper(QueryResult result);
|
||||
bool HandleBanHelper(BanMode mode,char const* args);
|
||||
bool HandleBanHelper(BanMode mode, char const* args);
|
||||
bool HandleBanInfoHelper(uint32 accountid, char const* accountname);
|
||||
bool HandleUnBanHelper(BanMode mode,char const* args);
|
||||
bool HandleUnBanHelper(BanMode mode, char const* args);
|
||||
void HandleCharacterLevel(Player* player, uint64 player_guid, uint32 oldlevel, uint32 newlevel);
|
||||
void HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id);
|
||||
void HandleLearnSkillRecipesHelper(Player* player, uint32 skill_id);
|
||||
|
||||
// Stores informations about a deleted character
|
||||
struct DeletedInfo
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
// |color|Hquest:quest_id:quest_level|h[name]|h|r - client, quest list name shift-click
|
||||
// |color|Hskill:skill_id|h[name]|h|r
|
||||
// |color|Hspell:spell_id|h[name]|h|r - client, spellbook spell icon shift-click
|
||||
// |color|Htalent:talent_id,rank|h[name]|h|r - client, talent icon shift-click
|
||||
// |color|Htalent:talent_id, rank|h[name]|h|r - client, talent icon shift-click
|
||||
// |color|Htaxinode:id|h[name]|h|r
|
||||
// |color|Htele:id|h[name]|h|r
|
||||
// |color|Htitle:id|h[name]|h|r
|
||||
|
||||
@@ -78,7 +78,7 @@ bool ChatHandler::HandleGMAnnounceCommand(const char* args)
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
sWorld->SendGMText(LANG_GM_BROADCAST,args);
|
||||
sWorld->SendGMText(LANG_GM_BROADCAST, args);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
{
|
||||
uint64 guid = extractGuidFromLink((char*)args);
|
||||
if (guid)
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(),guid,TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
|
||||
obj = (WorldObject*)ObjectAccessor::GetObjectByTypeMask(*m_session->GetPlayer(), guid, TYPEMASK_UNIT|TYPEMASK_GAMEOBJECT);
|
||||
|
||||
if (!obj)
|
||||
{
|
||||
@@ -145,7 +145,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
Cell cell(cell_val);
|
||||
|
||||
uint32 zone_id, area_id;
|
||||
obj->GetZoneAndAreaId(zone_id,area_id);
|
||||
obj->GetZoneAndAreaId(zone_id, area_id);
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(obj->GetMapId());
|
||||
AreaTableEntry const* zoneEntry = GetAreaEntryByAreaID(zone_id);
|
||||
@@ -154,7 +154,7 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
float zone_x = obj->GetPositionX();
|
||||
float zone_y = obj->GetPositionY();
|
||||
|
||||
Map2ZoneCoordinates(zone_x,zone_y,zone_id);
|
||||
Map2ZoneCoordinates(zone_x, zone_y, zone_id);
|
||||
|
||||
Map const *map = obj->GetMap();
|
||||
float ground_z = map->GetHeight(obj->GetPositionX(), obj->GetPositionY(), MAX_HEIGHT);
|
||||
@@ -166,8 +166,8 @@ bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
int gx = 63 - p.x_coord;
|
||||
int gy = 63 - p.y_coord;
|
||||
|
||||
uint32 have_map = Map::ExistMap(obj->GetMapId(),gx,gy) ? 1 : 0;
|
||||
uint32 have_vmap = Map::ExistVMap(obj->GetMapId(),gx,gy) ? 1 : 0;
|
||||
uint32 have_map = Map::ExistMap(obj->GetMapId(), gx, gy) ? 1 : 0;
|
||||
uint32 have_vmap = Map::ExistVMap(obj->GetMapId(), gx, gy) ? 1 : 0;
|
||||
|
||||
if(have_vmap)
|
||||
{
|
||||
@@ -202,7 +202,7 @@ bool ChatHandler::HandleSummonCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
Player* _player = m_session->GetPlayer();
|
||||
@@ -234,7 +234,7 @@ bool ChatHandler::HandleSummonCommand(const char* args)
|
||||
// only allow if gm mode is on
|
||||
if (!_player->isGameMaster())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,nameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, nameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -262,13 +262,13 @@ bool ChatHandler::HandleSummonCommand(const char* args)
|
||||
(m_session->GetPlayer()->GetGroup()->GetLeaderGUID() != m_session->GetPlayer()->GetGUID()))
|
||||
// the last check is a bit excessive, but let it be, just in case
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,nameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, nameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),"");
|
||||
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), "");
|
||||
if (needReportToTarget(target))
|
||||
ChatHandler(target).PSendSysMessage(LANG_SUMMONED_BY, playerLink(_player->GetName()).c_str());
|
||||
|
||||
@@ -283,9 +283,9 @@ bool ChatHandler::HandleSummonCommand(const char* args)
|
||||
target->SaveRecallPosition();
|
||||
|
||||
// before GM
|
||||
float x,y,z;
|
||||
m_session->GetPlayer()->GetClosePoint(x,y,z,target->GetObjectSize());
|
||||
target->TeleportTo(m_session->GetPlayer()->GetMapId(),x,y,z,target->GetOrientation());
|
||||
float x, y, z;
|
||||
m_session->GetPlayer()->GetClosePoint(x, y, z, target->GetObjectSize());
|
||||
target->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, target->GetOrientation());
|
||||
target->SetPhaseMask(m_session->GetPlayer()->GetPhaseMask(), true);
|
||||
}
|
||||
else
|
||||
@@ -296,7 +296,7 @@ bool ChatHandler::HandleSummonCommand(const char* args)
|
||||
|
||||
std::string nameLink = playerLink(target_name);
|
||||
|
||||
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(),GetTrinityString(LANG_OFFLINE));
|
||||
PSendSysMessage(LANG_SUMMONING, nameLink.c_str(), GetTrinityString(LANG_OFFLINE));
|
||||
|
||||
// in point where GM stay
|
||||
Player::SavePositionInDB(m_session->GetPlayer()->GetMapId(),
|
||||
@@ -317,7 +317,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
Player* _player = m_session->GetPlayer();
|
||||
@@ -342,7 +342,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
// only allow if gm mode is on
|
||||
if (!_player->isGameMaster())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM,chrNameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_BG_GM, chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -367,7 +367,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
// we are in group, we can go only if we are in the player group
|
||||
if (_player->GetGroup() != target->GetGroup())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY,chrNameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_PARTY, chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
// we are not in group, let's verify our GM mode
|
||||
if (!_player->isGameMaster())
|
||||
{
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM,chrNameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_GO_TO_INST_GM, chrNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -415,8 +415,8 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
_player->SaveRecallPosition();
|
||||
|
||||
// to point to see at target with same orientation
|
||||
float x,y,z;
|
||||
target->GetContactPoint(_player,x,y,z);
|
||||
float x, y, z;
|
||||
target->GetContactPoint(_player, x, y, z);
|
||||
|
||||
_player->TeleportTo(target->GetMapId(), x, y, z, _player->GetAngle(target), TELE_TO_GM_MODE);
|
||||
_player->SetPhaseMask(target->GetPhaseMask(), true);
|
||||
@@ -432,10 +432,10 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
PSendSysMessage(LANG_APPEARING_AT, nameLink.c_str());
|
||||
|
||||
// to point where player stay (if loaded)
|
||||
float x,y,z,o;
|
||||
float x, y, z, o;
|
||||
uint32 map;
|
||||
bool in_flight;
|
||||
if (!Player::LoadPositionFromDB(map,x,y,z,o,in_flight,target_guid))
|
||||
if (!Player::LoadPositionFromDB(map, x, y, z, o, in_flight, target_guid))
|
||||
return false;
|
||||
|
||||
// stop flight if need
|
||||
@@ -448,7 +448,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
else
|
||||
_player->SaveRecallPosition();
|
||||
|
||||
_player->TeleportTo(map, x, y, z,_player->GetOrientation());
|
||||
_player->TeleportTo(map, x, y, z, _player->GetOrientation());
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -458,7 +458,7 @@ bool ChatHandler::HandleAppearCommand(const char* args)
|
||||
bool ChatHandler::HandleRecallCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
if (!extractPlayerTarget((char*)args, &target))
|
||||
return false;
|
||||
|
||||
// check online security
|
||||
@@ -537,7 +537,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
|
||||
std::string namepart = args;
|
||||
std::wstring wnamepart;
|
||||
|
||||
if (!Utf8toWStr (namepart,wnamepart))
|
||||
if (!Utf8toWStr (namepart, wnamepart))
|
||||
return false;
|
||||
|
||||
bool found = false;
|
||||
@@ -621,7 +621,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
|
||||
std::string namepart = str;
|
||||
std::wstring wnamepart;
|
||||
|
||||
if (!Utf8toWStr(namepart,wnamepart))
|
||||
if (!Utf8toWStr(namepart, wnamepart))
|
||||
return false;
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
@@ -655,7 +655,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
|
||||
if (reply.str().empty())
|
||||
SendSysMessage(LANG_COMMAND_TELE_NOLOCATION);
|
||||
else
|
||||
PSendSysMessage(LANG_COMMAND_TELE_LOCATION,reply.str().c_str());
|
||||
PSendSysMessage(LANG_COMMAND_TELE_LOCATION, reply.str().c_str());
|
||||
|
||||
if (limitReached)
|
||||
PSendSysMessage(LANG_COMMAND_LOOKUP_MAX_RESULTS, maxResults);
|
||||
@@ -709,7 +709,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
char* tail1 = strtok(NULL, "");
|
||||
@@ -733,12 +733,12 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
|
||||
std::string text = msgText;
|
||||
|
||||
// from console show not existed sender
|
||||
MailSender sender(MAIL_NORMAL,m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
|
||||
MailSender sender(MAIL_NORMAL, m_session ? m_session->GetPlayer()->GetGUIDLow() : 0, MAIL_STATIONERY_GM);
|
||||
|
||||
//- TODO: Fix poor design
|
||||
SQLTransaction trans = CharacterDatabase.BeginTransaction();
|
||||
MailDraft(subject, text)
|
||||
.SendMailTo(trans, MailReceiver(target,GUID_LOPART(target_guid)),sender);
|
||||
.SendMailTo(trans, MailReceiver(target, GUID_LOPART(target_guid)), sender);
|
||||
|
||||
CharacterDatabase.CommitTransaction(trans);
|
||||
|
||||
@@ -751,7 +751,7 @@ bool ChatHandler::HandleSendMailCommand(const char* args)
|
||||
bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
if (!extractPlayerTarget((char*)args, &target))
|
||||
return false;
|
||||
|
||||
// check online security
|
||||
@@ -764,7 +764,7 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
|
||||
if (!grp)
|
||||
{
|
||||
PSendSysMessage(LANG_NOT_IN_GROUP,nameLink.c_str());
|
||||
PSendSysMessage(LANG_NOT_IN_GROUP, nameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -810,13 +810,13 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
if (plMap->Instanceable() && plMap->GetInstanceId() != gmMap->GetInstanceId())
|
||||
{
|
||||
// cannot summon from instance to instance
|
||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST,plNameLink.c_str());
|
||||
PSendSysMessage(LANG_CANNOT_SUMMON_TO_INST, plNameLink.c_str());
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(),"");
|
||||
PSendSysMessage(LANG_SUMMONING, plNameLink.c_str(), "");
|
||||
if (needReportToTarget(pl))
|
||||
ChatHandler(pl).PSendSysMessage(LANG_SUMMONED_BY, GetNameLink().c_str());
|
||||
|
||||
@@ -831,9 +831,9 @@ bool ChatHandler::HandleGroupSummonCommand(const char* args)
|
||||
pl->SaveRecallPosition();
|
||||
|
||||
// before GM
|
||||
float x,y,z;
|
||||
m_session->GetPlayer()->GetClosePoint(x,y,z,pl->GetObjectSize());
|
||||
pl->TeleportTo(m_session->GetPlayer()->GetMapId(),x,y,z,pl->GetOrientation());
|
||||
float x, y, z;
|
||||
m_session->GetPlayer()->GetClosePoint(x, y, z, pl->GetObjectSize());
|
||||
pl->TeleportTo(m_session->GetPlayer()->GetMapId(), x, y, z, pl->GetOrientation());
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -48,7 +48,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
{
|
||||
char* nameStr;
|
||||
char* delayStr;
|
||||
extractOptFirstArg((char*)args,&nameStr,&delayStr);
|
||||
extractOptFirstArg((char*)args, &nameStr, &delayStr);
|
||||
if (!delayStr)
|
||||
return false;
|
||||
|
||||
@@ -60,7 +60,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget(nameStr,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget(nameStr, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
|
||||
@@ -73,7 +73,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
uint32 notspeaktime = (uint32) atoi(delayStr);
|
||||
|
||||
// must have strong lesser security level
|
||||
if (HasLowerSecurity (target,target_guid,true))
|
||||
if (HasLowerSecurity (target, target_guid, true))
|
||||
return false;
|
||||
|
||||
time_t mutetime = time(NULL) + notspeaktime*60;
|
||||
@@ -81,7 +81,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
if (target)
|
||||
target->GetSession()->m_muteTime = mutetime;
|
||||
|
||||
LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'",uint64(mutetime), account_id);
|
||||
LoginDatabase.PExecute("UPDATE account SET mutetime = " UI64FMTD " WHERE id = '%u'", uint64(mutetime), account_id);
|
||||
|
||||
if (target)
|
||||
ChatHandler(target).PSendSysMessage(LANG_YOUR_CHAT_DISABLED, notspeaktime, mutereasonstr.c_str());
|
||||
@@ -99,7 +99,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
uint32 account_id = target ? target->GetSession()->GetAccountId() : sObjectMgr->GetPlayerAccountIdByGUID(target_guid);
|
||||
@@ -110,7 +110,7 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
target = session->GetPlayer();
|
||||
|
||||
// must have strong lesser security level
|
||||
if (HasLowerSecurity (target,target_guid,true))
|
||||
if (HasLowerSecurity (target, target_guid, true))
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
@@ -236,7 +236,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
uint32 accId = 0;
|
||||
@@ -289,11 +289,11 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
uint32 security = 0;
|
||||
std::string last_login = GetTrinityString(LANG_ERROR);
|
||||
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT a.username,aa.gmlevel,a.email,a.last_ip,a.last_login "
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT a.username, aa.gmlevel, a.email, a.last_ip, a.last_login "
|
||||
"FROM account a "
|
||||
"LEFT JOIN account_access aa "
|
||||
"ON (a.id = aa.id) "
|
||||
"WHERE a.id = '%u'",accId);
|
||||
"WHERE a.id = '%u'", accId);
|
||||
if (result)
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
@@ -348,7 +348,7 @@ bool ChatHandler::HandlePInfoCommand(const char* args)
|
||||
case CLASS_DRUID: Class_s = "Druid"; break;
|
||||
}
|
||||
|
||||
std::string timeStr = secsToTimeString(total_player_time,true,true);
|
||||
std::string timeStr = secsToTimeString(total_player_time, true, true);
|
||||
uint32 gold = money /GOLD;
|
||||
uint32 silv = (money % GOLD) / SILVER;
|
||||
uint32 copp = (money % GOLD) % SILVER;
|
||||
@@ -363,7 +363,7 @@ bool ChatHandler::HandleCharacterRenameCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
@@ -396,7 +396,7 @@ bool ChatHandler::HandleCharacterCustomizeCommand(const char* args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if (!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if (!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
if (target)
|
||||
@@ -422,7 +422,7 @@ bool ChatHandler::HandleCharacterChangeFactionCommand(const char * args)
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
|
||||
if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if(!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
if(target)
|
||||
@@ -449,7 +449,7 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
if(!extractPlayerTarget((char*)args,&target,&target_guid,&target_name))
|
||||
if(!extractPlayerTarget((char*)args, &target, &target_guid, &target_name))
|
||||
return false;
|
||||
|
||||
if(target)
|
||||
@@ -474,7 +474,7 @@ bool ChatHandler::HandleCharacterChangeRaceCommand(const char * args)
|
||||
bool ChatHandler::HandleCharacterReputationCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
if (!extractPlayerTarget((char*)args, &target))
|
||||
return false;
|
||||
|
||||
LocaleConstant loc = GetSessionDbcLocale();
|
||||
@@ -521,7 +521,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
std::wstring wnamepart;
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
if (!Utf8toWStr(namepart,wnamepart))
|
||||
if (!Utf8toWStr(namepart, wnamepart))
|
||||
return false;
|
||||
|
||||
wstrToLower(wnamepart);
|
||||
@@ -552,9 +552,9 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
char const* active = activeEvents.find(id) != activeEvents.end() ? GetTrinityString(LANG_ACTIVE) : "";
|
||||
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT,id,id,eventData.description.c_str(),active);
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CHAT, id, id, eventData.description.c_str(), active);
|
||||
else
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE,id,eventData.description.c_str(),active);
|
||||
PSendSysMessage(LANG_EVENT_ENTRY_LIST_CONSOLE, id, eventData.description.c_str(), active);
|
||||
|
||||
if (!found)
|
||||
found = true;
|
||||
@@ -570,7 +570,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
bool ChatHandler::HandleCombatStopCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
if (!extractPlayerTarget((char*)args, &target))
|
||||
return false;
|
||||
|
||||
// check online security
|
||||
@@ -594,9 +594,9 @@ bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
||||
|
||||
LoginDatabase.escape_string (ip);
|
||||
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE last_ip = '%s'", ip.c_str ());
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result,limit);
|
||||
return LookupPlayerSearchCommand (result, limit);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
@@ -613,9 +613,9 @@ bool ChatHandler::HandleLookupPlayerAccountCommand(const char* args)
|
||||
|
||||
LoginDatabase.escape_string (account);
|
||||
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE username = '%s'", account.c_str ());
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE username = '%s'", account.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result,limit);
|
||||
return LookupPlayerSearchCommand (result, limit);
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
@@ -630,9 +630,9 @@ bool ChatHandler::HandleLookupPlayerEmailCommand(const char* args)
|
||||
|
||||
LoginDatabase.escape_string (email);
|
||||
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id,username FROM account WHERE email = '%s'", email.c_str ());
|
||||
QueryResult result = LoginDatabase.PQuery ("SELECT id, username FROM account WHERE email = '%s'", email.c_str ());
|
||||
|
||||
return LookupPlayerSearchCommand (result,limit);
|
||||
return LookupPlayerSearchCommand (result, limit);
|
||||
}
|
||||
|
||||
bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
@@ -659,10 +659,10 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
uint32 acc_id = fields[0].GetUInt32();
|
||||
std::string acc_name = fields[1].GetString();
|
||||
|
||||
QueryResult chars = CharacterDatabase.PQuery("SELECT guid,name FROM characters WHERE account = '%u'", acc_id);
|
||||
QueryResult chars = CharacterDatabase.PQuery("SELECT guid, name FROM characters WHERE account = '%u'", acc_id);
|
||||
if (chars)
|
||||
{
|
||||
PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT,acc_name.c_str(),acc_id);
|
||||
PSendSysMessage(LANG_LOOKUP_PLAYER_ACCOUNT, acc_name.c_str(), acc_id);
|
||||
|
||||
uint64 guid = 0;
|
||||
std::string name;
|
||||
@@ -673,7 +673,7 @@ bool ChatHandler::LookupPlayerSearchCommand(QueryResult result, int32 limit)
|
||||
guid = charfields[0].GetUInt64();
|
||||
name = charfields[1].GetString();
|
||||
|
||||
PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER,name.c_str(),guid);
|
||||
PSendSysMessage(LANG_LOOKUP_PLAYER_CHARACTER, name.c_str(), guid);
|
||||
++i;
|
||||
|
||||
} while (chars->NextRow() && (limit == -1 || i < limit));
|
||||
@@ -700,7 +700,7 @@ bool ChatHandler::HandleServerCorpsesCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleRepairitemsCommand(const char* args)
|
||||
{
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
if (!extractPlayerTarget((char*)args, &target))
|
||||
return false;
|
||||
|
||||
// check online security
|
||||
@@ -807,7 +807,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
}
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel()-1);
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel()-1);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
@@ -817,7 +817,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* /*args*/)
|
||||
pet->GetMap()->Add(pet->ToCreature());
|
||||
|
||||
// visual effect for levelup
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL,creatureTarget->getLevel());
|
||||
pet->SetUInt32Value(UNIT_FIELD_LEVEL, creatureTarget->getLevel());
|
||||
|
||||
player->SetMinion(pet, true);
|
||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||
@@ -858,7 +858,7 @@ bool ChatHandler::HandlePetLearnCommand(const char* args)
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(spellId);
|
||||
if (!spellInfo || !SpellMgr::IsSpellValid(spellInfo))
|
||||
{
|
||||
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN,spellId);
|
||||
PSendSysMessage(LANG_COMMAND_SPELL_BROKEN, spellId);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
@@ -931,7 +931,7 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
|
||||
std::string namepart = args;
|
||||
std::wstring wnamepart;
|
||||
|
||||
if (!Utf8toWStr(namepart,wnamepart))
|
||||
if (!Utf8toWStr(namepart, wnamepart))
|
||||
return false;
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
@@ -983,13 +983,13 @@ bool ChatHandler::HandleLookupTitleCommand(const char* args)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr,80,name.c_str(),targetName);
|
||||
snprintf(titleNameStr, 80, name.c_str(), targetName);
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr);
|
||||
PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
|
||||
else
|
||||
PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,titleNameStr,localeNames[loc],knownStr,activeStr);
|
||||
PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, titleNameStr, localeNames[loc], knownStr, activeStr);
|
||||
|
||||
++counter;
|
||||
}
|
||||
@@ -1006,7 +1006,7 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
|
||||
return false;
|
||||
|
||||
Player* target;
|
||||
if (!extractPlayerTarget((char*)args,&target))
|
||||
if (!extractPlayerTarget((char*)args, &target))
|
||||
return false;
|
||||
|
||||
LocaleConstant loc = GetSessionDbcLocale();
|
||||
@@ -1028,13 +1028,13 @@ bool ChatHandler::HandleCharacterTitlesCommand(const char* args)
|
||||
: "";
|
||||
|
||||
char titleNameStr[80];
|
||||
snprintf(titleNameStr,80,name.c_str(),targetName);
|
||||
snprintf(titleNameStr, 80, name.c_str(), targetName);
|
||||
|
||||
// send title in "id (idx:idx) - [namedlink locale]" format
|
||||
if (m_session)
|
||||
PSendSysMessage(LANG_TITLE_LIST_CHAT,id,titleInfo->bit_index,id,titleNameStr,localeNames[loc],knownStr,activeStr);
|
||||
PSendSysMessage(LANG_TITLE_LIST_CHAT, id, titleInfo->bit_index, id, titleNameStr, localeNames[loc], knownStr, activeStr);
|
||||
else
|
||||
PSendSysMessage(LANG_TITLE_LIST_CONSOLE,id,titleInfo->bit_index,name.c_str(),localeNames[loc],knownStr,activeStr);
|
||||
PSendSysMessage(LANG_TITLE_LIST_CONSOLE, id, titleInfo->bit_index, name.c_str(), localeNames[loc], knownStr, activeStr);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user