mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-02-17 02:22:36 +01:00
Add packets
This commit is contained in:
parent
5325c65b10
commit
40be434792
@ -1,5 +1,5 @@
|
|||||||
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration';
|
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration';
|
||||||
import { SellablePetPalettesEvent } from './messages';
|
import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, SellablePetPalettesEvent } from './messages';
|
||||||
import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
|
import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
|
||||||
import { ChangeNameUpdateEvent } from './messages/incoming/avatar/ChangeNameUpdateEvent';
|
import { ChangeNameUpdateEvent } from './messages/incoming/avatar/ChangeNameUpdateEvent';
|
||||||
import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent';
|
import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent';
|
||||||
@ -444,6 +444,7 @@ export class NitroMessages implements IMessageConfiguration
|
|||||||
this._events.set(IncomingHeader.REDEEM_VOUCHER_ERROR, CatalogRedeemVoucherErrorEvent);
|
this._events.set(IncomingHeader.REDEEM_VOUCHER_ERROR, CatalogRedeemVoucherErrorEvent);
|
||||||
this._events.set(IncomingHeader.REDEEM_VOUCHER_OK, CatalogRedeemVoucherOkEvent);
|
this._events.set(IncomingHeader.REDEEM_VOUCHER_OK, CatalogRedeemVoucherOkEvent);
|
||||||
this._events.set(IncomingHeader.CATALOG_RECEIVE_PET_BREEDS, SellablePetPalettesEvent);
|
this._events.set(IncomingHeader.CATALOG_RECEIVE_PET_BREEDS, SellablePetPalettesEvent);
|
||||||
|
this._events.set(IncomingHeader.CATALOG_APPROVE_NAME_RESULT, CatalogApproveNameResultEvent);
|
||||||
|
|
||||||
// CLIENT
|
// CLIENT
|
||||||
this._events.set(IncomingHeader.CLIENT_PING, ClientPingEvent);
|
this._events.set(IncomingHeader.CLIENT_PING, ClientPingEvent);
|
||||||
@ -938,6 +939,7 @@ export class NitroMessages implements IMessageConfiguration
|
|||||||
this._composers.set(OutgoingHeader.ROOM_MUTE, RoomMuteComposer);
|
this._composers.set(OutgoingHeader.ROOM_MUTE, RoomMuteComposer);
|
||||||
|
|
||||||
// USER
|
// USER
|
||||||
|
this._composers.set(OutgoingHeader.APPROVE_NAME, ApproveNameMessageComposer);
|
||||||
this._composers.set(OutgoingHeader.USER_RESPECT, UserRespectComposer);
|
this._composers.set(OutgoingHeader.USER_RESPECT, UserRespectComposer);
|
||||||
|
|
||||||
// DATA
|
// DATA
|
||||||
|
@ -246,4 +246,5 @@ export class IncomingHeader
|
|||||||
public static MARKETPLACE_ITEMS_SEARCHED = 680;
|
public static MARKETPLACE_ITEMS_SEARCHED = 680;
|
||||||
public static MARKETPLACE_AFTER_ORDER_STATUS = 2032;
|
public static MARKETPLACE_AFTER_ORDER_STATUS = 2032;
|
||||||
public static CATALOG_RECEIVE_PET_BREEDS = 3331;
|
public static CATALOG_RECEIVE_PET_BREEDS = 3331;
|
||||||
|
public static CATALOG_APPROVE_NAME_RESULT = 1503;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../core/communication/messages/IMessageEvent';
|
||||||
|
import { MessageEvent } from '../../../../../core/communication/messages/MessageEvent';
|
||||||
|
import { CatalogApproveNameResultParser } from '../../parser';
|
||||||
|
|
||||||
|
export class CatalogApproveNameResultEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, CatalogApproveNameResultParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): CatalogApproveNameResultParser
|
||||||
|
{
|
||||||
|
return this.parser as CatalogApproveNameResultParser;
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
export * from './CatalogApproveNameResultEvent';
|
||||||
export * from './CatalogClubEvent';
|
export * from './CatalogClubEvent';
|
||||||
export * from './CatalogClubGiftsEvent';
|
export * from './CatalogClubGiftsEvent';
|
||||||
export * from './CatalogGiftConfigurationEvent';
|
export * from './CatalogGiftConfigurationEvent';
|
||||||
|
@ -231,4 +231,5 @@ export class OutgoingHeader
|
|||||||
public static MARKETPLACE_REQUEST_OFFERS = 2407;
|
public static MARKETPLACE_REQUEST_OFFERS = 2407;
|
||||||
public static MARKETPLACE_BUY_OFFER = 1603;
|
public static MARKETPLACE_BUY_OFFER = 1603;
|
||||||
public static CATALOG_REQUESET_PET_BREEDS = 1756;
|
public static CATALOG_REQUESET_PET_BREEDS = 1756;
|
||||||
|
public static APPROVE_NAME = 2109;
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer';
|
||||||
|
|
||||||
|
export class ApproveNameMessageComposer implements IMessageComposer<ConstructorParameters<typeof ApproveNameMessageComposer>>
|
||||||
|
{
|
||||||
|
private _data: ConstructorParameters<typeof ApproveNameMessageComposer>;
|
||||||
|
|
||||||
|
constructor(name: string, type: number)
|
||||||
|
{
|
||||||
|
this._data = [ name, type ];
|
||||||
|
}
|
||||||
|
|
||||||
|
public getMessageArray()
|
||||||
|
{
|
||||||
|
return this._data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public dispose(): void
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
export * from './ApproveNameMessageComposer';
|
||||||
export * from './data';
|
export * from './data';
|
||||||
export * from './inventory';
|
export * from './inventory';
|
||||||
export * from './settings';
|
export * from './settings';
|
||||||
|
@ -0,0 +1,36 @@
|
|||||||
|
import { IMessageDataWrapper } from '../../../../../core/communication/messages/IMessageDataWrapper';
|
||||||
|
import { IMessageParser } from '../../../../../core/communication/messages/IMessageParser';
|
||||||
|
|
||||||
|
export class CatalogApproveNameResultParser implements IMessageParser
|
||||||
|
{
|
||||||
|
private _result: number;
|
||||||
|
private _validationInfo: string;
|
||||||
|
|
||||||
|
public flush(): boolean
|
||||||
|
{
|
||||||
|
this._result = -1;
|
||||||
|
this._validationInfo = '';
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public parse(wrapper: IMessageDataWrapper): boolean
|
||||||
|
{
|
||||||
|
if(!wrapper) return false;
|
||||||
|
|
||||||
|
this._result = wrapper.readInt();
|
||||||
|
this._validationInfo = wrapper.readString();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get result(): number
|
||||||
|
{
|
||||||
|
return this._result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get validationInfo(): string
|
||||||
|
{
|
||||||
|
return this._validationInfo;
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
export * from './CatalogApproveNameResultParser';
|
||||||
export * from './CatalogClubGiftsParser';
|
export * from './CatalogClubGiftsParser';
|
||||||
export * from './CatalogClubParser';
|
export * from './CatalogClubParser';
|
||||||
export * from './CatalogGiftConfigurationParser';
|
export * from './CatalogGiftConfigurationParser';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user