v3.1.0
Everything that still asked the framework directly now goes through the msk_core bridge, which is what finally makes Qbox behave like the other two.
This release reads the player and the job list through the rewritten bridge. On msk_core 3.x the group lookup returns nothing and the job dropdown stays empty. Update msk_core along with this script.
Security
msk_core:playerLogoutwas registered as a net event on the server. The event is server-local, so registering it as a net event let any client fire it with an arbitrary player id, and here that means clearing somebody else's handcuff state. It is anAddEventHandlernow.
Fixed
-
The logout handler had never run once. Nothing in msk_core 3.x ever triggered
msk_core:playerLogout, so a character switch left the handcuff state behind. Since msk_core 4.0.0 the event actually fires. A disconnect was always covered byplayerDroppedand is unaffected. -
On Qbox every player counted as unemployed in the client-side pre-checks. The job lookup covered ESX and QBCore only. It went through the framework directly because
MSK.Bridgeresolved to a function in a consumer resource and could not be read;MSK.GetPlayerJob()answers in one shape on all three now. -
The job dropdown in the dashboard stayed empty on Qbox, for the same reason.
MSK.GetJobs()covers ESX, QBCore and Qbox. -
The framework group was only ever resolved on ESX. It went through
xPlayer.getGroup(), a method QBCore and Qbox do not have, so an admin without the matchingadd_principalline was refused there.player.groupis a plain string on all three frameworks since msk_core 4.0.0. -
The QBCore-only fallback ran on every framework.
GetQbPermissionstarts with a check that leaves the function unless QBCore is running, and that check could never pass, because readingMSK.Bridge.Frameworkraisedattempt to index a function value. msk_core 4.0.0 makesMSK.Bridgea real table.
Changed
- The client restore listens to one event instead of three.
esx:playerLoadedandQBCore:Client:OnPlayerLoadedare gone. They were a workaround for msk_core 3.x, wheremsk_core:playerLoadednever fired, and they also triggered the restore up to three times per spawn.
Changed files
fxmanifest.lua
client/main.lua
client/actions.lua
server/main.lua
server/admin/api.lua
server/admin/permissions.lua