#29 - VotePollCounterMessageComposer added (#87)

Co-authored-by: Bill <billsonnn@users.noreply.github.com>
This commit is contained in:
object 2023-05-09 17:36:13 +02:00 committed by GitHub
parent 5c2580881d
commit 81cfd5c56f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 2 deletions

View File

@ -31,6 +31,7 @@ export interface IRoomSession extends IDisposable
sendPollStartMessage(pollId: number): void; sendPollStartMessage(pollId: number): void;
sendPollRejectMessage(pollId: number): void; sendPollRejectMessage(pollId: number): void;
sendPollAnswerMessage(pollId: number, questionId: number, answers: string[]): void; sendPollAnswerMessage(pollId: number, questionId: number, answers: string[]): void;
votePoll(counter: number): void;
sendPeerUsersClassificationMessage(userClassType: string): void; sendPeerUsersClassificationMessage(userClassType: string): void;
sendRoomUsersClassificationMessage(userClassType: string): void; sendRoomUsersClassificationMessage(userClassType: string): void;
updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void; updateMoodlightData(id: number, effectId: number, color: number, brightness: number, apply: boolean): void;

File diff suppressed because one or more lines are too long

View File

@ -443,6 +443,7 @@ export class OutgoingHeader
public static POLL_ANSWER = 3505; public static POLL_ANSWER = 3505;
public static POLL_REJECT = 1773; public static POLL_REJECT = 1773;
public static POLL_START = 109; public static POLL_START = 109;
public static POLL_VOTE_COUNTER = 6200;
public static DISCONNECT = 2445; public static DISCONNECT = 2445;
public static SCR_GET_KICKBACK_INFO = 869; public static SCR_GET_KICKBACK_INFO = 869;
public static COMPOST_PLANT = 3835; public static COMPOST_PLANT = 3835;

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../api';
export class VotePollCounterMessageComposer implements IMessageComposer<ConstructorParameters<typeof VotePollCounterMessageComposer>>
{
private _data: ConstructorParameters<typeof VotePollCounterMessageComposer>;
constructor(counter: number)
{
this._data = [counter];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -1,3 +1,4 @@
export * from './PollAnswerComposer'; export * from './PollAnswerComposer';
export * from './PollRejectComposer'; export * from './PollRejectComposer';
export * from './PollStartComposer'; export * from './PollStartComposer';
export * from './VotePollCounterMessageComposer';

View File

@ -1,7 +1,7 @@
import { IConnection, IRoomSession, RoomControllerLevel, RoomTradingLevelEnum } from '../../api'; import { IConnection, IRoomSession, RoomControllerLevel, RoomTradingLevelEnum } from '../../api';
import { Disposable } from '../../core'; import { Disposable } from '../../core';
import { RoomSessionEvent } from '../../events'; import { RoomSessionEvent } from '../../events';
import { BotRemoveComposer, ChangeQueueMessageComposer, CompostPlantMessageComposer, FurnitureMultiStateComposer, GetPetCommandsComposer, HarvestPetMessageComposer, MoodlightSettingsComposer, MoodlightSettingsSaveComposer, MoodlightTogggleStateComposer, NewUserExperienceScriptProceedComposer, OpenPetPackageMessageComposer, OpenPresentComposer, PeerUsersClassificationMessageComposer, PetMountComposer, PetRemoveComposer, PollAnswerComposer, PollRejectComposer, PollStartComposer, RemovePetSaddleComposer, RoomAmbassadorAlertComposer, RoomBanUserComposer, RoomDoorbellAccessComposer, RoomEnterComposer, RoomGiveRightsComposer, RoomKickUserComposer, RoomModerationSettings, RoomMuteUserComposer, RoomTakeRightsComposer, RoomUnitActionComposer, RoomUnitChatComposer, RoomUnitChatShoutComposer, RoomUnitChatWhisperComposer, RoomUnitDanceComposer, RoomUnitPostureComposer, RoomUnitSignComposer, RoomUnitTypingStartComposer, RoomUnitTypingStopComposer, RoomUsersClassificationMessageComposer, SetClothingChangeDataMessageComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer, UserMottoComposer } from '../communication'; import { BotRemoveComposer, ChangeQueueMessageComposer, CompostPlantMessageComposer, FurnitureMultiStateComposer, GetPetCommandsComposer, HarvestPetMessageComposer, MoodlightSettingsComposer, MoodlightSettingsSaveComposer, MoodlightTogggleStateComposer, NewUserExperienceScriptProceedComposer, OpenPetPackageMessageComposer, OpenPresentComposer, PeerUsersClassificationMessageComposer, PetMountComposer, PetRemoveComposer, PollAnswerComposer, PollRejectComposer, PollStartComposer, RemovePetSaddleComposer, RoomAmbassadorAlertComposer, RoomBanUserComposer, RoomDoorbellAccessComposer, RoomEnterComposer, RoomGiveRightsComposer, RoomKickUserComposer, RoomModerationSettings, RoomMuteUserComposer, RoomTakeRightsComposer, RoomUnitActionComposer, RoomUnitChatComposer, RoomUnitChatShoutComposer, RoomUnitChatWhisperComposer, RoomUnitDanceComposer, RoomUnitPostureComposer, RoomUnitSignComposer, RoomUnitTypingStartComposer, RoomUnitTypingStopComposer, RoomUsersClassificationMessageComposer, SetClothingChangeDataMessageComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer, UserMottoComposer, VotePollCounterMessageComposer } from '../communication';
import { UserDataManager } from './UserDataManager'; import { UserDataManager } from './UserDataManager';
export class RoomSession extends Disposable implements IRoomSession export class RoomSession extends Disposable implements IRoomSession
@ -331,6 +331,11 @@ export class RoomSession extends Disposable implements IRoomSession
this._connection.send(new ChangeQueueMessageComposer(targetQueue)); this._connection.send(new ChangeQueueMessageComposer(targetQueue));
} }
public votePoll(counter: number): void
{
this._connection.send(new VotePollCounterMessageComposer(counter));
}
public get connection(): IConnection public get connection(): IConnection
{ {
return this._connection; return this._connection;