diff options
author | /dev/humancontroller <devhc@example.com> | 2017-04-06 23:33:56 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-04-06 23:33:56 +0200 |
commit | cde6ddad7abe2452301bd9bc3ef06070b19371ee (patch) | |
tree | bfbf213f5f94338abd98eab6d739797d883afd31 /src/server/sv_ccmds.c | |
parent | e984293788358a72dcb57ad5d74402a3f10f0d97 (diff) |
implement sv_schachtmeisterPort; add compat shit for crapware from the future
Diffstat (limited to 'src/server/sv_ccmds.c')
-rw-r--r-- | src/server/sv_ccmds.c | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c index 65585308..acbd01fe 100644 --- a/src/server/sv_ccmds.c +++ b/src/server/sv_ccmds.c @@ -287,28 +287,41 @@ static void SV_KillServer_f( void ) { static void SV_SMQ_f( void ) { static qboolean schmResolved = qfalse; static netadr_t schmAddress; - char args[ MAX_STRING_CHARS ]; - char *p; - int s, i; if ( !schmResolved ) { schmResolved = qtrue; - NET_StringToAdr( "127.0.0.1:1337", &schmAddress, NA_IP ); + NET_StringToAdr( "127.0.0.1", &schmAddress, NA_IP ); + schmAddress.port = 1337; } - p = args; - s = sizeof( args ); - - for ( i = 1; i < Cmd_Argc(); ++i ) + if ( sv_schachtmeisterPort->modified && + sv_schachtmeisterPort->integer >= 1 && sv_schachtmeisterPort->integer <= 65535 ) { - int l; - Com_sprintf( p, s, " \"%s\"", Cmd_Argv( i ) ); - l = strlen( p ); - s -= l; - p += l; + schmAddress.port = sv_schachtmeisterPort->integer; } - NET_OutOfBandPrint( NS_SERVER, schmAddress, "sm2query%s", args ); + if ( Cmd_Argc() >= 3 && !Q_stricmp( Cmd_Argv( 1 ), "ipa" ) ) // compatibility with out-of-date crapware conceived in the future + NET_OutOfBandPrint( NS_SERVER, schmAddress, "sm2query %s", Cmd_ArgsFrom( 2 ) ); + else + { + char args[ MAX_STRING_CHARS ]; + char *p; + int s, i; + + p = args; + s = sizeof( args ); + + for ( i = 1; i < Cmd_Argc(); ++i ) + { + int l; + Com_sprintf( p, s, " \"%s\"", Cmd_Argv( i ) ); + l = strlen( p ); + s -= l; + p += l; + } + + NET_OutOfBandPrint( NS_SERVER, schmAddress, "sm2query%s", args ); + } } //=========================================================== |