Improvements to object resolution
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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++);
|
||||
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1601,7 +1601,7 @@ export class GameObject implements IGameObjectData
|
||||
}
|
||||
}
|
||||
|
||||
private async getXML(xml: XMLNode, rootPrim: GameObject, linkNum: number, rootNode?: string): Promise<void>
|
||||
private async getXML(xml: XMLNode, rootPrim: GameObject, linkNum: number, rootNode?: string, skipInventory = false): Promise<void>
|
||||
{
|
||||
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<XMLElement>
|
||||
async exportXMLElement(rootNode?: string, skipInventory = false): Promise<XMLElement>
|
||||
{
|
||||
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<string>
|
||||
async exportXML(rootNode?: string, skipInventory = false): Promise<string>
|
||||
{
|
||||
return (await this.exportXMLElement(rootNode)).end({ pretty: true, allowEmpty: true });
|
||||
return (await this.exportXMLElement(rootNode, skipInventory)).end({ pretty: true, allowEmpty: true });
|
||||
}
|
||||
|
||||
public toJSON(): IGameObjectData
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user