Teleport and EventQueue reliability improvements. Start plumbing for stayPut()

This commit is contained in:
Casper Warden
2018-10-09 20:03:28 +01:00
parent 56f99d3ef3
commit da9fe9710c
46 changed files with 1382 additions and 666 deletions

View File

@@ -17,6 +17,7 @@ export class Caps
private capabilities: { [key: string]: string } = {};
private clientEvents: ClientEvents;
private agent: Agent;
private active = false;
eventQueueClient: EventQueueClient | null = null;
constructor(agent: Agent, region: Region, seedURL: string, clientEvents: ClientEvents)
@@ -113,7 +114,7 @@ export class Caps
req.push('ViewerMetrics');
req.push('ViewerStartAuction');
req.push('ViewerStats');
this.active = true;
this.request(seedURL, LLSD.LLSD.formatXML(req), 'application/llsd+xml').then((body: string) =>
{
this.capabilities = LLSD.LLSD.parseXML(body);
@@ -211,6 +212,11 @@ export class Caps
{
return new Promise<string>((resolve, reject) =>
{
if (!this.active)
{
reject(new Error('Requesting getCapability to an inactive Caps instance'));
return;
}
this.waitForSeedCapability().then(() =>
{
if (this.capabilities[capability])
@@ -279,5 +285,6 @@ export class Caps
{
this.eventQueueClient.shutdown();
}
this.active = false;
}
}