diff options
-rw-r--r-- | src/server/sv_ccmds.c | 10 | ||||
-rw-r--r-- | src/server/sv_main.c | 10 |
2 files changed, 13 insertions, 7 deletions
diff --git a/src/server/sv_ccmds.c b/src/server/sv_ccmds.c index 61ee6f11..21a5f0e5 100644 --- a/src/server/sv_ccmds.c +++ b/src/server/sv_ccmds.c @@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA =========================================================================== */ +#include <arpa/inet.h> #include "server.h" /* @@ -297,16 +298,13 @@ static void SV_SMQ_f( void ) { if ( sv_schachtmeisterPort->modified && sv_schachtmeisterPort->integer >= 1 && sv_schachtmeisterPort->integer <= 65535 ) { - schmAddress.port = sv_schachtmeisterPort->integer; + schmAddress.port = htons(sv_schachtmeisterPort->integer); } - if ( Cmd_Argc() >= 3 && !Q_stricmp( Cmd_Argv( 1 ), "ipa" ) ) // compatibility with out-of-date crapware conceived in the future - { + 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 ) ); Com_Printf( "^3query [^7sm2query %s^3]\n", Cmd_ArgsFrom( 2 ) ); // DELME - } - else - { + } else { char args[ MAX_STRING_CHARS ]; char *p; int s, i; diff --git a/src/server/sv_main.c b/src/server/sv_main.c index a39e3769..8d75d55f 100644 --- a/src/server/sv_main.c +++ b/src/server/sv_main.c @@ -755,11 +755,19 @@ static void SVC_RemoteCommand( netadr_t from, msg_t *msg ) { } static void SVC_SchachtmeisterResponse( netadr_t from ) { + int tmp[ 4 ]; + if ( !( from.type == NA_IP && from.ip[0] == 127 ) ) { return; } - strcpy( Cmd_Argv( 0 ), "smr" ); + if ( Cmd_Argc() >= 2 && sscanf( Cmd_Argv( 1 ), "%i.%i.%i.%i", &tmp[ 0 ], &tmp[ 1 ], &tmp[ 2 ], &tmp[ 3 ] ) == 4 ) { // compatibility with out-of-date crapware conceived in the future + char cmdl[ MAX_STRING_CHARS ]; + Com_sprintf( cmdl, sizeof( cmdl ), "smr ipa %s", Cmd_ArgsFrom( 1 ) ); + Cmd_TokenizeString( cmdl ); + } else { + strcpy( Cmd_Argv( 0 ), "smr" ); + } SV_GameCommand(); } |