Skip to content

Commit f095410

Browse files
Fix MinClientReqCheck and improve resource upgrade (#3862)
1 parent af5b696 commit f095410

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

Server/mods/deathmatch/StdInc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include <bochs_internal/bochs_crc32.h>
5050
#include <pcrecpp.h>
5151
#include <pthread.h>
52+
#include "version.h"
5253

5354
extern class CNetServer* g_pRealNetServer;
5455
extern class CGame* g_pGame;

Server/mods/deathmatch/logic/CResource.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <net/SimHeaders.h>
3636
#include <zip.h>
3737
#include <glob/glob.h>
38-
#include "version.h"
3938
#include "CStaticFunctionDefinitions.h"
4039

4140
#ifdef WIN32

Server/mods/deathmatch/logic/CResourceChecker.Data.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ namespace
167167
//{false, "doesPedHaveJetPack", "isPedWearingJetpack"},
168168

169169
// Base Encoding & Decoding
170-
{false, "base64Encode", "encodeString"},
171-
{false, "base64Decode", "decodeString"},
170+
{true, "base64Encode", "Please manually change this to encodeString (different syntax). Refer to the wiki for details"},
171+
{true, "base64Decode", "Please manually change this to decodeString (different syntax). Refer to the wiki for details"},
172172

173173
{false, "setHelicopterRotorSpeed", "setVehicleRotorSpeed"}
174174
};
@@ -271,7 +271,7 @@ namespace
271271
{true, "setPlayerDiscordJoinParams", "See GitHub PR #2499 for more details"},
272272

273273
// Base Encoding & Decoding
274-
{false, "base64Encode", "encodeString"},
275-
{false, "base64Decode", "decodeString"}
274+
{true, "base64Encode", "Please manually change this to encodeString (different syntax). Refer to the wiki for details"},
275+
{true, "base64Decode", "Please manually change this to decodeString (different syntax). Refer to the wiki for details"}
276276
};
277277
} // namespace

Server/mods/deathmatch/logic/CResourceChecker.cpp

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -367,16 +367,25 @@ void CResourceChecker::CheckMetaSourceForIssues(CXMLNode* pRootNode, const strin
367367
attributes.Delete("client");
368368
attributes.Delete("both");
369369

370-
if (!m_strReqServerVersion.empty())
370+
// Use "both" if client and server versions are the same
371+
if (!m_strReqServerVersion.empty() && !m_strReqClientVersion.empty() && m_strReqServerVersion == m_strReqClientVersion)
371372
{
372-
CXMLAttribute* pAttr = attributes.Create("server");
373+
CXMLAttribute* pAttr = attributes.Create("both");
373374
pAttr->SetValue(m_strReqServerVersion);
374375
}
375-
376-
if (!m_strReqClientVersion.empty())
376+
else
377377
{
378-
CXMLAttribute* pAttr = attributes.Create("client");
379-
pAttr->SetValue(m_strReqClientVersion);
378+
if (!m_strReqServerVersion.empty())
379+
{
380+
CXMLAttribute* pAttr = attributes.Create("server");
381+
pAttr->SetValue(m_strReqServerVersion);
382+
}
383+
384+
if (!m_strReqClientVersion.empty())
385+
{
386+
CXMLAttribute* pAttr = attributes.Create("client");
387+
pAttr->SetValue(m_strReqClientVersion);
388+
}
380389
}
381390

382391
if (pbOutHasChanged)

Server/mods/deathmatch/logic/CResourceChecker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
*
33
* PROJECT: Multi Theft Auto v1.0
44
* LICENSE: See LICENSE in the top level directory
5-
* FILE: mods/deathmatch/logic/CResourceChecker.cpp
5+
* FILE: mods/deathmatch/logic/CResourceChecker.h
66
* PURPOSE: Resource file content checker/validator/upgrader
77
*
88
* Multi Theft Auto is available from http://www.multitheftauto.com/

0 commit comments

Comments
 (0)