add poll methods to RoomSession

This commit is contained in:
dank074 2021-11-16 01:01:05 -06:00
parent 1cedce0a76
commit 52954806f8
2 changed files with 19 additions and 1 deletions

View File

@ -28,6 +28,9 @@ export interface IRoomSession extends IDisposable
sendBanMessage(userId: number, type: string): void;
sendGiveRightsMessage(userId: number): void;
sendTakeRightsMessage(userId: number): void;
sendPollStartMessage(pollId:number):void;
sendPollRejectMessage(pollId:number):void;
sendPollAnswerMessage(pollId:number, questionId:number, answers:string[]):void;
updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void;
toggleMoodlightState(): void;
pickupPet(id: number): void;

View File

@ -1,6 +1,6 @@
import { Disposable } from '../../core/common/disposable/Disposable';
import { IConnection } from '../../core/communication/connections/IConnection';
import { FurnitureMultiStateComposer, PetMountComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication';
import { FurnitureMultiStateComposer, PetMountComposer, PollAnswerComposer, PollRejectComposer, PollStartComposer, RemovePetSaddleComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer } from '../communication';
import { RoomDoorbellAccessComposer } from '../communication/messages/outgoing/room/access/RoomDoorbellAccessComposer';
import { RoomEnterComposer } from '../communication/messages/outgoing/room/access/RoomEnterComposer';
import { RoomAmbassadorAlertComposer } from '../communication/messages/outgoing/room/action/RoomAmbassadorAlertComposer';
@ -225,6 +225,21 @@ export class RoomSession extends Disposable implements IRoomSession
this._connection.send(new RoomTakeRightsComposer(userId));
}
public sendPollStartMessage(pollId:number):void
{
this._connection.send(new PollStartComposer(pollId));
}
public sendPollRejectMessage(pollId:number):void
{
this._connection.send(new PollRejectComposer(pollId));
}
public sendPollAnswerMessage(pollId:number, questionId:number, answers:string[]):void
{
this._connection.send(new PollAnswerComposer(pollId, questionId, answers));
}
public updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void
{
let colorString = '000000' + color.toString(16).toUpperCase();