From 9ff5cf6184b9c5183c1f55cfa6c0d08586eb02c9 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 10 Feb 2011 18:07:24 +0000 Subject: Added a local chat channel. The say command defaults to zone chat, global messages can be send with the shout command. Removed NonSolid flag fro race objects, have race use the local chat channel. Updated to network protocol version 22. Updated developer documentation. --- src/core/netconnection.cc | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/core/netconnection.cc') diff --git a/src/core/netconnection.cc b/src/core/netconnection.cc index 15e57e2..262c956 100644 --- a/src/core/netconnection.cc +++ b/src/core/netconnection.cc @@ -393,10 +393,19 @@ void NetConnection::send_rcon(std::string const &cmdline) this->send_raw(msg); } +// send a "shout" chat message message to the server +void NetConnection::send_shout(std::string const &text) +{ + std::string msg("msg public "); + msg.append(text); + msg += '\n'; + this->send_raw(msg); +} + // send a "say" chat message message to the server void NetConnection::send_say(std::string const &text) { - std::string msg("say "); + std::string msg("msg local "); msg.append(text); msg += '\n'; this->send_raw(msg); @@ -405,7 +414,7 @@ void NetConnection::send_say(std::string const &text) // send a "priv" private message to the server void NetConnection::send_private_message(std::string const &text) { - std::string msg("priv "); + std::string msg("msg private "); msg.append(text); msg += '\n'; this->send_raw(msg); @@ -604,6 +613,12 @@ void NetConnection::parse_incoming_message(const std::string & message) if (message.size() > 9) { application()->notify_message(Message::RCon, message.substr(9)); } + } else if (level == "local") { + // FIXME - separate zone and sender nickname + if (message.size() > 10) { + application()->notify_message(Message::Local, message.substr(10)); + } + } else if (level == "public") { // FIXME - separate sender nickname if (message.size() > 11) { -- cgit v1.2.3