diff options
author | Stijn Buys <ingar@osirion.org> | 2008-07-05 10:17:39 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-07-05 10:17:39 +0000 |
commit | e5aada2bf01e51753829215c0a3035aa8bd8135a (patch) | |
tree | 65d7f5145334db1be780f177b93feb054f35cc82 /src/core/application.cc | |
parent | 68e4bbe3153f45139031a614541b2ccd80dd5526 (diff) |
ncurses updates, refactored say
Diffstat (limited to 'src/core/application.cc')
-rw-r--r-- | src/core/application.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/application.cc b/src/core/application.cc index cd6d278..f8c563c 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -59,6 +59,17 @@ void func_disconnect(std::string const &args) application()->disconnect(); } +void func_say(std::string const &args) +{ + if (connection()) { + connection()->say(args); + } else if (server()) { + server()->say(localplayer(), args); + } else { + con_print << "Not connected." << std::endl; + } +} + // --------------- signal_handler ----------------------------------- #ifndef _WIN32 @@ -207,6 +218,9 @@ void Application::init(int count, char **arguments) func = Func::add("disconnect", func_disconnect); func->set_info("leave the current game"); + + func = Func::add("say",func_say); + func->set_info("say [text] say something on the public chat"); } void Application::shutdown() @@ -224,6 +238,7 @@ void Application::shutdown() save_config(); // remove our engine functions + Func::remove("say"); Func::remove("help"); Func::remove("quit"); |