From 2454594a18e3e9cecd4ec33fbae4d8ca5300e630 Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin <15944199+nekonomicon@users.noreply.github.com> Date: Sun, 4 Dec 2022 20:18:41 +0500 Subject: [PATCH] engine: server: simplify strings operations. --- engine/server/sv_client.c | 4 ++-- engine/server/sv_log.c | 4 ++-- engine/server/sv_main.c | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/engine/server/sv_client.c b/engine/server/sv_client.c index ba417dec..a7bc8c2f 100644 --- a/engine/server/sv_client.c +++ b/engine/server/sv_client.c @@ -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; } diff --git a/engine/server/sv_log.c b/engine/server/sv_log.c index db6c4dfe..bc3a5429 100644 --- a/engine/server/sv_log.c +++ b/engine/server/sv_log.c @@ -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 ) diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index 016bcc8c..97db71cd 100644 --- a/engine/server/sv_main.c +++ b/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, "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 );