summaryrefslogtreecommitdiff
path: root/source/common.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-02-28 12:09:10 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-02-28 12:09:10 +0000
commitbf6d45c620f098c84d602e9347bc7cf457c38b5a (patch)
treeec075676ff09467ea910c51fb45fb37185a1ddf3 /source/common.c
parent4034314816f7ec9e26c9b9bfc2630c8ca0a24874 (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/common.c')
-rw-r--r--source/common.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/source/common.c b/source/common.c
index 9a4ba50..63fba19 100644
--- a/source/common.c
+++ b/source/common.c
@@ -1131,6 +1131,34 @@ finish:
return NULL;
}
+const char *Com_AddressGenerator( const char *partial, int state ) {
+ static int length;
+ static int index;
+ cvar_t *var;
+ char buffer[MAX_QPATH];
+
+ if( !state ) {
+ length = strlen( partial );
+ index = 0;
+ }
+
+ while( index < 1024 ) {
+ Com_sprintf( buffer, sizeof( buffer ), "adr%i", index );
+ index++;
+ var = Cvar_FindVar( buffer );
+ if( !var ) {
+ break;
+ }
+ if( !var->string[0] ) {
+ continue;
+ }
+ if( !strncmp( partial, var->string, length ) ) {
+ return var->string;
+ }
+ }
+
+ return NULL;
+}
/*
===============
@@ -1220,7 +1248,7 @@ Qcommon_Init
=================
*/
void Qcommon_Init( int argc, char **argv ) {
- static const char *version = APPLICATION " " VERSION " " __DATE__ " " BUILDSTRING " " CPUSTRING;
+ static const char version[] = APPLICATION " " VERSION " " __DATE__ " " BUILDSTRING " " CPUSTRING;
if( setjmp( abortframe ) )
Sys_Error( "Error during initialization: %s", com_errorMsg );
@@ -1256,7 +1284,7 @@ void Qcommon_Init( int argc, char **argv ) {
logfile_active = Cvar_Get( "logfile", "0", 0 );
logfile_flush = Cvar_Get( "logfile_flush", "0", 0 );
logfile_name = Cvar_Get( "logfile_name", COM_LOGFILE_NAME, 0 );
- logfile_prefix = Cvar_Get( "logfile_prefix", "", 0 );
+ logfile_prefix = Cvar_Get( "logfile_prefix", "[%Y-%m-%d %H:%M] ", 0 );
#ifdef DEDICATED_ONLY
dedicated = Cvar_Get ("dedicated", "1", CVAR_ROM);
#else