diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
commit | bd56bf8afdab16383ed8ad08412a8c807f84af85 (patch) | |
tree | 0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/chat.cpp | |
parent | 5359640b6f271af31f6423df9d661433eff89a3e (diff) | |
download | mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2 mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip |
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/chat.cpp')
-rw-r--r-- | src/gui/chat.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp index 748f4848..29fbebfe 100644 --- a/src/gui/chat.cpp +++ b/src/gui/chat.cpp @@ -34,16 +34,17 @@ #include "../game.h" #include "../graphics.h" +#include "../localplayer.h" #include "../log.h" -#include "../playerinfo.h" #include "../net/messageout.h" #include "../net/protocol.h" extern Graphics *graphics; -ChatWindow::ChatWindow(const std::string &logfile): +ChatWindow::ChatWindow(const std::string &logfile, Network *network): Window(""), + mNetwork(network), mTmpVisible(false) { setWindowName("Chat"); @@ -206,7 +207,7 @@ ChatWindow::action(const std::string& eventId) curHist = history.end(); // Send the message to the server - chatSend(player_info->name.c_str(), message.c_str()); + chatSend(player_node->getName().c_str(), message.c_str()); // Clear the text from the chat input chatInput->setText(""); @@ -262,7 +263,7 @@ ChatWindow::chatSend(std::string nick, std::string msg) if (msg.substr(0, IS_ANNOUNCE_LENGTH) == IS_ANNOUNCE) { msg.erase(0, IS_ANNOUNCE_LENGTH); - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(0x0099); outMsg.writeInt16(msg.length() + 4); outMsg.writeString(msg, msg.length()); @@ -281,7 +282,7 @@ ChatWindow::chatSend(std::string nick, std::string msg) } else if (msg.substr(0, IS_WHO_LENGTH) == IS_WHO) { - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(0x00c1); } else @@ -295,7 +296,7 @@ ChatWindow::chatSend(std::string nick, std::string msg) nick += msg; msg = nick; - MessageOut outMsg; + MessageOut outMsg(mNetwork); outMsg.writeInt16(CMSG_CHAT_MESSAGE); outMsg.writeInt16(msg.length() + 4); outMsg.writeString(msg, msg.length()); |