- Add "GET" method to Caps

- New events: ObjectPhysicsDataEvent, ParcelPropertiesEvent, NewObjectEvent, ObjectUpdateEvent, ObjectKilledEvent
- Added getXML function to Color4, Vector2, Vector3, Vector4, GameObject, Region, Quaternion, UUID for opensim-compatible XML export
- Added TextureAnim and ParticleSystem decoding to the "full" ObjectStore
- Object store will automatically request missing "parent" prims
- "setPersist" - When persist is TRUE, the ObjectStore will not forget about "killed" prims - useful for region scanning
- Support for Flexible params, Light params, LightImage params, Mesh data, Sculpt maps
- Fixed object scale being incorrectly calculated
- Add terrain decoding (this was a ballache)
- Add parcel map decoding
- Add support for region windlight settings (region.environment)
- Add support for materials (normal / specular maps)
- Add getBuffer, getLong and bitwiseOr to UUID
- Added a circular-reference-safe JSONStringify to Utils
- Add XferFile capability to Circuit

PUBLIC API:

AssetCommands:
- Rework "downloadAsset" to detect failures
- NEW: downloadInventoryAsset() - uses TransferRequest for prim inventory items
- NEW: getMaterials() - resolves material UUIDs

RegionCommands:
- NEW: getTerrainTextures()
- NEW: exportSettings() - OpenSim XML export of region settings
- NEW: async getTerrain() - Get binary terrain heightmap, 256x256 float32
- resolveObjects() - now fetches task inventory contents too.
- resolveObjects() - fix calculation of land impact
- NEW: getObjectByLocalID(localID: number, timeout: number)
- NEW: getObjectByUUID(uuid: UUID, timeout: number)
- NEW: getParcels();
- NEW: pruneObjects - removes missing GameObjects from a list
- NEW: setPersist - prevent objectstore from forgetting about killed gameobjects
This commit is contained in:
Casper Warden
2018-10-31 11:28:24 +00:00
parent fc2186029b
commit da4cd459f1
61 changed files with 4232 additions and 440 deletions

View File

@@ -1,4 +1,7 @@
import * as validator from 'validator';
import * as builder from 'xmlbuilder';
import {XMLElementOrXMLNode} from 'xmlbuilder';
import * as Long from 'long';
const uuid = require('uuid');
export class UUID
@@ -15,6 +18,24 @@ export class UUID
return new UUID(newUUID);
}
static getString(u?: UUID): string
{
if (u === undefined)
{
return UUID.zero().toString();
}
else
{
return u.toString();
}
}
static getXML(doc: XMLElementOrXMLNode, u?: UUID)
{
const str = UUID.getString(u);
doc.ele('UUID', str);
}
constructor(buf?: Buffer | string, pos?: number)
{
if (buf !== undefined)
@@ -78,4 +99,29 @@ export class UUID
return cmp.equals(this.mUUID);
}
}
public getBuffer()
{
const buf = Buffer.allocUnsafe(16);
this.writeToBuffer(buf, 0);
return buf;
}
public getLong()
{
const buf = this.getBuffer();
return new Long(buf.readUInt32LE(7), buf.readUInt32LE(12));
}
public bitwiseOr(w: UUID): UUID
{
const buf1 = this.getBuffer();
const buf2 = w.getBuffer();
const buf3 = Buffer.allocUnsafe(16);
for (let x = 0; x < 16; x++)
{
buf3[x] = buf1[x] ^ buf2[x];
}
return new UUID(buf3, 0);
}
}