mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2024-11-30 03:00:51 +01:00
Merge branch 'pet-confirm-pet-breeding-request' of https://github.com/oobjectt/nitro-renderer into oobjectt-pet-confirm-pet-breeding-request
This commit is contained in:
commit
4234690a3c
@ -1,4 +1,5 @@
|
|||||||
import { IRoomSession } from '../../api';
|
import { IRoomSession } from '../../api';
|
||||||
|
import { BreedingPetInfo, RarityCategoryData } from '../../nitro';
|
||||||
import { RoomSessionEvent } from './RoomSessionEvent';
|
import { RoomSessionEvent } from './RoomSessionEvent';
|
||||||
|
|
||||||
export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent
|
export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent
|
||||||
@ -6,25 +7,20 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent
|
|||||||
public static CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING';
|
public static CONFIRM_PET_BREEDING: string = 'RSPFUE_CONFIRM_PET_BREEDING';
|
||||||
|
|
||||||
private _nestId: number;
|
private _nestId: number;
|
||||||
private _pet1: any;
|
private _pet1: BreedingPetInfo;
|
||||||
private _pet2: any;
|
private _pet2: BreedingPetInfo;
|
||||||
private _rarityCategories: any[];
|
private _rarityCategories: RarityCategoryData[];
|
||||||
private _resultPetTypeId: number;
|
private _resultPetTypeId: number;
|
||||||
|
|
||||||
constructor(k: IRoomSession, _arg_2: number, _arg_3: any, _arg_4: any, _arg_5: any[], _arg_6: number)
|
constructor(session: IRoomSession, nestId: number, pet1: BreedingPetInfo, pet2: BreedingPetInfo, rarityCategories: RarityCategoryData[], resultPetTypeId: number)
|
||||||
{
|
{
|
||||||
super(RoomSessionConfirmPetBreedingEvent.CONFIRM_PET_BREEDING, k);
|
super(RoomSessionConfirmPetBreedingEvent.CONFIRM_PET_BREEDING, session);
|
||||||
|
|
||||||
this._nestId = _arg_2;
|
this._nestId = nestId;
|
||||||
this._pet1 = _arg_3;
|
this._pet1 = pet1;
|
||||||
this._pet2 = _arg_4;
|
this._pet2 = pet2;
|
||||||
this._rarityCategories = _arg_5;
|
this._rarityCategories = rarityCategories;
|
||||||
this._resultPetTypeId = _arg_6;
|
this._resultPetTypeId = resultPetTypeId;
|
||||||
}
|
|
||||||
|
|
||||||
public get rarityCategories(): any[]
|
|
||||||
{
|
|
||||||
return this._rarityCategories;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get nestId(): number
|
public get nestId(): number
|
||||||
@ -32,16 +28,21 @@ export class RoomSessionConfirmPetBreedingEvent extends RoomSessionEvent
|
|||||||
return this._nestId;
|
return this._nestId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get pet1(): any
|
public get pet1(): BreedingPetInfo
|
||||||
{
|
{
|
||||||
return this._pet1;
|
return this._pet1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public get pet2(): any
|
public get pet2(): BreedingPetInfo
|
||||||
{
|
{
|
||||||
return this._pet2;
|
return this._pet2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get rarityCategories(): RarityCategoryData[]
|
||||||
|
{
|
||||||
|
return this._rarityCategories;
|
||||||
|
}
|
||||||
|
|
||||||
public get resultPetTypeId(): number
|
public get resultPetTypeId(): number
|
||||||
{
|
{
|
||||||
return this._resultPetTypeId;
|
return this._resultPetTypeId;
|
||||||
|
File diff suppressed because one or more lines are too long
@ -128,6 +128,7 @@ export class IncomingHeader
|
|||||||
public static PET_CONFIRM_BREEDING_RESULT = 1625;
|
public static PET_CONFIRM_BREEDING_RESULT = 1625;
|
||||||
public static PET_GO_TO_BREEDING_NEST_FAILURE = 2621;
|
public static PET_GO_TO_BREEDING_NEST_FAILURE = 2621;
|
||||||
public static PET_NEST_BREEDING_SUCCESS = 2527;
|
public static PET_NEST_BREEDING_SUCCESS = 2527;
|
||||||
|
public static PET_CONFIRM_BREEDING_REQUEST = 634;
|
||||||
public static RECYCLER_PRIZES = 3164;
|
public static RECYCLER_PRIZES = 3164;
|
||||||
public static ROOM_BAN_LIST = 1869;
|
public static ROOM_BAN_LIST = 1869;
|
||||||
public static ROOM_BAN_REMOVE = 3429;
|
public static ROOM_BAN_REMOVE = 3429;
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
import { IMessageEvent } from '../../../../../../api';
|
||||||
|
import { MessageEvent } from '../../../../../../events';
|
||||||
|
import { ConfirmBreedingRequestParser } from '../../../parser';
|
||||||
|
|
||||||
|
export class ConfirmBreedingRequestEvent extends MessageEvent implements IMessageEvent
|
||||||
|
{
|
||||||
|
constructor(callBack: Function)
|
||||||
|
{
|
||||||
|
super(callBack, ConfirmBreedingRequestParser);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getParser(): ConfirmBreedingRequestParser
|
||||||
|
{
|
||||||
|
return this.parser as ConfirmBreedingRequestParser;
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,4 @@
|
|||||||
|
export * from './ConfirmBreedingRequestEvent';
|
||||||
export * from './ConfirmBreedingResultEvent';
|
export * from './ConfirmBreedingResultEvent';
|
||||||
export * from './GoToBreedingNestFailureEvent';
|
export * from './GoToBreedingNestFailureEvent';
|
||||||
export * from './NestBreedingSuccessEvent';
|
export * from './NestBreedingSuccessEvent';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { IConnection, IRoomHandlerListener, IRoomUserData } from '../../../api';
|
import { IConnection, IRoomHandlerListener, IRoomUserData } from '../../../api';
|
||||||
import { RoomSessionConfirmPetBreedingResultEvent, RoomSessionDanceEvent, RoomSessionDoorbellEvent, RoomSessionErrorMessageEvent, RoomSessionFavoriteGroupUpdateEvent, RoomSessionFriendRequestEvent, RoomSessionNestBreedingSuccessEvent, RoomSessionPetBreedingEvent, RoomSessionPetFigureUpdateEvent, RoomSessionPetInfoUpdateEvent, RoomSessionPetLevelUpdateEvent, RoomSessionPetStatusUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserDataUpdateEvent, RoomSessionUserFigureUpdateEvent } from '../../../events';
|
import { RoomSessionConfirmPetBreedingEvent, RoomSessionConfirmPetBreedingResultEvent, RoomSessionDanceEvent, RoomSessionDoorbellEvent, RoomSessionErrorMessageEvent, RoomSessionFavoriteGroupUpdateEvent, RoomSessionFriendRequestEvent, RoomSessionNestBreedingSuccessEvent, RoomSessionPetBreedingEvent, RoomSessionPetFigureUpdateEvent, RoomSessionPetInfoUpdateEvent, RoomSessionPetLevelUpdateEvent, RoomSessionPetStatusUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserDataUpdateEvent, RoomSessionUserFigureUpdateEvent } from '../../../events';
|
||||||
import { BotErrorEvent, ConfirmBreedingResultEvent, DoorbellMessageEvent, FavoriteMembershipUpdateMessageEvent, NestBreedingSuccessEvent, NewFriendRequestEvent, PetBreedingMessageEvent, PetFigureUpdateEvent, PetInfoEvent, PetLevelUpdateMessageEvent, PetPlacingErrorEvent, PetStatusUpdateEvent, RoomUnitDanceEvent, RoomUnitEvent, RoomUnitInfoEvent, RoomUnitRemoveEvent, UserCurrentBadgesEvent, UserNameChangeMessageEvent } from '../../communication';
|
import { BotErrorEvent, ConfirmBreedingRequestEvent, ConfirmBreedingResultEvent, DoorbellMessageEvent, FavoriteMembershipUpdateMessageEvent, NestBreedingSuccessEvent, NewFriendRequestEvent, PetBreedingMessageEvent, PetFigureUpdateEvent, PetInfoEvent, PetLevelUpdateMessageEvent, PetPlacingErrorEvent, PetStatusUpdateEvent, RoomUnitDanceEvent, RoomUnitEvent, RoomUnitInfoEvent, RoomUnitRemoveEvent, UserCurrentBadgesEvent, UserNameChangeMessageEvent } from '../../communication';
|
||||||
import { RoomPetData } from '../RoomPetData';
|
import { RoomPetData } from '../RoomPetData';
|
||||||
import { RoomUserData } from '../RoomUserData';
|
import { RoomUserData } from '../RoomUserData';
|
||||||
import { BaseHandler } from './BaseHandler';
|
import { BaseHandler } from './BaseHandler';
|
||||||
@ -25,6 +25,7 @@ export class RoomUsersHandler extends BaseHandler
|
|||||||
connection.addMessageEvent(new PetLevelUpdateMessageEvent(this.onPetLevelUpdateMessageEvent.bind(this)));
|
connection.addMessageEvent(new PetLevelUpdateMessageEvent(this.onPetLevelUpdateMessageEvent.bind(this)));
|
||||||
connection.addMessageEvent(new ConfirmBreedingResultEvent(this.onConfirmBreedingResultEvent.bind(this)));
|
connection.addMessageEvent(new ConfirmBreedingResultEvent(this.onConfirmBreedingResultEvent.bind(this)));
|
||||||
connection.addMessageEvent(new NestBreedingSuccessEvent(this.onNestBreedingSuccessEvent.bind(this)));
|
connection.addMessageEvent(new NestBreedingSuccessEvent(this.onNestBreedingSuccessEvent.bind(this)));
|
||||||
|
connection.addMessageEvent(new ConfirmBreedingRequestEvent(this.onConfirmBreedingRequestEvent.bind(this)));
|
||||||
connection.addMessageEvent(new PetFigureUpdateEvent(this.onPetFigureUpdateEvent.bind(this)));
|
connection.addMessageEvent(new PetFigureUpdateEvent(this.onPetFigureUpdateEvent.bind(this)));
|
||||||
connection.addMessageEvent(new PetPlacingErrorEvent(this.onPetPlacingError.bind(this)));
|
connection.addMessageEvent(new PetPlacingErrorEvent(this.onPetPlacingError.bind(this)));
|
||||||
connection.addMessageEvent(new BotErrorEvent(this.onBotError.bind(this)));
|
connection.addMessageEvent(new BotErrorEvent(this.onBotError.bind(this)));
|
||||||
@ -320,6 +321,21 @@ export class RoomUsersHandler extends BaseHandler
|
|||||||
this.listener.events.dispatchEvent(new RoomSessionNestBreedingSuccessEvent(session, parser.petId, parser.rarityCategory));
|
this.listener.events.dispatchEvent(new RoomSessionNestBreedingSuccessEvent(session, parser.petId, parser.rarityCategory));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private onConfirmBreedingRequestEvent(event: ConfirmBreedingRequestEvent): void
|
||||||
|
{
|
||||||
|
if(!this.listener) return;
|
||||||
|
|
||||||
|
const parser = event.getParser();
|
||||||
|
|
||||||
|
if(!parser) return;
|
||||||
|
|
||||||
|
const session = this.listener.getSession(this.roomId);
|
||||||
|
|
||||||
|
if(!session) return;
|
||||||
|
|
||||||
|
this.listener.events.dispatchEvent(new RoomSessionConfirmPetBreedingEvent(session, parser.nestId, parser.pet1, parser.pet2, parser.rarityCategories, parser.resultPetType));
|
||||||
|
}
|
||||||
|
|
||||||
private onPetFigureUpdateEvent(event: PetFigureUpdateEvent): void
|
private onPetFigureUpdateEvent(event: PetFigureUpdateEvent): void
|
||||||
{
|
{
|
||||||
if(!this.listener) return;
|
if(!this.listener) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user