From e942db1c8d87b7db286545d72c604e879f7aeab0 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 9 Jul 2011 14:11:44 +0000 Subject: Cleanup of the messaging interface. --- src/core/player.cc | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/core/player.cc') diff --git a/src/core/player.cc b/src/core/player.cc index f183a4c..d07b258 100644 --- a/src/core/player.cc +++ b/src/core/player.cc @@ -11,12 +11,15 @@ #include "core/player.h" #include "core/cvar.h" #include "core/application.h" +#include "core/gameserver.h" namespace core { -Player::Player() +Player::Player(NetClient *client) { + player_client = client; + clear(); } @@ -61,26 +64,21 @@ void Player::print() const } -void Player::send(const std::string text) +void Player::message(Message::Channel channel, const std::string text) { - message(core::Message::Info, text); + server()->message(this, channel, text); } -void Player::send_warning(const std::string text) +void Player::send(const std::string text) { - message(core::Message::Info, text); - player_warningtime = application()->time(); + server()->message(this, core::Message::Info, text); } void Player::sound(const std::string name) { - application()->notify_sound(name.c_str()); + server()->message(this, core::Message::Sound, name); } -void Player::message(Message::Channel channel, const std::string text) -{ - application()->notify_message(channel, text); -} void Player::set_control(EntityControlable *entitycontrolable) { -- cgit v1.2.3