mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 21:40:06 +00:00
if we're searching by IP also match online players by IP
This commit is contained in:
parent
d353870ad3
commit
471cfea4b9
@ -98,6 +98,9 @@ namespace {
|
||||
bool match_username(std::pair<network::connection, wesnothd::player> pl, const std::string& username) {
|
||||
return pl.second.name() == username;
|
||||
}
|
||||
bool match_ip(std::pair<network::connection, wesnothd::player> pl, const std::string& ip) {
|
||||
return network::ip_address(pl.first) == ip;
|
||||
}
|
||||
}
|
||||
|
||||
static lg::log_domain log_server("server");
|
||||
@ -1613,7 +1616,7 @@ std::string server::process_command(std::string query, std::string issuer_name)
|
||||
const std::string& ip = i->second;
|
||||
if (utils::wildcard_string_match(ip, parameters)) {
|
||||
found_something = true;
|
||||
wesnothd::player_map::const_iterator pl = std::find_if(players_.begin(), players_.end(), boost::bind(&::match_username, _1, username));
|
||||
wesnothd::player_map::const_iterator pl = std::find_if(players_.begin(), players_.end(), boost::bind(&::match_ip, _1, ip));
|
||||
if (pl != players_.end()) {
|
||||
out << std::endl << player_status(pl);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user