add poll outgoing packets

This commit is contained in:
dank074 2021-11-14 03:50:44 -06:00
parent 7ad0b94ed7
commit d208aaa283
6 changed files with 55 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -372,4 +372,7 @@ export class OutgoingHeader
public static GUIDE_SESSION_RESOLVED = 887; public static GUIDE_SESSION_RESOLVED = 887;
public static POST_QUIZ_ANSWERS = 3720; public static POST_QUIZ_ANSWERS = 3720;
public static SEARCH_FAQS = 2031; public static SEARCH_FAQS = 2031;
public static POLL_ANSWER = 3505;
public static POLL_REJECT = 1773;
public static POLL_START = 109;
} }

View File

@ -20,6 +20,7 @@ export * from './moderation';
export * from './navigator'; export * from './navigator';
export * from './OutgoingHeader'; export * from './OutgoingHeader';
export * from './pet'; export * from './pet';
export * from './poll';
export * from './quest'; export * from './quest';
export * from './room'; export * from './room';
export * from './roomevents'; export * from './roomevents';

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
export class PollAnswerComposer implements IMessageComposer<any>
{
private _data: any;
constructor(pollId:number, questionId:number, answers:string[])
{
this._data = [ pollId, questionId, answers.length, ...answers ];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

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

View File

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