Core/Commands: Allow to search for other account/characters from a selected player without having to write the ip as argument (By Bizzy)
This commit is contained in:
@@ -731,7 +731,7 @@ this method is called when group is inserted, or player / group is removed from
|
||||
it must be called after fully adding the members of a group to ensure group joining
|
||||
should be called from Battleground::RemovePlayer function in some cases
|
||||
*/
|
||||
void BattlegroundQueue::BattlegroundQueueUpdate(uint32 diff, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id, uint8 arenaType, bool isRated, uint32 arenaRating)
|
||||
void BattlegroundQueue::BattlegroundQueueUpdate(uint32 /*diff*/, BattlegroundTypeId bgTypeId, BattlegroundBracketId bracket_id, uint8 arenaType, bool isRated, uint32 arenaRating)
|
||||
{
|
||||
//if no players in queue - do nothing
|
||||
if (m_QueuedGroups[bracket_id][BG_QUEUE_PREMADE_ALLIANCE].empty() &&
|
||||
|
||||
@@ -707,19 +707,31 @@ bool ChatHandler::HandleCombatStopCommand(const char* args)
|
||||
|
||||
bool ChatHandler::HandleLookupPlayerIpCommand(const char* args)
|
||||
{
|
||||
std::string ip;
|
||||
int32 limit;
|
||||
char* limit_str;
|
||||
|
||||
Player *chr = getSelectedPlayer();
|
||||
if (chr == NULL)
|
||||
{
|
||||
if (!*args)
|
||||
return false;
|
||||
|
||||
std::string ip = strtok ((char*)args, " ");
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
ip = strtok ((char*)args, " ");
|
||||
limit_str = strtok (NULL, " ");
|
||||
limit = limit_str ? atoi (limit_str) : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ip = chr->GetSession()->GetRemoteAddress();
|
||||
limit = -1;
|
||||
}
|
||||
|
||||
LoginDatabase.EscapeString (ip);
|
||||
LoginDatabase.EscapeString(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)
|
||||
|
||||
Reference in New Issue
Block a user