diff options
author | Tim Angus <tim@ngus.net> | 2006-01-20 23:37:31 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2006-01-20 23:37:31 +0000 |
commit | 470f5cc7203a148289d6ad6f0f5c7b4d80a48d50 (patch) | |
tree | 89b94ab3965ac1c6c08dd8255ca23f1ef79aebb3 /src/server | |
parent | ba69ac8d95b7a05fbaf12209785492e3500f1117 (diff) |
* Master server now logs version and renderer strings
* Master server now responsible for logging game statistics
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/server.h | 1 | ||||
-rw-r--r-- | src/server/sv_game.c | 4 | ||||
-rw-r--r-- | src/server/sv_main.c | 31 |
3 files changed, 36 insertions, 0 deletions
diff --git a/src/server/server.h b/src/server/server.h index da8c8aae..45e199f7 100644 --- a/src/server/server.h +++ b/src/server/server.h @@ -261,6 +261,7 @@ void SV_RemoveOperatorCommands (void); void SV_MasterHeartbeat (void); void SV_MasterShutdown (void); +void SV_MasterGameStat( const char *data ); diff --git a/src/server/sv_game.c b/src/server/sv_game.c index a0ccc0f7..cefcddeb 100644 --- a/src/server/sv_game.c +++ b/src/server/sv_game.c @@ -446,6 +446,10 @@ long SV_GameSystemCalls( long *args ) { Sys_SnapVector( VMA(1) ); return 0; + case G_SEND_GAMESTAT: + SV_MasterGameStat( VMA(1) ); + return 0; + //==================================== case BOTLIB_SETUP: diff --git a/src/server/sv_main.c b/src/server/sv_main.c index 1d658a60..d017e7b1 100644 --- a/src/server/sv_main.c +++ b/src/server/sv_main.c @@ -293,6 +293,37 @@ void SV_MasterShutdown( void ) { // it will be removed from the list } +/* +================= +SV_MasterGameStat +================= +*/ +void SV_MasterGameStat( const char *data ) +{ + static netadr_t adr; + + if( !com_dedicated || com_dedicated->integer != 2 ) + return; // only dedicated servers send stats + + Com_Printf( "Resolving %s\n", MASTER_SERVER_NAME ); + if( !NET_StringToAdr( MASTER_SERVER_NAME, &adr ) ) + { + Com_Printf( "Couldn't resolve address: %s\n", MASTER_SERVER_NAME ); + return; + } + else + { + if( !strstr( ":", MASTER_SERVER_NAME ) ) + adr.port = BigShort( PORT_MASTER ); + + Com_Printf( "%s resolved to %i.%i.%i.%i:%i\n", MASTER_SERVER_NAME, + adr.ip[0], adr.ip[1], adr.ip[2], adr.ip[3], + BigShort( adr.port ) ); + } + + Com_Printf ("Sending gamestat to %s\n", MASTER_SERVER_NAME ); + NET_OutOfBandPrint( NS_SERVER, adr, "gamestat %s", data ); +} /* ============================================================================== |