Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export class PollRejectComposer implements IMessageComposer<ConstructorParameter
{
private _data: ConstructorParameters<typeof PollRejectComposer>;

constructor(k: number)
constructor(pollId: number)
{
this._data = [k];
this._data = [pollId];
}

public getMessageArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ export class PollStartComposer implements IMessageComposer<ConstructorParameters
{
private _data: ConstructorParameters<typeof PollStartComposer>;

constructor(k: number)
constructor(pollId: number)
{
this._data = [k];
this._data = [pollId];
}

public getMessageArray()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand All @@ -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;
}
}
2 changes: 1 addition & 1 deletion src/nitro/session/handler/PollHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down