mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-31 11:12:35 +01:00
added landing view packets
This commit is contained in:
parent
f281a54fb2
commit
30f6dda417
@ -85,6 +85,8 @@ import { TradingOpenEvent } from './messages/incoming/inventory/trading/TradingO
|
|||||||
import { TradingOpenFailedEvent } from './messages/incoming/inventory/trading/TradingOpenFailedEvent';
|
import { TradingOpenFailedEvent } from './messages/incoming/inventory/trading/TradingOpenFailedEvent';
|
||||||
import { TradingOtherNotAllowedEvent } from './messages/incoming/inventory/trading/TradingOtherNotAllowedEvent';
|
import { TradingOtherNotAllowedEvent } from './messages/incoming/inventory/trading/TradingOtherNotAllowedEvent';
|
||||||
import { TradingYouAreNotAllowedEvent } from './messages/incoming/inventory/trading/TradingYouAreNotAllowedEvent';
|
import { TradingYouAreNotAllowedEvent } from './messages/incoming/inventory/trading/TradingYouAreNotAllowedEvent';
|
||||||
|
import { PromoArticlesMessageEvent } from './messages/incoming/landingview/PromoArticlesMessageEvent';
|
||||||
|
import { CommunityGoalVoteMessageEvent } from './messages/incoming/landingview/votes/CommunityGoalVoteMessageEvent';
|
||||||
import { ModeratorMessageEvent } from './messages/incoming/moderation/ModeratorMessageEvent';
|
import { ModeratorMessageEvent } from './messages/incoming/moderation/ModeratorMessageEvent';
|
||||||
import { ModtoolCallForHelpTopicsEvent } from './messages/incoming/modtool/ModtoolCallForHelpTopicsEvent';
|
import { ModtoolCallForHelpTopicsEvent } from './messages/incoming/modtool/ModtoolCallForHelpTopicsEvent';
|
||||||
import { ModtoolMainEvent } from './messages/incoming/modtool/ModtoolMainEvent';
|
import { ModtoolMainEvent } from './messages/incoming/modtool/ModtoolMainEvent';
|
||||||
@ -284,6 +286,8 @@ import { TradingListAddItemsComposer } from './messages/outgoing/inventory/tradi
|
|||||||
import { TradingListItemRemoveComposer } from './messages/outgoing/inventory/trading/TradingListRemoveItemComposer';
|
import { TradingListItemRemoveComposer } from './messages/outgoing/inventory/trading/TradingListRemoveItemComposer';
|
||||||
import { TradingOpenComposer } from './messages/outgoing/inventory/trading/TradingOpenComposer';
|
import { TradingOpenComposer } from './messages/outgoing/inventory/trading/TradingOpenComposer';
|
||||||
import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer';
|
import { TradingUnacceptComposer } from './messages/outgoing/inventory/trading/TradingUnacceptComposer';
|
||||||
|
import { GetPromoArticlesComposer } from './messages/outgoing/landingview/GetPromoArticlesComposer';
|
||||||
|
import { CommunityGoalVoteMessageComposer } from './messages/outgoing/landingview/votes/CommunityGoalVoteMessageComposer';
|
||||||
import { ModtoolChangeRoomSettingsComposer } from './messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer';
|
import { ModtoolChangeRoomSettingsComposer } from './messages/outgoing/modtool/ModtoolChangeRoomSettingsComposer';
|
||||||
import { ModtoolEventAlertComposer } from './messages/outgoing/modtool/ModtoolEventAlertComposer';
|
import { ModtoolEventAlertComposer } from './messages/outgoing/modtool/ModtoolEventAlertComposer';
|
||||||
import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer';
|
import { ModtoolRequestRoomChatlogComposer } from './messages/outgoing/modtool/ModtoolRequestRoomChatlogComposer';
|
||||||
@ -745,6 +749,10 @@ export class NitroMessages implements IMessageConfiguration
|
|||||||
this._events.set(IncomingHeader.MARKETPLACE_ITEM_POSTED, MarketplaceItemPostedEvent);
|
this._events.set(IncomingHeader.MARKETPLACE_ITEM_POSTED, MarketplaceItemPostedEvent);
|
||||||
this._events.set(IncomingHeader.MARKETPLACE_ITEMS_SEARCHED, MarketplaceOffersReceivedEvent);
|
this._events.set(IncomingHeader.MARKETPLACE_ITEMS_SEARCHED, MarketplaceOffersReceivedEvent);
|
||||||
this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceBuyOfferResultEvent);
|
this._events.set(IncomingHeader.MARKETPLACE_AFTER_ORDER_STATUS, MarketplaceBuyOfferResultEvent);
|
||||||
|
|
||||||
|
// LANDING VIEW
|
||||||
|
this._events.set(IncomingHeader.COMMUNITY_GOAL_VOTE_EVENT, CommunityGoalVoteMessageEvent);
|
||||||
|
this._events.set(IncomingHeader.PROMO_ARTICLES, PromoArticlesMessageEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
private registerComposers(): void
|
private registerComposers(): void
|
||||||
@ -1060,6 +1068,10 @@ export class NitroMessages implements IMessageConfiguration
|
|||||||
this._composers.set(OutgoingHeader.USER_SETTINGS_OLD_CHAT, UserSettingsOldChatComposer);
|
this._composers.set(OutgoingHeader.USER_SETTINGS_OLD_CHAT, UserSettingsOldChatComposer);
|
||||||
this._composers.set(OutgoingHeader.USER_SETTINGS_INVITES, UserSettingsRoomInvitesComposer);
|
this._composers.set(OutgoingHeader.USER_SETTINGS_INVITES, UserSettingsRoomInvitesComposer);
|
||||||
this._composers.set(OutgoingHeader.USER_SETTINGS_VOLUME, UserSettingsSoundComposer);
|
this._composers.set(OutgoingHeader.USER_SETTINGS_VOLUME, UserSettingsSoundComposer);
|
||||||
|
|
||||||
|
// LANDING VIEW
|
||||||
|
this._composers.set(OutgoingHeader.COMMUNITY_GOAL_VOTE_COMPOSER, CommunityGoalVoteMessageComposer);
|
||||||
|
this._composers.set(OutgoingHeader.GET_PROMO_ARTICLES, GetPromoArticlesComposer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get events(): Map<number, Function>
|
public get events(): Map<number, Function>
|
||||||
|
@ -252,4 +252,6 @@ export class IncomingHeader
|
|||||||
public static CATALOG_APPROVE_NAME_RESULT = 1503;
|
public static CATALOG_APPROVE_NAME_RESULT = 1503;
|
||||||
public static OBJECTS_DATA_UPDATE = 1453;
|
public static OBJECTS_DATA_UPDATE = 1453;
|
||||||
public static PET_EXPERIENCE = 2156;
|
public static PET_EXPERIENCE = 2156;
|
||||||
|
public static COMMUNITY_GOAL_VOTE_EVENT = 1435;
|
||||||
|
public static PROMO_ARTICLES = 286;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,62 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
|
||||||
|
export class PromoArticleData
|
||||||
|
{
|
||||||
|
public static readonly LINK_TYPE_URL = 0;
|
||||||
|
public static readonly LINK_TYPE_INTERNAL = 1;
|
||||||
|
public static readonly LINK_TYPE_NO_LINK = 2;
|
||||||
|
|
||||||
|
private _id: number;
|
||||||
|
private _title: string;
|
||||||
|
private _bodyText: string;
|
||||||
|
private _buttonText: string;
|
||||||
|
private _linkType: number;
|
||||||
|
private _linkContent: string;
|
||||||
|
private _imageUrl: string;
|
||||||
|
|
||||||
|
constructor(k: IMessageDataWrapper)
|
||||||
|
{
|
||||||
|
this._id = k.readInt();
|
||||||
|
this._title = k.readString();
|
||||||
|
this._bodyText = k.readString();
|
||||||
|
this._buttonText = k.readString();
|
||||||
|
this._linkType = k.readInt();
|
||||||
|
this._linkContent = k.readString();
|
||||||
|
this._imageUrl = k.readString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public get id(): number
|
||||||
|
{
|
||||||
|
return this._id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get title(): string
|
||||||
|
{
|
||||||
|
return this._title;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get bodyText(): string
|
||||||
|
{
|
||||||
|
return this._bodyText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get buttonText(): string
|
||||||
|
{
|
||||||
|
return this._buttonText;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get linkType(): number
|
||||||
|
{
|
||||||
|
return this._linkType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get linkContent(): string
|
||||||
|
{
|
||||||
|
return this._linkContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get imageUrl(): string
|
||||||
|
{
|
||||||
|
return this._imageUrl;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { PromoArticlesMessageParser } from '../../parser/landingview/PromoArticlesMessageParser';
|
||||||
|
|
||||||
|
export class PromoArticlesMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, PromoArticlesMessageParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): PromoArticlesMessageParser
|
||||||
|
{
|
||||||
|
return this.parser as PromoArticlesMessageParser;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { CommunityVoteReceivedParser } from '../../../parser/landingview/votes/CommunityVoteReceivedParser';
|
||||||
|
|
||||||
|
export class CommunityGoalVoteMessageEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, CommunityVoteReceivedParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): CommunityVoteReceivedParser
|
||||||
|
{
|
||||||
|
return this.parser as CommunityVoteReceivedParser;
|
||||||
|
}
|
||||||
|
}
|
@ -246,4 +246,6 @@ export class OutgoingHeader
|
|||||||
public static TOGGLE_PET_BREEDING = 3379;
|
public static TOGGLE_PET_BREEDING = 3379;
|
||||||
public static UNSEEN_RESET_CATEGORY = 3493;
|
public static UNSEEN_RESET_CATEGORY = 3493;
|
||||||
public static UNSEEN_RESET_ITEMS = 2343;
|
public static UNSEEN_RESET_ITEMS = 2343;
|
||||||
|
public static COMMUNITY_GOAL_VOTE_COMPOSER = 3536;
|
||||||
|
public static GET_PROMO_ARTICLES = 1827;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
|
||||||
|
|
||||||
|
export class GetPromoArticlesComposer implements IMessageComposer<ConstructorParameters<typeof GetPromoArticlesComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof GetPromoArticlesComposer>;
|
||||||
|
|
||||||
|
constructor()
|
||||||
|
{
|
||||||
|
this._data = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer';
|
||||||
|
|
||||||
|
export class CommunityGoalVoteMessageComposer implements IMessageComposer<ConstructorParameters<typeof CommunityGoalVoteMessageComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof CommunityGoalVoteMessageComposer>;
|
||||||
|
|
||||||
|
constructor(voteOption: number)
|
||||||
|
{
|
||||||
|
this._data = [voteOption];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
import { PromoArticleData } from '../../incoming/landingview/PromoArticleData';
|
||||||
|
import { IMessageParser } from './../../../../../core/communication/messages/IMessageParser';
|
||||||
|
|
||||||
|
export class PromoArticlesMessageParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _articles: PromoArticleData[];
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._articles = [];
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
const count = wrapper.readInt();
|
||||||
|
|
||||||
|
for(let i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
this._articles.push(new PromoArticleData(wrapper));
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get articles(): PromoArticleData[]
|
||||||
|
{
|
||||||
|
return this._articles;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,24 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
import { IMessageParser } from './../../../../../../core/communication/messages/IMessageParser';
|
||||||
|
|
||||||
|
export class CommunityVoteReceivedParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _acknowledged: boolean;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
this._acknowledged = wrapper.readBoolean();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get acknowledged(): boolean
|
||||||
|
{
|
||||||
|
return this._acknowledged;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user