mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-17 02:22:36 +01:00
added quest incoming messages
This commit is contained in:
parent
30f6dda417
commit
c74432feab
@ -113,6 +113,17 @@ import { NotificationDialogMessageEvent } from './messages/incoming/notification
|
||||
import { PetPlacingErrorEvent } from './messages/incoming/notifications/PetPlacingErrorEvent';
|
||||
import { RespectReceivedEvent } from './messages/incoming/notifications/RespectReceivedEvent';
|
||||
import { UnseenItemsEvent } from './messages/incoming/notifications/UnseenItemsEvent';
|
||||
import { CommunityGoalEarnedPrizesMessageEvent } from './messages/incoming/quest/CommunityGoalEarnedPrizesMessageEvent';
|
||||
import { CommunityGoalHallOfFameMessageEvent } from './messages/incoming/quest/CommunityGoalHallOfFameMessageEvent';
|
||||
import { CommunityGoalProgressMessageEvent } from './messages/incoming/quest/CommunityGoalProgressMessageEvent';
|
||||
import { ConcurrentUsersGoalProgressMessageEvent } from './messages/incoming/quest/ConcurrentUsersGoalProgressMessageEvent';
|
||||
import { EpicPopupMessageEvent } from './messages/incoming/quest/EpicPopupMessageEvent';
|
||||
import { QuestCancelledMessageEvent } from './messages/incoming/quest/QuestCancelledMessageEvent';
|
||||
import { QuestCompletedMessageEvent } from './messages/incoming/quest/QuestCompletedMessageEvent';
|
||||
import { QuestDailyMessageEvent } from './messages/incoming/quest/QuestDailyMessageEvent';
|
||||
import { QuestMessageEvent } from './messages/incoming/quest/QuestMessageEvent';
|
||||
import { QuestsMessageEvent } from './messages/incoming/quest/QuestsMessageEvent';
|
||||
import { SeasonalQuestsMessageEvent } from './messages/incoming/quest/SeasonalQuestsMessageEvent';
|
||||
import { RoomDoorbellAcceptedEvent } from './messages/incoming/room/access/doorbell/RoomDoorbellAcceptedEvent';
|
||||
import { RoomDoorbellEvent } from './messages/incoming/room/access/doorbell/RoomDoorbellEvent';
|
||||
import { RoomDoorbellRejectedEvent } from './messages/incoming/room/access/doorbell/RoomDoorbellRejectedEvent';
|
||||
@ -753,6 +764,19 @@ export class NitroMessages implements IMessageConfiguration
|
||||
// LANDING VIEW
|
||||
this._events.set(IncomingHeader.COMMUNITY_GOAL_VOTE_EVENT, CommunityGoalVoteMessageEvent);
|
||||
this._events.set(IncomingHeader.PROMO_ARTICLES, PromoArticlesMessageEvent);
|
||||
|
||||
// QUESTS
|
||||
this._events.set(IncomingHeader.COMMUNITY_GOAL_EARNED_PRIZES, CommunityGoalEarnedPrizesMessageEvent);
|
||||
this._events.set(IncomingHeader.COMMUNITY_GOAL_PROGRESS, CommunityGoalProgressMessageEvent);
|
||||
this._events.set(IncomingHeader.CONCURRENT_USERS_GOAL_PROGRESS, ConcurrentUsersGoalProgressMessageEvent);
|
||||
this._events.set(IncomingHeader.QUEST_DAILY, QuestDailyMessageEvent);
|
||||
this._events.set(IncomingHeader.QUEST_CANCELLED, QuestCancelledMessageEvent);
|
||||
this._events.set(IncomingHeader.QUEST_COMPLETED, QuestCompletedMessageEvent);
|
||||
this._events.set(IncomingHeader.COMMUNITY_GOAL_HALL_OF_FAME, CommunityGoalHallOfFameMessageEvent);
|
||||
this._events.set(IncomingHeader.EPIC_POPUP, EpicPopupMessageEvent);
|
||||
this._events.set(IncomingHeader.SEASONAL_QUESTS, SeasonalQuestsMessageEvent);
|
||||
this._events.set(IncomingHeader.QUESTS, QuestsMessageEvent);
|
||||
this._events.set(IncomingHeader.QUEST, QuestMessageEvent);
|
||||
}
|
||||
|
||||
private registerComposers(): void
|
||||
|
@ -254,4 +254,15 @@ export class IncomingHeader
|
||||
public static PET_EXPERIENCE = 2156;
|
||||
public static COMMUNITY_GOAL_VOTE_EVENT = 1435;
|
||||
public static PROMO_ARTICLES = 286;
|
||||
public static COMMUNITY_GOAL_EARNED_PRIZES = 3319;
|
||||
public static COMMUNITY_GOAL_PROGRESS = 2525;
|
||||
public static CONCURRENT_USERS_GOAL_PROGRESS = 2737;
|
||||
public static QUEST_DAILY = 1878;
|
||||
public static QUEST_CANCELLED = 3027;
|
||||
public static QUEST_COMPLETED = 949;
|
||||
public static COMMUNITY_GOAL_HALL_OF_FAME = 3005;
|
||||
public static EPIC_POPUP = 3945;
|
||||
public static SEASONAL_QUESTS = 1122;
|
||||
public static QUESTS = 3625;
|
||||
public static QUEST = 230;
|
||||
}
|
||||
|
@ -22,11 +22,13 @@ export * from './inventory/furni/gifts';
|
||||
export * from './inventory/marketplace';
|
||||
export * from './inventory/pets';
|
||||
export * from './inventory/trading';
|
||||
export * from './landingview';
|
||||
export * from './moderation';
|
||||
export * from './modtool';
|
||||
export * from './mysterybox';
|
||||
export * from './navigator';
|
||||
export * from './notifications';
|
||||
export * from './quest';
|
||||
export * from './room';
|
||||
export * from './room/access';
|
||||
export * from './room/access/doorbell';
|
||||
|
@ -0,0 +1,3 @@
|
||||
export * from './PromoArticleData';
|
||||
export * from './PromoArticlesMessageEvent';
|
||||
export * from './votes';
|
@ -0,0 +1 @@
|
||||
export * from './CommunityGoalVoteMessageEvent';
|
@ -0,0 +1,96 @@
|
||||
import { IDisposable } from '../../../../../core/common/disposable/IDisposable';
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
|
||||
export class CommunityGoalData implements IDisposable
|
||||
{
|
||||
private _hasGoalExpired: boolean;
|
||||
private _personalContributionScore: number;
|
||||
private _personalContributionRank: number;
|
||||
private _communityTotalScore: number;
|
||||
private _communityHighestAchievedLevel: number;
|
||||
private _scoreRemainingUntilNextLevel: number;
|
||||
private _percentCompletionTowardsNextLevel: number;
|
||||
private _goalCode: string;
|
||||
private _timeRemainingInSeconds: number;
|
||||
private _rewardUserLimits: number[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._rewardUserLimits = [];
|
||||
this._hasGoalExpired = wrapper.readBoolean();
|
||||
this._personalContributionScore = wrapper.readInt();
|
||||
this._personalContributionRank = wrapper.readInt();
|
||||
this._communityTotalScore = wrapper.readInt();
|
||||
this._communityHighestAchievedLevel = wrapper.readInt();
|
||||
this._scoreRemainingUntilNextLevel = wrapper.readInt();
|
||||
this._percentCompletionTowardsNextLevel = wrapper.readInt();
|
||||
this._goalCode = wrapper.readString();
|
||||
this._timeRemainingInSeconds = wrapper.readInt();
|
||||
|
||||
const count = wrapper.readInt();
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._rewardUserLimits.push(wrapper.readInt());
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
this._rewardUserLimits = null;
|
||||
}
|
||||
|
||||
public get disposed(): boolean
|
||||
{
|
||||
return this._rewardUserLimits == null;
|
||||
}
|
||||
|
||||
public get hasGoalExpired(): boolean
|
||||
{
|
||||
return this._hasGoalExpired;
|
||||
}
|
||||
|
||||
public get personalContributionScore(): number
|
||||
{
|
||||
return this._personalContributionScore;
|
||||
}
|
||||
|
||||
public get personalContributionRank(): number
|
||||
{
|
||||
return this._personalContributionRank;
|
||||
}
|
||||
|
||||
public get communityTotalScore(): number
|
||||
{
|
||||
return this._communityTotalScore;
|
||||
}
|
||||
|
||||
public get communityHighestAchievedLevel(): number
|
||||
{
|
||||
return this._communityHighestAchievedLevel;
|
||||
}
|
||||
|
||||
public get scoreRemainingUntilNextLevel(): number
|
||||
{
|
||||
return this._scoreRemainingUntilNextLevel;
|
||||
}
|
||||
|
||||
public get percentCompletionTowardsNextLevel(): number
|
||||
{
|
||||
return this._percentCompletionTowardsNextLevel;
|
||||
}
|
||||
|
||||
public get timeRemainingInSeconds(): number
|
||||
{
|
||||
return this._timeRemainingInSeconds;
|
||||
}
|
||||
|
||||
public get rewardUserLimits(): number[]
|
||||
{
|
||||
return this._rewardUserLimits;
|
||||
}
|
||||
|
||||
public get goalCode(): string
|
||||
{
|
||||
return this._goalCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { CommunityGoalEarnedPrizesMessageParser } from '../../parser/quest/CommunityGoalEarnedPrizesMessageParser';
|
||||
|
||||
export class CommunityGoalEarnedPrizesMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CommunityGoalEarnedPrizesMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CommunityGoalEarnedPrizesMessageParser
|
||||
{
|
||||
return this.parser as CommunityGoalEarnedPrizesMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import { IDisposable } from '../../../../../core/common/disposable/IDisposable';
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { HallOfFameEntryData } from './HallOfFameEntryData';
|
||||
|
||||
export class CommunityGoalHallOfFameData implements IDisposable
|
||||
{
|
||||
private _goalCode: string;
|
||||
private _hof: HallOfFameEntryData[];
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._hof = [];
|
||||
this._goalCode = wrapper.readString();
|
||||
|
||||
const count = wrapper.readInt();
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._hof.push(new HallOfFameEntryData(wrapper));
|
||||
}
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
this._hof = null;
|
||||
}
|
||||
|
||||
public get disposed(): boolean
|
||||
{
|
||||
return this._hof == null;
|
||||
}
|
||||
|
||||
public get hof(): HallOfFameEntryData[]
|
||||
{
|
||||
return this._hof;
|
||||
}
|
||||
|
||||
public get goalCode(): string
|
||||
{
|
||||
return this._goalCode;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { CommunityGoalHallOfFameMessageParser } from '../../parser/quest/CommunityGoalHallOfFameMessageParser';
|
||||
|
||||
export class CommunityGoalHallOfFameMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CommunityGoalHallOfFameMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CommunityGoalHallOfFameMessageParser
|
||||
{
|
||||
return this.parser as CommunityGoalHallOfFameMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { CommunityGoalProgressMessageParser } from '../../parser/quest/CommunityGoalProgressMessageParser';
|
||||
|
||||
export class CommunityGoalProgressMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, CommunityGoalProgressMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): CommunityGoalProgressMessageParser
|
||||
{
|
||||
return this.parser as CommunityGoalProgressMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { ConcurrentUsersGoalProgressMessageParser } from '../../parser/quest/ConcurrentUsersGoalProgressMessageParser';
|
||||
|
||||
export class ConcurrentUsersGoalProgressMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, ConcurrentUsersGoalProgressMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): ConcurrentUsersGoalProgressMessageParser
|
||||
{
|
||||
return this.parser as ConcurrentUsersGoalProgressMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { EpicPopupMessageParser } from '../../parser/quest/EpicPopupMessageParser';
|
||||
|
||||
export class EpicPopupMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, EpicPopupMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): EpicPopupMessageParser
|
||||
{
|
||||
return this.parser as EpicPopupMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { ILandingPageUserEntry } from './ILandingPageUserEntry';
|
||||
|
||||
export class HallOfFameEntryData implements ILandingPageUserEntry
|
||||
{
|
||||
private _userId: number;
|
||||
private _userName: string;
|
||||
private _figure: string;
|
||||
private _rank: number;
|
||||
private _currentScore: number;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._userId = wrapper.readInt();
|
||||
this._userName = wrapper.readString();
|
||||
this._figure = wrapper.readString();
|
||||
this._rank = wrapper.readInt();
|
||||
this._currentScore = wrapper.readInt();
|
||||
}
|
||||
|
||||
public get userId(): number
|
||||
{
|
||||
return this._userId;
|
||||
}
|
||||
|
||||
public get userName(): string
|
||||
{
|
||||
return this._userName;
|
||||
}
|
||||
|
||||
public get figure(): string
|
||||
{
|
||||
return this._figure;
|
||||
}
|
||||
|
||||
public get rank(): number
|
||||
{
|
||||
return this._rank;
|
||||
}
|
||||
|
||||
public get currentScore(): number
|
||||
{
|
||||
return this._currentScore;
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
export interface ILandingPageUserEntry
|
||||
{
|
||||
get userId(): number;
|
||||
get userName(): string;
|
||||
get figure(): string;
|
||||
}
|
51
src/nitro/communication/messages/incoming/quest/PrizeData.ts
Normal file
51
src/nitro/communication/messages/incoming/quest/PrizeData.ts
Normal file
@ -0,0 +1,51 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
|
||||
export class PrizeData
|
||||
{
|
||||
private _communityGoalId: number;
|
||||
private _communityGoalCode: string;
|
||||
private _userRank: number;
|
||||
private _rewardCode: string;
|
||||
private _badge: boolean;
|
||||
private _localizedName: string;
|
||||
|
||||
constructor(k: IMessageDataWrapper)
|
||||
{
|
||||
this._communityGoalId = k.readInt();
|
||||
this._communityGoalCode = k.readString();
|
||||
this._userRank = k.readInt();
|
||||
this._rewardCode = k.readString();
|
||||
this._badge = k.readBoolean();
|
||||
this._localizedName = k.readString();
|
||||
}
|
||||
|
||||
public get communityGoalId(): number
|
||||
{
|
||||
return this._communityGoalId;
|
||||
}
|
||||
|
||||
public get communityGoalCode(): string
|
||||
{
|
||||
return this._communityGoalCode;
|
||||
}
|
||||
|
||||
public get userRank(): number
|
||||
{
|
||||
return this._userRank;
|
||||
}
|
||||
|
||||
public get rewardCode(): string
|
||||
{
|
||||
return this._rewardCode;
|
||||
}
|
||||
|
||||
public get badge(): boolean
|
||||
{
|
||||
return this._badge;
|
||||
}
|
||||
|
||||
public get localizedName(): string
|
||||
{
|
||||
return this._localizedName;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { QuestCancelledMessageParser } from '../../parser/quest/QuestCancelledMessageParser';
|
||||
|
||||
export class QuestCancelledMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, QuestCancelledMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): QuestCancelledMessageParser
|
||||
{
|
||||
return this.parser as QuestCancelledMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { QuestCompletedMessageParser } from '../../parser/quest/QuestCompletedMessageParser';
|
||||
|
||||
export class QuestCompletedMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, QuestCompletedMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): QuestCompletedMessageParser
|
||||
{
|
||||
return this.parser as QuestCompletedMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { QuestDailyMessageParser } from '../../parser/quest/QuestDailyMessageParser';
|
||||
|
||||
export class QuestDailyMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, QuestDailyMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): QuestDailyMessageParser
|
||||
{
|
||||
return this.parser as QuestDailyMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,186 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
|
||||
export class QuestMessageData
|
||||
{
|
||||
private _campaignCode: string;
|
||||
private _completedQuestsInCampaign: number;
|
||||
private _questCountInCampaign: number;
|
||||
private _activityPointType: number;
|
||||
private _id: number;
|
||||
private _accepted: boolean;
|
||||
private _type: string;
|
||||
private _imageVersion: string;
|
||||
private _rewardCurrencyAmount: number;
|
||||
private _localizationCode: string;
|
||||
private _completedSteps: number;
|
||||
private _totalSteps: number;
|
||||
private _waitPeriodSeconds: number;
|
||||
private _sortOrder: number;
|
||||
private _catalogPageName: string;
|
||||
private _chainCode: string;
|
||||
private _easy: boolean;
|
||||
private _receiveTime: Date;
|
||||
|
||||
constructor(wrapper: IMessageDataWrapper)
|
||||
{
|
||||
this._receiveTime = new Date();
|
||||
this._campaignCode = wrapper.readString();
|
||||
this._completedQuestsInCampaign = wrapper.readInt();
|
||||
this._questCountInCampaign = wrapper.readInt();
|
||||
this._activityPointType = wrapper.readInt();
|
||||
this._id = wrapper.readInt();
|
||||
this._accepted = wrapper.readBoolean();
|
||||
this._type = wrapper.readString();
|
||||
this._imageVersion = wrapper.readString();
|
||||
this._rewardCurrencyAmount = wrapper.readInt();
|
||||
this._localizationCode = wrapper.readString();
|
||||
this._completedSteps = wrapper.readInt();
|
||||
this._totalSteps = wrapper.readInt();
|
||||
this._sortOrder = wrapper.readInt();
|
||||
this._catalogPageName = wrapper.readString();
|
||||
this._chainCode = wrapper.readString();
|
||||
this._easy = wrapper.readBoolean();
|
||||
}
|
||||
|
||||
public static getCampaignLocalizationKeyForCode(k: string): string
|
||||
{
|
||||
return 'quests.' + k;
|
||||
}
|
||||
|
||||
public get campaignCode(): string
|
||||
{
|
||||
return this._campaignCode;
|
||||
}
|
||||
|
||||
public get localizationCode(): string
|
||||
{
|
||||
return this._localizationCode;
|
||||
}
|
||||
|
||||
public get completedQuestsInCampaign(): number
|
||||
{
|
||||
return this._completedQuestsInCampaign;
|
||||
}
|
||||
|
||||
public get questCountInCampaign(): number
|
||||
{
|
||||
return this._questCountInCampaign;
|
||||
}
|
||||
|
||||
public get activityPointType(): number
|
||||
{
|
||||
return this._activityPointType;
|
||||
}
|
||||
|
||||
public set accepted(k: boolean)
|
||||
{
|
||||
this._accepted = k;
|
||||
}
|
||||
|
||||
public get accepted(): boolean
|
||||
{
|
||||
return this._accepted;
|
||||
}
|
||||
|
||||
public set id(k: number)
|
||||
{
|
||||
this._id = k;
|
||||
}
|
||||
|
||||
public get id(): number
|
||||
{
|
||||
return this._id;
|
||||
}
|
||||
|
||||
public get type(): string
|
||||
{
|
||||
return this._type;
|
||||
}
|
||||
|
||||
public get imageVersion(): string
|
||||
{
|
||||
return this._imageVersion;
|
||||
}
|
||||
|
||||
public get rewardCurrencyAmount(): number
|
||||
{
|
||||
return this._rewardCurrencyAmount;
|
||||
}
|
||||
|
||||
public get completedSteps(): number
|
||||
{
|
||||
return this._completedSteps;
|
||||
}
|
||||
|
||||
public get totalSteps(): number
|
||||
{
|
||||
return this._totalSteps;
|
||||
}
|
||||
|
||||
public get isCompleted(): boolean
|
||||
{
|
||||
return this._completedSteps == this._totalSteps;
|
||||
}
|
||||
|
||||
public set waitPeriodSeconds(k: number)
|
||||
{
|
||||
this._waitPeriodSeconds = k;
|
||||
}
|
||||
|
||||
public get waitPeriodSeconds(): number
|
||||
{
|
||||
if(this._waitPeriodSeconds < 1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
const k = new Date();
|
||||
const _local_2 = (k.getTime() - this._receiveTime.getTime());
|
||||
const _local_3 = Math.max(0, (this._waitPeriodSeconds - Math.floor((_local_2 / 1000))));
|
||||
return _local_3;
|
||||
}
|
||||
|
||||
public getCampaignLocalizationKey(): string
|
||||
{
|
||||
return QuestMessageData.getCampaignLocalizationKeyForCode(this.campaignCode);
|
||||
}
|
||||
|
||||
public getQuestLocalizationKey(): string
|
||||
{
|
||||
return (this.getCampaignLocalizationKey() + '.') + this._localizationCode;
|
||||
}
|
||||
|
||||
public get completedCampaign(): boolean
|
||||
{
|
||||
return this._id < 1;
|
||||
}
|
||||
|
||||
public get lastQuestInCampaign(): boolean
|
||||
{
|
||||
return this._completedQuestsInCampaign >= this._questCountInCampaign;
|
||||
}
|
||||
|
||||
public get receiveTime(): Date
|
||||
{
|
||||
return this._receiveTime;
|
||||
}
|
||||
|
||||
public get sortOrder(): number
|
||||
{
|
||||
return this._sortOrder;
|
||||
}
|
||||
|
||||
public get catalogPageName(): string
|
||||
{
|
||||
return this._catalogPageName;
|
||||
}
|
||||
|
||||
public get chainCode(): string
|
||||
{
|
||||
return this._chainCode;
|
||||
}
|
||||
|
||||
public get easy(): boolean
|
||||
{
|
||||
return this._easy;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { QuestMessageParser } from '../../parser/quest/QuestMessageParser';
|
||||
|
||||
export class QuestMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, QuestMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): QuestMessageParser
|
||||
{
|
||||
return this.parser as QuestMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { QuestsMessageParser } from '../../parser/quest/QuestsMessageParser';
|
||||
|
||||
export class QuestsMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, QuestsMessageParser);
|
||||
}
|
||||
|
||||
public getParser(): QuestsMessageParser
|
||||
{
|
||||
return this.parser as QuestsMessageParser;
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||
import { SeasonalQuestsParser } from '../../parser/quest/SeasonalQuestsParser';
|
||||
|
||||
export class SeasonalQuestsMessageEvent extends MessageEvent implements IMessageEvent
|
||||
{
|
||||
constructor(callBack: Function)
|
||||
{
|
||||
super(callBack, SeasonalQuestsParser);
|
||||
}
|
||||
|
||||
public getParser(): SeasonalQuestsParser
|
||||
{
|
||||
return this.parser as SeasonalQuestsParser;
|
||||
}
|
||||
}
|
17
src/nitro/communication/messages/incoming/quest/index.ts
Normal file
17
src/nitro/communication/messages/incoming/quest/index.ts
Normal file
@ -0,0 +1,17 @@
|
||||
export * from './CommunityGoalData';
|
||||
export * from './CommunityGoalEarnedPrizesMessageEvent';
|
||||
export * from './CommunityGoalHallOfFameData';
|
||||
export * from './CommunityGoalHallOfFameMessageEvent';
|
||||
export * from './CommunityGoalProgressMessageEvent';
|
||||
export * from './ConcurrentUsersGoalProgressMessageEvent';
|
||||
export * from './EpicPopupMessageEvent';
|
||||
export * from './HallOfFameEntryData';
|
||||
export * from './ILandingPageUserEntry';
|
||||
export * from './PrizeData';
|
||||
export * from './QuestCancelledMessageEvent';
|
||||
export * from './QuestCompletedMessageEvent';
|
||||
export * from './QuestDailyMessageEvent';
|
||||
export * from './QuestMessageData';
|
||||
export * from './QuestMessageEvent';
|
||||
export * from './QuestsMessageEvent';
|
||||
export * from './SeasonalQuestsMessageEvent';
|
@ -6,6 +6,7 @@ export * from './friendlist';
|
||||
export * from './group';
|
||||
export * from './handshake';
|
||||
export * from './inventory';
|
||||
export * from './landingview';
|
||||
export * from './modtool';
|
||||
export * from './navigator';
|
||||
export * from './OutgoingHeader';
|
||||
|
@ -0,0 +1,2 @@
|
||||
export * from './GetPromoArticlesComposer';
|
||||
export * from './votes';
|
@ -0,0 +1 @@
|
||||
export * from './CommunityGoalVoteMessageComposer';
|
@ -9,11 +9,13 @@ export * from './generic';
|
||||
export * from './group';
|
||||
export * from './help';
|
||||
export * from './inventory';
|
||||
export * from './landingview';
|
||||
export * from './moderation';
|
||||
export * from './modtool';
|
||||
export * from './mysterybox';
|
||||
export * from './navigator';
|
||||
export * from './notifications';
|
||||
export * from './quest';
|
||||
export * from './room';
|
||||
export * from './roomevents';
|
||||
export * from './security';
|
||||
|
@ -0,0 +1,2 @@
|
||||
export * from './PromoArticlesMessageParser';
|
||||
export * from './votes';
|
@ -0,0 +1 @@
|
||||
export * from './CommunityVoteReceivedParser';
|
@ -0,0 +1,31 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { PrizeData } from '../../incoming/quest/PrizeData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class CommunityGoalEarnedPrizesMessageParser implements IMessageParser
|
||||
{
|
||||
private _prizes: PrizeData[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._prizes = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
const count = wrapper.readInt();
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._prizes.push(new PrizeData(wrapper));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public get prizes(): PrizeData[]
|
||||
{
|
||||
return this._prizes;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { CommunityGoalHallOfFameData } from '../../incoming/quest/CommunityGoalHallOfFameData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class CommunityGoalHallOfFameMessageParser implements IMessageParser
|
||||
{
|
||||
private _data: CommunityGoalHallOfFameData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._data = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._data = new CommunityGoalHallOfFameData(wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): CommunityGoalHallOfFameData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { CommunityGoalData } from '../../incoming/quest/CommunityGoalData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class CommunityGoalProgressMessageParser implements IMessageParser
|
||||
{
|
||||
private _data: CommunityGoalData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._data = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper: IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._data = new CommunityGoalData(wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
public get data(): CommunityGoalData
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class ConcurrentUsersGoalProgressMessageParser implements IMessageParser
|
||||
{
|
||||
private _state: number;
|
||||
private _userCount: number;
|
||||
private _userCountGoal: number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._state = -1;
|
||||
this._userCount = -1;
|
||||
this._userCountGoal = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._state = wrapper.readInt();
|
||||
this._userCount = wrapper.readInt();
|
||||
this._userCountGoal = wrapper.readInt();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get state(): number
|
||||
{
|
||||
return this._state;
|
||||
}
|
||||
|
||||
public get userCount(): number
|
||||
{
|
||||
return this._userCount;
|
||||
}
|
||||
|
||||
public get userCountGoal(): number
|
||||
{
|
||||
return this._userCountGoal;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class EpicPopupMessageParser implements IMessageParser
|
||||
{
|
||||
private _imageUri: string;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._imageUri = '';
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._imageUri = wrapper.readString();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get imageUri():string
|
||||
{
|
||||
return this._imageUri;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class QuestCancelledMessageParser implements IMessageParser
|
||||
{
|
||||
private _expired: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._expired = wrapper.readBoolean();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get expired(): boolean
|
||||
{
|
||||
return this._expired;
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { QuestMessageData } from '../../incoming/quest/QuestMessageData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class QuestCompletedMessageParser implements IMessageParser
|
||||
{
|
||||
private _questData: QuestMessageData;
|
||||
private _showDialog: boolean;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._questData = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._questData = new QuestMessageData(wrapper);
|
||||
this._showDialog = wrapper.readBoolean();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get questData():QuestMessageData
|
||||
{
|
||||
return this._questData;
|
||||
}
|
||||
|
||||
public get showDialog(): boolean
|
||||
{
|
||||
return this._showDialog;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { QuestMessageData } from '../../incoming/quest/QuestMessageData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class QuestDailyMessageParser implements IMessageParser
|
||||
{
|
||||
private _quest:QuestMessageData;
|
||||
private _easyQuestCount:number;
|
||||
private _hardQuestCount:number;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._quest = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
const _local_2 = wrapper.readBoolean();
|
||||
if(_local_2)
|
||||
{
|
||||
this._quest = new QuestMessageData(wrapper);
|
||||
this._easyQuestCount = wrapper.readInt();
|
||||
this._hardQuestCount = wrapper.readInt();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public get quest(): QuestMessageData
|
||||
{
|
||||
return this._quest;
|
||||
}
|
||||
|
||||
public get easyQuestCount(): number
|
||||
{
|
||||
return this._easyQuestCount;
|
||||
}
|
||||
|
||||
public get hardQuestCount(): number
|
||||
{
|
||||
return this._hardQuestCount;
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { QuestMessageData } from '../../incoming/quest/QuestMessageData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class QuestMessageParser implements IMessageParser
|
||||
{
|
||||
private _quest: QuestMessageData;
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._quest = null;
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
this._quest = new QuestMessageData(wrapper);
|
||||
return true;
|
||||
}
|
||||
|
||||
public get quest():QuestMessageData
|
||||
{
|
||||
return this._quest;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
|
||||
import { QuestMessageData } from '../../incoming/quest/QuestMessageData';
|
||||
|
||||
export class QuestsMessageParser implements IMessageParser
|
||||
{
|
||||
private _quests: QuestMessageData[];
|
||||
private _openWindow: boolean;
|
||||
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._quests = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
const count = wrapper.readInt();
|
||||
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._quests.push(new QuestMessageData(wrapper));
|
||||
}
|
||||
|
||||
this._openWindow = wrapper.readBoolean();
|
||||
return true;
|
||||
}
|
||||
|
||||
public get quests(): QuestMessageData[]
|
||||
{
|
||||
return this._quests;
|
||||
}
|
||||
|
||||
public get openWindow(): boolean
|
||||
{
|
||||
return this._openWindow;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||
import { QuestMessageData } from '../../incoming/quest/QuestMessageData';
|
||||
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||
|
||||
export class SeasonalQuestsParser implements IMessageParser
|
||||
{
|
||||
private _quests: QuestMessageData[];
|
||||
|
||||
public flush(): boolean
|
||||
{
|
||||
this._quests = [];
|
||||
return true;
|
||||
}
|
||||
|
||||
public parse(wrapper:IMessageDataWrapper): boolean
|
||||
{
|
||||
if(!wrapper) return false;
|
||||
|
||||
const count = wrapper.readInt();
|
||||
|
||||
for(let i = 0; i < count; i++)
|
||||
{
|
||||
this._quests.push(new QuestMessageData(wrapper));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get quests(): QuestMessageData[]
|
||||
{
|
||||
return this._quests;
|
||||
}
|
||||
}
|
11
src/nitro/communication/messages/parser/quest/index.ts
Normal file
11
src/nitro/communication/messages/parser/quest/index.ts
Normal file
@ -0,0 +1,11 @@
|
||||
export * from './CommunityGoalEarnedPrizesMessageParser';
|
||||
export * from './CommunityGoalHallOfFameMessageParser';
|
||||
export * from './CommunityGoalProgressMessageParser';
|
||||
export * from './ConcurrentUsersGoalProgressMessageParser';
|
||||
export * from './EpicPopupMessageParser';
|
||||
export * from './QuestCancelledMessageParser';
|
||||
export * from './QuestCompletedMessageParser';
|
||||
export * from './QuestDailyMessageParser';
|
||||
export * from './QuestMessageParser';
|
||||
export * from './QuestsMessageParser';
|
||||
export * from './SeasonalQuestsParser';
|
Loading…
x
Reference in New Issue
Block a user