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/netplayer.cc | 77 --------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 src/core/netplayer.cc (limited to 'src/core/netplayer.cc') diff --git a/src/core/netplayer.cc b/src/core/netplayer.cc deleted file mode 100644 index 9d3e677..0000000 --- a/src/core/netplayer.cc +++ /dev/null @@ -1,77 +0,0 @@ -/* - net/netplayer.cc - This file is part of the Osirion project and is distributed under - the terms of the GNU General Public License version 2 -*/ - -#include - -#include "core/net.h" -#include "core/netplayer.h" -#include "sys/sys.h" - -namespace core -{ - -NetPlayer::NetPlayer(NetClient *client) : Player() -{ - - player_client = client; -} - -NetPlayer::~NetPlayer() -{ -} - -void NetPlayer::sound(const std::string name) -{ - std::string msg("msg snd "); - msg.append(name); - msg += '\n'; - - player_client->send_raw(msg); -} - -void NetPlayer::message(const Message::Channel channel, const std::string text) -{ - if (!text.size()) - return; - - std::string msg_channel; - switch (channel) { - case core::Message::Info: // Info message - msg_channel.assign("info"); - break; - - case core::Message::Local: // Chat message in the local zone - msg_channel.assign("local"); - break; - - case core::Message::Public: // Public chat message - msg_channel.assign("public"); - break; - - case core::Message::Private: // Private chat message - msg_channel.assign("private"); - break; - - case core::Message::RCon: // RCon message - msg_channel.assign("rcon"); - break; - - default: - con_warn << "message on unknown channel " << channel << "!" << std::endl; - return; - break; - } - - std::string msg("msg "); - msg.append(msg_channel); - msg += ' '; - msg.append(text); - msg += '\n'; - - player_client->send_raw(msg); -} - -} -- cgit v1.2.3