This commit is contained in:
Bill 2021-07-08 04:25:17 -04:00
parent be1c8bc90b
commit 161e145411
28 changed files with 433 additions and 59 deletions

View File

@ -1,5 +1,5 @@
import { IMessageConfiguration } from '../../core/communication/messages/IMessageConfiguration';
import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent } from './messages';
import { ApproveNameMessageComposer, CatalogApproveNameResultEvent, FurnitureGuildInfoComposer, PetMountComposer, PetSupplementComposer, RoomUnitGiveHandItemPetComposer, RoomWidgetCameraPublishedEvent, RoomWidgetCameraPurchaseComposer, SellablePetPalettesEvent } from './messages';
import { AvailabilityStatusMessageEvent } from './messages/incoming/availability/AvailabilityStatusMessageEvent';
import { CatalogClubEvent } from './messages/incoming/catalog/CatalogClubEvent';
import { CatalogClubGiftsEvent } from './messages/incoming/catalog/CatalogClubGiftsEvent';
@ -856,7 +856,9 @@ export class NitroMessages implements IMessageConfiguration
this._composers.set(OutgoingHeader.ACHIEVEMENT_LIST, RequestAchievementsMessageComposer);
// PET
this._composers.set(OutgoingHeader.PET_MOUNT, PetMountComposer);
this._composers.set(OutgoingHeader.PET_RESPECT, PetRespectComposer);
this._composers.set(OutgoingHeader.PET_SUPPLEMENT, PetSupplementComposer);
this._composers.set(OutgoingHeader.PET_INFO, RequestPetInfoComposer);
// ROOM
@ -902,6 +904,7 @@ export class NitroMessages implements IMessageConfiguration
// FURNITURE
this._composers.set(OutgoingHeader.FURNITURE_ALIASES, FurnitureAliasesComposer);
this._composers.set(OutgoingHeader.FURNITURE_GUILD_INFO, FurnitureGuildInfoComposer);
this._composers.set(OutgoingHeader.FURNITURE_PICKUP, FurniturePickupComposer);
this._composers.set(OutgoingHeader.FURNITURE_PLACE, FurniturePlaceComposer);
this._composers.set(OutgoingHeader.ITEM_PAINT, FurniturePlacePaintComposer);

View File

@ -236,4 +236,8 @@ export class OutgoingHeader
public static CATALOG_REQUESET_PET_BREEDS = 1756;
public static APPROVE_NAME = 2109;
public static UNIT_GIVE_HANDITEM_PET = 2768;
public static PET_MOUNT = 1036;
public static PET_SUPPLEMENT = 749;
public static FURNITURE_GUILD_INFO = 2651;
public static ACHIEVEMENT_RESOLUTION_OPEN = 359;
}

View File

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

View File

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

View File

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

View File

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

View File

@ -2,6 +2,7 @@ export * from './ads';
export * from './dimmer';
export * from './floor';
export * from './FurnitureAliasesComposer';
export * from './FurnitureGuildInfoComposer';
export * from './FurniturePickupComposer';
export * from './FurniturePlaceComposer';
export * from './FurniturePlacePaintComposer';

View File

@ -11,6 +11,7 @@ import { IRoomGeometry } from '../../room/utils/IRoomGeometry';
import { IVector3D } from '../../room/utils/IVector3D';
import { RoomEnterEffect } from '../../room/utils/RoomEnterEffect';
import { Vector3d } from '../../room/utils/Vector3d';
import { FurnitureGuildInfoComposer } from '../communication';
import { BotPlaceComposer } from '../communication/messages/outgoing/room/engine/BotPlaceComposer';
import { GetItemDataComposer } from '../communication/messages/outgoing/room/engine/GetItemDataComposer';
import { ModifyWallItemDataComposer } from '../communication/messages/outgoing/room/engine/ModifyWallItemDataComposer';
@ -34,6 +35,7 @@ import { RoomUnitWalkComposer } from '../communication/messages/outgoing/room/un
import { Nitro } from '../Nitro';
import { MouseEventType } from '../ui/MouseEventType';
import { RoomObjectPlacementSource } from './enums/RoomObjectPlacementSource';
import { RoomEngineUseProductEvent } from './events';
import { RoomEngineDimmerStateEvent } from './events/RoomEngineDimmerStateEvent';
import { RoomEngineObjectEvent } from './events/RoomEngineObjectEvent';
import { RoomEngineObjectPlacedEvent } from './events/RoomEngineObjectPlacedEvent';
@ -743,17 +745,90 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
case RoomObjectWidgetRequestEvent.CLOSE_WIDGET:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.CLOSE_WIDGET, roomId, objectId, objectCategory, ((event.object as IRoomObjectController).logic.widget)));
return;
case RoomObjectWidgetRequestEvent.TROPHY:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_TROPHY, roomId, objectId, objectCategory));
case RoomObjectWidgetRequestEvent.OPEN_FURNI_CONTEXT_MENU:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory, ((event.object as IRoomObjectController).logic.contextMenu)));
return;
case RoomObjectWidgetRequestEvent.CLOSE_FURNI_CONTEXT_MENU:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.OPEN_FURNI_CONTEXT_MENU, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.PLACEHOLDER:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PLACEHOLDER, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.CREDITFURNI:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_CREDITFURNI, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.INERNAL_LINK:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_INTERNAL_LINK, roomId, objectId, objectCategory));
case RoomObjectWidgetRequestEvent.STICKIE:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_STICKIE, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.ROOM_LINK:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ROOM_LINK, roomId, objectId, objectCategory));
case RoomObjectWidgetRequestEvent.PRESENT:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PRESENT, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.TROPHY:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_TROPHY, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.TEASER:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_TEASER, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.ECOTRONBOX:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ECOTRONBOX, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.DIMMER:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.WIDGET_REMOVE_DIMMER:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.CLOTHING_CHANGE:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_CLOTHING_CHANGE, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.JUKEBOX_PLAYLIST_EDITOR:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PLAYLIST_EDITOR, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.MANNEQUIN:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MANNEQUIN, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.PET_PRODUCT_MENU:
eventDispatcher.dispatchEvent(new RoomEngineUseProductEvent(RoomEngineUseProductEvent.USE_PRODUCT_FROM_ROOM, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.GUILD_FURNI_CONTEXT_MENU:
this._roomEngine.connection.send(new FurnitureGuildInfoComposer(event.objectId, event.object.model.getValue<number>(RoomObjectVariable.FURNITURE_GUILD_CUSTOMIZED_GUILD_ID)));
return;
case RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.BACKGROUND_COLOR:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_BACKGROUND_COLOR, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYBOX_OPEN_DIALOG, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYTROPHY_OPEN_DIALOG, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_OPEN:
//this._roomEngine.connection.send();
// new _Str_4406(k._Str_1577, 0)
return;
case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_ENGRAVING:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_FAILED:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_FAILED, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_CONFIRM:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_CONFIRM, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.BADGE_DISPLAY_ENGRAVING:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_BADGE_DISPLAY_ENGRAVING, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.HIGH_SCORE_DISPLAY:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_HIGH_SCORE_DISPLAY, roomId, objectId, objectCategory));
@ -761,42 +836,12 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
case RoomObjectWidgetRequestEvent.HIDE_HIGH_SCORE_DISPLAY:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_HIDE_HIGH_SCORE_DISPLAY, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.STICKIE:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_STICKIE, roomId, objectId, objectCategory));
case RoomObjectWidgetRequestEvent.INERNAL_LINK:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_INTERNAL_LINK, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.DIMMER:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_DIMMER, roomId, objectId, objectCategory));
case RoomObjectWidgetRequestEvent.ROOM_LINK:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ROOM_LINK, roomId, objectId, objectCategory));
return;
case RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.MYSTERYBOX_OPEN_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYBOX_OPEN_DIALOG, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MYSTERYTROPHY_OPEN_DIALOG, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_EFFECTBOX_OPEN_DIALOG, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.MANNEQUIN:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_MANNEQUIN, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.BACKGROUND_COLOR:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_BACKGROUND_COLOR, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_FRIEND_FURNITURE_ENGRAVING, roomId, objectId, objectCategory));
break;
case RoomObjectWidgetRequestEvent.PRESENT:
eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_PRESENT, roomId, objectId, objectCategory));
break;
}
}

View File

@ -4,11 +4,13 @@ import { IEventDispatcher } from '../../core/events/IEventDispatcher';
import { IRoomObjectEventHandler } from '../../room/object/logic/IRoomObjectEventHandler';
import { IRoomObjectLogicFactory } from '../../room/object/logic/IRoomObjectLogicFactory';
import { RoomObjectLogicBase } from '../../room/object/logic/RoomObjectLogicBase';
import { FurnitureEffectBoxLogic, FurnitureLoveLockLogic, FurnitureMonsterplantSeedLogic, FurnitureMysteryTrophyLogic, FurnitureRandomTeleportLogic, FurnitureRentableSpaceLogic } from './object';
import { AvatarLogic } from './object/logic/avatar/AvatarLogic';
import { FurnitureBadgeDisplayLogic } from './object/logic/furniture/FurnitureBadgeDisplayLogic';
import { FurnitureChangeStateWhenStepOnLogic } from './object/logic/furniture/FurnitureChangeStateWhenStepOnLogic';
import { FurnitureCounterClockLogic } from './object/logic/furniture/FurnitureCounterClockLogic';
import { FurnitureCrackableLogic } from './object/logic/furniture/FurnitureCrackableLogic';
import { FurnitureCraftingGizmoLogic } from './object/logic/furniture/FurnitureCraftingGizmoLogic';
import { FurnitureCreditLogic } from './object/logic/furniture/FurnitureCreditLogic';
import { FurnitureCustomStackHeightLogic } from './object/logic/furniture/FurnitureCustomStackHeightLogic';
import { FurnitureDiceLogic } from './object/logic/furniture/FurnitureDiceLogic';
@ -17,7 +19,6 @@ import { FurnitureEditableRoomLinkLogic } from './object/logic/furniture/Furnitu
import { FurnitureExternalImageLogic } from './object/logic/furniture/FurnitureExternalImageLogic';
import { FurnitureFireworksLogic } from './object/logic/furniture/FurnitureFireworksLogic';
import { FurnitureFloorHoleLogic } from './object/logic/furniture/FurnitureFloorHoleLogic';
import { FurnitureFriendLogic } from './object/logic/furniture/FurnitureFriendLogic';
import { FurnitureGuildCustomizedLogic } from './object/logic/furniture/FurnitureGuildCustomizedLogic';
import { FurnitureHighScoreLogic } from './object/logic/furniture/FurnitureHighScoreLogic';
import { FurnitureHockeyScoreLogic } from './object/logic/furniture/FurnitureHockeyScoreLogic';
@ -277,11 +278,29 @@ export class RoomObjectLogicFactory implements IRoomObjectLogicFactory
logic = FurnitureWindowLogic;
break;
case RoomObjectLogicType.FURNITURE_LOVELOCK:
logic = FurnitureFriendLogic;
logic = FurnitureLoveLockLogic;
break;
case RoomObjectLogicType.FURNITURE_YOUTUBE:
logic = FurnitureYoutubeLogic;
break;
case RoomObjectLogicType.FURNITURE_CRAFTING_GIZMO:
logic = FurnitureCraftingGizmoLogic;
break;
case RoomObjectLogicType.FURNITURE_RENTABLE_SPACE:
logic = FurnitureRentableSpaceLogic;
break;
case RoomObjectLogicType.FURNITURE_EFFECTBOX:
logic = FurnitureEffectBoxLogic;
break;
case RoomObjectLogicType.FURNITURE_MONSTERPLANT_SEED:
logic = FurnitureMonsterplantSeedLogic;
break;
case RoomObjectLogicType.FURNITURE_MYSTERYTROPHY:
logic = FurnitureMysteryTrophyLogic;
break;
case RoomObjectLogicType.FURNITURE_RANDOM_TELEPORT:
logic = FurnitureRandomTeleportLogic;
break;
default:
logic = FurnitureLogic;
break;

View File

@ -1,6 +1,6 @@
import { RoomEngineObjectEvent } from './RoomEngineObjectEvent';
export class RoomEngineSamplePlaybackEvent extends RoomEngineObjectEvent
export class RoomEngineSamplePlaybackEvent extends RoomEngineObjectEvent
{
public static ROOM_OBJECT_INITIALIZED: string = 'ROPSPE_ROOM_OBJECT_INITIALIZED';
public static ROOM_OBJECT_DISPOSED: string = 'ROPSPE_ROOM_OBJECT_DISPOSED';

View File

@ -47,4 +47,9 @@ export class RoomEngineTriggerWidgetEvent extends RoomEngineObjectEvent
{
return this._widget;
}
}
public get contextMenu(): string
{
return this._widget;
}
}

View File

@ -0,0 +1,28 @@
import { RoomEngineObjectEvent } from './RoomEngineObjectEvent';
export class RoomEngineUseProductEvent extends RoomEngineObjectEvent
{
public static USE_PRODUCT_FROM_ROOM: string = 'REUPE_USE_PRODUCT_FROM_ROOM';
public static USE_PRODUCT_FROM_INVENTORY: string = 'REUPE_USE_PRODUCT_FROM_INVENTORY';
private _inventoryStripId: number;
private _furnitureTypeId: number;
constructor(type: string, roomId: number, objectId: number, category: number, inventoryStripId = -1, furnitureTypeId = -1)
{
super(type, roomId, objectId, category);
this._inventoryStripId = inventoryStripId;
this._furnitureTypeId = furnitureTypeId;
}
public get inventoryStripId(): number
{
return this._inventoryStripId;
}
public get furnitureTypeId(): number
{
return this._furnitureTypeId;
}
}

View File

@ -38,8 +38,8 @@ export class RoomObjectWidgetRequestEvent extends RoomObjectEvent
public static INERNAL_LINK: string = 'ROWRE_INTERNAL_LINK';
public static ROOM_LINK: string = 'ROWRE_ROOM_LINK';
constructor(k: string, _arg_2: IRoomObject)
constructor(type: string, roomObject: IRoomObject)
{
super(k, _arg_2);
super(type, roomObject);
}
}
}

View File

@ -7,6 +7,7 @@ export * from './RoomEngineObjectPlacedEvent';
export * from './RoomEngineObjectPlacedOnUserEvent';
export * from './RoomEngineSamplePlaybackEvent';
export * from './RoomEngineTriggerWidgetEvent';
export * from './RoomEngineUseProductEvent';
export * from './RoomObjectBadgeAssetEvent';
export * from './RoomObjectDataRequestEvent';
export * from './RoomObjectDimmerStateUpdateEvent';

View File

@ -0,0 +1,10 @@
import { RoomWidgetEnum } from '../../../../ui';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureCraftingGizmoLogic extends FurnitureLogic
{
public get widget(): string
{
return RoomWidgetEnum.CRAFTING;
}
}

View File

@ -0,0 +1,27 @@
import { ContextMenuEnum } from '../../../../ui/widget/enums/ContextMenuEnum';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureEffectBoxLogic extends FurnitureLogic
{
private _timer: any;
public getEventTypes(): string[]
{
const types = [ RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG ];
return this.mergeTypes(super.getEventTypes(), types);
}
public useObject(): void
{
if(!this.eventDispatcher || !this.object) return;
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.EFFECTBOX_OPEN_DIALOG, this.object));
}
public get contextMenu(): string
{
return ContextMenuEnum.EFFECT_BOX;
}
}

View File

@ -1,12 +1,13 @@
import { IAssetData } from '../../../../../core/asset/interfaces';
import { RoomObjectUpdateMessage } from '../../../../../room/messages/RoomObjectUpdateMessage';
import { ContextMenuEnum } from '../../../../ui';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { ObjectDataUpdateMessage } from '../../../messages/ObjectDataUpdateMessage';
import { StringDataType } from '../../data/type/StringDataType';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';
export class FurnitureFriendLogic extends FurnitureMultiStateLogic
export class FurnitureFriendFurniLogic extends FurnitureMultiStateLogic
{
private static readonly STATE_UNINITIALIZED: number = -1;
private static readonly STATE_UNLOCKED: number = 0;
@ -14,11 +15,6 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic
private _state: number = -1;
public get engravingDialogType(): number
{
return 0;
}
public initialize(asset: IAssetData): void
{
super.initialize(asset);
@ -43,7 +39,6 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic
}
super.processUpdateMessage(message);
}
public getEventTypes(): string[]
@ -55,13 +50,25 @@ export class FurnitureFriendLogic extends FurnitureMultiStateLogic
public useObject(): void
{
if(this._state == FurnitureFriendLogic.STATE_LOCKED)
if(!this.eventDispatcher || !this.object) return;
if(this._state == FurnitureFriendFurniLogic.STATE_LOCKED)
{
(this.object && this.eventDispatcher && this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING, this.object)));
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.FRIEND_FURNITURE_ENGRAVING, this.object));
}
else
{
super.useObject();
}
}
public get engravingDialogType(): number
{
return 0;
}
public get contextMenu(): string
{
return ((this._state === FurnitureFriendFurniLogic.STATE_UNLOCKED) ? ContextMenuEnum.FRIEND_FURNITURE : ContextMenuEnum.DUMMY);
}
}

View File

@ -0,0 +1,10 @@
import { FriendFurniEngravingWidgetType } from '../../../enums';
import { FurnitureFriendFurniLogic } from './FurnitureFriendFurniLogic';
export class FurnitureLoveLockLogic extends FurnitureFriendFurniLogic
{
public get engravingDialogType(): number
{
return FriendFurniEngravingWidgetType.LOVE_LOCK;
}
}

View File

@ -0,0 +1,25 @@
import { ContextMenuEnum } from '../../../../ui';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';
export class FurnitureMonsterplantSeedLogic extends FurnitureMultiStateLogic
{
public getEventTypes(): string[]
{
const types = [ RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG ];
return this.mergeTypes(super.getEventTypes(), types);
}
public useObject(): void
{
if(!this.eventDispatcher || !this.object) return;
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MONSTERPLANT_SEED_PLANT_CONFIRMATION_DIALOG, this.object));
}
public get contextMenu(): string
{
return ContextMenuEnum.MONSTERPLANT_SEED;
}
}

View File

@ -0,0 +1,25 @@
import { ContextMenuEnum } from '../../../../ui';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';
export class FurnitureMysteryTrophyLogic extends FurnitureMultiStateLogic
{
public getEventTypes(): string[]
{
const types = [ RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG ];
return this.mergeTypes(super.getEventTypes(), types);
}
public useObject(): void
{
if(!this.eventDispatcher || !this.object) return;
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.MYSTERYTROPHY_OPEN_DIALOG, this.object));
}
public get contextMenu(): string
{
return ContextMenuEnum.MYSTERY_TROPHY;
}
}

View File

@ -1,3 +1,4 @@
import { ContextMenuEnum } from '../../../../ui';
import { RoomObjectWidgetRequestEvent } from '../../../events/RoomObjectWidgetRequestEvent';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';
@ -15,6 +16,13 @@ export class FurniturePurchaseableClothingLogic extends FurnitureMultiStateLogic
public useObject(): void
{
if(!this.eventDispatcher || !this.object) return;
this.eventDispatcher.dispatchEvent(new RoomObjectWidgetRequestEvent(RoomObjectWidgetRequestEvent.PURCHASABLE_CLOTHING_CONFIRMATION_DIALOG, this.object));
}
}
public get contextMenu(): string
{
return ContextMenuEnum.PURCHASABLE_CLOTHING;
}
}

View File

@ -0,0 +1,10 @@
import { ContextMenuEnum } from '../../../../ui';
import { FurnitureMultiStateLogic } from './FurnitureMultiStateLogic';
export class FurnitureRandomTeleportLogic extends FurnitureMultiStateLogic
{
public get contextMenu(): string
{
return ContextMenuEnum.RANDOM_TELEPORT;
}
}

View File

@ -0,0 +1,48 @@
import { AdvancedMap } from '../../../../../core';
import { RoomWidgetEnum } from '../../../../ui';
import { RoomObjectDataRequestEvent } from '../../../events';
import { RoomObjectVariable } from '../../RoomObjectVariable';
import { FurnitureLogic } from './FurnitureLogic';
export class FurnitureRentableSpaceLogic extends FurnitureLogic
{
public getEventTypes(): string[]
{
const types = [
RoomObjectDataRequestEvent.RODRE_CURRENT_USER_ID,
];
return this.mergeTypes(super.getEventTypes(), types);
}
public update(time: number): void
{
super.update(time);
if(this.object && this.object.model)
{
if(!this.object.model.getValue<number>(RoomObjectVariable.SESSION_CURRENT_USER_ID))
{
this.eventDispatcher.dispatchEvent(new RoomObjectDataRequestEvent(RoomObjectDataRequestEvent.RODRE_CURRENT_USER_ID, this.object));
}
const renterId = this.object.model.getValue<AdvancedMap<string, string>>(RoomObjectVariable.FURNITURE_DATA).getValue('renterId');
const userId = this.object.model.getValue<number>(RoomObjectVariable.SESSION_CURRENT_USER_ID);
if(renterId)
{
if(parseInt(renterId) === userId) this.object.setState(2, 0);
else this.object.setState(1, 0);
}
else
{
this.object.setState(0, 0);
}
}
}
public get widget(): string
{
return RoomWidgetEnum.RENTABLESPACE;
}
}

View File

@ -2,29 +2,36 @@ export * from './FurnitureBadgeDisplayLogic';
export * from './FurnitureChangeStateWhenStepOnLogic';
export * from './FurnitureCounterClockLogic';
export * from './FurnitureCrackableLogic';
export * from './FurnitureCraftingGizmoLogic';
export * from './FurnitureCreditLogic';
export * from './FurnitureCustomStackHeightLogic';
export * from './FurnitureDiceLogic';
export * from './FurnitureEditableInternalLinkLogic';
export * from './FurnitureEditableRoomLinkLogic';
export * from './FurnitureEffectBoxLogic';
export * from './FurnitureExternalImageLogic';
export * from './FurnitureFireworksLogic';
export * from './FurnitureFloorHoleLogic';
export * from './FurnitureFriendLogic';
export * from './FurnitureFriendFurniLogic';
export * from './FurnitureGuildCustomizedLogic';
export * from './FurnitureHabboWheelLogic';
export * from './FurnitureHighScoreLogic';
export * from './FurnitureHockeyScoreLogic';
export * from './FurnitureIceStormLogic';
export * from './FurnitureLogic';
export * from './FurnitureLoveLockLogic';
export * from './FurnitureMannequinLogic';
export * from './FurnitureMonsterplantSeedLogic';
export * from './FurnitureMultiHeightLogic';
export * from './FurnitureMultiStateLogic';
export * from './FurnitureMysteryTrophyLogic';
export * from './FurnitureOneWayDoorLogic';
export * from './FurniturePetCustomizationLogic';
export * from './FurniturePresentLogic';
export * from './FurniturePurchaseableClothingLogic';
export * from './FurniturePushableLogic';
export * from './FurnitureRandomTeleportLogic';
export * from './FurnitureRentableSpaceLogic';
export * from './FurnitureRoomBackgroundColorLogic';
export * from './FurnitureRoomBackgroundLogic';
export * from './FurnitureRoomBillboardLogic';

View File

@ -33,6 +33,8 @@ export interface IRoomSession extends IDisposable
pickupPet(id: number): void;
pickupBot(id: number): void;
requestMoodlightSettings(): void;
mountPet(id: number): void;
dismountPet(id: number): void;
connection: IConnection;
userDataManager: UserDataManager;
roomId: number;

View File

@ -1,5 +1,6 @@
import { Disposable } from '../../core/common/disposable/Disposable';
import { IConnection } from '../../core/communication/connections/IConnection';
import { PetMountComposer } from '../communication';
import { RoomDoorbellAccessComposer } from '../communication/messages/outgoing/room/access/RoomDoorbellAccessComposer';
import { RoomEnterComposer } from '../communication/messages/outgoing/room/access/RoomEnterComposer';
import { RoomAmbassadorAlertComposer } from '../communication/messages/outgoing/room/action/RoomAmbassadorAlertComposer';
@ -262,6 +263,16 @@ export class RoomSession extends Disposable implements IRoomSession
this._connection.send(new OpenPresentComposer(objectId));
}
public mountPet(id: number): void
{
this._connection.send(new PetMountComposer(id, true));
}
public dismountPet(id: number): void
{
this._connection.send(new PetMountComposer(id, false));
}
public get connection(): IConnection
{
return this._connection;

View File

@ -0,0 +1,12 @@
export class ContextMenuEnum
{
public static DUMMY: string = 'DUMMY';
public static FRIEND_FURNITURE: string = 'FRIEND_FURNITURE';
public static MONSTERPLANT_SEED: string = 'MONSTERPLANT_SEED';
public static MYSTERY_BOX: string = 'MYSTERY_BOX';
public static EFFECT_BOX: string = 'EFFECT_BOX';
public static MYSTERY_TROPHY: string = 'MYSTERY_TROPHY';
public static RANDOM_TELEPORT: string = 'RANDOM_TELEPORT';
public static PURCHASABLE_CLOTHING: string = 'PURCHASABLE_CLOTHING';
public static GENERIC_USABLE: string = 'GENERIC_USABLE';
}

View File

@ -1,4 +1,5 @@
export * from './AvatarExpressionEnum';
export * from './ContextMenuEnum';
export * from './FriendWidgetEngravingWidgetTypeEnum';
export * from './RoomWidgetEnum';
export * from './RoomWidgetEnumItemExtradataParameter';