diff options
author | /dev/humancontroller <devhc@example.com> | 2017-04-07 22:36:41 +0200 |
---|---|---|
committer | /dev/humancontroller <devhc@example.com> | 2017-04-17 01:06:07 +0200 |
commit | a150f425666146fbdca921ea44838b81889ec9e9 (patch) | |
tree | 8047f4e6a2aaf3e0d8144ddfc123b999fa1e27f0 /src | |
parent | 2b6f1a4d14154312d08e13ba6e8ef23ccf782922 (diff) |
moar shit
TODO (for me): rebase this shit
Diffstat (limited to 'src')
-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(); } |