diff --git a/src/engine/client/ec_client.c b/src/engine/client/ec_client.c index ad362972f..b4d913592 100644 --- a/src/engine/client/ec_client.c +++ b/src/engine/client/ec_client.c @@ -1952,27 +1952,27 @@ static void con_serverdummy(void *result, void *user_data) static void client_register_commands() { - MACRO_REGISTER_COMMAND("quit", "", CFGFLAG_CLIENT, con_quit, 0x0); - MACRO_REGISTER_COMMAND("connect", "s", CFGFLAG_CLIENT, con_connect, 0x0); - MACRO_REGISTER_COMMAND("disconnect", "", CFGFLAG_CLIENT, con_disconnect, 0x0); - MACRO_REGISTER_COMMAND("ping", "", CFGFLAG_CLIENT, con_ping, 0x0); - MACRO_REGISTER_COMMAND("screenshot", "", CFGFLAG_CLIENT, con_screenshot, 0x0); - MACRO_REGISTER_COMMAND("rcon", "r", CFGFLAG_CLIENT, con_rcon, 0x0); - MACRO_REGISTER_COMMAND("rcon_auth", "s", CFGFLAG_CLIENT, con_rcon_auth, 0x0); + MACRO_REGISTER_COMMAND("quit", "", CFGFLAG_CLIENT, con_quit, 0x0, ""); + MACRO_REGISTER_COMMAND("connect", "s", CFGFLAG_CLIENT, con_connect, 0x0, ""); + MACRO_REGISTER_COMMAND("disconnect", "", CFGFLAG_CLIENT, con_disconnect, 0x0, ""); + MACRO_REGISTER_COMMAND("ping", "", CFGFLAG_CLIENT, con_ping, 0x0, ""); + MACRO_REGISTER_COMMAND("screenshot", "", CFGFLAG_CLIENT, con_screenshot, 0x0, ""); + MACRO_REGISTER_COMMAND("rcon", "r", CFGFLAG_CLIENT, con_rcon, 0x0, ""); + MACRO_REGISTER_COMMAND("rcon_auth", "s", CFGFLAG_CLIENT, con_rcon_auth, 0x0, ""); - MACRO_REGISTER_COMMAND("play", "r", CFGFLAG_CLIENT, con_play, 0x0); - MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_CLIENT, con_record, 0); - MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_CLIENT, con_stoprecord, 0); + MACRO_REGISTER_COMMAND("play", "r", CFGFLAG_CLIENT, con_play, 0x0, ""); + MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_CLIENT, con_record, 0, ""); + MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_CLIENT, con_stoprecord, 0, ""); - MACRO_REGISTER_COMMAND("add_favorite", "s", CFGFLAG_CLIENT, con_addfavorite, 0x0); + MACRO_REGISTER_COMMAND("add_favorite", "s", CFGFLAG_CLIENT, con_addfavorite, 0x0, ""); /* register server dummy commands for tab completion */ - MACRO_REGISTER_COMMAND("kick", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("ban", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("unban", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("bans", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("status", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("shutdown", "", CFGFLAG_SERVER, con_serverdummy, 0); + MACRO_REGISTER_COMMAND("kick", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("ban", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("unban", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("bans", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("status", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("shutdown", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); /*MACRO_REGISTER_COMMAND("record", "", CFGFLAG_SERVER, con_serverdummy, 0); MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_serverdummy, 0);*/ } diff --git a/src/engine/e_console.c b/src/engine/e_console.c index 0218bad05..a7d29fa54 100644 --- a/src/engine/e_console.c +++ b/src/engine/e_console.c @@ -305,6 +305,19 @@ void console_possible_commands(const char *str, int flagmask, void (*callback)(c } } + +COMMAND *console_get_command(const char *str) +{ + COMMAND *cmd; + for (cmd = first_command; cmd; cmd = cmd->next) + { + if(str_comp_nocase(cmd->name, str) == 0) + return cmd; + } + + return 0x0; +} + void console_execute_line(const char *str) { console_execute_line_stroked(1, str); @@ -417,11 +430,11 @@ static void str_variable_command(void *result, void *user_data) void console_init() { - MACRO_REGISTER_COMMAND("echo", "r", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_echo, 0x0); - MACRO_REGISTER_COMMAND("exec", "r", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_exec, 0x0); + MACRO_REGISTER_COMMAND("echo", "r", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_echo, 0x0, ""); + MACRO_REGISTER_COMMAND("exec", "r", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_exec, 0x0, ""); - #define MACRO_CONFIG_INT(name,def,min,max,flags,desc) { static INT_VARIABLE_DATA data = { &config_get_ ## name, &config_set_ ## name }; MACRO_REGISTER_COMMAND(#name, "?i", flags, int_variable_command, &data) } - #define MACRO_CONFIG_STR(name,len,def,flags,desc) { static STR_VARIABLE_DATA data = { &config_get_ ## name, &config_set_ ## name }; MACRO_REGISTER_COMMAND(#name, "?r", flags, str_variable_command, &data) } + #define MACRO_CONFIG_INT(name,def,min,max,flags,desc) { static INT_VARIABLE_DATA data = { &config_get_ ## name, &config_set_ ## name }; MACRO_REGISTER_COMMAND(#name, "?i", flags, int_variable_command, &data, desc) } + #define MACRO_CONFIG_STR(name,len,def,flags,desc) { static STR_VARIABLE_DATA data = { &config_get_ ## name, &config_set_ ## name }; MACRO_REGISTER_COMMAND(#name, "?r", flags, str_variable_command, &data, desc) } #include "e_config_variables.h" diff --git a/src/engine/e_console.h b/src/engine/e_console.h index d5632da0f..c2393e399 100644 --- a/src/engine/e_console.h +++ b/src/engine/e_console.h @@ -14,6 +14,7 @@ typedef struct COMMAND_t int flags; CONSOLE_CALLBACK callback; void *user_data; + const char *help; struct COMMAND_t *next; } COMMAND; @@ -23,6 +24,7 @@ void console_execute_line(const char *str); void console_execute_line_stroked(int stroke, const char *str); void console_execute_file(const char *filename); void console_possible_commands(const char *str, int flagmask, void (*callback)(const char *cmd, void *user), void *user); +COMMAND *console_get_command(const char *cmd); void console_print(const char *str); void console_register_print_callback(void (*callback)(const char *, void *user_data), void *user_data); @@ -35,7 +37,7 @@ int console_arg_int(void *result, int index); float console_arg_float(void *result, int index); int console_arg_num(void *result); -#define MACRO_REGISTER_COMMAND(name, params, flags, func, ptr) { static COMMAND cmd = { name, params, flags, func, ptr, 0x0 }; console_register(&cmd); } +#define MACRO_REGISTER_COMMAND(name, params, flags, func, ptr, help) { static COMMAND cmd = { name, params, flags, func, ptr, help, 0x0}; console_register(&cmd); } #ifdef __cplusplus } diff --git a/src/engine/e_engine.c b/src/engine/e_engine.c index 2cc045a7f..0304572b2 100644 --- a/src/engine/e_engine.c +++ b/src/engine/e_engine.c @@ -83,8 +83,8 @@ void engine_init(const char *appname) jobs_initpool(&hostlookuppool, 1); - MACRO_REGISTER_COMMAND("dbg_dumpmem", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_dbg_dumpmem, 0x0); - MACRO_REGISTER_COMMAND("dbg_lognetwork", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_dbg_lognetwork, 0x0); + MACRO_REGISTER_COMMAND("dbg_dumpmem", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_dbg_dumpmem, 0x0, ""); + MACRO_REGISTER_COMMAND("dbg_lognetwork", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_dbg_lognetwork, 0x0, ""); /* reset the config */ config_reset(); diff --git a/src/engine/server/es_server.c b/src/engine/server/es_server.c index 2eac05ebd..3d9f56f5a 100644 --- a/src/engine/server/es_server.c +++ b/src/engine/server/es_server.c @@ -1288,15 +1288,15 @@ static void con_stoprecord(void *result, void *user_data) static void server_register_commands() { - MACRO_REGISTER_COMMAND("kick", "i", CFGFLAG_SERVER, con_kick, 0); - MACRO_REGISTER_COMMAND("ban", "s?i", CFGFLAG_SERVER, con_ban, 0); - MACRO_REGISTER_COMMAND("unban", "s", CFGFLAG_SERVER, con_unban, 0); - MACRO_REGISTER_COMMAND("bans", "", CFGFLAG_SERVER, con_bans, 0); - MACRO_REGISTER_COMMAND("status", "", CFGFLAG_SERVER, con_status, 0); - MACRO_REGISTER_COMMAND("shutdown", "", CFGFLAG_SERVER, con_shutdown, 0); + MACRO_REGISTER_COMMAND("kick", "i", CFGFLAG_SERVER, con_kick, 0, ""); + MACRO_REGISTER_COMMAND("ban", "s?i", CFGFLAG_SERVER, con_ban, 0, ""); + MACRO_REGISTER_COMMAND("unban", "s", CFGFLAG_SERVER, con_unban, 0, ""); + MACRO_REGISTER_COMMAND("bans", "", CFGFLAG_SERVER, con_bans, 0, ""); + MACRO_REGISTER_COMMAND("status", "", CFGFLAG_SERVER, con_status, 0, ""); + MACRO_REGISTER_COMMAND("shutdown", "", CFGFLAG_SERVER, con_shutdown, 0, ""); - MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_SERVER, con_record, 0); - MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_stoprecord, 0); + MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_SERVER, con_record, 0, ""); + MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_stoprecord, 0, ""); } int main(int argc, char **argv) diff --git a/src/game/client/components/binds.cpp b/src/game/client/components/binds.cpp index a2e30eaa6..a48ad187f 100644 --- a/src/game/client/components/binds.cpp +++ b/src/game/client/components/binds.cpp @@ -114,10 +114,10 @@ void BINDS::set_defaults() void BINDS::on_console_init() { // bindings - MACRO_REGISTER_COMMAND("bind", "sr", CFGFLAG_CLIENT, con_bind, this); - MACRO_REGISTER_COMMAND("unbind", "s", CFGFLAG_CLIENT, con_unbind, this); - MACRO_REGISTER_COMMAND("unbindall", "", CFGFLAG_CLIENT, con_unbindall, this); - MACRO_REGISTER_COMMAND("dump_binds", "", CFGFLAG_CLIENT, con_dump_binds, this); + MACRO_REGISTER_COMMAND("bind", "sr", CFGFLAG_CLIENT, con_bind, this, ""); + MACRO_REGISTER_COMMAND("unbind", "s", CFGFLAG_CLIENT, con_unbind, this, ""); + MACRO_REGISTER_COMMAND("unbindall", "", CFGFLAG_CLIENT, con_unbindall, this, ""); + MACRO_REGISTER_COMMAND("dump_binds", "", CFGFLAG_CLIENT, con_dump_binds, this, ""); // default bindings set_defaults(); diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 2bd4511d2..55097e583 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -41,9 +41,9 @@ void CHAT::con_chat(void *result, void *user_data) void CHAT::on_console_init() { - MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_CLIENT, con_say, this); - MACRO_REGISTER_COMMAND("say_team", "r", CFGFLAG_CLIENT, con_sayteam, this); - MACRO_REGISTER_COMMAND("chat", "s", CFGFLAG_CLIENT, con_chat, this); + MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_CLIENT, con_say, this, ""); + MACRO_REGISTER_COMMAND("say_team", "r", CFGFLAG_CLIENT, con_sayteam, this, ""); + MACRO_REGISTER_COMMAND("chat", "s", CFGFLAG_CLIENT, con_chat, this, ""); } bool CHAT::on_input(INPUT_EVENT e) diff --git a/src/game/client/components/console.cpp b/src/game/client/components/console.cpp index 201f145f0..fe43507c4 100644 --- a/src/game/client/components/console.cpp +++ b/src/game/client/components/console.cpp @@ -49,6 +49,8 @@ CONSOLE::INSTANCE::INSTANCE(int t) completion_buffer[0] = 0; completion_chosen = -1; + + command = 0x0; } void CONSOLE::INSTANCE::execute_line(const char *line) @@ -147,6 +149,18 @@ void CONSOLE::INSTANCE::on_input(INPUT_EVENT e) completion_chosen = -1; str_copy(completion_buffer, input.get_string(), sizeof(completion_buffer)); } + + // find the current command + { + char buf[64] = {0}; + const char *src = get_string(); + int i = 0; + for(; i < (int)sizeof(buf) && *src && *src != ' ' && *src != ' '; i++, src++) + buf[i] = *src; + buf[i] = 0; + + command = console_get_command(buf); + } } if(!handled) @@ -320,7 +334,7 @@ void CONSOLE::on_render() gfx_quads_drawTL(0,console_height-10.0f,screen.w,10.0f); gfx_quads_end(); - console_height -= 20.0f; + console_height -= 22.0f; INSTANCE *console = current_console(); @@ -338,7 +352,7 @@ void CONSOLE::on_render() info.wanted_completion = console->completion_chosen; info.enum_count = 0; info.current_cmd = console->completion_buffer; - gfx_text_set_cursor(&info.cursor, x, y+10.0f, font_size, TEXTFLAG_RENDER); + gfx_text_set_cursor(&info.cursor, x, y+12.0f, font_size, TEXTFLAG_RENDER); const char *prompt = "> "; if(console_type) @@ -370,7 +384,18 @@ void CONSOLE::on_render() // render possible commands if(console->input.get_string()[0] != 0) + { console_possible_commands(console->completion_buffer, console->completion_flagmask, possible_commands_render_callback, &info); + + if(info.enum_count <= 0) + { + if(console->command) + { + gfx_text_ex(&info.cursor, "Help: ", -1); + gfx_text_ex(&info.cursor, console->command->help, -1); + } + } + } gfx_text_color(1,1,1,1); // render log @@ -468,8 +493,8 @@ void CONSOLE::on_console_init() // console_register_print_callback(client_console_print_callback, this); - MACRO_REGISTER_COMMAND("toggle_local_console", "", CFGFLAG_CLIENT, con_toggle_local_console, this); - MACRO_REGISTER_COMMAND("toggle_remote_console", "", CFGFLAG_CLIENT, con_toggle_remote_console, this); + MACRO_REGISTER_COMMAND("toggle_local_console", "", CFGFLAG_CLIENT, con_toggle_local_console, this, ""); + MACRO_REGISTER_COMMAND("toggle_remote_console", "", CFGFLAG_CLIENT, con_toggle_remote_console, this, ""); } /* diff --git a/src/game/client/components/console.hpp b/src/game/client/components/console.hpp index 5a37b6642..0a4adbda9 100644 --- a/src/game/client/components/console.hpp +++ b/src/game/client/components/console.hpp @@ -23,6 +23,8 @@ class CONSOLE : public COMPONENT char completion_buffer[128]; int completion_chosen; int completion_flagmask; + + COMMAND *command; INSTANCE(int t); diff --git a/src/game/client/components/controls.cpp b/src/game/client/components/controls.cpp index e0ba7d96e..63d4fd167 100644 --- a/src/game/client/components/controls.cpp +++ b/src/game/client/components/controls.cpp @@ -49,20 +49,20 @@ static void con_key_input_nextprev_weapon(void *result, void *user_data) void CONTROLS::on_console_init() { // game commands - MACRO_REGISTER_COMMAND("+left", "", CFGFLAG_CLIENT, con_key_input_state, &input_direction_left); - MACRO_REGISTER_COMMAND("+right", "", CFGFLAG_CLIENT, con_key_input_state, &input_direction_right); - MACRO_REGISTER_COMMAND("+jump", "", CFGFLAG_CLIENT, con_key_input_state, &input_data.jump); - MACRO_REGISTER_COMMAND("+hook", "", CFGFLAG_CLIENT, con_key_input_state, &input_data.hook); - MACRO_REGISTER_COMMAND("+fire", "", CFGFLAG_CLIENT, con_key_input_counter, &input_data.fire); + MACRO_REGISTER_COMMAND("+left", "", CFGFLAG_CLIENT, con_key_input_state, &input_direction_left, ""); + MACRO_REGISTER_COMMAND("+right", "", CFGFLAG_CLIENT, con_key_input_state, &input_direction_right, ""); + MACRO_REGISTER_COMMAND("+jump", "", CFGFLAG_CLIENT, con_key_input_state, &input_data.jump, ""); + MACRO_REGISTER_COMMAND("+hook", "", CFGFLAG_CLIENT, con_key_input_state, &input_data.hook, ""); + MACRO_REGISTER_COMMAND("+fire", "", CFGFLAG_CLIENT, con_key_input_counter, &input_data.fire, ""); - { static INPUTSET set = {this, &input_data.wanted_weapon, 1}; MACRO_REGISTER_COMMAND("+weapon1", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set); } - { static INPUTSET set = {this, &input_data.wanted_weapon, 2}; MACRO_REGISTER_COMMAND("+weapon2", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set); } - { static INPUTSET set = {this, &input_data.wanted_weapon, 3}; MACRO_REGISTER_COMMAND("+weapon3", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set); } - { static INPUTSET set = {this, &input_data.wanted_weapon, 4}; MACRO_REGISTER_COMMAND("+weapon4", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set); } - { static INPUTSET set = {this, &input_data.wanted_weapon, 5}; MACRO_REGISTER_COMMAND("+weapon5", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set); } + { static INPUTSET set = {this, &input_data.wanted_weapon, 1}; MACRO_REGISTER_COMMAND("+weapon1", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set, ""); } + { static INPUTSET set = {this, &input_data.wanted_weapon, 2}; MACRO_REGISTER_COMMAND("+weapon2", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set, ""); } + { static INPUTSET set = {this, &input_data.wanted_weapon, 3}; MACRO_REGISTER_COMMAND("+weapon3", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set, ""); } + { static INPUTSET set = {this, &input_data.wanted_weapon, 4}; MACRO_REGISTER_COMMAND("+weapon4", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set, ""); } + { static INPUTSET set = {this, &input_data.wanted_weapon, 5}; MACRO_REGISTER_COMMAND("+weapon5", "", CFGFLAG_CLIENT, con_key_input_set, (void *)&set, ""); } - { static INPUTSET set = {this, &input_data.next_weapon, 0}; MACRO_REGISTER_COMMAND("+nextweapon", "", CFGFLAG_CLIENT, con_key_input_nextprev_weapon, (void *)&set); } - { static INPUTSET set = {this, &input_data.prev_weapon, 0}; MACRO_REGISTER_COMMAND("+prevweapon", "", CFGFLAG_CLIENT, con_key_input_nextprev_weapon, (void *)&set); } + { static INPUTSET set = {this, &input_data.next_weapon, 0}; MACRO_REGISTER_COMMAND("+nextweapon", "", CFGFLAG_CLIENT, con_key_input_nextprev_weapon, (void *)&set, ""); } + { static INPUTSET set = {this, &input_data.prev_weapon, 0}; MACRO_REGISTER_COMMAND("+prevweapon", "", CFGFLAG_CLIENT, con_key_input_nextprev_weapon, (void *)&set, ""); } } void CONTROLS::on_message(int msg, void *rawmsg) diff --git a/src/game/client/components/emoticon.cpp b/src/game/client/components/emoticon.cpp index 8ca01ee35..c9b086cdf 100644 --- a/src/game/client/components/emoticon.cpp +++ b/src/game/client/components/emoticon.cpp @@ -25,8 +25,8 @@ void EMOTICON::con_emote(void *result, void *user_data) void EMOTICON::on_console_init() { - MACRO_REGISTER_COMMAND("+emote", "", CFGFLAG_CLIENT, con_key_emoticon, this); - MACRO_REGISTER_COMMAND("emote", "i", CFGFLAG_CLIENT, con_emote, this); + MACRO_REGISTER_COMMAND("+emote", "", CFGFLAG_CLIENT, con_key_emoticon, this, ""); + MACRO_REGISTER_COMMAND("emote", "i", CFGFLAG_CLIENT, con_emote, this, ""); } void EMOTICON::on_reset() diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 5fdc87214..bdeec3c16 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -26,7 +26,7 @@ void SCOREBOARD::on_reset() void SCOREBOARD::on_console_init() { - MACRO_REGISTER_COMMAND("+scoreboard", "", CFGFLAG_CLIENT, con_key_scoreboard, this); + MACRO_REGISTER_COMMAND("+scoreboard", "", CFGFLAG_CLIENT, con_key_scoreboard, this, ""); } void SCOREBOARD::render_goals(float x, float y, float w) diff --git a/src/game/client/components/voting.cpp b/src/game/client/components/voting.cpp index 68a4d42bb..09fd19307 100644 --- a/src/game/client/components/voting.cpp +++ b/src/game/client/components/voting.cpp @@ -88,8 +88,8 @@ void VOTING::on_reset() void VOTING::on_console_init() { - MACRO_REGISTER_COMMAND("callvote", "sr", CFGFLAG_CLIENT, con_callvote, this); - MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_CLIENT, con_vote, this); + MACRO_REGISTER_COMMAND("callvote", "sr", CFGFLAG_CLIENT, con_callvote, this, ""); + MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_CLIENT, con_vote, this, ""); } void VOTING::on_message(int msgtype, void *rawmsg) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index b198b4aa0..32ce0307a 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -160,19 +160,19 @@ void GAMECLIENT::on_console_init() input.add(binds); // add the some console commands - MACRO_REGISTER_COMMAND("team", "i", CFGFLAG_CLIENT, con_team, this); - MACRO_REGISTER_COMMAND("kill", "", CFGFLAG_CLIENT, con_kill, this); + MACRO_REGISTER_COMMAND("team", "i", CFGFLAG_CLIENT, con_team, this, ""); + MACRO_REGISTER_COMMAND("kill", "", CFGFLAG_CLIENT, con_kill, this, ""); // register server dummy commands for tab completion - MACRO_REGISTER_COMMAND("tune", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("tune_reset", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("tune_dump", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("change_map", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("restart", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("broadcast", "", CFGFLAG_SERVER, con_serverdummy, 0); + MACRO_REGISTER_COMMAND("tune", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("tune_reset", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("tune_dump", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("change_map", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("restart", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("broadcast", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); /*MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_serverdummy, 0);*/ - MACRO_REGISTER_COMMAND("set_team", "", CFGFLAG_SERVER, con_serverdummy, 0); - MACRO_REGISTER_COMMAND("addvote", "", CFGFLAG_SERVER, con_serverdummy, 0); + MACRO_REGISTER_COMMAND("set_team", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); + MACRO_REGISTER_COMMAND("addvote", "", CFGFLAG_SERVER, con_serverdummy, 0, ""); /*MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0);*/ // let all the other components register their console commands diff --git a/src/game/server/hooks.cpp b/src/game/server/hooks.cpp index f2534de2f..18626b4e3 100644 --- a/src/game/server/hooks.cpp +++ b/src/game/server/hooks.cpp @@ -501,18 +501,18 @@ static void con_vote(void *result, void *user_data) void mods_console_init() { - MACRO_REGISTER_COMMAND("tune", "si", CFGFLAG_SERVER, con_tune_param, 0); - MACRO_REGISTER_COMMAND("tune_reset", "", CFGFLAG_SERVER, con_tune_reset, 0); - MACRO_REGISTER_COMMAND("tune_dump", "", CFGFLAG_SERVER, con_tune_dump, 0); + MACRO_REGISTER_COMMAND("tune", "si", CFGFLAG_SERVER, con_tune_param, 0, ""); + MACRO_REGISTER_COMMAND("tune_reset", "", CFGFLAG_SERVER, con_tune_reset, 0, ""); + MACRO_REGISTER_COMMAND("tune_dump", "", CFGFLAG_SERVER, con_tune_dump, 0, ""); - MACRO_REGISTER_COMMAND("change_map", "r", CFGFLAG_SERVER, con_change_map, 0); - MACRO_REGISTER_COMMAND("restart", "?i", CFGFLAG_SERVER, con_restart, 0); - MACRO_REGISTER_COMMAND("broadcast", "r", CFGFLAG_SERVER, con_broadcast, 0); - MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_say, 0); - MACRO_REGISTER_COMMAND("set_team", "ii", CFGFLAG_SERVER, con_set_team, 0); + MACRO_REGISTER_COMMAND("change_map", "r", CFGFLAG_SERVER, con_change_map, 0, ""); + MACRO_REGISTER_COMMAND("restart", "?i", CFGFLAG_SERVER, con_restart, 0, ""); + MACRO_REGISTER_COMMAND("broadcast", "r", CFGFLAG_SERVER, con_broadcast, 0, ""); + MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_say, 0, ""); + MACRO_REGISTER_COMMAND("set_team", "ii", CFGFLAG_SERVER, con_set_team, 0, ""); - MACRO_REGISTER_COMMAND("addvote", "r", CFGFLAG_SERVER, con_addvote, 0); - MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_SERVER, con_vote, 0); + MACRO_REGISTER_COMMAND("addvote", "r", CFGFLAG_SERVER, con_addvote, 0, ""); + MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_SERVER, con_vote, 0, ""); } void mods_init()