Fix object selectin/deselection, deprecated http option
This commit is contained in:
@@ -174,7 +174,9 @@ export class Caps
|
|||||||
const assetURL = capURL + '/?' + type + '_id=' + uuid.toString();
|
const assetURL = capURL + '/?' + type + '_id=' + uuid.toString();
|
||||||
|
|
||||||
const response = await got.get(assetURL, {
|
const response = await got.get(assetURL, {
|
||||||
rejectUnauthorized: false,
|
https: {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
},
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
responseType: 'buffer'
|
responseType: 'buffer'
|
||||||
});
|
});
|
||||||
@@ -195,7 +197,9 @@ export class Caps
|
|||||||
'Content-Type': contentType
|
'Content-Type': contentType
|
||||||
},
|
},
|
||||||
body: data,
|
body: data,
|
||||||
rejectUnauthorized: false
|
https: {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return { status: response.statusCode, body: response.body };
|
return { status: response.statusCode, body: response.body };
|
||||||
@@ -209,7 +213,9 @@ export class Caps
|
|||||||
'Content-Type': contentType
|
'Content-Type': contentType
|
||||||
},
|
},
|
||||||
body: data,
|
body: data,
|
||||||
rejectUnauthorized: false
|
https: {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return { status: response.statusCode, body: response.body };
|
return { status: response.statusCode, body: response.body };
|
||||||
@@ -218,7 +224,9 @@ export class Caps
|
|||||||
public async requestGet(requestURL: string): Promise<ICapResponse>
|
public async requestGet(requestURL: string): Promise<ICapResponse>
|
||||||
{
|
{
|
||||||
const response = await got.get(requestURL, {
|
const response = await got.get(requestURL, {
|
||||||
rejectUnauthorized: false
|
https: {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return { status: response.statusCode, body: response.body };
|
return { status: response.statusCode, body: response.body };
|
||||||
@@ -227,7 +235,9 @@ export class Caps
|
|||||||
public async requestDelete(requestURL: string): Promise<ICapResponse>
|
public async requestDelete(requestURL: string): Promise<ICapResponse>
|
||||||
{
|
{
|
||||||
const response = await got.delete(requestURL, {
|
const response = await got.delete(requestURL, {
|
||||||
rejectUnauthorized: false
|
https: {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return { status: response.statusCode, body: response.body };
|
return { status: response.statusCode, body: response.body };
|
||||||
|
|||||||
@@ -568,7 +568,9 @@ export class EventQueueClient
|
|||||||
'Content-Type': contentType
|
'Content-Type': contentType
|
||||||
},
|
},
|
||||||
body: data,
|
body: data,
|
||||||
rejectUnauthorized: false,
|
https: {
|
||||||
|
rejectUnauthorized: false,
|
||||||
|
},
|
||||||
timeout: 1800000 // Super long timeout
|
timeout: 1800000 // Super long timeout
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ export class ObjectStoreFull extends ObjectStoreLite implements IObjectStore
|
|||||||
{
|
{
|
||||||
this.insertIntoRtree(obj);
|
this.insertIntoRtree(obj);
|
||||||
const parentObj = this.objects.get(objData.ParentID ?? 0);
|
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(() =>
|
this.requestMissingObject(objData.ParentID).then(() =>
|
||||||
{
|
{
|
||||||
@@ -352,7 +352,7 @@ export class ObjectStoreFull extends ObjectStoreLite implements IObjectStore
|
|||||||
}
|
}
|
||||||
else
|
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) =>
|
this.requestMissingObject(o.ParentID).catch((e) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -663,7 +663,7 @@ export class ObjectStoreLite implements IObjectStore
|
|||||||
|
|
||||||
this.notifyObjectUpdate(newObject, obj!);
|
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);
|
this.requestMissingObject(objData.ParentID);
|
||||||
}
|
}
|
||||||
@@ -907,7 +907,7 @@ export class ObjectStoreLite implements IObjectStore
|
|||||||
return;
|
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) =>
|
this.requestMissingObject(o.ParentID).catch((e) =>
|
||||||
{
|
{
|
||||||
@@ -1160,7 +1160,7 @@ export class ObjectStoreLite implements IObjectStore
|
|||||||
}
|
}
|
||||||
else
|
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) =>
|
this.requestMissingObject(go.ParentID).catch((e: unknown) =>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -201,20 +201,28 @@ export class RegionCommands extends CommandsBase
|
|||||||
SessionID: this.circuit.sessionID
|
SessionID: this.circuit.sessionID
|
||||||
};
|
};
|
||||||
deselectObject.ObjectData = [];
|
deselectObject.ObjectData = [];
|
||||||
const idMap: { [key: number]: GameObject } = {};
|
const uuidMap: { [key: string]: GameObject } = {};
|
||||||
|
let skipped = 0;
|
||||||
for (const obj of objects)
|
for (const obj of objects)
|
||||||
{
|
{
|
||||||
const localID = obj.ID;
|
if (!(obj instanceof GameObject))
|
||||||
if (!idMap[localID])
|
|
||||||
{
|
{
|
||||||
idMap[localID] = obj;
|
skipped++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const uuidStr = obj.FullID.toString();
|
||||||
|
if (!uuidMap[uuidStr])
|
||||||
|
{
|
||||||
|
uuidMap[uuidStr] = obj;
|
||||||
deselectObject.ObjectData.push({
|
deselectObject.ObjectData.push({
|
||||||
ObjectLocalID: obj.ID
|
ObjectLocalID: obj.ID
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (skipped > 0)
|
||||||
// Create a map of our expected UUIDs
|
{
|
||||||
|
console.log('Skipped ' + String(skipped) + ' bad objects during deselection');
|
||||||
|
}
|
||||||
|
|
||||||
const sequenceID = this.circuit.sendMessage(deselectObject, PacketFlags.Reliable);
|
const sequenceID = this.circuit.sendMessage(deselectObject, PacketFlags.Reliable);
|
||||||
return this.circuit.waitForAck(sequenceID, 10000);
|
return this.circuit.waitForAck(sequenceID, 10000);
|
||||||
@@ -286,8 +294,14 @@ export class RegionCommands extends CommandsBase
|
|||||||
};
|
};
|
||||||
selectObject.ObjectData = [];
|
selectObject.ObjectData = [];
|
||||||
const uuidMap: { [key: string]: GameObject } = {};
|
const uuidMap: { [key: string]: GameObject } = {};
|
||||||
|
let skipped = 0;
|
||||||
for (const obj of objects)
|
for (const obj of objects)
|
||||||
{
|
{
|
||||||
|
if (!(obj instanceof GameObject))
|
||||||
|
{
|
||||||
|
skipped++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const uuidStr = obj.FullID.toString();
|
const uuidStr = obj.FullID.toString();
|
||||||
if (!uuidMap[uuidStr])
|
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
|
// Create a map of our expected UUIDs
|
||||||
this.circuit.sendMessage(selectObject, PacketFlags.Reliable);
|
this.circuit.sendMessage(selectObject, PacketFlags.Reliable);
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.7.13",
|
"version": "0.7.14",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.7.13",
|
"version": "0.7.14",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@caspertech/llsd": "^1.0.5",
|
"@caspertech/llsd": "^1.0.5",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@caspertech/node-metaverse",
|
"name": "@caspertech/node-metaverse",
|
||||||
"version": "0.7.13",
|
"version": "0.7.14",
|
||||||
"description": "A node.js interface for Second Life.",
|
"description": "A node.js interface for Second Life.",
|
||||||
"main": "dist/lib/index.js",
|
"main": "dist/lib/index.js",
|
||||||
"types": "dist/lib/index.d.ts",
|
"types": "dist/lib/index.d.ts",
|
||||||
|
|||||||
Reference in New Issue
Block a user