Merge branch 'pet-nest-breeding-success' of https://github.com/oobjectt/nitro-renderer into oobjectt-pet-nest-breeding-success

This commit is contained in:
dank074 2022-12-23 20:01:09 -06:00
commit 4c883c7fe4
7 changed files with 45 additions and 10 deletions

View File

@ -8,12 +8,12 @@ export class RoomSessionNestBreedingSuccessEvent extends RoomSessionEvent
private _rarityCategory: number; private _rarityCategory: number;
private _petId: number; private _petId: number;
constructor(k: IRoomSession, _arg_2: number, _arg_3: number) constructor(session: IRoomSession, petId: number, rarityCategory: number)
{ {
super(RoomSessionNestBreedingSuccessEvent.NEST_BREEDING_SUCCESS, k); super(RoomSessionNestBreedingSuccessEvent.NEST_BREEDING_SUCCESS, session);
this._petId = _arg_2; this._petId = petId;
this._rarityCategory = _arg_3; this._rarityCategory = rarityCategory;
} }
public get rarityCategory(): number public get rarityCategory(): number

File diff suppressed because one or more lines are too long

View File

@ -127,6 +127,7 @@ export class IncomingHeader
public static PET_BREEDING = 1746; public static PET_BREEDING = 1746;
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 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;

View File

@ -0,0 +1,16 @@
import { IMessageEvent } from '../../../../../../api';
import { MessageEvent } from '../../../../../../events';
import { NestBreedingSuccessParser } from '../../../parser';
export class NestBreedingSuccessEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, NestBreedingSuccessParser);
}
public getParser(): NestBreedingSuccessParser
{
return this.parser as NestBreedingSuccessParser;
}
}

View File

@ -1,5 +1,6 @@
export * from './ConfirmBreedingResultEvent'; export * from './ConfirmBreedingResultEvent';
export * from './GoToBreedingNestFailureEvent'; export * from './GoToBreedingNestFailureEvent';
export * from './NestBreedingSuccessEvent';
export * from './PetAddedToInventoryEvent'; export * from './PetAddedToInventoryEvent';
export * from './PetInventoryEvent'; export * from './PetInventoryEvent';
export * from './PetReceivedMessageEvent'; export * from './PetReceivedMessageEvent';

View File

@ -13,10 +13,10 @@ export class NestBreedingSuccessParser implements IMessageParser
return true; return true;
} }
public parse(k: IMessageDataWrapper): boolean public parse(wrapper: IMessageDataWrapper): boolean
{ {
this._petId = k.readInt(); this._petId = wrapper.readInt();
this._rarityCategory = k.readInt(); this._rarityCategory = wrapper.readInt();
return true; return true;
} }

View File

@ -1,6 +1,6 @@
import { IConnection, IRoomHandlerListener, IRoomUserData } from '../../../api'; import { IConnection, IRoomHandlerListener, IRoomUserData } from '../../../api';
import { RoomSessionConfirmPetBreedingResultEvent, RoomSessionDanceEvent, RoomSessionDoorbellEvent, RoomSessionErrorMessageEvent, RoomSessionFavoriteGroupUpdateEvent, RoomSessionFriendRequestEvent, RoomSessionPetBreedingEvent, RoomSessionPetFigureUpdateEvent, RoomSessionPetInfoUpdateEvent, RoomSessionPetLevelUpdateEvent, RoomSessionPetStatusUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserDataUpdateEvent, RoomSessionUserFigureUpdateEvent } from '../../../events'; import { RoomSessionConfirmPetBreedingResultEvent, RoomSessionDanceEvent, RoomSessionDoorbellEvent, RoomSessionErrorMessageEvent, RoomSessionFavoriteGroupUpdateEvent, RoomSessionFriendRequestEvent, RoomSessionNestBreedingSuccessEvent, RoomSessionPetBreedingEvent, RoomSessionPetFigureUpdateEvent, RoomSessionPetInfoUpdateEvent, RoomSessionPetLevelUpdateEvent, RoomSessionPetStatusUpdateEvent, RoomSessionUserBadgesEvent, RoomSessionUserDataUpdateEvent, RoomSessionUserFigureUpdateEvent } from '../../../events';
import { BotErrorEvent, ConfirmBreedingResultEvent, DoorbellMessageEvent, FavoriteMembershipUpdateMessageEvent, NewFriendRequestEvent, PetBreedingMessageEvent, PetFigureUpdateEvent, PetInfoEvent, PetLevelUpdateMessageEvent, PetPlacingErrorEvent, PetStatusUpdateEvent, RoomUnitDanceEvent, RoomUnitEvent, RoomUnitInfoEvent, RoomUnitRemoveEvent, UserCurrentBadgesEvent, UserNameChangeMessageEvent } from '../../communication'; import { BotErrorEvent, 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';
@ -24,6 +24,7 @@ export class RoomUsersHandler extends BaseHandler
connection.addMessageEvent(new PetBreedingMessageEvent(this.onPetBreedingMessageEvent.bind(this))); connection.addMessageEvent(new PetBreedingMessageEvent(this.onPetBreedingMessageEvent.bind(this)));
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 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)));
@ -304,6 +305,21 @@ export class RoomUsersHandler extends BaseHandler
this.listener.events.dispatchEvent(new RoomSessionConfirmPetBreedingResultEvent(session, parser.breedingNestStuffId, parser.result)); this.listener.events.dispatchEvent(new RoomSessionConfirmPetBreedingResultEvent(session, parser.breedingNestStuffId, parser.result));
} }
private onNestBreedingSuccessEvent(event: NestBreedingSuccessEvent): 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 RoomSessionNestBreedingSuccessEvent(session, parser.petId, parser.rarityCategory));
}
private onPetFigureUpdateEvent(event: PetFigureUpdateEvent): void private onPetFigureUpdateEvent(event: PetFigureUpdateEvent): void
{ {
if(!this.listener) return; if(!this.listener) return;