From 4d3a13e2bd0af81463759d0af9ad97c05ccbf661 Mon Sep 17 00:00:00 2001 From: Bill Date: Fri, 18 Mar 2022 00:59:43 -0400 Subject: [PATCH] Add GetResolutionAchievementsMessageComposer --- src/nitro/communication/NitroMessages.ts | 3 +++ ...etResolutionAchievementsMessageComposer.ts | 21 +++++++++++++++++++ .../messages/outgoing/game/index.ts | 1 + .../communication/messages/outgoing/index.ts | 1 + src/nitro/room/RoomObjectEventHandler.ts | 4 ++-- 5 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 src/nitro/communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer.ts create mode 100644 src/nitro/communication/messages/outgoing/game/index.ts diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index ff28d62b..4f38a336 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -275,6 +275,7 @@ import { SendMessageComposer } from './messages/outgoing/friendlist/SendMessageC import { SendRoomInviteComposer } from './messages/outgoing/friendlist/SendRoomInviteComposer'; import { SetRelationshipStatusComposer } from './messages/outgoing/friendlist/SetRelationshipStatusComposer'; import { VisitUserComposer } from './messages/outgoing/friendlist/VisitUserComposer'; +import { GetResolutionAchievementsMessageComposer } from './messages/outgoing/game/GetResolutionAchievementsMessageComposer'; import { GroupAdminGiveComposer } from './messages/outgoing/group/GroupAdminGiveComposer'; import { GroupAdminTakeComposer } from './messages/outgoing/group/GroupAdminTakeComposer'; import { GroupBadgePartsComposer } from './messages/outgoing/group/GroupBadgePartsComposer'; @@ -1374,6 +1375,8 @@ export class NitroMessages implements IMessageConfiguration // TALENT this._composers.set(OutgoingHeader.HELPER_TALENT_TRACK, TalentTrackComposer); + + this._composers.set(OutgoingHeader.ACHIEVEMENT_RESOLUTION_OPEN, GetResolutionAchievementsMessageComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer.ts b/src/nitro/communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer.ts new file mode 100644 index 00000000..80b037b3 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core'; + +export class GetResolutionAchievementsMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(objectId: number, achievementId: number) + { + this._data = [ objectId, achievementId ]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/game/index.ts b/src/nitro/communication/messages/outgoing/game/index.ts new file mode 100644 index 00000000..97e10c21 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/game/index.ts @@ -0,0 +1 @@ +export * from './GetResolutionAchievementsMessageComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index 96ea24b4..a310f6e8 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -8,6 +8,7 @@ export * from './crafting'; export * from './desktop'; export * from './friendfurni'; export * from './friendlist'; +export * from './game'; export * from './gifts'; export * from './group'; export * from './groupforums'; diff --git a/src/nitro/room/RoomObjectEventHandler.ts b/src/nitro/room/RoomObjectEventHandler.ts index b211ddce..1ce23390 100644 --- a/src/nitro/room/RoomObjectEventHandler.ts +++ b/src/nitro/room/RoomObjectEventHandler.ts @@ -12,6 +12,7 @@ import { IVector3D } from '../../room/utils/IVector3D'; import { RoomEnterEffect } from '../../room/utils/RoomEnterEffect'; import { Vector3d } from '../../room/utils/Vector3d'; import { FurnitureGroupInfoComposer, SetObjectDataMessageComposer } from '../communication'; +import { GetResolutionAchievementsMessageComposer } from '../communication/messages/outgoing/game/GetResolutionAchievementsMessageComposer'; import { BotPlaceComposer } from '../communication/messages/outgoing/room/engine/BotPlaceComposer'; import { GetItemDataComposer } from '../communication/messages/outgoing/room/engine/GetItemDataComposer'; import { PetMoveComposer } from '../communication/messages/outgoing/room/engine/PetMoveComposer'; @@ -835,8 +836,7 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou 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) + this._roomEngine.connection.send(new GetResolutionAchievementsMessageComposer(event.objectId, 0)); return; case RoomObjectWidgetRequestEvent.ACHIEVEMENT_RESOLUTION_ENGRAVING: eventDispatcher.dispatchEvent(new RoomEngineTriggerWidgetEvent(RoomEngineTriggerWidgetEvent.REQUEST_ACHIEVEMENT_RESOLUTION_ENGRAVING, roomId, objectId, objectCategory));