#include <chat_command_handler.hpp>
Public Types | |
typedef map_command_handler< chat_command_handler > | map |
Public Types inherited from events::map_command_handler< chat_command_handler > | |
typedef void(Worker::* | command_handler) () |
typedef std::map< std::string, command > | command_map |
typedef std::map< std::string, std::string > | command_alias_map |
Public Member Functions | |
chat_command_handler (chat_handler &chathandler, bool allies_only) | |
Public Member Functions inherited from events::map_command_handler< chat_command_handler > | |
map_command_handler () | |
virtual | ~map_command_handler () |
bool | empty () const |
void | dispatch (std::string cmd) |
std::vector< std::string > | get_commands_list () const |
void | command_failed (const std::string &message, bool=false) |
Protected Member Functions | |
void | do_emote () |
void | do_network_send () |
void | do_network_send (const std::string &data) |
void | do_network_send_req_arg () |
void | do_whisper () |
void | do_log () |
void | do_ignore () |
void | do_friend () |
void | do_remove () |
void | do_display () |
void | do_version () |
void | do_clear_messages () |
void | do_mp_report () |
void | do_info () |
Request information about a user from the server. More... | |
std::string | get_flags_description () const |
std::string | get_command_flags_description (const map_command_handler< chat_command_handler >::command &c) const |
bool | is_enabled (const map_command_handler< chat_command_handler >::command &c) const |
void | print (const std::string &title, const std::string &message) |
void | init_map () |
Protected Member Functions inherited from events::map_command_handler< chat_command_handler > | |
void | init_map_default () |
virtual std::string | get_command_flags_description (const command &) const |
virtual bool | is_enabled (const command &) const |
virtual void | parse_cmd (const std::string &cmd_string) |
virtual std::string | get_arg (unsigned argn) const |
virtual std::string | get_data (unsigned argn=1) const |
virtual std::string | get_cmd () const |
void | command_failed_need_arg (int argn) |
void | print_usage () |
std::string | get_actual_cmd (const std::string &cmd) const |
const command * | get_command (const std::string &cmd) const |
command * | get_command (const std::string &cmd) |
void | help () |
bool | help_command (const std::string &acmd) |
virtual void | register_command (const std::string &cmd, command_handler h, const std::string &help="", const std::string &usage="", const std::string &flags="") |
virtual void | register_alias (const std::string &to_cmd, const std::string &cmd) |
Private Attributes | |
chat_handler & | chat_handler_ |
bool | allies_only_ |
Additional Inherited Members | |
Static Protected Member Functions inherited from events::map_command_handler< chat_command_handler > | |
static void | set_help_on_unknown (bool value) |
static void | set_cmd_prefix (const std::string &value) |
static void | set_cmd_flag (bool value) |
static const std::vector< std::string > | get_aliases (const std::string &cmd) |
Protected Attributes inherited from events::map_command_handler< chat_command_handler > | |
cmd_arg_parser | cap_ |
Definition at line 23 of file chat_command_handler.hpp.
Definition at line 26 of file chat_command_handler.hpp.
|
inline |
Definition at line 27 of file chat_command_handler.hpp.
|
protected |
Definition at line 143 of file chat_command_handler.cpp.
References chat_handler_, and events::chat_handler::clear_messages().
Referenced by init_map().
|
protected |
Definition at line 120 of file chat_command_handler.cpp.
References pref_constants::VIEW_FRIENDS.
Referenced by do_friend(), and do_ignore().
|
protected |
Definition at line 37 of file chat_command_handler.cpp.
References allies_only_, chat_handler_, events::map_command_handler< chat_command_handler >::get_data(), and events::chat_handler::send_chat_message().
Referenced by init_map().
|
protected |
Definition at line 90 of file chat_command_handler.cpp.
References _(), chat_handler_, events::map_command_handler< chat_command_handler >::command_failed(), do_display(), events::map_command_handler< chat_command_handler >::empty(), prefs::get(), events::map_command_handler< chat_command_handler >::get_arg(), events::map_command_handler< chat_command_handler >::get_data(), print(), events::chat_handler::user_relation_changed(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 71 of file chat_command_handler.cpp.
References _(), chat_handler_, events::map_command_handler< chat_command_handler >::command_failed(), do_display(), events::map_command_handler< chat_command_handler >::empty(), prefs::get(), events::map_command_handler< chat_command_handler >::get_arg(), events::map_command_handler< chat_command_handler >::get_data(), print(), events::chat_handler::user_relation_changed(), and VGETTEXT.
Referenced by init_map().
|
protected |
Request information about a user from the server.
Definition at line 129 of file chat_command_handler.cpp.
References _(), config::add_child(), chat_handler_, events::map_command_handler< chat_command_handler >::command_failed_need_arg(), data, events::map_command_handler< chat_command_handler >::empty(), events::map_command_handler< chat_command_handler >::get_arg(), events::map_command_handler< chat_command_handler >::get_data(), print(), events::chat_handler::send_to_server(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 66 of file chat_command_handler.cpp.
References events::chat_handler::change_logging(), chat_handler_, and events::map_command_handler< chat_command_handler >::get_data().
Referenced by init_map().
|
protected |
Definition at line 147 of file chat_command_handler.cpp.
References do_network_send().
Referenced by init_map().
|
protected |
Definition at line 42 of file chat_command_handler.cpp.
References chat_handler_, events::map_command_handler< chat_command_handler >::get_cmd(), events::map_command_handler< chat_command_handler >::get_data(), and events::chat_handler::send_command().
Referenced by do_mp_report(), do_network_send_req_arg(), and init_map().
|
protected |
Definition at line 47 of file chat_command_handler.cpp.
References chat_handler_, data, events::map_command_handler< chat_command_handler >::get_cmd(), and events::chat_handler::send_command().
|
protected |
Definition at line 52 of file chat_command_handler.cpp.
References events::map_command_handler< chat_command_handler >::command_failed_need_arg(), do_network_send(), events::map_command_handler< chat_command_handler >::empty(), and events::map_command_handler< chat_command_handler >::get_data().
Referenced by init_map().
|
protected |
Definition at line 109 of file chat_command_handler.cpp.
References _(), chat_handler_, prefs::get(), events::map_command_handler< chat_command_handler >::get_arg(), i, print(), prefs::remove_acquaintance(), events::chat_handler::user_relation_changed(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 125 of file chat_command_handler.cpp.
References _(), print(), and game_config::revision.
Referenced by init_map().
|
protected |
Definition at line 58 of file chat_command_handler.cpp.
References events::chat_handler::add_whisper_sent(), chat_handler_, events::map_command_handler< chat_command_handler >::command_failed_need_arg(), events::map_command_handler< chat_command_handler >::empty(), events::map_command_handler< chat_command_handler >::get_arg(), events::map_command_handler< chat_command_handler >::get_data(), and events::chat_handler::send_whisper().
Referenced by init_map().
|
inlineprotected |
Definition at line 54 of file chat_command_handler.hpp.
|
inlineprotectedvirtual |
Reimplemented from events::map_command_handler< chat_command_handler >.
Reimplemented in events::console_handler.
Definition at line 50 of file chat_command_handler.hpp.
References _().
|
inlineprotectedvirtual |
Implements events::map_command_handler< chat_command_handler >.
Reimplemented in events::console_handler.
Definition at line 69 of file chat_command_handler.hpp.
References _(), do_clear_messages(), do_emote(), do_friend(), do_ignore(), do_info(), do_log(), do_mp_report(), do_network_send(), do_network_send_req_arg(), do_remove(), do_version(), do_whisper(), events::map_command_handler< chat_command_handler >::register_alias(), events::map_command_handler< chat_command_handler >::register_command(), events::map_command_handler< chat_command_handler >::set_cmd_flag(), and events::map_command_handler< chat_command_handler >::set_cmd_prefix().
|
protected |
Definition at line 27 of file chat_command_handler.cpp.
References c, and mp::logged_in_as_moderator().
|
protectedvirtual |
Implements events::map_command_handler< chat_command_handler >.
Reimplemented in events::console_handler.
Definition at line 32 of file chat_command_handler.cpp.
References events::chat_handler::add_chat_message(), and chat_handler_.
Referenced by do_friend(), do_ignore(), do_info(), do_remove(), and do_version().
|
private |
Definition at line 125 of file chat_command_handler.hpp.
Referenced by do_emote().
|
private |
Definition at line 124 of file chat_command_handler.hpp.
Referenced by do_clear_messages(), do_emote(), do_friend(), do_ignore(), do_info(), do_log(), do_network_send(), do_remove(), do_whisper(), and print().