Fixed reading version information from the configuration file to the engine
diff --git a/src/engine/client/cl_main.cpp b/src/engine/client/cl_main.cpp
index 8ee8731..703cf5e 100644
--- a/src/engine/client/cl_main.cpp
+++ b/src/engine/client/cl_main.cpp
@@ -3540,7 +3540,7 @@ void CL_CheckAutoUpdate( void )
cls.autoupdateServer.ip[2], cls.autoupdateServer.ip[3],
BigShort( cls.autoupdateServer.port ) );
- networkChainSystem->OutOfBandPrint( NS_CLIENT, cls.autoupdateServer, "getUpdateInfo \"%s\" \"%s\"\n", Q3_VERSION, ARCH_STRING );
+ networkChainSystem->OutOfBandPrint( NS_CLIENT, cls.autoupdateServer, "getUpdateInfo \"%s\" \"%s\"\n", PRODUCT_VERSION, OS_STRING );
#endif // !PRE_RELEASE_DEMO
diff --git a/src/engine/qcommon/common.cpp b/src/engine/qcommon/common.cpp
index 0cab883..96f0a2b 100644
--- a/src/engine/qcommon/common.cpp
+++ b/src/engine/qcommon/common.cpp
@@ -3048,7 +3048,7 @@ void Com_Init( valueType* commandLine )
// TTimo gcc warning: variable `safeMode' might be clobbered by `longjmp' or `vfork'
volatile bool safeMode = true;
- Com_Printf( "%s %s %s\n%s\n", PRODUCT_NAME, ARCH_STRING, __DATE__, commandLine );
+ Com_Printf( "%s %s %s\n%s\n", PRODUCT_NAME, PLATFORM_STRING, __DATE__, commandLine );
if( setjmp( abortframe ) )
{
@@ -3264,7 +3264,7 @@ void Com_Init( valueType* commandLine )
cmdSystem->AddCommand( "quit", Com_Quit_f, "Quits the running game, and exits application completely. For server also see killserver" );
cmdSystem->AddCommand( "writeconfig", Com_WriteConfig_f, "Saves all current settings to the specified file, if none specified then uses owconfig.cfg" );
- s = va( "%s %s %s %s", PRODUCT_NAME, ARCH_STRING, OS_STRING, __DATE__ );
+ s = va( "%s %s %s %s", PRODUCT_NAME, OS_STRING, OS_STRING, __DATE__ );
com_version = cvarSystem->Get( "version", s, CVAR_ROM | CVAR_SERVERINFO, "Records all info about the application version: build number, build date, win/linux etc" );
com_protocol = cvarSystem->Get( "protocol", va( "%i", ETPROTOCOL_VERSION ), CVAR_SERVERINFO | CVAR_ARCHIVE, "Returns the current protocol (changes with patches)." );
diff --git a/src/engine/server/serverInit.cpp b/src/engine/server/serverInit.cpp
index 198588c..268c014 100644
--- a/src/engine/server/serverInit.cpp
+++ b/src/engine/server/serverInit.cpp
@@ -1029,7 +1029,6 @@ void idServerInitSystemLocal::ParseVersionMapping( void )
Com_Error( ERR_FATAL, "Exceeded maximum number of mappings(%d)", MAX_UPDATE_VERSIONS );
return;
}
-
}
Com_Printf( " found %d mapping%c\n--------------------------------------\n\n", numVersions, numVersions > 1 ? 's' : ' ' );
diff --git a/src/engine/server/serverMain.cpp b/src/engine/server/serverMain.cpp
index d2ab697..192aee6 100644
--- a/src/engine/server/serverMain.cpp
+++ b/src/engine/server/serverMain.cpp
@@ -1,4 +1,4 @@
-////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////
// Copyright(C) 1999 - 2010 id Software LLC, a ZeniMax Media company.
// Copyright(C) 2011 - 2019 Dusan Jocic <dusanjocic@msn.com>
//
@@ -867,27 +867,55 @@ void idServerMainSystemLocal::GetUpdateInfo( netadr_t from )
for( i = 0; i < numVersions; i++ )
{
- if( strcmp( versionMap[i].platform, platform ) == 0 && ( strcmp( versionMap[i].version, version ) != 0 ) )
+ if( !::strcmp( versionMap[i].version, version ) )
{
- // If the installer is set to "current", we will skip over it
- if( strcmp( versionMap[i].installer, "current" ) )
- {
- found = true;
- }
-
- break;
+ Com_DPrintf( " version string is same string\n" );
+ found = true;
+ }
+ else
+ {
+ Com_DPrintf( " version string is not the same\n" );
+ Com_DPrintf( " found version %s version %s\n", versionMap[i].version, version );
+ found = false;
+ }
+
+ if( !::strcmp( versionMap[i].platform, platform ) )
+ {
+ Com_DPrintf( " platform string is the same\n" );
+ Com_DPrintf( " found platform %s platform %s\n", versionMap[i].platform, platform );
+ found = true;
+ }
+ else
+ {
+ Com_DPrintf( " platform string is not the same \n" );
+ Com_DPrintf( " found platform %s platform %s\n", versionMap[i].platform, platform );
+ found = false;
+ }
+
+ if( ::strcmp( versionMap[i].installer, "current" ) )
+ {
+ Com_DPrintf( " installer string is the current\n" );
+ found = true;
+ }
+ else
+ {
+ Com_DPrintf( " installer string is not the same\n" );
+ Com_DPrintf( " found %s installer\n", versionMap[i].installer );
+ found = false;
+ }
+
+ Com_DPrintf( " -------------------------------------------------------------------\n" );
+
+ if( found )
+ {
+ networkChainSystem->OutOfBandPrint( NS_SERVER, from, "updateResponse 1 %s", versionMap[i].installer );
+ Com_DPrintf( " SENT: updateResponse 1 %s\n", versionMap[i].installer );
+ }
+ else
+ {
+ networkChainSystem->OutOfBandPrint( NS_SERVER, from, "updateResponse 0" );
+ Com_DPrintf( " SENT: updateResponse 0\n" );
}
- }
-
- if( found )
- {
- networkChainSystem->OutOfBandPrint( NS_SERVER, from, "updateResponse 1 %s", versionMap[i].installer );
- Com_DPrintf( " SENT: updateResponse 1 %s\n", versionMap[i].installer );
- }
- else
- {
- networkChainSystem->OutOfBandPrint( NS_SERVER, from, "updateResponse 0" );
- Com_DPrintf( " SENT: updateResponse 0\n" );
}
#endif
}
GitHub
sha: 0b52a380