-
Notifications
You must be signed in to change notification settings - Fork 737
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
Common - Improve PBO checking #9266
Conversation
Legacy code / used to run when remote executed without CBA and ACE installed.
Yes. Todo: make it a function, not a script.
Don't see the point. Also, whack that Dedmen didn't make them insertion ordered. |
What does this mean ultimately? Can this be updated or not? |
Nothing, it's already broken.
Sure, but keep in mind that it has to be backwards compatible, meaning, it makes no sense if someone connects with an older version and then nothing shows up because the interface of the PBO checking keeps changing between updates. |
btw 2.14 will add mod hash to https://community.bistudio.com/wiki/allAddonsInfo |
Would this new system replace the current one or compliment it? |
don't need to do anything about it in this PR |
All mismatched PBOs should be listed in logs. User error message (and that functionality) was changed in #9560, should update this PR after to see what overlaps/conflicts. |
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.
I did not mean to approve that.
Haven't tested yet, but request after https://discord.com/channels/976165959041679380/1166914354051027024: addon mismatch message should show server's |
Can you elaborate further on your suggestion? Do you mean only for ACE (so only in |
ACE only. Server's source for To clarify, there shouldn't be any errors on a source mismatch. But the source should be displayed if there is a version/addon mismatch. |
I've tested in self-hosted, I have not been able to test on a dedicated server. |
I was able to test this on a dedicated server:
It works as intended. |
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.
I'm still not completely happy with how we give feedback on this (we could add custom properties in config for the compats that'd override the error message to indicate client/server has extra CDLC, for example, instead of just saying there's extra/missing ACE addons), but this PR is good.
* Update PBO checking * Added kicking of clients without ACE loaded * Update fnc_errorMessage.sqf * Update fnc_checkVersionNumber.sqf * More compatibility for acemod#9568 * Cleanup * Minor cleanup + added server source * update outdated/not present error message * check version number fixes * Update fnc_errorMessage.sqf * Changed error names Server is always right, client has either older or newer versions, or missing or additional addons * Improved ACE detection method * Tweaks and fixes * Try another approach * Update events-framework.md * Update XEH_postInit.sqf * Update fnc_checkVersionNumber.sqf * Removed check for non-ACE clients * Update XEH_postInit.sqf * Cleanup * Remove rogue change * Improved message display in systemChat * Update fnc_checkPBOs.sqf * Removed loop variable initialisers * Fixed header * Updated headers --------- Co-authored-by: Grim <69561145+LinkIsGrim@users.noreply.github.com> Co-authored-by: LinkIsGrim <salluci.lovi@gmail.com>
When merged this pull request will:
However, I have not tested if ACE PBO Check, when set to "Kick", can be bypassed using an Xbox Controller #9181 has been fixed with this, as I do not own a controller.
FUNC(errorMessage)
has been modified to be a dedicated function for usage in PBO checkingand has been adapted to be executable on clients without any mods."ace_versioning_clientCheckDone"
and"ace_versioning_serverCheckDone"
for public usage. This would allow other mods to be notified when PBO checking has been completed and whether it has been completed successfully or not. Event names and arguments passed are up for debate: For now,"ace_versioning_clientCheckDone"
passes a copy ofACE_Version_ClientErrors
,"ace_versioning_serverCheckDone"
passes a copy ofACE_Version_ServerVersions
.FUNC(checkPBOs)
uses the event"ace_versioning_clientCheckDone"
instead of a PFH.checkVersionNumber.sqf
now prints"and x more."
at the end of an error message, to allow players to know how many PBOs they are missing.waitUntil
have been replaced withaddPublicVariableEventHandler
.checkVersionNumber.sqf
is now a function.Added checking for clients that don't have ACE 3.x.x loaded (version depending on if/when this is added). If a client has an older version, they will be kicked.I was not satisfied by any of the solutions that we came up with, so I dropped it.The way it checks might need some tweaking (changes are in
XEH_postInit.sqf
).Old description
- Intended to close #9181 by adding a new argument to `FUNC(errorMessage)`, which allows users to pass codes to both the "Ok" and "Cancel" buttons, without having said buttons being shown. However, I have not tested if #9181 has been fixed with this, as I do not own a controller. - `FUNC(errorMessage)`: "ok" and "cancel" codes are no longer global variables ~~, they are passed using `CBA_fnc_addBISEventHandler`~~. This prevents code from being overwritten, however I'm unsure if this is necessary at all. - ~~PFHs and `waitUntil` used for checking public variables have had their intervals reduced from 1 second to 0.5 seconds. This should make loading into mission be a little snappier.~~ - Added events `"ace_versioning_clientCheckDone"` and `"ace_versioning_serverCheckDone"` for public usage. This would allow other mods to be notified when PBO checking has been completed and whether it has been completed successfully or not. Event names and arguments passed are up for debate: For now, `"ace_versioning_clientCheckDone"` passes a copy of `ACE_Version_ClientErrors`, `"ace_versioning_serverCheckDone"` passes a copy of `ACE_Version_ServerVersions`. - `FUNC(checkPBOs)` uses the event `"ace_versioning_clientCheckDone"` instead of a PFH. I'm unsure about this change, as if the event is raised externally it could cause some issues - hence the `WIP` tag in the title. If the event is not considered safe, then I will restructure `FUNC(checkPBOs)`: First I'd execute `checkVersionNumber.sqf` and `waitUntil` it's done, then execute the rest of `FUNC(checkPBOs)`, so as to remove a PFH check - or something else, see in the first point of the questions below. - ~~`checkVersionNumber.sqf` no longer relies on the global variable `ACE_Version_Whitelist`, the whitelist is passed by `FUNC(checkPBOs)` directly. This is to avoid third party influence. `ACE_Version_ClientVersions` has also been changed for the same reason.~~ no longer valid - `checkVersionNumber.sqf` now prints `"and x more."` at the end of an error message, to allow players to know how many PBOs they are missing. - Code cleanup.8386a3c includes:
waitUntil
have been replaced withaddPublicVariableEventHandler
.checkVersionNumber.sqf
is now a function.The way it checks might need some tweaking (changes are in
XEH_postInit.sqf
).FUNC(errorMessage)
has been adapted to be executable on clients without any mods.Questions I had:
- ~~Is there any specific reason why `waitUntil` is used in `checkVersionNumber.sqf` instead of a PFH? `FUNC(checkPBOs)` runs when the event `"CBA_settingsInitialized"` has been raised, so `CBA_fnc_addPerFrameHandler` ought to be available. Even more elegant imo would be to use a `addPublicVariableEventHandler` on `ACE_Version_ServerVersions` to check when it has been received by the client. Would there be any disadvantages to this?~~ answered - ~~In `FUNC(checkPBOs)`: What does the `@todo` refer to? The point above?~~ answered - ~~Currently, max. 11 PBOs are listed in the log if they are missing, wrong version etc. I added the `"and x more."` at the end of an error message. Should this be changed to something that reflects the total amount instead (e.g. `"(_x total)"`)? Or should ACE simply list all of the PBOs in the logs (probably not `systemChat` though)? Other ideas? I feel like the current info could be supplemented to help out people figure out what they need to load/unload.~~ - ~~For when 2.14 rolls out: Should `ACE_Version_ServerVersions` and `ACE_Version_ClientVersions` switch to hashmaps, for the sole purpose of hashmaps being able to be made final using [compileFinal](https://community.bistudio.com/wiki/compileFinal)? Unless - can arrays be made final? The disadvantage of hashmaps is the alphabetical order would be lost, which in this case would be less than ideal imo, so I don't really want to change to them. But at the same time, finalising the variables might outweigh that drawback.~~ answeredIMPORTANT
Component - Add|Fix|Improve|Change|Make|Remove {changes}
.