From d1841004784fbe3a87aa9d807f49e2181e1fa5e2 Mon Sep 17 00:00:00 2001 From: object <110488133+oobjectt@users.noreply.github.com> Date: Sun, 26 Nov 2023 15:19:19 +0100 Subject: [PATCH] Poll | Change name variables --- .../outgoing/poll/PollRejectComposer.ts | 4 ++-- .../outgoing/poll/PollStartComposer.ts | 4 ++-- .../parser/poll/PollContentsParser.ts | 18 +++++++-------- .../parser/poll/RoomPollResultParser.ts | 22 +++++++++---------- src/nitro/session/handler/PollHandler.ts | 2 +- 5 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts b/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts index 4fc7a57a..58b31b0a 100644 --- a/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts +++ b/src/nitro/communication/messages/outgoing/poll/PollRejectComposer.ts @@ -4,9 +4,9 @@ export class PollRejectComposer implements IMessageComposer; - constructor(k: number) + constructor(pollId: number) { - this._data = [k]; + this._data = [pollId]; } public getMessageArray() diff --git a/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts b/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts index 1782e553..790930d0 100644 --- a/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts +++ b/src/nitro/communication/messages/outgoing/poll/PollStartComposer.ts @@ -4,9 +4,9 @@ export class PollStartComposer implements IMessageComposer; - constructor(k: number) + constructor(pollId: number) { - this._data = [k]; + this._data = [pollId]; } public getMessageArray() diff --git a/src/nitro/communication/messages/parser/poll/PollContentsParser.ts b/src/nitro/communication/messages/parser/poll/PollContentsParser.ts index 1240dde6..d22058eb 100644 --- a/src/nitro/communication/messages/parser/poll/PollContentsParser.ts +++ b/src/nitro/communication/messages/parser/poll/PollContentsParser.ts @@ -45,21 +45,21 @@ export class PollContentsParser implements IMessageParser return true; } - private parsePollQuestion(k: IMessageDataWrapper): PollQuestion + private parsePollQuestion(wrapper: IMessageDataWrapper): PollQuestion { const pollQuestion = new PollQuestion(); - pollQuestion.questionId = k.readInt(); - pollQuestion.sortOrder = k.readInt(); - pollQuestion.questionType = k.readInt(); - pollQuestion.questionText = k.readString(); - pollQuestion.questionCategory = k.readInt(); - pollQuestion.questionAnswerType = k.readInt(); - pollQuestion.questionAnswerCount = k.readInt(); + pollQuestion.questionId = wrapper.readInt(); + pollQuestion.sortOrder = wrapper.readInt(); + pollQuestion.questionType = wrapper.readInt(); + pollQuestion.questionText = wrapper.readString(); + pollQuestion.questionCategory = wrapper.readInt(); + pollQuestion.questionAnswerType = wrapper.readInt(); + pollQuestion.questionAnswerCount = wrapper.readInt(); if(((pollQuestion.questionType == 1) || (pollQuestion.questionType == 2))) { for(let i = 0; i < pollQuestion.questionAnswerCount; i++) { - pollQuestion.questionChoices.push(new PollChoice(k.readString(), k.readString(), k.readInt())); + pollQuestion.questionChoices.push(new PollChoice(wrapper.readString(), wrapper.readString(), wrapper.readInt())); } } return pollQuestion; diff --git a/src/nitro/communication/messages/parser/poll/RoomPollResultParser.ts b/src/nitro/communication/messages/parser/poll/RoomPollResultParser.ts index 7d3569c8..db708065 100644 --- a/src/nitro/communication/messages/parser/poll/RoomPollResultParser.ts +++ b/src/nitro/communication/messages/parser/poll/RoomPollResultParser.ts @@ -4,15 +4,15 @@ export class RoomPollResultParser implements IMessageParser { private _question: string; private _choices: string[]; - private _SafeStr_7651: any[]; - private _SafeStr_7654: number; + private _results: any[]; + private _timer: number; flush(): boolean { this._question = null; this._choices = []; - this._SafeStr_7651 = []; - this._SafeStr_7654 = -1; + this._results = []; + this._timer = -1; return true; } @@ -21,18 +21,18 @@ export class RoomPollResultParser implements IMessageParser this._question = wrapper.readString(); this._choices = []; - this._SafeStr_7651 = []; + this._results = []; let totalChoices = wrapper.readInt(); while(totalChoices > 0) { this._choices.push(wrapper.readString()); - this._SafeStr_7651.push(wrapper.readInt()); + this._results.push(wrapper.readInt()); totalChoices--; } - this._SafeStr_7654 = wrapper.readInt(); + this._timer = wrapper.readInt(); return true; } @@ -47,13 +47,13 @@ export class RoomPollResultParser implements IMessageParser return this._choices; } - public get SafeStr_7651(): any[] + public get results(): any[] { - return this._SafeStr_7651; + return this._results; } - public get SafeStr_7654(): number + public get timer(): number { - return this._SafeStr_7654; + return this._timer; } } diff --git a/src/nitro/session/handler/PollHandler.ts b/src/nitro/session/handler/PollHandler.ts index b2a4bfb2..bba7d5c8 100644 --- a/src/nitro/session/handler/PollHandler.ts +++ b/src/nitro/session/handler/PollHandler.ts @@ -107,7 +107,7 @@ export class PollHandler extends BaseHandler if(!parser) return; - const pollEvent = new RoomSessionVoteEvent(RoomSessionVoteEvent.VOTE_RESULT, session, parser.question, parser.choices, parser.SafeStr_7651, parser.SafeStr_7654); + const pollEvent = new RoomSessionVoteEvent(RoomSessionVoteEvent.VOTE_RESULT, session, parser.question, parser.choices, parser.results, parser.timer); NitroEventDispatcher.dispatchEvent(pollEvent); }