diff options
author | Stijn Buys <ingar@osirion.org> | 2011-02-10 18:07:24 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2011-02-10 18:07:24 +0000 |
commit | 9ff5cf6184b9c5183c1f55cfa6c0d08586eb02c9 (patch) | |
tree | d50dd2d8ed48acfbb7063d4c073f77cb195106f7 /src/core/netconnection.cc | |
parent | a255dbc032d15a4f5024bc60baa19c45ebceecc6 (diff) |
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.
Diffstat (limited to 'src/core/netconnection.cc')
-rw-r--r-- | src/core/netconnection.cc | 19 |
1 files changed, 17 insertions, 2 deletions
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) { |