fixed so the console show help for each command. not all commands have descriptions however

This commit is contained in:
Magnus Auvinen 2009-01-24 13:12:04 +00:00
parent ae5b47a266
commit 5f186c8906
15 changed files with 122 additions and 80 deletions

View file

@ -1952,27 +1952,27 @@ static void con_serverdummy(void *result, void *user_data)
static void client_register_commands() static void client_register_commands()
{ {
MACRO_REGISTER_COMMAND("quit", "", CFGFLAG_CLIENT, con_quit, 0x0); MACRO_REGISTER_COMMAND("quit", "", CFGFLAG_CLIENT, con_quit, 0x0, "");
MACRO_REGISTER_COMMAND("connect", "s", CFGFLAG_CLIENT, con_connect, 0x0); MACRO_REGISTER_COMMAND("connect", "s", CFGFLAG_CLIENT, con_connect, 0x0, "");
MACRO_REGISTER_COMMAND("disconnect", "", CFGFLAG_CLIENT, con_disconnect, 0x0); MACRO_REGISTER_COMMAND("disconnect", "", CFGFLAG_CLIENT, con_disconnect, 0x0, "");
MACRO_REGISTER_COMMAND("ping", "", CFGFLAG_CLIENT, con_ping, 0x0); MACRO_REGISTER_COMMAND("ping", "", CFGFLAG_CLIENT, con_ping, 0x0, "");
MACRO_REGISTER_COMMAND("screenshot", "", CFGFLAG_CLIENT, con_screenshot, 0x0); MACRO_REGISTER_COMMAND("screenshot", "", CFGFLAG_CLIENT, con_screenshot, 0x0, "");
MACRO_REGISTER_COMMAND("rcon", "r", CFGFLAG_CLIENT, con_rcon, 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("rcon_auth", "s", CFGFLAG_CLIENT, con_rcon_auth, 0x0, "");
MACRO_REGISTER_COMMAND("play", "r", CFGFLAG_CLIENT, con_play, 0x0); MACRO_REGISTER_COMMAND("play", "r", CFGFLAG_CLIENT, con_play, 0x0, "");
MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_CLIENT, con_record, 0); MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_CLIENT, con_record, 0, "");
MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_CLIENT, con_stoprecord, 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 */ /* register server dummy commands for tab completion */
MACRO_REGISTER_COMMAND("kick", "", 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("ban", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
MACRO_REGISTER_COMMAND("unban", "", 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("bans", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
MACRO_REGISTER_COMMAND("status", "", 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("shutdown", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
/*MACRO_REGISTER_COMMAND("record", "", CFGFLAG_SERVER, con_serverdummy, 0); /*MACRO_REGISTER_COMMAND("record", "", CFGFLAG_SERVER, con_serverdummy, 0);
MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_serverdummy, 0);*/ MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_serverdummy, 0);*/
} }

View file

@ -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) void console_execute_line(const char *str)
{ {
console_execute_line_stroked(1, str); console_execute_line_stroked(1, str);
@ -417,11 +430,11 @@ static void str_variable_command(void *result, void *user_data)
void console_init() void console_init()
{ {
MACRO_REGISTER_COMMAND("echo", "r", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_echo, 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); 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_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) } #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" #include "e_config_variables.h"

View file

@ -14,6 +14,7 @@ typedef struct COMMAND_t
int flags; int flags;
CONSOLE_CALLBACK callback; CONSOLE_CALLBACK callback;
void *user_data; void *user_data;
const char *help;
struct COMMAND_t *next; struct COMMAND_t *next;
} COMMAND; } 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_line_stroked(int stroke, const char *str);
void console_execute_file(const char *filename); 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); 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_print(const char *str);
void console_register_print_callback(void (*callback)(const char *, void *user_data), void *user_data); 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); float console_arg_float(void *result, int index);
int console_arg_num(void *result); 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 #ifdef __cplusplus
} }

View file

@ -83,8 +83,8 @@ void engine_init(const char *appname)
jobs_initpool(&hostlookuppool, 1); jobs_initpool(&hostlookuppool, 1);
MACRO_REGISTER_COMMAND("dbg_dumpmem", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_dbg_dumpmem, 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); MACRO_REGISTER_COMMAND("dbg_lognetwork", "", CFGFLAG_SERVER|CFGFLAG_CLIENT, con_dbg_lognetwork, 0x0, "");
/* reset the config */ /* reset the config */
config_reset(); config_reset();

View file

@ -1288,15 +1288,15 @@ static void con_stoprecord(void *result, void *user_data)
static void server_register_commands() static void server_register_commands()
{ {
MACRO_REGISTER_COMMAND("kick", "i", CFGFLAG_SERVER, con_kick, 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("ban", "s?i", CFGFLAG_SERVER, con_ban, 0, "");
MACRO_REGISTER_COMMAND("unban", "s", CFGFLAG_SERVER, con_unban, 0); MACRO_REGISTER_COMMAND("unban", "s", CFGFLAG_SERVER, con_unban, 0, "");
MACRO_REGISTER_COMMAND("bans", "", CFGFLAG_SERVER, con_bans, 0); MACRO_REGISTER_COMMAND("bans", "", CFGFLAG_SERVER, con_bans, 0, "");
MACRO_REGISTER_COMMAND("status", "", CFGFLAG_SERVER, con_status, 0); MACRO_REGISTER_COMMAND("status", "", CFGFLAG_SERVER, con_status, 0, "");
MACRO_REGISTER_COMMAND("shutdown", "", CFGFLAG_SERVER, con_shutdown, 0); MACRO_REGISTER_COMMAND("shutdown", "", CFGFLAG_SERVER, con_shutdown, 0, "");
MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_SERVER, con_record, 0); MACRO_REGISTER_COMMAND("record", "s", CFGFLAG_SERVER, con_record, 0, "");
MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_stoprecord, 0); MACRO_REGISTER_COMMAND("stoprecord", "", CFGFLAG_SERVER, con_stoprecord, 0, "");
} }
int main(int argc, char **argv) int main(int argc, char **argv)

View file

@ -114,10 +114,10 @@ void BINDS::set_defaults()
void BINDS::on_console_init() void BINDS::on_console_init()
{ {
// bindings // bindings
MACRO_REGISTER_COMMAND("bind", "sr", CFGFLAG_CLIENT, con_bind, this); MACRO_REGISTER_COMMAND("bind", "sr", CFGFLAG_CLIENT, con_bind, this, "");
MACRO_REGISTER_COMMAND("unbind", "s", CFGFLAG_CLIENT, con_unbind, this); MACRO_REGISTER_COMMAND("unbind", "s", CFGFLAG_CLIENT, con_unbind, this, "");
MACRO_REGISTER_COMMAND("unbindall", "", CFGFLAG_CLIENT, con_unbindall, this); MACRO_REGISTER_COMMAND("unbindall", "", CFGFLAG_CLIENT, con_unbindall, this, "");
MACRO_REGISTER_COMMAND("dump_binds", "", CFGFLAG_CLIENT, con_dump_binds, this); MACRO_REGISTER_COMMAND("dump_binds", "", CFGFLAG_CLIENT, con_dump_binds, this, "");
// default bindings // default bindings
set_defaults(); set_defaults();

View file

@ -41,9 +41,9 @@ void CHAT::con_chat(void *result, void *user_data)
void CHAT::on_console_init() void CHAT::on_console_init()
{ {
MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_CLIENT, con_say, 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("say_team", "r", CFGFLAG_CLIENT, con_sayteam, this, "");
MACRO_REGISTER_COMMAND("chat", "s", CFGFLAG_CLIENT, con_chat, this); MACRO_REGISTER_COMMAND("chat", "s", CFGFLAG_CLIENT, con_chat, this, "");
} }
bool CHAT::on_input(INPUT_EVENT e) bool CHAT::on_input(INPUT_EVENT e)

View file

@ -49,6 +49,8 @@ CONSOLE::INSTANCE::INSTANCE(int t)
completion_buffer[0] = 0; completion_buffer[0] = 0;
completion_chosen = -1; completion_chosen = -1;
command = 0x0;
} }
void CONSOLE::INSTANCE::execute_line(const char *line) void CONSOLE::INSTANCE::execute_line(const char *line)
@ -147,6 +149,18 @@ void CONSOLE::INSTANCE::on_input(INPUT_EVENT e)
completion_chosen = -1; completion_chosen = -1;
str_copy(completion_buffer, input.get_string(), sizeof(completion_buffer)); 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) if(!handled)
@ -320,7 +334,7 @@ void CONSOLE::on_render()
gfx_quads_drawTL(0,console_height-10.0f,screen.w,10.0f); gfx_quads_drawTL(0,console_height-10.0f,screen.w,10.0f);
gfx_quads_end(); gfx_quads_end();
console_height -= 20.0f; console_height -= 22.0f;
INSTANCE *console = current_console(); INSTANCE *console = current_console();
@ -338,7 +352,7 @@ void CONSOLE::on_render()
info.wanted_completion = console->completion_chosen; info.wanted_completion = console->completion_chosen;
info.enum_count = 0; info.enum_count = 0;
info.current_cmd = console->completion_buffer; 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 = "> "; const char *prompt = "> ";
if(console_type) if(console_type)
@ -370,7 +384,18 @@ void CONSOLE::on_render()
// render possible commands // render possible commands
if(console->input.get_string()[0] != 0) if(console->input.get_string()[0] != 0)
{
console_possible_commands(console->completion_buffer, console->completion_flagmask, possible_commands_render_callback, &info); 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); gfx_text_color(1,1,1,1);
// render log // render log
@ -468,8 +493,8 @@ void CONSOLE::on_console_init()
// //
console_register_print_callback(client_console_print_callback, this); 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_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_remote_console", "", CFGFLAG_CLIENT, con_toggle_remote_console, this, "");
} }
/* /*

View file

@ -23,6 +23,8 @@ class CONSOLE : public COMPONENT
char completion_buffer[128]; char completion_buffer[128];
int completion_chosen; int completion_chosen;
int completion_flagmask; int completion_flagmask;
COMMAND *command;
INSTANCE(int t); INSTANCE(int t);

View file

@ -49,20 +49,20 @@ static void con_key_input_nextprev_weapon(void *result, void *user_data)
void CONTROLS::on_console_init() void CONTROLS::on_console_init()
{ {
// game commands // game commands
MACRO_REGISTER_COMMAND("+left", "", CFGFLAG_CLIENT, con_key_input_state, &input_direction_left); 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("+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("+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("+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("+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, 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, 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, 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, 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, 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.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.prev_weapon, 0}; MACRO_REGISTER_COMMAND("+prevweapon", "", CFGFLAG_CLIENT, con_key_input_nextprev_weapon, (void *)&set, ""); }
} }
void CONTROLS::on_message(int msg, void *rawmsg) void CONTROLS::on_message(int msg, void *rawmsg)

View file

@ -25,8 +25,8 @@ void EMOTICON::con_emote(void *result, void *user_data)
void EMOTICON::on_console_init() void EMOTICON::on_console_init()
{ {
MACRO_REGISTER_COMMAND("+emote", "", CFGFLAG_CLIENT, con_key_emoticon, this); MACRO_REGISTER_COMMAND("+emote", "", CFGFLAG_CLIENT, con_key_emoticon, this, "");
MACRO_REGISTER_COMMAND("emote", "i", CFGFLAG_CLIENT, con_emote, this); MACRO_REGISTER_COMMAND("emote", "i", CFGFLAG_CLIENT, con_emote, this, "");
} }
void EMOTICON::on_reset() void EMOTICON::on_reset()

View file

@ -26,7 +26,7 @@ void SCOREBOARD::on_reset()
void SCOREBOARD::on_console_init() 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) void SCOREBOARD::render_goals(float x, float y, float w)

View file

@ -88,8 +88,8 @@ void VOTING::on_reset()
void VOTING::on_console_init() void VOTING::on_console_init()
{ {
MACRO_REGISTER_COMMAND("callvote", "sr", CFGFLAG_CLIENT, con_callvote, this); MACRO_REGISTER_COMMAND("callvote", "sr", CFGFLAG_CLIENT, con_callvote, this, "");
MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_CLIENT, con_vote, this); MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_CLIENT, con_vote, this, "");
} }
void VOTING::on_message(int msgtype, void *rawmsg) void VOTING::on_message(int msgtype, void *rawmsg)

View file

@ -160,19 +160,19 @@ void GAMECLIENT::on_console_init()
input.add(binds); input.add(binds);
// add the some console commands // add the some console commands
MACRO_REGISTER_COMMAND("team", "i", CFGFLAG_CLIENT, con_team, this); MACRO_REGISTER_COMMAND("team", "i", CFGFLAG_CLIENT, con_team, this, "");
MACRO_REGISTER_COMMAND("kill", "", CFGFLAG_CLIENT, con_kill, this); MACRO_REGISTER_COMMAND("kill", "", CFGFLAG_CLIENT, con_kill, this, "");
// register server dummy commands for tab completion // register server dummy commands for tab completion
MACRO_REGISTER_COMMAND("tune", "", 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_reset", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
MACRO_REGISTER_COMMAND("tune_dump", "", 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("change_map", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
MACRO_REGISTER_COMMAND("restart", "", 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("broadcast", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
/*MACRO_REGISTER_COMMAND("say", "r", 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("set_team", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
MACRO_REGISTER_COMMAND("addvote", "", CFGFLAG_SERVER, con_serverdummy, 0); MACRO_REGISTER_COMMAND("addvote", "", CFGFLAG_SERVER, con_serverdummy, 0, "");
/*MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0);*/ /*MACRO_REGISTER_COMMAND("vote", "", CFGFLAG_SERVER, con_serverdummy, 0);*/
// let all the other components register their console commands // let all the other components register their console commands

View file

@ -501,18 +501,18 @@ static void con_vote(void *result, void *user_data)
void mods_console_init() void mods_console_init()
{ {
MACRO_REGISTER_COMMAND("tune", "si", CFGFLAG_SERVER, con_tune_param, 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_reset", "", CFGFLAG_SERVER, con_tune_reset, 0, "");
MACRO_REGISTER_COMMAND("tune_dump", "", CFGFLAG_SERVER, con_tune_dump, 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("change_map", "r", CFGFLAG_SERVER, con_change_map, 0, "");
MACRO_REGISTER_COMMAND("restart", "?i", CFGFLAG_SERVER, con_restart, 0); MACRO_REGISTER_COMMAND("restart", "?i", CFGFLAG_SERVER, con_restart, 0, "");
MACRO_REGISTER_COMMAND("broadcast", "r", CFGFLAG_SERVER, con_broadcast, 0); MACRO_REGISTER_COMMAND("broadcast", "r", CFGFLAG_SERVER, con_broadcast, 0, "");
MACRO_REGISTER_COMMAND("say", "r", CFGFLAG_SERVER, con_say, 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("set_team", "ii", CFGFLAG_SERVER, con_set_team, 0, "");
MACRO_REGISTER_COMMAND("addvote", "r", CFGFLAG_SERVER, con_addvote, 0); MACRO_REGISTER_COMMAND("addvote", "r", CFGFLAG_SERVER, con_addvote, 0, "");
MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_SERVER, con_vote, 0); MACRO_REGISTER_COMMAND("vote", "r", CFGFLAG_SERVER, con_vote, 0, "");
} }
void mods_init() void mods_init()