When StoreMyAttachmentsOnly is set, Drop all other objects as soon as we know our agent localID

This commit is contained in:
Casper Warden
2017-12-14 02:24:06 +00:00
parent ba121281dc
commit 8dcbf2d32a
2 changed files with 24 additions and 0 deletions

View File

@@ -127,6 +127,18 @@ export class ObjectStoreFull implements IObjectStore
if (this.objects[localID].PCode === PCode.Avatar && this.objects[localID].FullID.toString() === this.agent.agentID.toString())
{
this.agent.localID = localID;
if (this.options & BotOptionFlags.StoreMyAttachmentsOnly)
{
Object.keys(this.objectsByParent).forEach((objParentID: string) =>
{
const parent = parseInt(objParentID, 10);
if (parent !== this.agent.localID)
{
this.deleteObject(parent);
}
});
}
}
this.readExtraParams(objData.ExtraParams, 0, this.objects[localID]);

View File

@@ -86,6 +86,18 @@ export class ObjectStoreLite implements IObjectStore
if (objData.PCode === PCode.Avatar && this.objects[localID].FullID.toString() === this.agent.agentID.toString())
{
this.agent.localID = localID;
if (this.options & BotOptionFlags.StoreMyAttachmentsOnly)
{
Object.keys(this.objectsByParent).forEach((objParentID: string) =>
{
const parent = parseInt(objParentID, 10);
if (parent !== this.agent.localID)
{
this.deleteObject(parent);
}
});
}
}
this.objectsByUUID[objData.FullID.toString()] = localID;