diff --git a/lib/classes/Caps.ts b/lib/classes/Caps.ts index 6962f7c..951f44d 100644 --- a/lib/classes/Caps.ts +++ b/lib/classes/Caps.ts @@ -174,7 +174,9 @@ export class Caps const assetURL = capURL + '/?' + type + '_id=' + uuid.toString(); const response = await got.get(assetURL, { - rejectUnauthorized: false, + https: { + rejectUnauthorized: false, + }, method: 'GET', responseType: 'buffer' }); @@ -195,7 +197,9 @@ export class Caps 'Content-Type': contentType }, body: data, - rejectUnauthorized: false + https: { + rejectUnauthorized: false, + }, }); return { status: response.statusCode, body: response.body }; @@ -209,7 +213,9 @@ export class Caps 'Content-Type': contentType }, body: data, - rejectUnauthorized: false + https: { + rejectUnauthorized: false, + }, }); return { status: response.statusCode, body: response.body }; @@ -218,7 +224,9 @@ export class Caps public async requestGet(requestURL: string): Promise { const response = await got.get(requestURL, { - rejectUnauthorized: false + https: { + rejectUnauthorized: false, + }, }); return { status: response.statusCode, body: response.body }; @@ -227,7 +235,9 @@ export class Caps public async requestDelete(requestURL: string): Promise { const response = await got.delete(requestURL, { - rejectUnauthorized: false + https: { + rejectUnauthorized: false, + }, }); return { status: response.statusCode, body: response.body }; diff --git a/lib/classes/EventQueueClient.ts b/lib/classes/EventQueueClient.ts index 03eee48..787be8f 100644 --- a/lib/classes/EventQueueClient.ts +++ b/lib/classes/EventQueueClient.ts @@ -568,7 +568,9 @@ export class EventQueueClient 'Content-Type': contentType }, body: data, - rejectUnauthorized: false, + https: { + rejectUnauthorized: false, + }, timeout: 1800000 // Super long timeout }); diff --git a/lib/classes/ObjectStoreFull.ts b/lib/classes/ObjectStoreFull.ts index c4a76f8..5c7779e 100644 --- a/lib/classes/ObjectStoreFull.ts +++ b/lib/classes/ObjectStoreFull.ts @@ -214,7 +214,7 @@ export class ObjectStoreFull extends ObjectStoreLite implements IObjectStore { this.insertIntoRtree(obj); const parentObj = this.objects.get(objData.ParentID ?? 0); - if (objData.ParentID !== undefined && objData.ParentID !== 0 && !parentObj) + if (objData.ParentID !== undefined && objData.ParentID !== 0 && !parentObj && !obj.IsAttachment) { this.requestMissingObject(objData.ParentID).then(() => { @@ -352,7 +352,7 @@ export class ObjectStoreFull extends ObjectStoreLite implements IObjectStore } else { - if (o.ParentID !== undefined && o.ParentID !== 0 && !this.objects.has(o.ParentID)) + if (o.ParentID !== undefined && o.ParentID !== 0 && !this.objects.has(o.ParentID) && !o.IsAttachment) { this.requestMissingObject(o.ParentID).catch((e) => { diff --git a/lib/classes/ObjectStoreLite.ts b/lib/classes/ObjectStoreLite.ts index 500a0f3..18b0e5a 100644 --- a/lib/classes/ObjectStoreLite.ts +++ b/lib/classes/ObjectStoreLite.ts @@ -663,7 +663,7 @@ export class ObjectStoreLite implements IObjectStore this.notifyObjectUpdate(newObject, obj!); - if (objData.ParentID !== undefined && objData.ParentID !== 0 && !this.objects.get(objData.ParentID)) + if (objData.ParentID !== undefined && objData.ParentID !== 0 && !this.objects.get(objData.ParentID) && !obj?.IsAttachment) { this.requestMissingObject(objData.ParentID); } @@ -907,7 +907,7 @@ export class ObjectStoreLite implements IObjectStore return; } } - if (o.ParentID !== undefined && o.ParentID !== 0 && !this.objects.has(o.ParentID)) + if (o.ParentID !== undefined && o.ParentID !== 0 && !this.objects.has(o.ParentID) && !o.IsAttachment) { this.requestMissingObject(o.ParentID).catch((e) => { @@ -1160,7 +1160,7 @@ export class ObjectStoreLite implements IObjectStore } else { - if (go.ParentID !== undefined && go.ParentID !== 0 && !parentObj) + if (go.ParentID !== undefined && go.ParentID !== 0 && !parentObj && !go.IsAttachment) { this.requestMissingObject(go.ParentID).catch((e: unknown) => { diff --git a/lib/classes/commands/RegionCommands.ts b/lib/classes/commands/RegionCommands.ts index 05a3a3d..c51f641 100644 --- a/lib/classes/commands/RegionCommands.ts +++ b/lib/classes/commands/RegionCommands.ts @@ -201,20 +201,28 @@ export class RegionCommands extends CommandsBase SessionID: this.circuit.sessionID }; deselectObject.ObjectData = []; - const idMap: { [key: number]: GameObject } = {}; + const uuidMap: { [key: string]: GameObject } = {}; + let skipped = 0; for (const obj of objects) { - const localID = obj.ID; - if (!idMap[localID]) + if (!(obj instanceof GameObject)) { - idMap[localID] = obj; + skipped++; + continue; + } + const uuidStr = obj.FullID.toString(); + if (!uuidMap[uuidStr]) + { + uuidMap[uuidStr] = obj; deselectObject.ObjectData.push({ ObjectLocalID: obj.ID }); } } - - // Create a map of our expected UUIDs + if (skipped > 0) + { + console.log('Skipped ' + String(skipped) + ' bad objects during deselection'); + } const sequenceID = this.circuit.sendMessage(deselectObject, PacketFlags.Reliable); return this.circuit.waitForAck(sequenceID, 10000); @@ -286,8 +294,14 @@ export class RegionCommands extends CommandsBase }; selectObject.ObjectData = []; const uuidMap: { [key: string]: GameObject } = {}; + let skipped = 0; for (const obj of objects) { + if (!(obj instanceof GameObject)) + { + skipped++; + continue; + } const uuidStr = obj.FullID.toString(); if (!uuidMap[uuidStr]) { @@ -297,6 +311,10 @@ export class RegionCommands extends CommandsBase }); } } + if (skipped > 0) + { + console.log('Skipped ' + String(skipped) + ' bad objects during deselection'); + } // Create a map of our expected UUIDs this.circuit.sendMessage(selectObject, PacketFlags.Reliable); diff --git a/package-lock.json b/package-lock.json index e0f77f4..96d9d91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@caspertech/node-metaverse", - "version": "0.7.13", + "version": "0.7.14", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@caspertech/node-metaverse", - "version": "0.7.13", + "version": "0.7.14", "license": "MIT", "dependencies": { "@caspertech/llsd": "^1.0.5", diff --git a/package.json b/package.json index 3ec33a9..af8c114 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@caspertech/node-metaverse", - "version": "0.7.13", + "version": "0.7.14", "description": "A node.js interface for Second Life.", "main": "dist/lib/index.js", "types": "dist/lib/index.d.ts",