From ca0c1d3e6f8b5fa4eb2e0a86fcf47b12fb600786 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 27 Sep 2008 17:16:15 +0000 Subject: mission targets, texture unloading, private messages --- src/core/application.cc | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/core/application.cc') 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 + } } -- cgit v1.2.3