From 52954806f809e4d3aaa5e785fc8067a765b0a0b0 Mon Sep 17 00:00:00 2001 From: dank074 Date: Tue, 16 Nov 2021 01:01:05 -0600 Subject: [PATCH] add poll methods to RoomSession --- src/nitro/session/IRoomSession.ts | 3 +++ src/nitro/session/RoomSession.ts | 17 ++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/nitro/session/IRoomSession.ts b/src/nitro/session/IRoomSession.ts index d4847481..8b3ee921 100644 --- a/src/nitro/session/IRoomSession.ts +++ b/src/nitro/session/IRoomSession.ts @@ -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; diff --git a/src/nitro/session/RoomSession.ts b/src/nitro/session/RoomSession.ts index 34df6dff..751eaeaf 100644 --- a/src/nitro/session/RoomSession.ts +++ b/src/nitro/session/RoomSession.ts @@ -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();