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
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
This commit is contained in:
@@ -1,12 +1,23 @@
|
|||||||
import { IMessageComposer } from '@nitrots/api';
|
import { IMessageComposer } from '@nitrots/api';
|
||||||
|
|
||||||
export class RoomEnterComposer implements IMessageComposer<ConstructorParameters<typeof RoomEnterComposer>>
|
type RoomEnterPayload = [ number, string, number?, number? ];
|
||||||
{
|
|
||||||
private _data: ConstructorParameters<typeof RoomEnterComposer>;
|
|
||||||
|
|
||||||
constructor(roomId: number, password: string = null)
|
export class RoomEnterComposer implements IMessageComposer<RoomEnterPayload>
|
||||||
|
{
|
||||||
|
private _data: RoomEnterPayload;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Optional spawnX/spawnY let the server resume the avatar at a
|
||||||
|
* specific tile when re-entering the same room — used by the
|
||||||
|
* reconnect flow. Arcturus' RequestRoomLoadEvent reads both ints
|
||||||
|
* only if `packet.remaining >= 8`, so omitting them keeps the
|
||||||
|
* legacy enter-via-door behavior.
|
||||||
|
*/
|
||||||
|
constructor(roomId: number, password: string = null, spawnX?: number, spawnY?: number)
|
||||||
{
|
{
|
||||||
this._data = [roomId, password];
|
this._data = (spawnX !== undefined && spawnY !== undefined)
|
||||||
|
? [ roomId, password, spawnX, spawnY ]
|
||||||
|
: [ roomId, password ];
|
||||||
}
|
}
|
||||||
|
|
||||||
public getMessageArray()
|
public getMessageArray()
|
||||||
|
|||||||
Reference in New Issue
Block a user