mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-22 23:50:52 +01:00
Poll | Change name variables
This commit is contained in:
parent
961540b045
commit
d184100478
@ -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()
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user