Commit Graph

245 Commits

Author SHA1 Message Date
simoleo89 b42f989e28 RoomEnterComposer: optional spawnX/spawnY for reconnect
Arcturus' RequestRoomLoadEvent reads the two extra ints only when
the inbound packet has 8+ bytes remaining after roomId+password, so
the renderer can send 2-arg or 4-arg payloads against the same
header. The client already calls 'new RoomEnterComposer(roomId,
password, spawnX, spawnY)' in two places inside RoomSession /
RoomSessionManager (the reconnect/respawn flow) — the composer
signature is what was lagging behind.

Server-side reference:
Arcturus-Morningstar-Extended/Emulator/src/main/java/com/eu/habbo/
messages/incoming/rooms/RequestRoomLoadEvent.java
2026-05-11 21:09:51 +02:00
simoleo89 999b8187d6 Fix PetBreedingMessageParser bytesAvailable check
bytesAvailable is a boolean (IMessageDataWrapper.bytesAvailable: boolean,
returns 'there is at least one byte left'); the parser was doing
'wrapper.bytesAvailable < 12' as if it were a count, which both
mis-compares boolean to number and short-circuits incorrectly when
exactly 11 bytes remain.

Align with every other parser in the codebase: 'if(!wrapper ||
!wrapper.bytesAvailable) return false;'. The downstream readInt
calls already throw on truncated packets so the explicit length
check was load-bearing only against malformed inputs that wouldn't
parse anyway.
2026-05-11 21:09:41 +02:00
simoleo89 0fc38a1c71 Fix self-referential ConstructorParameters in two Wired composers
WiredRoomSettingsRequestComposer and WiredUserVariablesRequestComposer
declared 'implements IMessageComposer<ConstructorParameters<typeof Self>>'
but neither defines a constructor, so ConstructorParameters resolved
to 'any[]' and getMessageArray() returning [] (any[]) failed the
narrower base-type signature () => [].

Both composers send zero payload; type as IMessageComposer<[]>
directly + annotate the return type.
2026-05-11 21:09:37 +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 c37171a61c TS 5.7+ ArrayBuffer drift: cast where ArrayBufferLike leaked
TypeScript 5.7 split ArrayBuffer / SharedArrayBuffer at the type level
(ArrayBuffer now exposes resizable/transfer/detached etc; SharedArrayBuffer
doesn't), and parametrized the typed-array constructors so plain
Uint8Array became Uint8Array<ArrayBufferLike>.

The renderer never uses SharedArrayBuffer, so this is type-level only —
narrowing back to ArrayBuffer at the boundaries:

- BinaryReader.readBytes() / .toArrayBuffer() return the underlying
  DataView buffer; cast to ArrayBuffer.
- BinaryWriter.getBuffer() same shape.
- WsSessionCrypto.randomNonce() now returns Uint8Array<ArrayBuffer>
  (it's always backed by a plain ArrayBuffer); aesGcmEncrypt/Decrypt
  nonce parameter retyped accordingly so SubtleCrypto.encrypt accepts
  it as BufferSource.
- ArrayBufferToBase64 now accepts Uint8Array | ArrayBufferLike directly
  (pako/inflate hands back Uint8Array<ArrayBuffer> which the old
  ArrayBuffer-only signature rejected).
2026-05-11 21:09:22 +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 e82d3e03be chore(types): augment ImportMeta with glob signature
`AssetManager.loadRoomImages()` and friends use `import.meta.glob('./assets/...', { eager: true })`
to bundle PNG assets via Vite, but TypeScript doesn't see `glob` on
ImportMeta without pulling `vite/client` — which we avoid here so the
React client (which has its own asset declarations) keeps full control.

src/globals.d.ts adds just the `glob` signature, typed for the eager
image case (`Record<string, { default: string }>`). The call sites'
existing `mod.default ?? mod` narrowing still works.

Net renderer typecheck: 29 → 26 (-3 errors).
2026-05-10 21:46:10 +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 c7a5aea98a chore(ts): bump TypeScript 5.8 → 6.0 and add tsgo for fast type-checking
- typescript: ~5.8.2 → ^6.0.3 (matches Nitro-V3 client)
- adds @typescript/native-preview (tsgo) as TypeScript 7 preview
- new `compile:fast` script using tsgo (~7× faster: 2.5s vs 17.6s)
- tsconfig cleanup ahead of TypeScript 7 deprecations:
  - removed `baseUrl` (unused: no `paths` mappings on this project)
  - removed `downlevelIteration` (target ES2022 makes it a no-op)
  - `moduleResolution`: "Node" → "bundler" (vite consumes the renderer)

Compile errors: 28 → 29. Net +1 because TS 6's tightened lib types flag
two pre-existing crypto calls (WsSessionCrypto.ts:43,48) and resolves one
prior false positive. All errors are in pre-existing code, unrelated to
the new event/snapshot APIs from 791b8ad.
2026-05-10 19:27:37 +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
DuckieTM 98b03aa0be Merge pull request #68 from duckietm/Dev
Dev
2026-05-08 11:59:09 +02:00
DuckieTM 6bc4a45ee1 Merge pull request #67 from Lorenzune/merge-duckie-main-2026-05-06
Improve mobile room interaction handling
2026-05-08 08:00:59 +02:00
Lorenzune f7fc502685 Improve mobile room interaction handling 2026-05-07 21:21:48 +02:00
DuckieTM e5181c7c3c Merge pull request #66 from duckietm/Dev
Dev
2026-05-06 12:51:56 +02:00
DuckieTM 167d80620e Merge pull request #65 from Lorenzune/merge-duckie-main-2026-05-06
Merge live renderer updates into Dev
2026-05-06 07:08:15 +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 15b1954eac Merge pull request #64 from duckietm/Dev
🆙 Small update
2026-05-04 15:37:17 +02:00
duckietm 7a6092ed7e 🆙 Small update 2026-05-04 15:28:19 +02:00
DuckieTM 9c2e4e4a13 Merge pull request #63 from duckietm/Dev
🆙 Fix BlackHoles
2026-05-04 12:53:33 +02:00
duckietm 151a3db2f4 🆙 Fix BlackHoles 2026-05-04 12:53:18 +02:00
DuckieTM f46d28da24 Merge pull request #62 from duckietm/Dev
🆙 Fixed the Door not visable when window is on wall
2026-05-04 12:02:40 +02:00
duckietm 6ab93ee146 🆙 Fixed the Door not visable when window is on wall 2026-05-04 12:01:45 +02:00
DuckieTM c7c28466c5 Merge pull request #61 from duckietm/Dev
🆕 Card Background
2026-05-04 10:53:30 +02:00
duckietm 2f7b80e894 🆕 Card Background 2026-05-04 08:44:40 +02:00
DuckieTM 7113fabcf0 Merge pull request #59 from duckietm/Dev
🆙 Floorplan fix
2026-04-30 07:57:49 +02:00
duckietm 43dc054fed 🆙 Floorplan fix 2026-04-30 07:57:31 +02:00
DuckieTM f448816690 Merge pull request #58 from duckietm/Dev
🆕 Effect selection in user dropdown
2026-04-29 17:08:52 +02:00
duckietm 853204a5b8 🆕 Effect selection in user dropdown 2026-04-29 13:23:30 +02:00
DuckieTM 4e90350f60 Merge pull request #57 from duckietm/Dev
Dev
2026-04-28 09:45:33 +02:00
duckietm 2a707c3b8d 🆙 Cleanup log in console 2026-04-28 09:41:37 +02:00
duckietm d34f82c716 🆙 Bump renderer to V8.18.1 and replace clientjs with a better solution 2026-04-28 09:14:49 +02:00
Lorenzune 9abec36f02 Merge remote-tracking branch 'duckie/main' into duckie-live-merge-2026-04-21 2026-04-25 13:34:15 +02:00
DuckieTM 7cabbc89ce Merge pull request #56 from duckietm/Dev
🆙 CryptoV2
2026-04-24 16:24:26 +02:00
duckietm 455b75e41d 🆙 CryptoV2 2026-04-24 16:24:02 +02:00
DuckieTM 73f18a1e3f Merge pull request #55 from duckietm/Dev
🆙 Fix background clipping
2026-04-24 14:18:03 +02:00
duckietm e1cc87afa3 🆙 Fix background clipping 2026-04-24 13:55:18 +02:00
DuckieTM 7b36825bb0 Merge pull request #54 from duckietm/Dev
🆕 Handshake on connect
2026-04-23 15:57:52 +02:00
duckietm 7957a8f7f3 🆕 Handshake on connect 2026-04-23 15:57:24 +02:00
Lorenzune 7fa8eff751 Merge latest duckie renderer main 2026-04-21 11:53:28 +02:00
Lorenzune c37c7005fc Fix prefix composer imports after duckie merge 2026-04-21 11:23:38 +02:00
Lorenzune 1dede2c098 Merge remote-tracking branch 'duckie-temp/main' into duckie-merge-2026-04-21
# Conflicts:
#	packages/communication/src/NitroMessages.ts
#	packages/communication/src/messages/incoming/IncomingHeader.ts
#	packages/communication/src/messages/outgoing/OutgoingHeader.ts
2026-04-21 11:20:02 +02:00
Lorenzune 7bf552824f Sync renderer safety push 2026-04-21 08:57:35 +02:00
DuckieTM 6323914dfc Merge pull request #53 from duckietm/Dev
Dev
2026-04-17 14:26:35 +02:00
duckietm 078bba0780 🆙 Make have_offer read from emu 2026-04-17 14:24:15 +02:00
duckietm 4b598fc717 Revert "Merge pull request #48 from simoleo89/feature/catalog-admin-composers"
This reverts commit 67c8dd42cd, reversing
changes made to bc6bd8764d.
2026-04-17 14:03:47 +02:00
DuckieTM 67c8dd42cd Merge pull request #48 from simoleo89/feature/catalog-admin-composers
Feature/catalog admin composers
2026-04-17 13:56:46 +02:00
DuckieTM 8eaca5677c Merge pull request #52 from duckietm/Dev
🔥 Fix Avatar buddy they are now 100% as habbo
2026-04-17 13:54:12 +02:00
duckietm bc6bd8764d 🆙 Fix Catalog Editor 2026-04-17 13:53:07 +02:00
duckietm 2c2f03f20e 🔥 Fix Avatar buddy they are now 100% as habbo 2026-04-17 11:48:38 +02:00
DuckieTM cec4182f3c Merge pull request #51 from duckietm/Dev
Dev
2026-04-16 13:36:36 +02:00