#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(chat_command_handler::* | 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_req_arg () |
void | do_room_query () |
void | do_room_query_noarg () |
void | do_gen_room_query () |
void | do_whisper () |
void | do_chanmsg () |
void | do_log () |
void | do_ignore () |
void | do_friend () |
void | do_remove () |
void | do_display () |
void | do_version () |
void | do_register () |
Ask the server to register the currently used nick. More... | |
void | do_drop () |
Ask the server do drop the currently used (and registered) nick. More... | |
void | do_set () |
Update details for the currently used username. More... | |
void | do_info () |
Request information about a user from the server. More... | |
void | do_details () |
Request a list of details that can be set for a username as these might vary depending on the configuration of 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 | assert_existence (const std::string &cmd) |
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 (std::string 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 9 of file chat_command_handler.hpp.
Definition at line 12 of file chat_command_handler.hpp.
|
inline |
Definition at line 13 of file chat_command_handler.hpp.
|
protected |
Definition at line 75 of file chat_command_handler.cpp.
References events::chat_handler::add_chat_room_message_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_chat_room_message().
Referenced by init_map().
|
protected |
Request a list of details that can be set for a username as these might vary depending on the configuration of the server.
Definition at line 217 of file chat_command_handler.cpp.
References config::add_child(), chat_handler_, and events::chat_handler::send_to_server().
Referenced by init_map().
|
protected |
Definition at line 137 of file chat_command_handler.cpp.
References game_config_manager::get(), CVideo::get_singleton(), preferences::show_preferences_dialog(), and preferences::VIEW_FRIENDS.
Referenced by do_friend(), and do_ignore().
|
protected |
Ask the server do drop the currently used (and registered) nick.
Definition at line 174 of file chat_command_handler.cpp.
References _(), config::add_child(), chat_handler_, print(), and events::chat_handler::send_to_server().
Referenced by init_map().
|
protected |
Definition at line 22 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 107 of file chat_command_handler.cpp.
References _(), preferences::add_friend(), chat_handler_, events::map_command_handler< chat_command_handler >::command_failed(), do_display(), 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::user_relation_changed(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 56 of file chat_command_handler.cpp.
References config::add_child(), 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_to_server().
Referenced by init_map().
|
protected |
Definition at line 88 of file chat_command_handler.cpp.
References _(), preferences::add_ignore(), chat_handler_, events::map_command_handler< chat_command_handler >::command_failed(), do_display(), 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::user_relation_changed(), and VGETTEXT.
Referenced by init_map().
|
protected |
Request information about a user from the server.
Definition at line 203 of file chat_command_handler.cpp.
References _(), config::add_child(), 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(), print(), events::chat_handler::send_to_server(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 83 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 27 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_network_send_req_arg(), and init_map().
|
protected |
Definition at line 32 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 |
Ask the server to register the currently used nick.
Definition at line 148 of file chat_command_handler.cpp.
References _(), config::add_child(), 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(), game_logic::msg(), print(), events::chat_handler::send_to_server(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 126 of file chat_command_handler.cpp.
References _(), chat_handler_, events::map_command_handler< chat_command_handler >::get_arg(), i, print(), preferences::remove_acquaintance(), events::chat_handler::user_relation_changed(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 46 of file chat_command_handler.cpp.
References config::add_child(), 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_cmd(), events::map_command_handler< chat_command_handler >::get_data(), and events::chat_handler::send_to_server().
Referenced by init_map().
|
protected |
Definition at line 38 of file chat_command_handler.cpp.
References config::add_child(), chat_handler_, events::map_command_handler< chat_command_handler >::get_cmd(), and events::chat_handler::send_to_server().
Referenced by init_map().
|
protected |
Update details for the currently used username.
Definition at line 185 of file chat_command_handler.cpp.
References _(), config::add_child(), 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(), print(), events::chat_handler::send_to_server(), cursor::set(), and VGETTEXT.
Referenced by init_map().
|
protected |
Definition at line 144 of file chat_command_handler.cpp.
References _(), print(), and game_config::revision.
Referenced by init_map().
|
protected |
Definition at line 67 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 56 of file chat_command_handler.hpp.
References _().
|
inlineprotectedvirtual |
Reimplemented from events::map_command_handler< chat_command_handler >.
Reimplemented in events::console_handler.
Definition at line 52 of file chat_command_handler.hpp.
References _().
|
inlineprotectedvirtual |
Implements events::map_command_handler< chat_command_handler >.
Reimplemented in events::console_handler.
Definition at line 71 of file chat_command_handler.hpp.
References _(), do_chanmsg(), do_details(), do_drop(), do_emote(), do_friend(), do_gen_room_query(), do_ignore(), do_info(), do_log(), do_network_send(), do_network_send_req_arg(), do_register(), do_remove(), do_room_query(), do_room_query_noarg(), do_set(), do_version(), do_whisper(), events::map_command_handler< chat_command_handler >::register_alias(), events::map_command_handler< chat_command_handler >::register_command(), and events::map_command_handler< chat_command_handler >::set_cmd_prefix().
Referenced by events::console_handler::init_map().
|
protected |
Definition at line 11 of file chat_command_handler.cpp.
References preferences::is_authenticated().
|
protectedvirtual |
Implements events::map_command_handler< chat_command_handler >.
Reimplemented in events::console_handler.
Definition at line 16 of file chat_command_handler.cpp.
References events::chat_handler::add_chat_message(), and chat_handler_.
Referenced by do_drop(), do_friend(), do_ignore(), do_info(), do_register(), do_remove(), do_set(), and do_version().
|
private |
Definition at line 151 of file chat_command_handler.hpp.
Referenced by do_emote().
|
private |
Definition at line 150 of file chat_command_handler.hpp.
Referenced by do_chanmsg(), do_details(), do_drop(), do_emote(), do_friend(), do_gen_room_query(), do_ignore(), do_info(), do_log(), do_network_send(), do_register(), do_remove(), do_room_query(), do_room_query_noarg(), do_set(), do_whisper(), and print().