269 Commits

Author SHA1 Message Date
simoleo89 80df492753 feat(earnings): add Earnings Center packets (9308-9310 / 9407-9408)
Client-side counterpart to the emulator earnings contract
(emulatore/docs/earnings-packet-contract.md). Outgoing: RequestEarningsCenter /
ClaimEarningsReward(categoryKey) / ClaimAllEarningsRewards. Incoming:
EarningsCenter + EarningsClaimResult sharing one entry/reward shape. Registered
in NitroMessages + barrel chain (incoming/outgoing/parser).
2026-06-15 22:28:17 +02:00
DuckieTM 494beb7d13 Merge pull request #104 from simoleo89/fix/furnidata-merge-refresh
fix(session): refresh furni surfaces on live furnidata merge
2026-06-15 07:26:52 +02:00
DuckieTM 2ca3cadfe9 Merge pull request #103 from simoleo89/fix/userprofile-totalbadges
fix(communication): read trailing totalBadges int in UserProfileParser
2026-06-15 07:26:27 +02:00
DuckieTM 7a351144d4 Merge pull request #102 from simoleo89/fix/roomsession-snapshot-invalidate
fix(session): invalidate RoomSession snapshot on room-data/permission changes
2026-06-15 07:26:11 +02:00
simoleo89 b954ddcd79 fix(session): refresh furni surfaces on live furnidata merge
mergeFurnitureDataFromUrl dispatched SESSION_DATA_UPDATED, which only drives the
userData snapshot (useUserDataSnapshot) — and it was dispatched here WITHOUT
invalidateUserDataSnapshot(), so the snapshot reference never changed and
consumers bailed out: a no-op. The catalog / inventory / infostand furni name &
description surfaces listen to the window event `nitro-localization-updated` (the
same signal applyFurnidataDelta emits), which the merge never fired — so newly
merged furnidata (e.g. custom/imported.json5 on catalog open) didn't refresh
live. Dispatch `nitro-localization-updated` instead.
2026-06-13 18:17:25 +02:00
simoleo89 e1465f665a fix(communication): read trailing totalBadges int in UserProfileParser
UserProfileComposer appends getTotalBadges() as the final int of the profile
packet, but UserProfileParser returned after displayOrder and never read it, so
the _totalBadges getter always returned its flush default 0. The extended-profile
summary (UserContainerView) reads userProfile.totalBadges with a
`?? userBadges.length` fallback, but since the getter returned 0 (not undefined)
the fallback never triggered and the badge count rendered 0.

Add a 5th optional-trailing tier reading the int (bytesAvailable-guarded so older
servers that don't emit it still parse cleanly).
2026-06-13 18:17:21 +02:00
simoleo89 3ce15e5819 fix(session): invalidate RoomSession snapshot on room-data and permission changes
getActiveRoomSessionSnapshot() caches the frozen snapshot keyed on the session
reference, but RoomDataHandler (tradeMode/groupId/isGuildRoom/doorMode/allowPets)
and RoomPermissionsHandler (controllerLevel/owner) mutate those fields on the
same session object without invalidating the cache. Any consumer reading a
mutable field via useActiveRoomSessionSnapshot would get stale data and never
re-render.

Expose invalidateRoomSessionSnapshot() on IRoomHandlerListener and call it from
both handlers after they mutate the session.
2026-06-13 18:17:17 +02:00
simoleo89 2ea53af267 fix(communication): register outgoing prefix request/delete composers
RequestPrefixesComposer (REQUEST_PREFIXES=7011) and DeletePrefixComposer
(DELETE_PREFIX=7013) are used by the client's useInventoryPrefixes but were
never registered in NitroMessages, so SendMessageComposer(new RequestPrefixesComposer())
resolved to composer id -1 ("Unknown Composer") and the packet was dropped — the
Prefixes panel never even requested its list, so the incoming registrations from
the previous commit had nothing to decode. Both headers align with the emulator
(RequestUserPrefixesEvent / DeletePrefixEvent = 7011 / 7013).

Completes the previous incoming-side fix; the prefix list + delete flow now goes
out end-to-end.
2026-06-13 18:17:12 +02:00
simoleo89 0d8e52b0e0 fix(communication): register incoming prefix packets so the Prefixes panel works
UserPrefixesEvent (7001), PrefixReceivedEvent (7002) and
ActivePrefixUpdatedEvent (7003) were defined and exported but never mapped in
NitroMessages, so the client's useInventoryPrefixes listeners could never fire:
opening the Prefixes inventory tab sends RequestUserPrefixes, the emulator
replies with UserPrefixesComposer (7001) and the client had no decoder for it
(panel stayed empty); purchase (7002) and active-prefix changes (7003) likewise
didn't update live. Only the sibling USER_NICK_ICONS (7004) was registered,
which is why this went unnoticed.

Register the three incoming headers next to USER_NICK_ICONS.
2026-06-13 18:17:12 +02:00
duckietm a49c835870 🆙 Fix : classic O(n²) buffer blow-up in the message decoder — not threading 2026-06-11 13:04:35 +02:00
duckietm a1ef3aaefe 🆙 Fix multiheight 2026-06-10 15:11:41 +02:00
simoleo89 a2064e2901 fix(handshake): send UniqueID (machine fingerprint) before the SSO ticket
Arcturus' Habbo.connect() runs when the SSOTicket packet is handled and needs the machineId, which is set by the UniqueID packet. Sending the SSO ticket first made such servers reject the login (WS closed with "Bye") because the fingerprint hadn't arrived yet. Send UniqueID before the SSO ticket so the machineId is available when the server processes the login.
2026-06-09 20:53:48 +02:00
simoleo89 6e0cfb033e feat: parse furnidata diagnostics 2026-06-07 21:21:21 +02:00
simoleo89 108a24625f feat(furni-editor): import-text packet (10049) for Habbo furnidata fetch
Add FurniEditorImportTextComposer (outgoing 10049) + FurniEditorImportText
ResultEvent/Parser (incoming 10049: found, name, description, classname),
register both in NitroMessages and export from the furnieditor barrels.
Lets the editor pull official names/descriptions from a server-fetched
Habbo furnidata URL.
2026-06-06 15:26:23 +02:00
simoleo89 7da07aa1d5 feat(furni-editor): add sortField/sortDir to search composer
Append optional sort field + direction to FurniEditorSearchComposer so
the server can order the full result set (not just the visible page).
Defaults id/asc keep existing callers working.
2026-06-06 15:08:46 +02:00
simoleo89 751da35ce4 fix(furnieditor): register furnidata update/revert composers (was Unknown Composer) 2026-06-06 13:07:53 +02:00
simoleo89 4f3e2b7ce7 feat(furnieditor): outgoing composers for furnidata update (10046) + revert (10048) 2026-06-06 02:42:17 +02:00
simoleo89 beea0a2c61 Merge remote-tracking branch 'fork/main'
# Conflicts:
#	packages/communication/src/NitroMessages.ts
2026-06-06 00:21:11 +02:00
simoleo89 334e8e07be Merge branch 'feat/furni-names-from-json-server'
# Conflicts:
#	packages/communication/src/NitroMessages.ts
2026-06-05 23:35:10 +02:00
DuckieTM 6a7443b602 🆙 mask filter 2026-06-05 21:01:54 +02:00
duckietm 746e2c8289 🆙 Small alphablend fix 2026-06-05 17:22:48 +02:00
duckietm 20f6af232e 🆙 Update to Pixi.js 8.19.0 and alphablend is now fixed 2026-06-05 16:30:22 +02:00
duckietm d61a07e1e7 🆙 Fix the Admin Catalogue stuff 2026-06-05 14:25:47 +02:00
simoleo89 1d6c102fd6 feat(session): apply FurnitureDataReload delta + reload-hint (separate path) 2026-06-04 22:01:08 +02:00
simoleo89 dbd398ae80 feat(communication): route FURNITURE_DATA_RELOAD to its event 2026-06-04 21:54:43 +02:00
simoleo89 17957e7f54 feat(communication): FurnitureDataReload incoming event + parser (header 10047) 2026-06-04 21:50:34 +02:00
duckietm becf654c9e 🆙 Updates Mention 2026-06-04 10:42:10 +02:00
medievalshell e83468563d feat(session): live furnidata reload via mergeFurnitureDataFromUrl
Add SessionDataManager.mergeFurnitureDataFromUrl() + FurnitureDataLoader.mergeFromUrl()
to merge a single furnidata chunk (e.g. a custom tier) into the live floor/wall maps at
runtime, returning the added entries so callers can also refresh the RoomContentLoader.
Lets newly added furniture appear without a full client reload.
2026-06-03 23:36:07 +02:00
DuckieTM 6c07cf8677 Merge pull request #86 from simoleo89/feat/mentions-packets
feat(mentions): mention packets (received / list / request / mark-read / delete)
2026-06-03 09:48:56 +02:00
duckietm 90f2fa5fd8 🆙 Updated Prefixes 2026-06-03 09:39:53 +02:00
simoleo89 cf81ca6689 feat(messenger): typing packets (ConsoleTyping + FriendTyping) 2026-06-02 20:57:38 +02:00
simoleo89 9a678b04fb feat(messenger): read-receipt packets (MarkConsoleRead + ConsoleReadReceipt) 2026-06-02 20:03:32 +02:00
simoleo89 4774eeeae9 feat(messenger): add friend-category client composers (add/rename/remove/move) 2026-06-02 17:30:30 +02:00
simoleo89 6701b8bf50 feat(mentions): add DeleteMention composer (header 4805) 2026-06-02 14:44:15 +02:00
simoleo89 2b32ffa990 feat(mentions): add MentionReceived/MentionsList packets + parsers and composers 2026-05-31 21:38:46 +02:00
medievalshell c3b15f02bf perf(gamedata): manifest ext by JSON mode, no double-probe
tryFetchManifestPair sceglie l'estensione in base a resolveJsonMode():
json5 -> .json5, legacy -> .json, auto -> entrambi. Evita le richieste
manifest.json fallite a ogni avvio in modalita json5.
2026-05-30 00:14:44 +02:00
medievalshell b127501c52 fix: restore room-background Z transparency after branding offsetZ change
FurnitureBrandedImageVisualization now adds offsetZ to the branded layer (z-index for the MPU/billboard editor). The room background uses offsetZ as an inverse depth push (the 'play with Z to hide floor/walls' trick); its getLayerZOffset subtracted offsetZ assuming the parent did not add it, so the two cancelled out and the effect was lost. Cancel the parent's +offsetZ for the branded layer to restore the original net (base - offsetZ).
2026-05-29 00:45:05 +02:00
medievalshell 9ece87240e feat: branding furni image position + scale (MPU background editor)
Renderer support for the in-client image position editor:
- FurnitureBrandedImageVisualization applies offsetX/Y to the branded image
  layer only (offsetZ stays as z-index/depth), so the image can be moved
  without shifting the furni frame
- new `scale` branding key + FURNITURE_BRANDING_SCALE: zooms the image via a
  real per-sprite scale (RoomObjectSprite.scale, default 1, applied in
  RoomSpriteCanvas) — NOT by writing the read-only width/height
- AssetManager loads external raster images (png/jpg/…) via a CORS <img> +
  Texture.from instead of Assets.load (which didn't load cross-origin images);
  branding image download failures are now surfaced instead of swallowed
2026-05-28 15:29:42 +02:00
medievalshell 238592cd72 feat: soundboard packets
Add the soundboard message protocol mirroring the Arcturus side:
- incoming SoundboardSettings (enabled flag + sound list) and
  SoundboardPlay (soundId, url, username) events + parsers
- outgoing SoundboardPlay (soundId) and SoundboardSetEnabled composers
- header ids 9405/9406 (incoming), 9306/9307 (outgoing)
- NitroMessages registration + barrel exports
2026-05-28 09:02:57 +02:00
medievalshell 87eec0563d feat: rare values + fortune wheel protocol + prize editor
Composers/parsers/events for rare values + wheel (open/spin/buy/data/result/
recent-wins) + admin (get/save prizes), headers 9300-9305 / 9400-9404.
fix: figure map uses split-aware loadGamedata (raw fetch broke on tier-manifest
gamedata, silently empty avatars).
2026-05-28 02:39:01 +02:00
duckietm b7688f9d2b 🆕 Added Pickup furni to the floorplan 2026-05-27 09:41:18 +02:00
DuckieTM 72c9564488 Merge pull request #78 from simoleo89/pr/floor-editor-live-preview
feat(room): RoomMessageHandler.applyFloorModelLocally for live floor-plan editor preview
2026-05-26 13:21:56 +02:00
DuckieTM 0a6afd1742 Merge pull request #77 from simoleo89/feat/housekeeping-packets
feat(communication): Housekeeping in-client admin packet surface
2026-05-26 10:50:13 +02:00
DuckieTM 4ddd4bb93d Merge branch 'Dev' into merge-duckie-main-2026-05-06 2026-05-25 18:48:34 +02:00
Lorenzune 22a6d0b3d2 Add total badge count to user profile parser 2026-05-25 10:55:26 +02:00
simoleo89 2504aea85f fix(room): guard RoomPreviewer.updatePreviewModel against null _planeParser
After dispose() nulls out the internal _planeParser /
_backgroundSprite refs, any further updatePreviewModel call
crashed with 'this._planeParser is null'. React 19 StrictMode
in dev double-mounts effects (setup, cleanup, setup again),
which can briefly leave a consumer holding a stale reference
to a disposed previewer between the two setup runs. Bail
silently in that window instead of crashing the editor.
2026-05-24 21:14:53 +02:00
simoleo89 28a41ba543 fix(room): applyFloorModelLocally also rebuilds the furniture stacking map
The first cut updated wallGeometry + RoomMapData (so the
visualization rebuilt) but NOT the FurnitureStackingHeightMap.
The stacking map is what governs whether the room treats a
tile as 'a room tile you can stack furni on' vs. 'blocked'.
Without rebuilding it, every newly-painted tile in the live
preview looks walkable but rejects furniture placement -
user reported exactly that.

Mirror the structure of onRoomHeightMapEvent: build a fresh
FurnitureStackingHeightMap from the parsed floor (height +
isRoomTile from FloorHeightMapMessageParser.TILE_BLOCKED),
default stackingBlocked=false, then setFurnitureStackingHeightMap
+ refreshTileObjectMap so the room object map picks up the
new tile set.
2026-05-24 21:14:52 +02:00
simoleo89 afd0a4fa16 feat(room): RoomMessageHandler.applyFloorModelLocally for live floor preview
Adds a public method that rebuilds the active room's floor
geometry from an in-memory model string + wallHeight without
touching the server. Same pipeline as the wire-driven
onRoomModelEvent (FloorHeightMapMessageParser ->
_planeParser -> wallGeometry), but instead of going through
RoomEngine.createRoomInstance (which is a no-op on a room
that already exists) it routes the resulting RoomMapData
through the room object's ObjectRoomMapUpdateMessage channel
- the same mechanism RoomPreviewer.updateRoomPlanes uses for
its iso preview. Result: the visualization rebuilds in place
and existing furniture/avatars are preserved.

Refactor: extracted the parser->planeParser->wallGeometry-
>RoomMapData work from onRoomModelEvent into a private
_rebuildFloorGeometry(parser) helper so the wire handler and
the new public method share an implementation.

Intended use: tools that need a live in-room preview of a
floor edit before committing it server-side (e.g. the React
floor-plan editor's live-preview mode). The wire
UpdateFloorPropertiesMessageComposer remains the source of
truth - call applyFloorModelLocally only for transient
client-side preview.
2026-05-24 21:14:52 +02:00
simoleo89 5dd5b26bbe feat(communication): housekeeping hotel alert + dashboard + audit log
Outgoing 9127-9129: send-hotel-alert (message string), get-dashboard
(no args), list-action-log (limit int).

Incoming 9206 HousekeepingDashboardEvent + 9207 ActionLogEvent with
matching parsers and data classes. Dashboard is a flat one-shot
parse — no count prefix; action log uses the standard "count + N
entries" list pattern.

Closes the HK packet surface — yarn compile:fast clean.
2026-05-24 16:28:52 +02:00
simoleo89 386bf79ddc feat(communication): housekeeping economy — 4 composers
OutgoingHeader 9117-9120: give-credits, give-currency (generic across
duckets/diamonds/seasonal via a currencyType int), grant-item,
set-hc-subscription. All four ride the existing
HousekeepingActionResultEvent — no new parser needed.

`yarn compile:fast` clean.
2026-05-24 16:26:07 +02:00