Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MinClientReqCheck and improve resource upgrade #3862

Merged
merged 8 commits into from
Nov 21, 2024
1 change: 1 addition & 0 deletions Server/mods/deathmatch/StdInc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <bochs_internal/bochs_crc32.h>
#include <pcrecpp.h>
#include <pthread.h>
#include "version.h"

extern class CNetServer* g_pRealNetServer;
extern class CGame* g_pGame;
1 change: 0 additions & 1 deletion Server/mods/deathmatch/logic/CResource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <net/SimHeaders.h>
#include <zip.h>
#include <glob/glob.h>
#include "version.h"
#include "CStaticFunctionDefinitions.h"

#ifdef WIN32
Expand Down
21 changes: 15 additions & 6 deletions Server/mods/deathmatch/logic/CResourceChecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,25 @@ void CResourceChecker::CheckMetaSourceForIssues(CXMLNode* pRootNode, const strin
attributes.Delete("client");
attributes.Delete("both");

if (!m_strReqServerVersion.empty())
// Use "both" if client and server versions are the same
if (!m_strReqServerVersion.empty() && !m_strReqClientVersion.empty() && m_strReqServerVersion == m_strReqClientVersion)
{
CXMLAttribute* pAttr = attributes.Create("server");
CXMLAttribute* pAttr = attributes.Create("both");
pAttr->SetValue(m_strReqServerVersion);
}

if (!m_strReqClientVersion.empty())
else
{
CXMLAttribute* pAttr = attributes.Create("client");
pAttr->SetValue(m_strReqClientVersion);
if (!m_strReqServerVersion.empty())
{
CXMLAttribute* pAttr = attributes.Create("server");
pAttr->SetValue(m_strReqServerVersion);
}

if (!m_strReqClientVersion.empty())
{
CXMLAttribute* pAttr = attributes.Create("client");
pAttr->SetValue(m_strReqClientVersion);
}
}

if (pbOutHasChanged)
Expand Down
2 changes: 1 addition & 1 deletion Server/mods/deathmatch/logic/CResourceChecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* PROJECT: Multi Theft Auto v1.0
* LICENSE: See LICENSE in the top level directory
* FILE: mods/deathmatch/logic/CResourceChecker.cpp
* FILE: mods/deathmatch/logic/CResourceChecker.h
* PURPOSE: Resource file content checker/validator/upgrader
*
* Multi Theft Auto is available from http://www.multitheftauto.com/
Expand Down
Loading