wesnothd: Only disclose the number of online admins to admins using adminmsg
(cherry-picked from commit be41a692fb
)
This commit is contained in:
parent
0c5a47def4
commit
b14b1e9509
1 changed files with 12 additions and 3 deletions
|
@ -2229,12 +2229,21 @@ void server::adminmsg_handler(
|
|||
}
|
||||
}
|
||||
|
||||
if(n == 0) {
|
||||
*out << "Sorry, no admin available right now. But your message got logged.";
|
||||
bool is_admin = false;
|
||||
|
||||
for(const auto& player : player_connections_) {
|
||||
if(issuer_name == player.info().name() && player.info().is_moderator()) {
|
||||
is_admin = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!is_admin) {
|
||||
*out << "Your report has been logged and sent to the server administrators. Thanks!";
|
||||
return;
|
||||
}
|
||||
|
||||
*out << "Message sent to " << n << " admins.";
|
||||
*out << "Your report has been logged and sent to " << n << " online administrators. Thanks!";
|
||||
}
|
||||
|
||||
void server::pm_handler(
|
||||
|
|
Loading…
Add table
Reference in a new issue