diff --git a/lib/classes/InventoryItem.ts b/lib/classes/InventoryItem.ts index cf14b30..52c57a9 100644 --- a/lib/classes/InventoryItem.ts +++ b/lib/classes/InventoryItem.ts @@ -421,6 +421,10 @@ export class InventoryItem { inventoryItem.inventoryType = parseInt(prop, 10); } + if ((prop = Utils.getFromXMLJS(result, 'Type')) !== undefined) + { + inventoryItem.type = parseInt(prop, 10); + } if ((prop = Utils.getFromXMLJS(result, 'CreatorUUID')) !== undefined) { try diff --git a/lib/classes/ObjectResolver.ts b/lib/classes/ObjectResolver.ts index 19b9cf9..28f0e9c 100644 --- a/lib/classes/ObjectResolver.ts +++ b/lib/classes/ObjectResolver.ts @@ -99,6 +99,10 @@ export class ObjectResolver } const objArray = Array.from(objs.values()); + for (const obj of objArray) + { + obj.resolveAttempts = (obj.resolveAttempts ?? 0) + 1; + } try { await this.region.clientCommands.region.selectObjects(objArray); diff --git a/lib/classes/ParticleSystem.ts b/lib/classes/ParticleSystem.ts index 4cba63e..64e4be7 100644 --- a/lib/classes/ParticleSystem.ts +++ b/lib/classes/ParticleSystem.ts @@ -234,7 +234,6 @@ export class ParticleSystem } const systemBlock = Buffer.allocUnsafe(68); let pos = 0; - console.log('FLAGS: ' + this.flags); systemBlock.writeUInt32LE(this.crc, pos); pos = pos + 4; systemBlock.writeUInt32LE(this.flags, pos); pos = pos + 4; // Flags is zero systemBlock.writeUInt8(this.pattern, pos++); diff --git a/lib/classes/commands/RegionCommands.ts b/lib/classes/commands/RegionCommands.ts index 1f25750..59e0312 100644 --- a/lib/classes/commands/RegionCommands.ts +++ b/lib/classes/commands/RegionCommands.ts @@ -376,21 +376,6 @@ export class RegionCommands extends CommandsBase { } - finally - { - - for (const obj of objects) - { - if (!(obj instanceof GameObject)) - { - continue; - } - if (obj.resolvedAt === undefined || obj.name === undefined) - { - obj.resolveAttempts++; - } - } - } } } diff --git a/lib/classes/public/GameObject.ts b/lib/classes/public/GameObject.ts index 862158c..3134894 100644 --- a/lib/classes/public/GameObject.ts +++ b/lib/classes/public/GameObject.ts @@ -1601,7 +1601,7 @@ export class GameObject implements IGameObjectData } } - private async getXML(xml: XMLNode, rootPrim: GameObject, linkNum: number, rootNode?: string): Promise + private async getXML(xml: XMLNode, rootPrim: GameObject, linkNum: number, rootNode?: string, skipInventory = false): Promise { const resolver = this.region?.resolver; if (resolver) @@ -1617,7 +1617,7 @@ export class GameObject implements IGameObjectData Logger.Error(e); } } - if (!this.resolvedInventory) + if (!this.resolvedInventory && !skipInventory) { try { @@ -1889,25 +1889,25 @@ export class GameObject implements IGameObjectData this.region.objects.populateChildren(this); } - async exportXMLElement(rootNode?: string): Promise + async exportXMLElement(rootNode?: string, skipInventory = false): Promise { const document = builder.create('SceneObjectGroup'); let linkNum = 1; - await this.getXML(document, this, linkNum, rootNode); + await this.getXML(document, this, linkNum, rootNode, skipInventory); if (this.children && this.children.length > 0) { const otherParts = document.ele('OtherParts'); for (const child of this.children) { - await child.getXML(otherParts, this, ++linkNum, (rootNode !== undefined) ? 'Part' : undefined); + await child.getXML(otherParts, this, ++linkNum, (rootNode !== undefined) ? 'Part' : undefined, skipInventory); } } return document; } - async exportXML(rootNode?: string): Promise + async exportXML(rootNode?: string, skipInventory = false): Promise { - return (await this.exportXMLElement(rootNode)).end({ pretty: true, allowEmpty: true }); + return (await this.exportXMLElement(rootNode, skipInventory)).end({ pretty: true, allowEmpty: true }); } public toJSON(): IGameObjectData diff --git a/package-lock.json b/package-lock.json index 6e0fd91..8818f7f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caspertech/node-metaverse", - "version": "0.7.22", + "version": "0.7.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@caspertech/node-metaverse", - "version": "0.7.22", + "version": "0.7.24", "license": "MIT", "dependencies": { "@caspertech/llsd": "^1.0.5", diff --git a/package.json b/package.json index fded662..c07dbd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caspertech/node-metaverse", - "version": "0.7.24", + "version": "0.7.28", "description": "A node.js interface for Second Life.", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts",