Zum Hauptinhalt springen

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.

Requires msk_core 4.0.0 or newer

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:playerLogout was 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 an AddEventHandler now.

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 by playerDropped and 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.Bridge resolved 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 matching add_principal line was refused there. player.group is a plain string on all three frameworks since msk_core 4.0.0.

  • The QBCore-only fallback ran on every framework. GetQbPermission starts with a check that leaves the function unless QBCore is running, and that check could never pass, because reading MSK.Bridge.Framework raised attempt to index a function value. msk_core 4.0.0 makes MSK.Bridge a real table.

Changed

  • The client restore listens to one event instead of three. esx:playerLoaded and QBCore:Client:OnPlayerLoaded are gone. They were a workaround for msk_core 3.x, where msk_core:playerLoaded never 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