diff options
Diffstat (limited to 'code/server')
-rw-r--r-- | code/server/sv_main.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/code/server/sv_main.c b/code/server/sv_main.c index b05a785..4be0af4 100644 --- a/code/server/sv_main.c +++ b/code/server/sv_main.c @@ -233,6 +233,7 @@ but not on every player enter or exit. void SV_MasterHeartbeat( void ) { static netadr_t adr[MAX_MASTER_SERVERS]; int i; + int res; // "dedicated 1" is for lan play, "dedicated 2" is for inet public play if ( !com_dedicated || com_dedicated->integer != 2 ) { @@ -259,7 +260,8 @@ void SV_MasterHeartbeat( void ) { sv_master[i]->modified = qfalse; Com_Printf( "Resolving %s\n", sv_master[i]->string ); - if ( !NET_StringToAdr( sv_master[i]->string, &adr[i], NA_UNSPEC ) ) { + res = NET_StringToAdr( sv_master[i]->string, &adr[i], NA_UNSPEC ); + if ( !res ) { // if the address failed to resolve, clear it // so we don't take repeated dns hits Com_Printf( "Couldn't resolve address: %s\n", sv_master[i]->string ); @@ -267,7 +269,8 @@ void SV_MasterHeartbeat( void ) { sv_master[i]->modified = qfalse; continue; } - if ( !strchr( sv_master[i]->string, ':' ) ) { + if ( res == 2 ) { + // if no port was specified, use the default master port adr[i].port = BigShort( PORT_MASTER ); } Com_Printf( "%s resolved to %s\n", sv_master[i]->string, NET_AdrToStringwPort(adr[i])); @@ -410,6 +413,7 @@ void SVC_Info( netadr_t from ) { va("%i", sv_maxclients->integer - sv_privateClients->integer ) ); Info_SetValueForKey( infostring, "gametype", va("%i", sv_gametype->integer ) ); Info_SetValueForKey( infostring, "pure", va("%i", sv_pure->integer ) ); + Info_SetValueForKey( infostring, "gamename", GAMENAME ); #ifdef USE_VOIP if (sv_voip->integer) { |