From 5f0ebee0d4d75fa91d417f4f352abdbc7502c2f0 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Thu, 2 Nov 2006 12:43:49 +0000 Subject: Network layer refactoring. --- src/gui/chat.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src/gui/chat.cpp') diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 9a5d60b0..3dc252ab 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -36,9 +36,9 @@ #include "../game.h" #include "../localplayer.h" -#include "../net/messageout.h" -#include "../net/network.h" -#include "../net/protocol.h" +#include "../net/chatserver/chatserver.h" + +#include "../net/gameserver/player.h" ChatWindow::ChatWindow(): Window(""), @@ -249,16 +249,12 @@ ChatWindow::chatSend(const std::string &nick, std::string msg) // Prepare ordinary message if (msg.substr(0, 1) != "/") { - MessageOut outMsg(PGMSG_SAY); - outMsg.writeString(msg); - Network::send(Network::GAME, outMsg); + Net::GameServer::Player::say(msg); } else if (msg.substr(0, IS_ANNOUNCE_LENGTH) == IS_ANNOUNCE) { msg.erase(0, IS_ANNOUNCE_LENGTH); - MessageOut outMsg(0x0099); - outMsg.writeShort(msg.length() + 4); - outMsg.writeString(msg, msg.length()); + Net::ChatServer::announce(msg); } else if (msg.substr(0, IS_HELP_LENGTH) == IS_HELP) { @@ -274,7 +270,10 @@ ChatWindow::chatSend(const std::string &nick, std::string msg) } else if (msg.substr(0, IS_WHO_LENGTH) == IS_WHO) { + // XXX Convert for new server + /* MessageOut outMsg(0x00c1); + */ } else { -- cgit v1.2.3-70-g09d2