Browse Source

engine: server: simplify strings operations.

pull/2/head
Andrey Akhmichin 2 years ago committed by Alibek Omarov
parent
commit
2454594a18
  1. 4
      engine/server/sv_client.c
  2. 4
      engine/server/sv_log.c
  3. 6
      engine/server/sv_main.c

4
engine/server/sv_client.c

@ -2118,8 +2118,8 @@ SV_SendBuildInfo_f
*/ */
static qboolean SV_SendBuildInfo_f( sv_client_t *cl ) static qboolean SV_SendBuildInfo_f( sv_client_t *cl )
{ {
SV_ClientPrintf( cl, "Server running %s %s (build %i-%s, %s-%s)\n", SV_ClientPrintf( cl, "Server running " XASH_ENGINE_NAME " " XASH_VERSION " (build %i-%s, %s-%s)\n",
XASH_ENGINE_NAME, XASH_VERSION, Q_buildnum(), Q_buildcommit(), Q_buildos(), Q_buildarch() ); Q_buildnum(), Q_buildcommit(), Q_buildos(), Q_buildarch() );
return true; return true;
} }

4
engine/server/sv_log.c

@ -76,8 +76,8 @@ void Log_Open( void )
} }
if( fp ) svs.log.file = fp; if( fp ) svs.log.file = fp;
Log_Printf( "Log file started (file \"%s\") (game \"%s\") (version \"%i/%s/%d\")\n", Log_Printf( "Log file started (file \"%s\") (game \"%s\") (version \"%i/" XASH_VERSION "/%d\")\n",
szTestFile, Info_ValueForKey( SV_Serverinfo(), "*gamedir" ), PROTOCOL_VERSION, XASH_VERSION, Q_buildnum() ); szTestFile, Info_ValueForKey( SV_Serverinfo(), "*gamedir" ), PROTOCOL_VERSION, Q_buildnum() );
} }
void Log_Close( void ) void Log_Close( void )

6
engine/server/sv_main.c

@ -766,7 +766,7 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
Info_SetValueForKey( s, "os", "w", len ); // Windows Info_SetValueForKey( s, "os", "w", len ); // Windows
Info_SetValueForKey( s, "secure", "0", len ); // server anti-cheat Info_SetValueForKey( s, "secure", "0", len ); // server anti-cheat
Info_SetValueForKey( s, "lan", "0", len ); // LAN servers doesn't send info to master Info_SetValueForKey( s, "lan", "0", len ); // LAN servers doesn't send info to master
Info_SetValueForKey( s, "version", va( "%s", XASH_VERSION ), len ); // server region. 255 -- all regions Info_SetValueForKey( s, "version", XASH_VERSION, len ); // server region. 255 -- all regions
Info_SetValueForKey( s, "region", "255", len ); // server region. 255 -- all regions Info_SetValueForKey( s, "region", "255", len ); // server region. 255 -- all regions
Info_SetValueForKey( s, "product", GI->gamefolder, len ); // product? Where is the difference with gamedir? Info_SetValueForKey( s, "product", GI->gamefolder, len ); // product? Where is the difference with gamedir?
Info_SetValueForKey( s, "nat", sv_nat.string, sizeof(s) ); // Server running under NAT, use reverse connection Info_SetValueForKey( s, "nat", sv_nat.string, sizeof(s) ); // Server running under NAT, use reverse connection
@ -964,8 +964,8 @@ void SV_Init( void )
MSG_Init( &net_message, "NetMessage", net_message_buffer, sizeof( net_message_buffer )); MSG_Init( &net_message, "NetMessage", net_message_buffer, sizeof( net_message_buffer ));
Q_snprintf( versionString, sizeof( versionString ), "%s: %s-%s(%s-%s),%i,%i", Q_snprintf( versionString, sizeof( versionString ), XASH_ENGINE_NAME ": " XASH_VERSION "-%s(%s-%s),%i,%i",
XASH_ENGINE_NAME, XASH_VERSION, Q_buildcommit(), Q_buildos(), Q_buildarch(), PROTOCOL_VERSION, Q_buildnum() ); Q_buildcommit(), Q_buildos(), Q_buildarch(), PROTOCOL_VERSION, Q_buildnum() );
Cvar_FullSet( "sv_version", versionString, FCVAR_READ_ONLY ); Cvar_FullSet( "sv_version", versionString, FCVAR_READ_ONLY );

Loading…
Cancel
Save