-
-
Notifications
You must be signed in to change notification settings - Fork 437
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
Fix MinClientReqCheck and improve resource upgrade #3862
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect so far!
Some factsRegarding resource upgrader: I found that the upgrade command can only upgrade resources by setting a new min_mta_version client/server setting via the Other older warnings like fetchRemote, callRemote etc cannot be automatically resolved with upgrade They only pollute the debug console until the developer manually does something about the script(s). |
@Nico8340 Ive committed a solution for base64Encode and base64Decode. Main PR post updated. |
Nice |
Details
I found that
MinClientReqCheck
was not working on any builds because it was checkingMTASA_VERSION_TYPE
, which was not defined due to a missingversion.h
import. I have restored this include in serverStdInc.h
, as it was back in the day (before a big refactor that removed this by mistake, see Fix min_mta_version 'server' not working as expected #3853 (comment)). This was resulting in clientside functions like fetchRemote which use old syntax not outputting any warnings.I changed the Resource Upgrade feature to set the
min_mta_version
meta.xml node with the"both"
attribute when the client & server versions to set are the same (CResourceChecker.cpp
). Attribute"both"
is already correctly supported on resource parsing/loading.I changed the way base64Encode and base64Decode functions are detected by the resource checker (& upgrader). Previously, the upgrader would automatically rename these functions in your scripts to encodeString and decodeString, causing the scripts to break because these functions take different arguments (different syntaxes). Now, instead of doing that automatically, it warns you to manually update, like it does for other functions such as
givePlayerJetPack
.Tests
min_mta_version
attribute"both"
Note
Tested by commenting the MTASA_VERSION_TYPE checks at MinServerReqCheck and MinClientReqCheck so this can run on custom builds:
Place this code on
client.lua
andserver.lua
script files in a new resource.Start the server to load all resources or start the resource if the server was already running.
The resource upgrader will detect the missing
min_mta_version
information due to this new 1.6.0 function being used, which was added in 1.6.0-9.21938 for both client and server.The upgrade command will result in the meta.xml being successfully updated with the new
"both"
min_mta_version
required.base64Encode
andbase64Decode
detectionPlace this code in a serverside script (taken from the wiki).
Start the resource. We now observe a warning asking you to update the function manually, where previously it would wrongfully replace the function name (base64Encode) with encodeString which has a different syntax.