Commit Graph

42 Commits

Author SHA1 Message Date
simoleo89 892d16b393 feat(sound): snapshot getter + volume-update event on SoundManager
Extends the snapshot pattern to the three audio volume levels (system /
furni / trax) so volume-slider widgets on the React client can subscribe
to a single source of truth via useSyncExternalStore.

API additions on ISoundManager:
- systemVolume / furniVolume getters (parity with the existing
  traxVolume getter)
- getVolumesSnapshot(): Readonly<ISoundVolumesSnapshot> with the same
  lazy-frozen + invalidation-on-change semantics as the user/session
  snapshots
- new ISoundVolumesSnapshot { system, furni, trax } interface

New event: NitroEventType.SOUND_VOLUMES_UPDATED. Dispatched only when
the incoming NitroSettingsEvent.SETTINGS_UPDATED actually changes one
of the three volumes (a no-op refresh stays quiet).

While in there, fixed a real bug: the previous implementation cached
`volumeFurniUpdated` / `volumeTraxUpdated` BEFORE writing the new
values, but read `castedEvent.volumeFurni` / `castedEvent.volumeTrax`
in their pre-division form — comparing percent (e.g. 75) against the
already-divided stored value (e.g. 0.75) — so the change check almost
always reported "updated" for a real settings push and never reported
"updated" if the percent matched the stored fraction by coincidence
(only 0/100 are stable). Updated check is now consistent (compare
fraction vs fraction) and also tracks systemVolume changes for the
new snapshot invalidation.
2026-05-18 20:55:12 +02:00
simoleo89 761d8ffe19 feat(session): snapshot getter for UserDataManager room user list
Extends the snapshot pattern to the room's user list. The React client
currently has many widgets each calling `getUserDataByIndex(idx)` in a
loop (chat, doorbell, room player list, infostand …) — every render
walks the underlying Map and rebuilds an array. With
`getRoomUserListSnapshot(): ReadonlyArray<IRoomUserData>` consumers can
memoize on the array reference and only rebuild when something actually
changed.

Invalidation fires on every state-changing path:
- updateUserData (add/replace)
- removeUserData (leave)
- updateFigure / updateName / updateMotto / updateNickIcon /
  updateCustomization / updateBackground / updateAchievementScore /
  updatePetLevel / updatePetBreedingStatus

The inner IRoomUserData objects keep their existing in-place mutation
semantics (deep-clone would be too expensive for 30+ avatars on every
single status push). Consumers should treat each entry as a
snapshot-at-time-of-read and not retain references across an
invalidation.

New event: NitroEventType.ROOM_USER_LIST_UPDATED. Interface and event
additions are backwards-compatible; no existing accessors changed.

Also tidied: `updatePetLevel` now uses the explicit `if(!userData)
return;` guard pattern matching the rest of the methods (was a one-line
inline conditional).
2026-05-18 20:52:33 +02:00
simoleo89 a599e0cf89 feat(session): snapshot getters for IgnoredUsersManager + GroupInformationManager
Extends the v2.1.0 React-friendly snapshot pattern (originally on
SessionDataManager / RoomSessionManager) to two more session-state
holders the React client reads frequently:

- IgnoredUsersManager.getIgnoredUsersSnapshot(): ReadonlyArray<string>
- GroupInformationManager.getGroupBadgesSnapshot(): ReadonlyMap<number, string>

Both follow the same shape: lazy-frozen snapshot, cached until the
underlying state mutates, then invalidated and a dispatched event lets
the React client rebuild via useSyncExternalStore.

Two new NitroEventType members carry the invalidation signal:
- IGNORED_USERS_UPDATED — dispatched by IgnoredUsersManager whenever
  the list changes (initial load, add, remove, queue-truncate case 2).
- GROUP_BADGES_UPDATED — dispatched by GroupInformationManager only
  when the incoming HabboGroupBadges payload contains at least one
  new or changed mapping (no-op refresh stays quiet).

This lets the user-info popup, profile page, friend/guild filtering,
and any other consumer share a single read through useSyncExternalStore
instead of each subscribing to the underlying message events
independently.

API additions are interface-respecting and backwards-compatible — the
existing `isIgnored(name)` / `getGroupBadge(groupId)` accessors stay
untouched.
2026-05-18 20:50:24 +02:00
simoleo89 08d1efafbe Drop dead sendWhisperGroupMessage — composer never existed
IRoomSession.sendWhisperGroupMessage(userId) was declared in the
interface and implemented in RoomSession by sending 'new
ChatWhisperGroupComposer(userId)' — but no such composer class
exists in the renderer (the file was never created). The only
whisper composer is RoomUnitChatWhisperComposer, which takes
(recipientName, message, styleId), not a userId.

No client call site references sendWhisperGroupMessage (grep across
Nitro-V3/src returned zero hits). Removing the dead interface method
+ broken impl is safer than inventing a ChatWhisperGroupComposer
class with no server-side handler.
2026-05-11 21:09:31 +02:00
simoleo89 afb5f33ec2 fix(api): IRoomSession.password + sendBackgroundMessage + optional chatColour
The IRoomSession interface was missing three things that have always
existed on the RoomSession implementation:

- `password: string` — the room session's join password (used by the
  reconnect flow in RoomSessionManager).
- `sendBackgroundMessage(backgroundImage, backgroundStand, backgroundOverlay, backgroundCard?)`
  — sends the profile-background composer (used by the React client's
  BackgroundsView).

Plus a signature relaxation:
- `sendChatMessage` / `sendShoutMessage` `chatColour` is now optional.
  The implementation already accepted `undefined` (the composer forwards
  it through), and every historical call site in the React client passes
  only 2 args — making the 3rd optional simply types reality.

Net renderer typecheck: 26 → 23.
The change also drops 7 errors on the consumer side
(see ../Nitro-V3 typecheck after the workspace link picks this up).

CLAUDE.md gotchas updated to reflect the new interface contract.
2026-05-10 21:48:49 +02:00
simoleo89 ddb7222b66 chore: bump TypeScript pins to ^6.0.3 across all 12 workspaces + thumbmarkjs 1.9 + add CLAUDE.md
Each workspace package was still pinning `typescript: ~5.5.x` or
`~5.8.2` in its own devDependencies even though the root bumped to 6.0.3
in 60b1143. The pins were dead (yarn 1 hoists from root) but they're
misleading when reading a single package.json. Bring them all to
`^6.0.3` to match the root.

Other:
- @thumbmarkjs/thumbmarkjs 1.8.1 → 1.9.0 (root + communication package)
- yarn.lock regenerated from a clean install (vitest 4 hoisting was
  flaking on the patch vite bump; reverted vite to ^8.0.10)

Adds CLAUDE.md at the repo root: short project context for future
sessions — stack, the 12-workspace layout, the React-friendly v2.1.0
additions (`subscribe()`, `subscribeMessage()`, snapshot getters), build
scripts, and known gotchas (`SessionDataManager.getUserData` does NOT
exist; sendChat* expects 3 args; dispatchEvent is sync).
2026-05-10 21:29:50 +02:00
simoleo89 87cf47847c feat(events,session): add React-friendly subscribe APIs and snapshot getters
Adds backwards-compatible primitives needed to consume the renderer from
React 19 hooks (useSyncExternalStore, use(), TanStack Query) without
re-architecting the event bus.

- EventDispatcher.subscribe(type, cb): () => void — unsubscriber-returning
  wrapper matching the useSyncExternalStore subscribe signature.
- CommunicationManager.subscribeMessage(eventCtor, handler): () => void —
  packet-stream equivalent.
- SessionDataManager.getUserDataSnapshot() and
  RoomSessionManager.getActiveRoomSessionSnapshot() — referentially-stable
  read-only views invalidated through new SESSION_DATA_UPDATED and
  ROOM_SESSION_UPDATED events.

All additive; existing addEventListener/removeEventListener / IRoomSession
APIs are unchanged. Bumps renderer to 2.1.0.
2026-05-10 19:16:32 +02:00
Lorenzune 5fc4564467 Merge remote-tracking branch 'duckie/main' into merge-duckie-main-2026-05-06
# Conflicts:
#	packages/communication/src/messages/parser/room/unit/RoomUnitInfoParser.ts
#	packages/communication/src/messages/parser/user/data/UserProfileParser.ts
#	packages/events/src/session/RoomSessionUserFigureUpdateEvent.ts
#	packages/session/src/handler/RoomUsersHandler.ts
2026-05-06 04:23:13 +02:00
duckietm 2f7b80e894 🆕 Card Background 2026-05-04 08:44:40 +02:00
duckietm 853204a5b8 🆕 Effect selection in user dropdown 2026-04-29 13:23:30 +02:00
Lorenzune 7fa8eff751 Merge latest duckie renderer main 2026-04-21 11:53:28 +02:00
Lorenzune 7bf552824f Sync renderer safety push 2026-04-21 08:57:35 +02:00
duckietm 2c2f03f20e 🔥 Fix Avatar buddy they are now 100% as habbo 2026-04-17 11:48:38 +02:00
duckietm 282fd6f6bd 🆙 New misc clothing 2026-04-16 13:36:17 +02:00
duckietm ca5e754b28 🆙 Small Fixes 2026-04-14 11:19:53 +02:00
Lorenzune 3718e7cf3d feat: tag stack walk helpers for widget support 2026-04-03 13:00:05 +02:00
Lorenzune 24f1d1278a feat: add room control rendering support 2026-04-03 12:09:16 +02:00
Lorenzune 99c4acea38 Expose room, user and furni metadata for wired tools
- parse extra room snapshot data such as hotel time, room item limit and group context

- expose richer furni metadata including flags, dimensions and teleport targets

- expose richer user metadata including room-entry fields and ids needed by inspection tools

- keep session and room engine models aligned with the new wired monitor/inspection flow
2026-03-27 09:37:14 +01:00
Lorenzune 075b0f722d Support NFT avatar editor category data 2026-03-26 05:24:53 +01:00
duckietm 10df60a3cb 🆕 🐶 have you favorite pet as your best pall next to you 2026-03-25 14:13:10 +01:00
Lorenzune 296df767ba Improve wired movement rendering and follow sync 2026-03-25 03:26:27 +01:00
Lorenzune 38a79d4f80 feat: support wired movement packets and room sync 2026-03-22 16:48:51 +01:00
Lorenzune 10b3d64ee0 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	packages/communication/src/NitroMessages.ts
2026-03-21 14:49:08 +01:00
Lorenzune fd61704375 fix(room): support wired click-user controls 2026-03-21 14:27:57 +01:00
duckietm 5aef7a3de2 🆕 Disconnection handler, when you got disconnected you automatic go back to the room 2026-03-19 15:04:47 +01:00
duckietm 4fac511a09 🆕 Rollers can now go up and down the mountains ! 🗻 2026-03-13 20:52:55 +01:00
duckietm ec0aef3c41 🆙 Update for the wf_slc_users_neighborhood 2026-03-10 15:40:24 +01:00
duckietm bc4605f45f 🆕 Added support for wf_slc_users_area and some avatar fixes 2026-03-06 11:26:40 +01:00
duckietm b456def1de 🆙 Fix Sleep & Blinking eye's 2026-03-02 16:52:08 +01:00
duckietm 120a502a7d 🆙 Update
- Animation canvas uses full landscape height for proper vertical positioning
- Animation assets always loaded from room collection
- Fallback to default plane when specific plane not found
2026-02-05 08:32:02 +01:00
DuckieTM d864fe3018 🆙 Update Deps. + WiP 2025-03-15 14:54:10 +01:00
DuckieTM beac15e20a 🆙 Even more updates 2025-03-09 11:56:32 +01:00
DuckieTM 791309ff73 🆙 More Updates 2025-03-09 11:45:21 +01:00
DuckieTM 4cae55befc 🆙 More updates 2025-03-09 11:27:01 +01:00
DuckieTM 5ff7478cb5 🆙 Update IGetImageListener 2025-03-09 10:53:31 +01:00
DuckieTM 70b1d232d5 🆙 Update dependencies 2025-03-09 10:39:43 +01:00
duckietm 14bf0fdcbd 🆙 Fix firework memory leak and update pixi.js 2024-09-13 08:04:35 +02:00
duckietm 1e4f45a107 🆙 the latest updates to Renderer 2024-07-15 10:23:54 +02:00
duckietm bd09ea8b25 🆙 added latest changes 2024-07-04 15:03:26 +02:00
duckietm d5a3a05c40 Updated the renderer V2 2024-04-25 11:35:50 +02:00
duckietm 95bc0045ec Added Color to the Renderer and Avatar update 2024-04-04 09:26:05 +02:00
duckietm b3134ce50b Move to Renderer V2 2024-04-03 09:27:56 +02:00