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/application.cc | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src/core/application.cc') diff --git a/src/core/application.cc b/src/core/application.cc index c731833..ec7e89c 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -202,8 +202,11 @@ void Application::init(int count, char **arguments) func = Func::add("disconnect", Application::func_disconnect); func->set_info("leave the current game"); + func = Func::add("shout", Application::func_shout); + func->set_info("shout [text] shout something on the global chat"); + func = Func::add("say", Application::func_say); - func->set_info("say [text] say something on the public chat"); + func->set_info("say [text] say something on the local chat"); func = Func::add("msg", Application::func_msg); func->set_info("msg [player] [text] send a private message to another player"); @@ -518,6 +521,17 @@ void Application::func_disconnect(std::string const &args) Application::instance()->disconnect(); } +void Application::func_shout(std::string const &args) +{ + if (connection()) { + connection()->shout(args); + } else if (server()) { + server()->shout(localplayer(), args); + } else { + con_print << "Not connected." << std::endl; + } +} + void Application::func_say(std::string const &args) { if (connection()) { -- cgit v1.2.3