From e984293788358a72dcb57ad5d74402a3f10f0d97 Mon Sep 17 00:00:00 2001 From: /dev/humancontroller Date: Thu, 6 Apr 2017 20:39:29 +0200 Subject: implement Schachtmeister v2 basics --- src/server/sv_ccmds.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/server/sv_ccmds.c') diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c index 56c73aa8..65585308 100644 --- a/src/server/sv_ccmds.c +++ b/src/server/sv_ccmds.c @@ -284,6 +284,33 @@ static void SV_KillServer_f( void ) { SV_Shutdown( "killserver" ); } +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 ); + } + + 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 ); +} + //=========================================================== /* @@ -320,6 +347,7 @@ void SV_AddOperatorCommands( void ) { Cmd_AddCommand ("devmap", SV_Map_f); Cmd_SetCommandCompletionFunc( "devmap", SV_CompleteMapName ); Cmd_AddCommand ("killserver", SV_KillServer_f); + Cmd_AddCommand ("smq", SV_SMQ_f); } /* -- cgit