Merge branch 'oobjectt-pet-breeding-confirm-result'

This commit is contained in:
dank074 2022-12-23 19:42:09 -06:00
commit ba3f23526b
6 changed files with 42 additions and 7 deletions

View File

@ -8,12 +8,12 @@ export class RoomSessionConfirmPetBreedingResultEvent extends RoomSessionEvent
private _breedingNestStuffId: number; private _breedingNestStuffId: number;
private _result: number; private _result: number;
constructor(k: IRoomSession, _arg_2: number, _arg_3: number) constructor(session: IRoomSession, breedingNestStuffId: number, result: number)
{ {
super(RoomSessionConfirmPetBreedingResultEvent.RSPFUE_CONFIRM_PET_BREEDING_RESULT, k); super(RoomSessionConfirmPetBreedingResultEvent.RSPFUE_CONFIRM_PET_BREEDING_RESULT, session);
this._breedingNestStuffId = _arg_2; this._breedingNestStuffId = breedingNestStuffId;
this._result = _arg_3; this._result = result;
} }
public get breedingNestStuffId(): number public get breedingNestStuffId(): number

File diff suppressed because one or more lines are too long

View File

@ -125,6 +125,7 @@ export class IncomingHeader
public static PET_OPEN_PACKAGE_REQUESTED = 2380; public static PET_OPEN_PACKAGE_REQUESTED = 2380;
public static PET_OPEN_PACKAGE_RESULT = 546; public static PET_OPEN_PACKAGE_RESULT = 546;
public static PET_BREEDING = 1746; public static PET_BREEDING = 1746;
public static PET_CONFIRM_BREEDING_RESULT = 1625;
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 { ConfirmBreedingResultParser } from '../../../parser';
export class ConfirmBreedingResultEvent extends MessageEvent implements IMessageEvent
{
constructor(callBack: Function)
{
super(callBack, ConfirmBreedingResultParser);
}
public getParser(): ConfirmBreedingResultParser
{
return this.parser as ConfirmBreedingResultParser;
}
}

View File

@ -1,3 +1,4 @@
export * from './ConfirmBreedingResultEvent';
export * from './PetAddedToInventoryEvent'; export * from './PetAddedToInventoryEvent';
export * from './PetInventoryEvent'; export * from './PetInventoryEvent';
export * from './PetReceivedMessageEvent'; export * from './PetReceivedMessageEvent';

View File

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