Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-18 09:21:20 +0000
committerStijn Buys <ingar@osirion.org>2008-05-18 09:21:20 +0000
commit4a2bad92171ff8a9a248599f47087cfe39e93653 (patch)
treeb8a4fe7f616b3e4f707d89a35fff5e8b5fdcfcc8 /src/core/gameserver.cc
parenta185c11f2397c0296a4b62cc266b4fa00a63c1e2 (diff)
OpenAL support
Diffstat (limited to 'src/core/gameserver.cc')
-rw-r--r--src/core/gameserver.cc25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/core/gameserver.cc b/src/core/gameserver.cc
index fb828e2..54d667b 100644
--- a/src/core/gameserver.cc
+++ b/src/core/gameserver.cc
@@ -8,6 +8,7 @@
#include "auxiliary/functions.h"
#include "sys/sys.h"
+#include "core/application.h"
#include "core/cvar.h"
#include "core/func.h"
#include "core/gameserver.h"
@@ -143,15 +144,19 @@ void GameServer::say(Player *player, std::string const &message)
if (!message.size())
return;
- // send to console
- con_print << "^B" << player->name() << "^F:^B " << message << std::endl;
+ std::string notification("^B");
+ notification.append(player->name());
+ notification.append("^F:^B ");
+ notification.append(message);
+
+ // send to application
+ application()->notify_message(notification);
+ application()->notify_sound("ui/chat.wav");
// broadcast to remote clients
if (server_network) {
- std::string netmessage("msg public ^B");
- netmessage.append(player->name());
- netmessage.append("^F:^B ");
- netmessage.append(message);
+ std::string netmessage("msg public ");
+ netmessage.append(notification);
netmessage += '\n';
server_network->broadcast(netmessage);
}
@@ -159,8 +164,8 @@ void GameServer::say(Player *player, std::string const &message)
void GameServer::broadcast(std::string const & message, Player *ignore_player)
{
- // send to console
- con_print << message << "\n";
+ // send to application
+ application()->notify_message(message);
// broadcast to remote clients
if (server_network) {
@@ -173,9 +178,9 @@ void GameServer::broadcast(std::string const & message, Player *ignore_player)
void GameServer::send(Player *player, std::string message)
{
- // send to console
+ // send to application
if (player->id() == localplayer()->id()) {
- con_print << message << "\n";
+ application()->notify_message(message);
}
// send to remote clients