diff options
author | Andrey Nazarov <skuller@skuller.net> | 2008-02-28 12:09:10 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2008-02-28 12:09:10 +0000 |
commit | bf6d45c620f098c84d602e9347bc7cf457c38b5a (patch) | |
tree | ec075676ff09467ea910c51fb45fb37185a1ddf3 /source/cl_keys.c | |
parent | 4034314816f7ec9e26c9b9bfc2630c8ca0a24874 (diff) |
Do not spam dedicated server console with heartbeats.
Added autocompletion of options for some commands.
Made logfile_prefix not empty by default.
Re-enabled `anti-kick' exploit fix.
Diffstat (limited to 'source/cl_keys.c')
-rw-r--r-- | source/cl_keys.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/cl_keys.c b/source/cl_keys.c index b415ada..116c2f0 100644 --- a/source/cl_keys.c +++ b/source/cl_keys.c @@ -375,7 +375,7 @@ void Key_SetBinding( int keynum, const char *binding ) { keybindings[keynum] = Z_CopyString( binding ); } -static const char *Key_Name_g( const char *partial, int state ) { +static const char *Key_NameGenerator( const char *partial, int state ) { static int length; static keyname_t *k; const char *name; @@ -396,6 +396,20 @@ static const char *Key_Name_g( const char *partial, int state ) { return NULL; } +static const char *Key_Bind_g( const char *partial, int argnum, int state ) { + if( argnum == 1 ) { + return Key_NameGenerator( partial, state ); + } + return Prompt_Completer( partial, 2, argnum, state ); +} + +static const char *Key_Unbind_g( const char *partial, int argnum, int state ) { + if( argnum == 1 ) { + return Key_NameGenerator( partial, state ); + } + return NULL; +} + /* =================== Key_Unbind_f @@ -522,8 +536,8 @@ void Key_FillAPI( keyAPI_t *api ) { } static cmdreg_t c_keys[] = { - { "bind", Key_Bind_f, Key_Name_g, Cmd_Mixed_g }, - { "unbind", Key_Unbind_f, Key_Name_g }, + { "bind", Key_Bind_f, Key_Bind_g }, + { "unbind", Key_Unbind_f, Key_Unbind_g }, { "unbindall", Key_Unbindall_f }, { "bindlist", Key_Bindlist_f }, |