engine: server: simplify strings operations.

This commit is contained in:
Andrey Akhmichin 2022-12-04 20:18:41 +05:00 committed by Alibek Omarov
parent 4daab23e2d
commit 2454594a18
3 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

@ -766,7 +766,7 @@ void SV_AddToMaster( netadr_t from, sizebuf_t *msg )
Info_SetValueForKey( s, "os", "w", len ); // Windows
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, "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, "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
@ -964,8 +964,8 @@ void SV_Init( void )
MSG_Init( &net_message, "NetMessage", net_message_buffer, sizeof( net_message_buffer ));
Q_snprintf( versionString, sizeof( versionString ), "%s: %s-%s(%s-%s),%i,%i",
XASH_ENGINE_NAME, XASH_VERSION, Q_buildcommit(), Q_buildos(), Q_buildarch(), PROTOCOL_VERSION, Q_buildnum() );
Q_snprintf( versionString, sizeof( versionString ), XASH_ENGINE_NAME ": " XASH_VERSION "-%s(%s-%s),%i,%i",
Q_buildcommit(), Q_buildos(), Q_buildarch(), PROTOCOL_VERSION, Q_buildnum() );
Cvar_FullSet( "sv_version", versionString, FCVAR_READ_ONLY );