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:
@@ -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;
|
||||
|
||||
ip = strtok ((char*)args, " ");
|
||||
limit_str = strtok (NULL, " ");
|
||||
limit = limit_str ? atoi (limit_str) : -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ip = chr->GetSession()->GetRemoteAddress();
|
||||
limit = -1;
|
||||
}
|
||||
|
||||
if (!*args)
|
||||
return false;
|
||||
LoginDatabase.EscapeString(ip);
|
||||
|
||||
std::string ip = strtok ((char*)args, " ");
|
||||
char* limit_str = strtok (NULL, " ");
|
||||
int32 limit = limit_str ? atoi (limit_str) : -1;
|
||||
QueryResult result = LoginDatabase.PQuery("SELECT id, username FROM account WHERE last_ip = '%s'", ip.c_str());
|
||||
|
||||
LoginDatabase.EscapeString (ip);
|
||||
|
||||
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