Update packets

This commit is contained in:
Bill 2021-08-25 23:04:50 -04:00
parent 1d346749e6
commit 728e643f40
13 changed files with 82 additions and 182 deletions

View File

@ -1,7 +1,6 @@
import { IMessageDataWrapper } from '../../../../../core'; import { IMessageDataWrapper } from '../../../../../core';
import { ICatalogLocalizationData } from '../../parser/catalog/utils/ICatalogLocalizationData';
export class CatalogLocalizationData implements ICatalogLocalizationData export class CatalogLocalizationData
{ {
private _images: string[]; private _images: string[];
private _texts: string[]; private _texts: string[];

View File

@ -0,0 +1,10 @@
export interface INodeData
{
visible: boolean;
icon: number;
pageId: number;
pageName: string;
localization: string;
children: INodeData[];
offerIds: number[];
}

View File

@ -22,6 +22,7 @@ export * from './GiftReceiverNotFoundEvent';
export * from './GiftWrappingConfigurationEvent'; export * from './GiftWrappingConfigurationEvent';
export * from './HabboClubExtendOfferMessageEvent'; export * from './HabboClubExtendOfferMessageEvent';
export * from './HabboClubOffersMessageEvent'; export * from './HabboClubOffersMessageEvent';
export * from './INodeData';
export * from './IsOfferGiftableMessageEvent'; export * from './IsOfferGiftableMessageEvent';
export * from './LimitedEditionSoldOutEvent'; export * from './LimitedEditionSoldOutEvent';
export * from './LimitedOfferAppearingNextMessageEvent'; export * from './LimitedOfferAppearingNextMessageEvent';

View File

@ -2,9 +2,8 @@ import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { CatalogLocalizationData } from '../../incoming/catalog/CatalogLocalizationData'; import { CatalogLocalizationData } from '../../incoming/catalog/CatalogLocalizationData';
import { CatalogPageMessageOfferData } from '../../incoming/catalog/CatalogPageMessageOfferData'; import { CatalogPageMessageOfferData } from '../../incoming/catalog/CatalogPageMessageOfferData';
import { FrontPageItem } from '../../incoming/catalog/FrontPageItem'; import { FrontPageItem } from '../../incoming/catalog/FrontPageItem';
import { ICatalogPageParser } from './utils/ICatalogPageParser';
export class CatalogPageMessageParser implements IMessageParser, ICatalogPageParser export class CatalogPageMessageParser implements IMessageParser
{ {
private _pageId: number; private _pageId: number;
private _catalogType: string; private _catalogType: string;

View File

@ -28,6 +28,5 @@ export * from './SellablePetPaletteData';
export * from './SellablePetPalettesParser'; export * from './SellablePetPalettesParser';
export * from './TargetedOfferNotFoundParser'; export * from './TargetedOfferNotFoundParser';
export * from './TargetedOfferParser'; export * from './TargetedOfferParser';
export * from './utils';
export * from './VoucherRedeemErrorMessageParser'; export * from './VoucherRedeemErrorMessageParser';
export * from './VoucherRedeemOkMessageParser'; export * from './VoucherRedeemOkMessageParser';

View File

@ -1,91 +0,0 @@
import { IMessageDataWrapper } from '../../../../../../core';
export class CatalogGroupData
{
private _id: number;
private _title: string;
private _badge: string;
private _colorA: string;
private _colorB: string;
private _isOwner: boolean;
private _ownerId: number;
private _hasForum: boolean;
constructor(wrapper: IMessageDataWrapper)
{
if(!wrapper) throw new Error('invalid_wrapper');
this.flush();
this.parse(wrapper);
}
public flush(): boolean
{
this._id = 0;
this._title = null;
this._badge = null;
this._colorA = null;
this._colorB = null;
this._isOwner = false;
this._ownerId = 0;
this._hasForum = false;
return true;
}
public parse(wrapper: IMessageDataWrapper): boolean
{
if(!wrapper) return false;
this._id = wrapper.readInt();
this._title = wrapper.readString();
this._badge = wrapper.readString();
this._colorA = wrapper.readString();
this._colorB = wrapper.readString();
this._isOwner = wrapper.readBoolean();
this._ownerId = wrapper.readInt();
this._hasForum = wrapper.readBoolean();
return true;
}
public get id(): number
{
return this._id;
}
public get title(): string
{
return this._title;
}
public get badge(): string
{
return this._badge;
}
public get colorA(): string
{
return this._colorA;
}
public get colorB(): string
{
return this._colorB;
}
public get isOwner(): boolean
{
return this._isOwner;
}
public get ownerId(): number
{
return this._ownerId;
}
public get hasForum(): boolean
{
return this._hasForum;
}
}

View File

@ -1,46 +0,0 @@
import { ICatalogPageData } from './ICatalogPageData';
export class CatalogSearchData implements ICatalogPageData
{
private _children: ICatalogPageData[];
constructor(pages: ICatalogPageData[])
{
this._children = pages;
}
public get children(): ICatalogPageData[]
{
return this._children;
}
public get icon(): number
{
return -1;
}
public get localization(): string
{
return '';
}
public get offerIds(): number[]
{
return [];
}
public get pageId(): number
{
return -1;
}
public get pageName(): string
{
return '';
}
public get visible(): boolean
{
return true;
}
}

View File

@ -1,5 +0,0 @@
export interface ICatalogLocalizationData
{
readonly images: string[];
readonly texts: string[];
}

View File

@ -1,10 +0,0 @@
export interface ICatalogPageData
{
visible: boolean;
icon: number;
pageId: number;
pageName: string;
localization: string;
children: ICatalogPageData[];
offerIds: number[];
}

View File

@ -1,16 +0,0 @@
import { CatalogPageMessageOfferData } from '../../../incoming/catalog/CatalogPageMessageOfferData';
import { FrontPageItem } from '../../../incoming/catalog/FrontPageItem';
import { ICatalogLocalizationData } from './ICatalogLocalizationData';
export interface ICatalogPageParser
{
readonly pageId: number;
readonly catalogType: string;
readonly layoutCode: string;
readonly localization: ICatalogLocalizationData;
readonly offers: CatalogPageMessageOfferData[];
readonly offerId: number;
readonly acceptSeasonCurrencyAsCredits: boolean;
readonly frontPageItems: FrontPageItem[];
}

View File

@ -1,5 +0,0 @@
export * from './CatalogGroupData';
export * from './CatalogSearchData';
export * from './ICatalogLocalizationData';
export * from './ICatalogPageData';
export * from './ICatalogPageParser';

View File

@ -1,9 +1,9 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../core'; import { IMessageDataWrapper, IMessageParser } from '../../../../../core';
import { CatalogGroupData } from '../catalog/utils/CatalogGroupData'; import { HabboGroupEntryData } from './HabboGroupEntryData';
export class GuildMembershipsMessageParser implements IMessageParser export class GuildMembershipsMessageParser implements IMessageParser
{ {
private _groups: CatalogGroupData[]; private _groups: HabboGroupEntryData[];
public flush(): boolean public flush(): boolean
{ {
@ -20,7 +20,7 @@ export class GuildMembershipsMessageParser implements IMessageParser
while(totalOffers > 0) while(totalOffers > 0)
{ {
this._groups.push(new CatalogGroupData(wrapper)); this._groups.push(new HabboGroupEntryData(wrapper));
totalOffers--; totalOffers--;
} }
@ -28,7 +28,7 @@ export class GuildMembershipsMessageParser implements IMessageParser
return true; return true;
} }
public get groups(): CatalogGroupData[] public get groups(): HabboGroupEntryData[]
{ {
return this._groups; return this._groups;
} }

View File

@ -0,0 +1,65 @@
import { IMessageDataWrapper } from '../../../../../core';
export class HabboGroupEntryData
{
private _groupId: number;
private _groupName: string;
private _badgeCode: string;
private _Str_6751: string;
private _Str_6979: string;
private _favourite: boolean;
private _ownerId: number;
private _Str_19808: boolean;
constructor(wrapper: IMessageDataWrapper)
{
this._groupId = wrapper.readInt();
this._groupName = wrapper.readString();
this._badgeCode = wrapper.readString();
this._Str_6751 = wrapper.readString();
this._Str_6979 = wrapper.readString();
this._favourite = wrapper.readBoolean();
this._ownerId = wrapper.readInt();
this._Str_19808 = wrapper.readBoolean();
}
public get groupId(): number
{
return this._groupId;
}
public get groupName(): string
{
return this._groupName;
}
public get badgeCode(): string
{
return this._badgeCode;
}
public get _Str_5845(): string
{
return this._Str_6751;
}
public get _Str_6659(): string
{
return this._Str_6979;
}
public get favourite(): boolean
{
return this._favourite;
}
public get ownerId(): number
{
return this._ownerId;
}
public get _Str_21674(): boolean
{
return this._Str_19808;
}
}