You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-19 15:06:19 +00:00
82d90418cd
`PermissionsManager.reload()` rebuilds the rank table from `permission_ranks` + `permission_definitions`, but every Habbo currently online still holds a reference to the OLD `Rank` object on `HabboInfo.rank`. Server-side `hasPermission()` therefore keeps returning stale results, and any Nitro client that reads permission state from the wire keeps gating UI on the map shipped at login — until a relogin or `:give_rank` forces a per-user refresh. Extend the existing `UpdatePermissionsCommand` so after `reload()` it: 1. Iterates the online Habbos via `HabboManager.getOnlineHabbos()`. 2. Re-binds each one's `HabboInfo.rank` to the FRESH `Rank` object returned by `PermissionsManager.getRank(currentRankId)`. Falls back to rank 1 if the admin deleted the rank from `permission_ranks` between sessions, so the user is never left with a null `Rank` reference. 3. Sends a fresh `UserPermissionsComposer` to each client. With the companion composer extension PR also merged, this broadcasts the rank metadata + resolved permission map runtime — the Nitro React-side `useHasPermission(key)` / `useUserRank()` consumers re-render against the freshly-loaded tables without requiring an F5. The whisper feedback now reports how many connected users were refreshed, useful for ops feedback after a large `permission_ranks` edit. Defensive null guards on habbo / habboInfo / client survive transient state during the broadcast (e.g. a user disconnecting mid-iteration).