You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
221f186d61
Drop the separate UserPermissionsMapEvent / UserPermissionsMapParser and the IncomingHeader.USER_PERMISSIONS_MAP = 10070 registration — the resolved permission map now rides on the existing UserPermissionsEvent as a third optional trailing block, after the rank metadata one. Same wire data, one fewer packet, one fewer event registration, one fewer handler. Wire layout (UserPermissionsEvent / header 411): int clubLevel int securityLevel bool isAmbassador --- rank metadata (Arcturus ≥ 4.2.10) --- int rankId string rankName string rankBadge string rankPrefix string rankPrefixColor --- resolved permission map (Arcturus ≥ 4.2.10) --- int count loop: string permission_key + int value (1=ALLOWED, 2=ROOM_OWNER) Both trailing blocks are guarded by `bytesAvailable` in UserPermissionsParser so older emulators that don't append them still parse cleanly. SessionDataManager.onUserPermissionsEvent is now the single handler: - updates clubLevel/securityLevel/isAmbassador/rank* AND _permissions; - invalidates BOTH the user-data snapshot and the permissions snapshot (dispatching the two distinct NitroEventType.SESSION_DATA_UPDATED / USER_PERMISSIONS_UPDATED events). The two distinct invalidation events stay so React consumers can subscribe granularly — useHasPermission(key) only triggers on a real permission map flip, not on every session-data bump. Companion Arcturus change (feat/react19-emu-update) folds UserPermissionsMapComposer into UserPermissionsComposer and removes the second sendResponse in HabboManager.setRank + SecureLoginEvent. Verification: yarn compile:fast clean, vitest 138/138.