mirror of
https://github.com/billsonnn/nitro-renderer.git
synced 2025-01-31 11:12:35 +01:00
Some updates
This commit is contained in:
parent
73006d4d5b
commit
55666e8d55
@ -381,12 +381,12 @@ import { BotPlaceComposer } from './messages/outgoing/room/engine/BotPlaceCompos
|
||||
import { BotRemoveComposer } from './messages/outgoing/room/engine/BotRemoveComposer';
|
||||
import { BotSkillSaveComposer } from './messages/outgoing/room/engine/BotSkillSaveComposer';
|
||||
import { GetItemDataComposer } from './messages/outgoing/room/engine/GetItemDataComposer';
|
||||
import { ModifyWallItemDataComposer } from './messages/outgoing/room/engine/ModifyWallItemDataComposer';
|
||||
import { PetMoveComposer } from './messages/outgoing/room/engine/PetMoveComposer';
|
||||
import { PetPlaceComposer } from './messages/outgoing/room/engine/PetPlaceComposer';
|
||||
import { PetRemoveComposer } from './messages/outgoing/room/engine/PetRemoveComposer';
|
||||
import { RemoveWallItemComposer } from './messages/outgoing/room/engine/RemoveWallItemComposer';
|
||||
import { RoomAdsUpdateComposer } from './messages/outgoing/room/furniture/ads/RoomAdsUpdateComposer';
|
||||
import { SetItemDataMessageComposer } from './messages/outgoing/room/engine/SetItemDataMessageComposer';
|
||||
import { SetObjectDataMessageComposer } from './messages/outgoing/room/engine/SetObjectDataMessageComposer';
|
||||
import { MoodlightSettingsComposer } from './messages/outgoing/room/furniture/dimmer/MoodlightSettingsComposer';
|
||||
import { MoodlightSettingsSaveComposer } from './messages/outgoing/room/furniture/dimmer/MoodlightSettingsSaveComposer';
|
||||
import { MoodlightTogggleStateComposer } from './messages/outgoing/room/furniture/dimmer/MoodlightTogggleStateComposer';
|
||||
@ -980,13 +980,14 @@ export class NitroMessages implements IMessageConfiguration
|
||||
// ENGINE
|
||||
this._composers.set(OutgoingHeader.GET_ITEM_DATA, GetItemDataComposer);
|
||||
this._composers.set(OutgoingHeader.REMOVE_WALL_ITEM, RemoveWallItemComposer);
|
||||
this._composers.set(OutgoingHeader.MODIFY_WALL_ITEM_DATA, ModifyWallItemDataComposer);
|
||||
this._composers.set(OutgoingHeader.BOT_PLACE, BotPlaceComposer);
|
||||
this._composers.set(OutgoingHeader.BOT_PICKUP, BotRemoveComposer);
|
||||
this._composers.set(OutgoingHeader.BOT_SKILL_SAVE, BotSkillSaveComposer);
|
||||
this._composers.set(OutgoingHeader.PET_PLACE, PetPlaceComposer);
|
||||
this._composers.set(OutgoingHeader.PET_MOVE, PetMoveComposer);
|
||||
this._composers.set(OutgoingHeader.PET_PICKUP, PetRemoveComposer);
|
||||
this._composers.set(OutgoingHeader.SET_ITEM_DATA, SetItemDataMessageComposer);
|
||||
this._composers.set(OutgoingHeader.SET_OBJECT_DATA, SetObjectDataMessageComposer);
|
||||
|
||||
// FURNITURE
|
||||
this._composers.set(OutgoingHeader.FURNITURE_ALIASES, FurnitureAliasesComposer);
|
||||
@ -1021,7 +1022,6 @@ export class NitroMessages implements IMessageConfiguration
|
||||
this._composers.set(OutgoingHeader.ONE_WAY_DOOR_CLICK, FurnitureOneWayDoorComposer);
|
||||
this._composers.set(OutgoingHeader.ITEM_EXCHANGE_REDEEM, FurnitureExchangeComposer);
|
||||
this._composers.set(OutgoingHeader.ITEM_CLOTHING_REDEEM, RedeemItemClothingComposer);
|
||||
this._composers.set(OutgoingHeader.ITEM_SAVE_BACKGROUND, RoomAdsUpdateComposer);
|
||||
|
||||
// MAPPING
|
||||
this._composers.set(OutgoingHeader.ROOM_MODEL, RoomModelComposer);
|
||||
|
@ -69,7 +69,7 @@ export class OutgoingHeader
|
||||
public static ITEM_DIMMER_TOGGLE = 2296;
|
||||
public static ITEM_EXCHANGE_REDEEM = 3115;
|
||||
public static ITEM_PAINT = 711;
|
||||
public static ITEM_SAVE_BACKGROUND = 3608;
|
||||
public static SET_OBJECT_DATA = 3608;
|
||||
public static ITEM_STACK_HELPER = 3839;
|
||||
public static ITEM_WALL_CLICK = 210;
|
||||
public static ITEM_WALL_UPDATE = 168;
|
||||
@ -196,7 +196,7 @@ export class OutgoingHeader
|
||||
public static GET_ITEM_DATA = 3964;
|
||||
public static ONE_WAY_DOOR_CLICK = 2765;
|
||||
public static REMOVE_WALL_ITEM = 3336;
|
||||
public static MODIFY_WALL_ITEM_DATA = 3666;
|
||||
public static SET_ITEM_DATA = 3666;
|
||||
public static CATALOG_REDEEM_VOUCHER = 339;
|
||||
public static ROOM_TONER_APPLY = 2880;
|
||||
public static LOVELOCK_START_CONFIRM = 3775;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer';
|
||||
|
||||
export class ModifyWallItemDataComposer implements IMessageComposer<ConstructorParameters<typeof ModifyWallItemDataComposer>>
|
||||
export class SetItemDataMessageComposer implements IMessageComposer<ConstructorParameters<typeof SetItemDataMessageComposer>>
|
||||
{
|
||||
private _data: ConstructorParameters<typeof ModifyWallItemDataComposer>;
|
||||
private _data: ConstructorParameters<typeof SetItemDataMessageComposer>;
|
||||
|
||||
constructor(itemId: number, colorHex: string, text: string)
|
||||
{
|
@ -0,0 +1,23 @@
|
||||
import { IMessageComposer } from '../../../../../../core/communication/messages/IMessageComposer';
|
||||
|
||||
export class SetObjectDataMessageComposer implements IMessageComposer<any[]>
|
||||
{
|
||||
private _data: any[];
|
||||
|
||||
constructor(objectId: number, data: Map<string, string>)
|
||||
{
|
||||
this._data = [ objectId, (data.size * 2) ];
|
||||
|
||||
for(const [ key, value ] of data.entries()) this._data.push( key, value );
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
@ -2,8 +2,9 @@ export * from './BotPlaceComposer';
|
||||
export * from './BotRemoveComposer';
|
||||
export * from './BotSkillSaveComposer';
|
||||
export * from './GetItemDataComposer';
|
||||
export * from './ModifyWallItemDataComposer';
|
||||
export * from './PetMoveComposer';
|
||||
export * from './PetPlaceComposer';
|
||||
export * from './PetRemoveComposer';
|
||||
export * from './RemoveWallItemComposer';
|
||||
export * from './SetItemDataMessageComposer';
|
||||
export * from './SetObjectDataMessageComposer';
|
||||
|
@ -1,23 +0,0 @@
|
||||
import { IMessageComposer } from '../../../../../../../core/communication/messages/IMessageComposer';
|
||||
|
||||
export class RoomAdsUpdateComposer implements IMessageComposer<any[]>
|
||||
{
|
||||
private _data: any[];
|
||||
|
||||
constructor(k: number, _arg_2: Map<string, string>)
|
||||
{
|
||||
this._data = [ k, (_arg_2.size * 2) ];
|
||||
|
||||
for(const [ key, value ] of _arg_2.entries()) this._data.push( key, value );
|
||||
}
|
||||
|
||||
public getMessageArray()
|
||||
{
|
||||
return this._data;
|
||||
}
|
||||
|
||||
public dispose(): void
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from './RoomAdsUpdateComposer';
|
@ -1,4 +1,3 @@
|
||||
export * from './ads';
|
||||
export * from './dimmer';
|
||||
export * from './floor';
|
||||
export * from './FurnitureAliasesComposer';
|
||||
|
@ -87,15 +87,14 @@ export interface IRoomEngine extends INitroManager
|
||||
objectInitialized(roomId: string, objectId: number, category: number): void;
|
||||
changeObjectModelData(roomId: number, objectId: number, category: number, numberKey: string, numberValue: number): boolean;
|
||||
changeObjectState(roomId: number, objectId: number, category: number): void;
|
||||
processRoomObjectWallOperation(objectId: number, category: number, operation: string, data: Map<string, string>): boolean;
|
||||
processRoomObjectFloorOperation(objectId: number, category: number, operation: string, data: string): boolean;
|
||||
processRoomObjectOperation(objectId: number, category: number, operation: string): boolean;
|
||||
modifyRoomObjectDataWithMap(objectId: number, category: number, operation: string, data: Map<string, string>): boolean
|
||||
modifyRoomObjectData(objectId: number, category: number, colorHex: string, data: string): boolean
|
||||
processRoomObjectPlacement(placementSource: string, id: number, category: number, typeId: number, legacyString?: string, stuffData?: IObjectData, state?: number, frameNumber?: number, posture?: string): boolean;
|
||||
dispatchMouseEvent(canvasId: number, x: number, y: number, type: string, altKey: boolean, ctrlKey: boolean, shiftKey: boolean, buttonDown: boolean): void;
|
||||
createTextureFromRoom(roomId: number, canvasId?: number, bounds?: Rectangle): RenderTexture;
|
||||
saveTextureAsScreenshot(texture: RenderTexture, saveAsThumbnail?: boolean): void;
|
||||
saveBase64AsScreenshot(base64: string, saveAsThumbnail?: boolean): void;
|
||||
modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean;
|
||||
deleteRoomObject(objectId: number, objectCategory: number): boolean;
|
||||
sessionDataManager: ISessionDataManager;
|
||||
roomSessionManager: IRoomSessionManager;
|
||||
|
@ -342,8 +342,6 @@ export class RoomContentLoader implements IFurnitureDataListener
|
||||
|
||||
const collection = new GraphicAssetCollection(data, spritesheet);
|
||||
|
||||
console.log(data);
|
||||
|
||||
this._collections.set(collection.name, collection);
|
||||
|
||||
const petIndex = this._pets[collection.name];
|
||||
|
@ -2648,22 +2648,22 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
this._roomObjectEventHandler.modifyRoomObject(this._activeRoomId, objectId, category, operation);
|
||||
}
|
||||
|
||||
public processRoomObjectWallOperation(objectId: number, category: number, operation: string, data: Map<string, string>): boolean
|
||||
{
|
||||
if(!this._roomObjectEventHandler) return false;
|
||||
|
||||
if(category !== RoomObjectCategory.WALL) return;
|
||||
|
||||
this._roomObjectEventHandler.processRoomObjectWallOperation(this._activeRoomId, objectId, category, operation, data);
|
||||
}
|
||||
|
||||
public processRoomObjectFloorOperation(objectId: number, category: number, operation: string, data: string): boolean
|
||||
public modifyRoomObjectDataWithMap(objectId: number, category: number, operation: string, data: Map<string, string>): boolean
|
||||
{
|
||||
if(!this._roomObjectEventHandler) return false;
|
||||
|
||||
if(category !== RoomObjectCategory.FLOOR) return;
|
||||
|
||||
this._roomObjectEventHandler.processRoomObjectFloorOperation(this._activeRoomId, objectId, operation, data);
|
||||
this._roomObjectEventHandler.modifyRoomObjectDataWithMap(this._activeRoomId, objectId, category, operation, data);
|
||||
}
|
||||
|
||||
public modifyRoomObjectData(objectId: number, category: number, colorHex: string, data: string): boolean
|
||||
{
|
||||
if(!this._roomObjectEventHandler) return false;
|
||||
|
||||
if(category !== RoomObjectCategory.WALL) return;
|
||||
|
||||
this._roomObjectEventHandler.modifyWallItemData(this._activeRoomId, objectId, colorHex, data);
|
||||
}
|
||||
|
||||
private processRoomObjectEvent(event: RoomObjectEvent): void
|
||||
@ -3588,13 +3588,6 @@ export class RoomEngine extends NitroManager implements IRoomEngine, IRoomCreato
|
||||
return this._roomContentLoader.getPetColorResultsForTag(petIndex, tagName);
|
||||
}
|
||||
|
||||
public modifyRoomObjectData(objectId: number, objectCategory: number, colorHex: string, text: string): boolean
|
||||
{
|
||||
if(!this._roomObjectEventHandler || (objectCategory !== RoomObjectCategory.WALL)) return false;
|
||||
|
||||
return (this._roomObjectEventHandler.modifyWallItemData(this._activeRoomId, objectId, colorHex, text));
|
||||
}
|
||||
|
||||
public deleteRoomObject(objectId: number, objectCategory: number): boolean
|
||||
{
|
||||
if(!this._roomObjectEventHandler || (objectCategory !== RoomObjectCategory.WALL)) return false;
|
||||
|
@ -11,13 +11,13 @@ 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 { FurnitureGuildInfoComposer, SetObjectDataMessageComposer } 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';
|
||||
import { PetMoveComposer } from '../communication/messages/outgoing/room/engine/PetMoveComposer';
|
||||
import { PetPlaceComposer } from '../communication/messages/outgoing/room/engine/PetPlaceComposer';
|
||||
import { RemoveWallItemComposer } from '../communication/messages/outgoing/room/engine/RemoveWallItemComposer';
|
||||
import { SetItemDataMessageComposer } from '../communication/messages/outgoing/room/engine/SetItemDataMessageComposer';
|
||||
import { FurnitureFloorUpdateComposer } from '../communication/messages/outgoing/room/furniture/floor/FurnitureFloorUpdateComposer';
|
||||
import { FurniturePickupComposer } from '../communication/messages/outgoing/room/furniture/FurniturePickupComposer';
|
||||
import { FurniturePlaceComposer } from '../communication/messages/outgoing/room/furniture/FurniturePlaceComposer';
|
||||
@ -1746,36 +1746,6 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
||||
}
|
||||
}
|
||||
|
||||
public processRoomObjectWallOperation(roomId: number, objectId: number, category: number, operation: string, data: Map<string, string>): boolean
|
||||
{
|
||||
if(!this._roomEngine) return false;
|
||||
|
||||
const roomObject = this._roomEngine.getRoomObject(roomId, objectId, category);
|
||||
|
||||
if(!roomObject) return false;
|
||||
|
||||
switch(operation)
|
||||
{
|
||||
case RoomObjectOperationType.OBJECT_SAVE_STUFF_DATA:
|
||||
if(this._roomEngine.connection)
|
||||
{
|
||||
//this._roomEngine.connection.send(new _Str_5686(objectId, data));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public processRoomObjectFloorOperation(roomId: number, objectId: number, operation: string, data: string): boolean
|
||||
{
|
||||
if(!this._roomEngine) return false;
|
||||
|
||||
//this._roomEngine.connection.send(new _Str_10640(objectId, operation, data));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public modifyRoomObject(roomId: number, objectId: number, category: number, operation: string): boolean
|
||||
{
|
||||
if(!this._roomEngine) return false;
|
||||
@ -1925,6 +1895,45 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
||||
return true;
|
||||
}
|
||||
|
||||
public modifyRoomObjectDataWithMap(roomId: number, objectId: number, category: number, operation: string, data: Map<string, string>): boolean
|
||||
{
|
||||
if(!this._roomEngine) return false;
|
||||
|
||||
const roomObject = this._roomEngine.getRoomObject(roomId, objectId, category);
|
||||
|
||||
if(!roomObject) return false;
|
||||
|
||||
switch(operation)
|
||||
{
|
||||
case RoomObjectOperationType.OBJECT_SAVE_STUFF_DATA:
|
||||
if(this._roomEngine.connection)
|
||||
{
|
||||
this._roomEngine.connection.send(new SetObjectDataMessageComposer(objectId, data));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public modifyWallItemData(roomId: number, objectId: number, colorHex: string, text: string): boolean
|
||||
{
|
||||
if(!this._roomEngine || !this._roomEngine.connection) return false;
|
||||
|
||||
this._roomEngine.connection.send(new SetItemDataMessageComposer(objectId, colorHex, text));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public deleteWallItem(roomId: number, itemId: number): boolean
|
||||
{
|
||||
if(!this._roomEngine || !this._roomEngine.connection) return false;
|
||||
|
||||
this._roomEngine.connection.send(new RemoveWallItemComposer(itemId));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public getValidRoomObjectDirection(k: IRoomObjectController, _arg_2: boolean): number
|
||||
{
|
||||
if(!k || !k.model) return 0;
|
||||
@ -2237,30 +2246,6 @@ export class RoomObjectEventHandler extends Disposable implements IRoomCanvasMou
|
||||
return true;
|
||||
}
|
||||
|
||||
public modifyWallItemData(roomId: number, objectId: number, colorHex: string, text: string): boolean
|
||||
{
|
||||
if(!this._roomEngine || !this._roomEngine.connection)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this._roomEngine.connection.send(new ModifyWallItemDataComposer(objectId, colorHex, text));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public deleteWallItem(roomId: number, itemId: number): boolean
|
||||
{
|
||||
if(!this._roomEngine || !this._roomEngine.connection)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
this._roomEngine.connection.send(new RemoveWallItemComposer(itemId));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public get engine(): IRoomEngineServices
|
||||
{
|
||||
return this._roomEngine;
|
||||
|
Loading…
x
Reference in New Issue
Block a user