Fix room settings composer

This commit is contained in:
Bill 2022-05-25 19:00:36 -04:00
parent 3ffef1772a
commit f9bd2b21f6

View File

@ -1,10 +1,15 @@
import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer'; import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer';
export class SaveRoomSettingsComposer implements IMessageComposer<ConstructorParameters<typeof SaveRoomSettingsComposer>> export class SaveRoomSettingsComposer
implements
IMessageComposer<
ConstructorParameters<typeof SaveRoomSettingsComposer>
>
{ {
private _data: ConstructorParameters<typeof SaveRoomSettingsComposer>; private _data: ConstructorParameters<typeof SaveRoomSettingsComposer>;
constructor(roomId: number, constructor(
roomId: number,
roomName: string, roomName: string,
roomDescription: string, roomDescription: string,
lockState: number, lockState: number,
@ -30,16 +35,19 @@ export class SaveRoomSettingsComposer implements IMessageComposer<ConstructorPar
chatFloodProtection: number chatFloodProtection: number
) )
{ {
this._data = [ this._data.push(
roomId, roomId,
roomName, roomName,
roomDescription, roomDescription,
lockState, lockState,
password, password,
userCount, userCount,
categoryId, categoryId
tagsCount, );
tags,
this._data.push(tags.length, ...tags);
this._data.push(
tradeState, tradeState,
allowPets, allowPets,
allowPetsEat, allowPetsEat,
@ -55,7 +63,7 @@ export class SaveRoomSettingsComposer implements IMessageComposer<ConstructorPar
chatBubbleSpeed, chatBubbleSpeed,
chatDistance, chatDistance,
chatFloodProtection chatFloodProtection
]; );
} }
public getMessageArray() public getMessageArray()