maint: improve overall logic in elimination_handler
This commit is contained in:
parent
89f29244ac
commit
27c2b2b75b
@ -30,6 +30,7 @@ void elimination_handler::run_frame()
|
|||||||
(server.state == game_server::state::can_ping && diff > 15min))
|
(server.state == game_server::state::can_ping && diff > 15min))
|
||||||
{
|
{
|
||||||
context.remove();
|
context.remove();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (server.game == game_type::unknown)
|
if (server.game == game_type::unknown)
|
||||||
@ -43,6 +44,7 @@ void elimination_handler::run_frame()
|
|||||||
console::log("Removing T7 server '%s' because they are using an outdated protocol (%i)", context.get_address().to_string().data(), server.protocol);
|
console::log("Removing T7 server '%s' because they are using an outdated protocol (%i)", context.get_address().to_string().data(), server.protocol);
|
||||||
#endif
|
#endif
|
||||||
context.remove();
|
context.remove();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
++server_count[server.game][context.get_address().to_string(false)];
|
++server_count[server.game][context.get_address().to_string(false)];
|
||||||
@ -50,6 +52,7 @@ void elimination_handler::run_frame()
|
|||||||
{
|
{
|
||||||
console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME", context.get_address().to_string().data());
|
console::log("Removing server '%s' because it exceeds MAX_SERVERS_PER_GAME", context.get_address().to_string().data());
|
||||||
context.remove();
|
context.remove();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto name = utils::string::to_lower(server.name);
|
const auto name = utils::string::to_lower(server.name);
|
||||||
@ -59,7 +62,7 @@ void elimination_handler::run_frame()
|
|||||||
{
|
{
|
||||||
console::log("Removing server '%s' (%s) because it contains a bad name", server.name.data(), context.get_address().to_string().data());
|
console::log("Removing server '%s' (%s) because it contains a bad name", server.name.data(), context.get_address().to_string().data());
|
||||||
context.remove();
|
context.remove();
|
||||||
break;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user