Renderer: surface allowUnderpass on RoomSettingsData + composer

Arcturus' RoomSettingsComposer appends an extra int at the end of the
payload — room.isAllowUnderpass() ? 1 : 0 — and RoomSettingsSaveEvent
optionally reads back a boolean at the end (if bytesAvailable > 0).
The renderer side never modeled this trailing field, so the client
couldn't surface or persist it.

- RoomSettingsData: add _allowUnderpass field + getter/setter +
  propagation through the .from() copy.
- RoomSettingsDataParser: read one trailing int after the moderation
  settings, guarded by 'if(wrapper.bytesAvailable)' so older servers
  that don't emit it keep parsing cleanly.
- SaveRoomSettingsComposer: optional trailing allowUnderpass arg. The
  server's optional-read guard tolerates 24-arg or 25-arg payloads, so
  callers that don't care about the field still send the legacy shape.

Cross-repo reference points:
- Arcturus emit side: Emulator/src/main/java/com/eu/habbo/messages/
  outgoing/rooms/RoomSettingsComposer.java line 55.
- Arcturus read side: Emulator/src/main/java/com/eu/habbo/messages/
  incoming/rooms/RoomSettingsSaveEvent.java lines 133-135.

Net client tsgo error count: 3 -> 0 on the NavigatorRoomSettings cluster.
This commit is contained in:
simoleo89
2026-05-11 21:46:36 +02:00
parent f7a5897232
commit ef6c661058
3 changed files with 20 additions and 1 deletions
@@ -32,7 +32,8 @@ implements
chatBubbleWeight: number, chatBubbleWeight: number,
chatBubbleSpeed: number, chatBubbleSpeed: number,
chatDistance: number, chatDistance: number,
chatFloodProtection: number chatFloodProtection: number,
allowUnderpass?: boolean
) )
{ {
//@ts-ignore //@ts-ignore
@@ -67,6 +68,8 @@ implements
chatDistance, chatDistance,
chatFloodProtection chatFloodProtection
); );
if(allowUnderpass !== undefined) this._data.push(allowUnderpass);
} }
public getMessageArray() public getMessageArray()
@@ -37,6 +37,7 @@ export class RoomSettingsData
private _roomModerationSettings: RoomModerationSettings = null; private _roomModerationSettings: RoomModerationSettings = null;
private _chatSettings: RoomChatSettings = null; private _chatSettings: RoomChatSettings = null;
private _allowNavigatorDynamicCats: boolean = false; private _allowNavigatorDynamicCats: boolean = false;
private _allowUnderpass: boolean = false;
public static from(settings: RoomSettingsData) public static from(settings: RoomSettingsData)
{ {
@@ -65,6 +66,7 @@ export class RoomSettingsData
instance._roomModerationSettings = settings._roomModerationSettings; instance._roomModerationSettings = settings._roomModerationSettings;
instance._chatSettings = settings._chatSettings; instance._chatSettings = settings._chatSettings;
instance._allowNavigatorDynamicCats = settings._allowNavigatorDynamicCats; instance._allowNavigatorDynamicCats = settings._allowNavigatorDynamicCats;
instance._allowUnderpass = settings._allowUnderpass;
return instance; return instance;
} }
@@ -329,4 +331,14 @@ export class RoomSettingsData
{ {
this._allowNavigatorDynamicCats = flag; this._allowNavigatorDynamicCats = flag;
} }
public get allowUnderpass(): boolean
{
return this._allowUnderpass;
}
public set allowUnderpass(flag: boolean)
{
this._allowUnderpass = flag;
}
} }
@@ -49,6 +49,10 @@ export class RoomSettingsDataParser implements IMessageParser
this._roomSettingsData.allowNavigatorDynamicCats = wrapper.readBoolean(); this._roomSettingsData.allowNavigatorDynamicCats = wrapper.readBoolean();
this._roomSettingsData.roomModerationSettings = new RoomModerationSettings(wrapper); this._roomSettingsData.roomModerationSettings = new RoomModerationSettings(wrapper);
// Custom Arcturus extension: trailing int (0/1) for the underpass toggle.
// Older servers may not emit it; default stays false when absent.
if(wrapper.bytesAvailable) this._roomSettingsData.allowUnderpass = (wrapper.readInt() === 1);
return true; return true;
} }