diff options
author | Stijn Buys <ingar@osirion.org> | 2008-09-27 17:16:15 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-09-27 17:16:15 +0000 |
commit | ca0c1d3e6f8b5fa4eb2e0a86fcf47b12fb600786 (patch) | |
tree | 5d72e330f11350065806e83cc8712693241b9aad /src/core/application.cc | |
parent | 29984680d6e0e52efec489497b1796e056164442 (diff) |
mission targets, texture unloading, private messages
Diffstat (limited to 'src/core/application.cc')
-rw-r--r-- | src/core/application.cc | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/core/application.cc b/src/core/application.cc index 21d5e50..6207a0d 100644 --- a/src/core/application.cc +++ b/src/core/application.cc @@ -70,6 +70,16 @@ void func_say(std::string const &args) } } +void func_msg(std::string const &args) +{ + if (connection()) { + connection()->private_message(args); + } else if (server()) { + server()->private_message(localplayer(), args); + } else { + con_print << "Not connected." << std::endl; + } +} // --------------- signal_handler ----------------------------------- #ifndef _WIN32 @@ -222,6 +232,9 @@ void Application::init(int count, char **arguments) func = Func::add("say",func_say); func->set_info("say [text] say something on the public chat"); + + func = Func::add("msg",func_msg); + func->set_info("msg [player] [text] send a private message to another player"); } void Application::shutdown() @@ -299,6 +312,7 @@ void Application::connect(std::string const &host) void Application::disconnect() { if(application_game) { + notify_disconnect(); delete application_game; application_game = 0; con_print << "^BDisconnected.\n"; @@ -446,6 +460,11 @@ void Application::load_commandline(int count, char **arguments) cmd() << '\n'; } +void Application::notify_message(Message::Channel const channel, std::string const message) +{ + con_print << message << std::endl; +} + void Application::notify_sound(const char *name) { // the default implementation does nothing. @@ -458,15 +477,17 @@ void Application::notify_remove_sound(size_t source) // Dedicated servers don't need sounds } -void Application::notify_message(std::string const & message) +void Application::notify_zoneclear(Zone *zone) { - con_print << message << std::endl; + // the default implementation does nothing. + // The client uses this to clear old zones } -void Application::notify_zoneclear(Zone *zone) +void Application::notify_disconnect() { // the default implementation does nothing. - // The client uses this to clear old zones + // The client uses this to clear game data + } } |