Skip to content

Commit

Permalink
Fix MinClientReqCheck and improve resource upgrade (#3862)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando-A-Rocha authored Nov 21, 2024
1 parent af5b696 commit f095410
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
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
8 changes: 4 additions & 4 deletions Server/mods/deathmatch/logic/CResourceChecker.Data.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ namespace
//{false, "doesPedHaveJetPack", "isPedWearingJetpack"},

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

{false, "setHelicopterRotorSpeed", "setVehicleRotorSpeed"}
};
Expand Down Expand Up @@ -271,7 +271,7 @@ namespace
{true, "setPlayerDiscordJoinParams", "See GitHub PR #2499 for more details"},

// Base Encoding & Decoding
{false, "base64Encode", "encodeString"},
{false, "base64Decode", "decodeString"}
{true, "base64Encode", "Please manually change this to encodeString (different syntax). Refer to the wiki for details"},
{true, "base64Decode", "Please manually change this to decodeString (different syntax). Refer to the wiki for details"}
};
} // namespace
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

0 comments on commit f095410

Please sign in to comment.