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

This commit is contained in:
dank074 2022-12-20 01:38:20 -06:00
commit 67e47b652a
13 changed files with 113 additions and 2 deletions

View File

@ -45,6 +45,7 @@ export interface IRoomSession extends IDisposable
useMultistateItem(id: number): void;
harvestPet(id: number): void;
compostPlant(id: number): void;
requestPetCommands(id: number): void;
connection: IConnection;
userDataManager: IUserDataManager;
roomId: number;

File diff suppressed because one or more lines are too long

View File

@ -119,6 +119,7 @@ export class IncomingHeader
public static NOTIFICATION_LIST = 1992;
public static PET_FIGURE_UPDATE = 1924;
public static PET_INFO = 2901;
public static PET_TRAINING_PANEL = 1164;
public static RECYCLER_PRIZES = 3164;
public static ROOM_BAN_LIST = 1869;
public static ROOM_BAN_REMOVE = 3429;

View File

@ -37,6 +37,7 @@ export * from './mysterybox';
export * from './navigator';
export * from './notifications';
export * from './perk';
export * from './pet';
export * from './poll';
export * from './quest';
export * from './room';

View File

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

View File

@ -0,0 +1 @@
export * from './PetTrainingPanelMessageEvent';

View File

@ -136,6 +136,7 @@ export class OutgoingHeader
public static PET_RESPECT = 3202;
public static PET_RIDE = 1036;
public static PET_MOVE = 3449;
public static GET_PET_TRAINING_PANEL = 2161;
public static RECYCLER_PRIZES = 398;
public static RELEASE_VERSION = 4000;
public static CALL_FOR_HELP = 1691;

View File

@ -0,0 +1,21 @@
import { IMessageComposer } from '../../../../../api';
export class GetPetCommandsComposer implements IMessageComposer<ConstructorParameters<typeof GetPetCommandsComposer>>
{
private _data: ConstructorParameters<typeof GetPetCommandsComposer>;
constructor(petId: number)
{
this._data = [petId];
}
public getMessageArray()
{
return this._data;
}
public dispose(): void
{
return;
}
}

View File

@ -1,3 +1,4 @@
export * from './GetPetCommandsComposer';
export * from './PetMountComposer';
export * from './PetRespectComposer';
export * from './PetSupplementComposer';

View File

@ -40,6 +40,7 @@ export * from './navigator/utils';
export * from './notifications';
export * from './perk';
export * from './perk/common';
export * from './pet';
export * from './poll';
export * from './quest';
export * from './room';

View File

@ -0,0 +1,57 @@
import { IMessageDataWrapper, IMessageParser } from '../../../../../api';
export class PetTrainingMessageParser implements IMessageParser
{
private _petId: number;
private _commands: number[];
private _enabledCommands: number[];
flush(): boolean
{
this._petId = -1;
this._commands = [];
this._enabledCommands = [];
return true;
}
parse(wrapper: IMessageDataWrapper): boolean
{
this._petId = wrapper.readInt();
let commands = wrapper.readInt();
while(commands > 0)
{
this._commands.push(wrapper.readInt());
commands--;
}
let enabledCommands = wrapper.readInt();
while(enabledCommands > 0)
{
this._enabledCommands.push(wrapper.readInt());
enabledCommands--;
}
return true;
}
public get petId(): number
{
return this._petId;
}
public get commands(): number[]
{
return this._commands;
}
public get enabledCommands(): number[]
{
return this._enabledCommands;
}
}

View File

@ -0,0 +1 @@
export * from './PetTrainingMessageParser';

View File

@ -1,7 +1,7 @@
import { IConnection, IRoomSession, RoomControllerLevel, RoomTradingLevelEnum } from '../../api';
import { Disposable } from '../../core';
import { RoomSessionEvent } from '../../events';
import { BotRemoveComposer, CompostPlantMessageComposer, FurnitureMultiStateComposer, HarvestPetMessageComposer, MoodlightSettingsComposer, MoodlightSettingsSaveComposer, MoodlightTogggleStateComposer, OpenPresentComposer, PetMountComposer, PetRemoveComposer, PollAnswerComposer, PollRejectComposer, PollStartComposer, RemovePetSaddleComposer, RoomAmbassadorAlertComposer, RoomBanUserComposer, RoomDoorbellAccessComposer, RoomEnterComposer, RoomGiveRightsComposer, RoomKickUserComposer, RoomModerationSettings, RoomMuteUserComposer, RoomTakeRightsComposer, RoomUnitActionComposer, RoomUnitChatComposer, RoomUnitChatShoutComposer, RoomUnitChatWhisperComposer, RoomUnitDanceComposer, RoomUnitPostureComposer, RoomUnitSignComposer, RoomUnitTypingStartComposer, RoomUnitTypingStopComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer, UserMottoComposer } from '../communication';
import { BotRemoveComposer, CompostPlantMessageComposer, FurnitureMultiStateComposer, GetPetCommandsComposer, HarvestPetMessageComposer, MoodlightSettingsComposer, MoodlightSettingsSaveComposer, MoodlightTogggleStateComposer, OpenPresentComposer, PetMountComposer, PetRemoveComposer, PollAnswerComposer, PollRejectComposer, PollStartComposer, RemovePetSaddleComposer, RoomAmbassadorAlertComposer, RoomBanUserComposer, RoomDoorbellAccessComposer, RoomEnterComposer, RoomGiveRightsComposer, RoomKickUserComposer, RoomModerationSettings, RoomMuteUserComposer, RoomTakeRightsComposer, RoomUnitActionComposer, RoomUnitChatComposer, RoomUnitChatShoutComposer, RoomUnitChatWhisperComposer, RoomUnitDanceComposer, RoomUnitPostureComposer, RoomUnitSignComposer, RoomUnitTypingStartComposer, RoomUnitTypingStopComposer, TogglePetBreedingComposer, TogglePetRidingComposer, UsePetProductComposer, UserMottoComposer } from '../communication';
import { UserDataManager } from './UserDataManager';
export class RoomSession extends Disposable implements IRoomSession
@ -296,6 +296,11 @@ export class RoomSession extends Disposable implements IRoomSession
this._connection.send(new CompostPlantMessageComposer(id));
}
public requestPetCommands(id: number):void
{
this._connection.send(new GetPetCommandsComposer(id));
}
public get connection(): IConnection
{
return this._connection;