You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
Expose room, user and furni metadata for wired tools
- parse extra room snapshot data such as hotel time, room item limit and group context - expose richer furni metadata including flags, dimensions and teleport targets - expose richer user metadata including room-entry fields and ids needed by inspection tools - keep session and room engine models aligned with the new wired monitor/inspection flow
This commit is contained in:
@@ -17,6 +17,11 @@ export class RoomSession implements IRoomSession
|
||||
private _allowPets: boolean = false;
|
||||
private _controllerLevel: number = RoomControllerLevel.NONE;
|
||||
private _ownRoomIndex: number = -1;
|
||||
private _groupId: number = 0;
|
||||
private _hotelTimeZone: string = 'UTC';
|
||||
private _hotelTimeSnapshotMs: number = 0;
|
||||
private _hotelTimeSyncMs: number = 0;
|
||||
private _roomItemLimit: number = 0;
|
||||
private _isGuildRoom: boolean = false;
|
||||
private _isRoomOwner: boolean = false;
|
||||
private _isDecorating: boolean = false;
|
||||
@@ -398,6 +403,56 @@ export class RoomSession implements IRoomSession
|
||||
return this._ownRoomIndex;
|
||||
}
|
||||
|
||||
public get groupId(): number
|
||||
{
|
||||
return this._groupId;
|
||||
}
|
||||
|
||||
public set groupId(groupId: number)
|
||||
{
|
||||
this._groupId = groupId;
|
||||
}
|
||||
|
||||
public get hotelTimeZone(): string
|
||||
{
|
||||
return this._hotelTimeZone;
|
||||
}
|
||||
|
||||
public set hotelTimeZone(timeZone: string)
|
||||
{
|
||||
this._hotelTimeZone = (timeZone || 'UTC');
|
||||
}
|
||||
|
||||
public get hotelTimeSnapshotMs(): number
|
||||
{
|
||||
return this._hotelTimeSnapshotMs;
|
||||
}
|
||||
|
||||
public set hotelTimeSnapshotMs(value: number)
|
||||
{
|
||||
this._hotelTimeSnapshotMs = value;
|
||||
}
|
||||
|
||||
public get hotelTimeSyncMs(): number
|
||||
{
|
||||
return this._hotelTimeSyncMs;
|
||||
}
|
||||
|
||||
public set hotelTimeSyncMs(value: number)
|
||||
{
|
||||
this._hotelTimeSyncMs = value;
|
||||
}
|
||||
|
||||
public get roomItemLimit(): number
|
||||
{
|
||||
return this._roomItemLimit;
|
||||
}
|
||||
|
||||
public set roomItemLimit(value: number)
|
||||
{
|
||||
this._roomItemLimit = value;
|
||||
}
|
||||
|
||||
public get isGuildRoom(): boolean
|
||||
{
|
||||
return this._isGuildRoom;
|
||||
|
||||
@@ -28,6 +28,8 @@ export class RoomUserData implements IRoomUserData
|
||||
private _hasBreedingPermission: boolean;
|
||||
private _botSkills: number[];
|
||||
private _isModerator: boolean;
|
||||
private _roomEntryMethod: string = 'unknown';
|
||||
private _roomEntryTeleportId: number = 0;
|
||||
|
||||
constructor(k: number)
|
||||
{
|
||||
@@ -288,4 +290,24 @@ export class RoomUserData implements IRoomUserData
|
||||
{
|
||||
this._isModerator = k;
|
||||
}
|
||||
|
||||
public get roomEntryMethod(): string
|
||||
{
|
||||
return this._roomEntryMethod;
|
||||
}
|
||||
|
||||
public set roomEntryMethod(k: string)
|
||||
{
|
||||
this._roomEntryMethod = k;
|
||||
}
|
||||
|
||||
public get roomEntryTeleportId(): number
|
||||
{
|
||||
return this._roomEntryTeleportId;
|
||||
}
|
||||
|
||||
public set roomEntryTeleportId(k: number)
|
||||
{
|
||||
this._roomEntryTeleportId = k;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ export class FurnitureData implements IFurnitureData
|
||||
private _purchaseCouldBeUsedForBuyout: boolean;
|
||||
private _rentCouldBeUsedForBuyout: boolean;
|
||||
private _availableForBuildersClub: boolean;
|
||||
private _allowStack: boolean;
|
||||
private _canStandOn: boolean;
|
||||
private _canSitOn: boolean;
|
||||
private _canLayOn: boolean;
|
||||
@@ -32,7 +33,7 @@ export class FurnitureData implements IFurnitureData
|
||||
private _environment: string;
|
||||
private _rare: boolean;
|
||||
|
||||
constructor(type: FurnitureType, id: number, fullName: string, className: string, category: string, localizedName: string, description: string, revision: number, tileSizeX: number, tileSizeY: number, tileSizeZ: number, colors: number[], hadIndexedColor: boolean, colorIndex: number, adUrl: string, purchaseOfferId: number, purchaseCouldBeUsedForBuyout: boolean, rentOfferId: number, rentCouldBeUsedForBuyout: boolean, availableForBuildersClub: boolean, customParams: string, specialType: number, canStandOn: boolean, canSitOn: boolean, canLayOn: boolean, excludedfromDynamic: boolean, furniLine: string, environment: string, rare: boolean)
|
||||
constructor(type: FurnitureType, id: number, fullName: string, className: string, category: string, localizedName: string, description: string, revision: number, tileSizeX: number, tileSizeY: number, tileSizeZ: number, colors: number[], hadIndexedColor: boolean, colorIndex: number, adUrl: string, purchaseOfferId: number, purchaseCouldBeUsedForBuyout: boolean, rentOfferId: number, rentCouldBeUsedForBuyout: boolean, availableForBuildersClub: boolean, customParams: string, specialType: number, allowStack: boolean, canStandOn: boolean, canSitOn: boolean, canLayOn: boolean, excludedfromDynamic: boolean, furniLine: string, environment: string, rare: boolean)
|
||||
{
|
||||
this._type = type;
|
||||
this._id = id;
|
||||
@@ -56,6 +57,7 @@ export class FurnitureData implements IFurnitureData
|
||||
this._customParams = customParams;
|
||||
this._specialType = specialType;
|
||||
this._availableForBuildersClub = availableForBuildersClub;
|
||||
this._allowStack = allowStack;
|
||||
this._canStandOn = canStandOn;
|
||||
this._canSitOn = canSitOn;
|
||||
this._canLayOn = canLayOn;
|
||||
@@ -180,6 +182,11 @@ export class FurnitureData implements IFurnitureData
|
||||
return this._availableForBuildersClub;
|
||||
}
|
||||
|
||||
public get allowStack(): boolean
|
||||
{
|
||||
return this._allowStack;
|
||||
}
|
||||
|
||||
public get canStandOn(): boolean
|
||||
{
|
||||
return this._canStandOn;
|
||||
|
||||
@@ -82,8 +82,9 @@ export class FurnitureDataLoader
|
||||
const className = classSplit[0];
|
||||
const colorIndex = ((classSplit.length > 1) ? parseInt(classSplit[1]) : 0);
|
||||
const hasColorIndex = (classSplit.length > 1);
|
||||
const allowStack = this.resolveBooleanFlag(furniture.allowstack, furniture.allow_stack, furniture.allowStack);
|
||||
|
||||
const furnitureData = new FurnitureData(FurnitureType.FLOOR, furniture.id, furniture.classname, className, furniture.category, furniture.name, furniture.description, furniture.revision, furniture.xdim, furniture.ydim, 0, colors, hasColorIndex, colorIndex, furniture.adurl, furniture.offerid, furniture.buyout, furniture.rentofferid, furniture.rentbuyout, furniture.bc, furniture.customparams, furniture.specialtype, furniture.canstandon, furniture.cansiton, furniture.canlayon, furniture.excludeddynamic, furniture.furniline, furniture.environment, furniture.rare);
|
||||
const furnitureData = new FurnitureData(FurnitureType.FLOOR, furniture.id, furniture.classname, className, furniture.category, furniture.name, furniture.description, furniture.revision, furniture.xdim, furniture.ydim, 0, colors, hasColorIndex, colorIndex, furniture.adurl, furniture.offerid, furniture.buyout, furniture.rentofferid, furniture.rentbuyout, furniture.bc, furniture.customparams, furniture.specialtype, allowStack, furniture.canstandon, furniture.cansiton, furniture.canlayon, furniture.excludeddynamic, furniture.furniline, furniture.environment, furniture.rare);
|
||||
|
||||
this._floorItems.set(furnitureData.id, furnitureData);
|
||||
|
||||
@@ -99,7 +100,8 @@ export class FurnitureDataLoader
|
||||
{
|
||||
if(!furniture) continue;
|
||||
|
||||
const furnitureData = new FurnitureData(FurnitureType.WALL, furniture.id, furniture.classname, furniture.classname, furniture.category, furniture.name, furniture.description, furniture.revision, 0, 0, 0, null, false, 0, furniture.adurl, furniture.offerid, furniture.buyout, furniture.rentofferid, furniture.rentbuyout, furniture.bc, null, furniture.specialtype, false, false, false, furniture.excludeddynamic, furniture.furniline, furniture.environment, furniture.rare);
|
||||
const allowStack = this.resolveBooleanFlag(furniture.allowstack, furniture.allow_stack, furniture.allowStack);
|
||||
const furnitureData = new FurnitureData(FurnitureType.WALL, furniture.id, furniture.classname, furniture.classname, furniture.category, furniture.name, furniture.description, furniture.revision, 0, 0, 0, null, false, 0, furniture.adurl, furniture.offerid, furniture.buyout, furniture.rentofferid, furniture.rentbuyout, furniture.bc, null, furniture.specialtype, allowStack, false, false, false, furniture.excludeddynamic, furniture.furniline, furniture.environment, furniture.rare);
|
||||
|
||||
this._wallItems.set(furnitureData.id, furnitureData);
|
||||
|
||||
@@ -121,4 +123,26 @@ export class FurnitureDataLoader
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private resolveBooleanFlag(...values: any[]): boolean
|
||||
{
|
||||
for(const value of values)
|
||||
{
|
||||
if(value === undefined || value === null) continue;
|
||||
|
||||
if(typeof value === 'string')
|
||||
{
|
||||
const normalized = value.trim().toLowerCase();
|
||||
|
||||
if(!normalized.length) continue;
|
||||
|
||||
if([ '1', 'true', 'yes' ].includes(normalized)) return true;
|
||||
if([ '0', 'false', 'no' ].includes(normalized)) return false;
|
||||
}
|
||||
|
||||
return !!value;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,11 @@ export class RoomDataHandler extends BaseHandler
|
||||
const roomData = parser.data;
|
||||
|
||||
roomSession.tradeMode = roomData.tradeMode;
|
||||
roomSession.groupId = roomData.habboGroupId;
|
||||
roomSession.hotelTimeZone = (parser.hotelTimeZoneId || 'UTC');
|
||||
roomSession.hotelTimeSnapshotMs = parser.hotelCurrentTimeMs;
|
||||
roomSession.hotelTimeSyncMs = Date.now();
|
||||
roomSession.roomItemLimit = parser.roomItemLimit;
|
||||
roomSession.isGuildRoom = (roomData.habboGroupId !== 0);
|
||||
roomSession.doorMode = roomData.doorMode;
|
||||
roomSession.allowPets = roomData.allowPets;
|
||||
|
||||
@@ -78,6 +78,8 @@ export class RoomUsersHandler extends BaseHandler
|
||||
userData.petLevel = user.petLevel;
|
||||
userData.botSkills = user.botSkills;
|
||||
userData.isModerator = user.isModerator;
|
||||
userData.roomEntryMethod = user.roomEntryMethod;
|
||||
userData.roomEntryTeleportId = user.roomEntryTeleportId;
|
||||
|
||||
if(!session.userDataManager.getUserData(user.roomIndex)) usersToAdd.push(userData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user