summaryrefslogtreecommitdiff
path: root/src/server/sv_main.c
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-01-20 23:37:31 +0000
committerTim Angus <tim@ngus.net>2006-01-20 23:37:31 +0000
commit470f5cc7203a148289d6ad6f0f5c7b4d80a48d50 (patch)
tree89b94ab3965ac1c6c08dd8255ca23f1ef79aebb3 /src/server/sv_main.c
parentba69ac8d95b7a05fbaf12209785492e3500f1117 (diff)
* Master server now logs version and renderer strings
* Master server now responsible for logging game statistics
Diffstat (limited to 'src/server/sv_main.c')
-rw-r--r--src/server/sv_main.c31
1 files changed, 31 insertions, 0 deletions
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 );
+}
/*
==============================================================================