diff options
Diffstat (limited to 'src/core/gameserver.cc')
-rw-r--r-- | src/core/gameserver.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc index 544f660..37c486c 100644 --- a/src/core/gameserver.cc +++ b/src/core/gameserver.cc @@ -472,6 +472,25 @@ void GameServer::broadcast_sound(const std::string name, Player *ignore_player) } } +// server sends a messagebox to a single player +void GameServer::messagebox(Player *player, const std::string & text, const std::string &label1, const std::string command1, const std::string &label2, const std::string command2) +{ + if (!text.size()) { + return; + } + + NetClient *client = player->client(); + + if (client) { + // this player is a network client, send message over network + server_network->send_messagebox(client, text, label1, command1, label2, command2); + + } else if (player == localplayer()) { + // local player, send message to the local application + application()->notify_messagebox(text, label1, command1, label2, command2); + } +} + // execute a command for a remote player void GameServer::exec(Player *player, std::string const & cmdline) { |