diff --git a/src/nitro/communication/NitroMessages.ts b/src/nitro/communication/NitroMessages.ts index 12e27741..c6347dfc 100644 --- a/src/nitro/communication/NitroMessages.ts +++ b/src/nitro/communication/NitroMessages.ts @@ -226,6 +226,12 @@ import { UserCurrencyUpdateEvent } from './messages/incoming/user/inventory/curr import { UserSubscriptionEvent } from './messages/incoming/user/inventory/subscription/UserSubscriptionEvent'; import { UserWardrobePageEvent } from './messages/incoming/user/wardrobe/UserWardrobePageEvent'; import { RequestAchievementsMessageComposer } from './messages/outgoing/achievements/RequestAchievementsMessageComposer'; +import { PhotoCompetitionMessageComposer } from './messages/outgoing/camera/PhotoCompetitionMessageComposer'; +import { PublishPhotoMessageComposer } from './messages/outgoing/camera/PublishPhotoMessageComposer'; +import { PurchasePhotoMessageComposer } from './messages/outgoing/camera/PurchasePhotoMessageComposer'; +import { RenderRoomMessageComposer } from './messages/outgoing/camera/RenderRoomMessageComposer'; +import { RenderRoomThumbnailMessageComposer } from './messages/outgoing/camera/RenderRoomThumbnailMessageComposer'; +import { RequestCameraConfigurationComposer } from './messages/outgoing/camera/RequestCameraConfigurationComposer'; import { CatalogGroupsComposer } from './messages/outgoing/catalog/CatalogGroupsComposer'; import { CatalogModeComposer } from './messages/outgoing/catalog/CatalogModeComposer'; import { CatalogPageComposer } from './messages/outgoing/catalog/CatalogPageComposer'; @@ -1155,6 +1161,14 @@ export class NitroMessages implements IMessageConfiguration this._composers.set(OutgoingHeader.GET_CRAFTABLE_PRODUCTS, GetCraftableProductsComposer); this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPE, GetCraftingRecipeComposer); this._composers.set(OutgoingHeader.GET_CRAFTING_RECIPES_AVAILABLE, GetCraftingRecipesAvailableComposer); + + // CAMERA + this._composers.set(OutgoingHeader.REQUEST_CAMERA_CONFIGURATION, RequestCameraConfigurationComposer); + this._composers.set(OutgoingHeader.RENDER_ROOM, RenderRoomMessageComposer); + this._composers.set(OutgoingHeader.RENDER_ROOM_THUMBNAIL, RenderRoomThumbnailMessageComposer); + this._composers.set(OutgoingHeader.PURCHASE_PHOTO, PurchasePhotoMessageComposer); + this._composers.set(OutgoingHeader.PUBLISH_PHOTO, PublishPhotoMessageComposer); + this._composers.set(OutgoingHeader.PHOTO_COMPETITION, PhotoCompetitionMessageComposer); } public get events(): Map diff --git a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts index 1e86d55f..dafeec4b 100644 --- a/src/nitro/communication/messages/outgoing/OutgoingHeader.ts +++ b/src/nitro/communication/messages/outgoing/OutgoingHeader.ts @@ -270,4 +270,10 @@ export class OutgoingHeader public static GET_CRAFTABLE_PRODUCTS = 633; public static GET_CRAFTING_RECIPE = 1173; public static GET_CRAFTING_RECIPES_AVAILABLE = 3086; + public static PHOTO_COMPETITION = 3959; + public static PUBLISH_PHOTO = 2068; + public static PURCHASE_PHOTO = 2408; + public static RENDER_ROOM = 3226; + public static RENDER_ROOM_THUMBNAIL = 1982; + public static REQUEST_CAMERA_CONFIGURATION = 796; } diff --git a/src/nitro/communication/messages/outgoing/camera/PhotoCompetitionMessageComposer.ts b/src/nitro/communication/messages/outgoing/camera/PhotoCompetitionMessageComposer.ts new file mode 100644 index 00000000..581f8f45 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/PhotoCompetitionMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PhotoCompetitionMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/camera/PublishPhotoMessageComposer.ts b/src/nitro/communication/messages/outgoing/camera/PublishPhotoMessageComposer.ts new file mode 100644 index 00000000..1b846b80 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/PublishPhotoMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PublishPhotoMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/camera/PurchasePhotoMessageComposer.ts b/src/nitro/communication/messages/outgoing/camera/PurchasePhotoMessageComposer.ts new file mode 100644 index 00000000..1dae08b5 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/PurchasePhotoMessageComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class PurchasePhotoMessageComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor(photoId: string) + { + this._data = [photoId]; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/camera/RenderRoomMessageComposer.ts b/src/nitro/communication/messages/outgoing/camera/RenderRoomMessageComposer.ts new file mode 100644 index 00000000..b540a82b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/RenderRoomMessageComposer.ts @@ -0,0 +1,30 @@ +import { RenderTexture } from 'pixi.js'; +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; +import { PNGEncoder } from '../../../../utils/PNGEncoder'; + +export class RenderRoomMessageComposer implements IMessageComposer> +{ + private _data: any; + + constructor(k:any, _arg_2: string, _arg_3: string, _arg_4: number, _arg_5: number) + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + this._data = []; + } + + public assignBitmap(texture: RenderTexture):void + { + const bitmapEncoded = PNGEncoder.encode(texture); + this._data = [ bitmapEncoded ]; + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/camera/RenderRoomThumbnailMessageComposer.ts b/src/nitro/communication/messages/outgoing/camera/RenderRoomThumbnailMessageComposer.ts new file mode 100644 index 00000000..a115da8f --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/RenderRoomThumbnailMessageComposer.ts @@ -0,0 +1,9 @@ +import { RenderRoomMessageComposer } from './RenderRoomMessageComposer'; + +export class RenderRoomThumbnailMessageComposer extends RenderRoomMessageComposer +{ + constructor(k:any, _arg_2:string, _arg_3:string, _arg_4:number, _arg_5:number) + { + super(k, _arg_2, _arg_3, _arg_4, _arg_5); + } +} diff --git a/src/nitro/communication/messages/outgoing/camera/RequestCameraConfigurationComposer.ts b/src/nitro/communication/messages/outgoing/camera/RequestCameraConfigurationComposer.ts new file mode 100644 index 00000000..e33f959b --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/RequestCameraConfigurationComposer.ts @@ -0,0 +1,21 @@ +import { IMessageComposer } from '../../../../../core/communication/messages/IMessageComposer'; + +export class RequestCameraConfigurationComposer implements IMessageComposer> +{ + private _data: ConstructorParameters; + + constructor() + { + this._data = []; + } + + public getMessageArray() + { + return this._data; + } + + public dispose(): void + { + return; + } +} diff --git a/src/nitro/communication/messages/outgoing/camera/index.ts b/src/nitro/communication/messages/outgoing/camera/index.ts new file mode 100644 index 00000000..626c1cd2 --- /dev/null +++ b/src/nitro/communication/messages/outgoing/camera/index.ts @@ -0,0 +1,6 @@ +export * from './PhotoCompetitionMessageComposer'; +export * from './PublishPhotoMessageComposer'; +export * from './PurchasePhotoMessageComposer'; +export * from './RenderRoomMessageComposer'; +export * from './RenderRoomThumbnailMessageComposer'; +export * from './RequestCameraConfigurationComposer'; diff --git a/src/nitro/communication/messages/outgoing/index.ts b/src/nitro/communication/messages/outgoing/index.ts index cd84b135..ee10b047 100644 --- a/src/nitro/communication/messages/outgoing/index.ts +++ b/src/nitro/communication/messages/outgoing/index.ts @@ -1,4 +1,5 @@ export * from './achievements'; +export * from './camera'; export * from './catalog'; export * from './client'; export * from './desktop';