2017-11-26 01:14:02 +00:00
|
|
|
// This file has been automatically generated by writeMessageClasses.js
|
|
|
|
|
|
2020-01-06 12:10:40 +00:00
|
|
|
import { UUID } from '../UUID';
|
|
|
|
|
import { Vector3 } from '../Vector3';
|
|
|
|
|
import * as Long from 'long';
|
|
|
|
|
import { MessageFlags } from '../../enums/MessageFlags';
|
|
|
|
|
import { MessageBase } from '../MessageBase';
|
|
|
|
|
import { Message } from '../../enums/Message';
|
2017-11-26 01:14:02 +00:00
|
|
|
|
|
|
|
|
export class ChildAgentPositionUpdateMessage implements MessageBase
|
|
|
|
|
{
|
|
|
|
|
name = 'ChildAgentPositionUpdate';
|
|
|
|
|
messageFlags = MessageFlags.Trusted | MessageFlags.FrequencyHigh;
|
|
|
|
|
id = Message.ChildAgentPositionUpdate;
|
|
|
|
|
|
|
|
|
|
AgentData: {
|
|
|
|
|
RegionHandle: Long;
|
|
|
|
|
ViewerCircuitCode: number;
|
|
|
|
|
AgentID: UUID;
|
|
|
|
|
SessionID: UUID;
|
|
|
|
|
AgentPos: Vector3;
|
|
|
|
|
AgentVel: Vector3;
|
|
|
|
|
Center: Vector3;
|
|
|
|
|
Size: Vector3;
|
|
|
|
|
AtAxis: Vector3;
|
|
|
|
|
LeftAxis: Vector3;
|
|
|
|
|
UpAxis: Vector3;
|
|
|
|
|
ChangedGrid: boolean;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getSize(): number
|
|
|
|
|
{
|
|
|
|
|
return 129;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
|
|
|
{
|
|
|
|
|
const startPos = pos;
|
|
|
|
|
buf.writeInt32LE(this.AgentData['RegionHandle'].low, pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeInt32LE(this.AgentData['RegionHandle'].high, pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeUInt32LE(this.AgentData['ViewerCircuitCode'], pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
this.AgentData['AgentID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
this.AgentData['SessionID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
this.AgentData['AgentPos'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
this.AgentData['AgentVel'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
this.AgentData['Center'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
this.AgentData['Size'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
this.AgentData['AtAxis'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
this.AgentData['LeftAxis'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
this.AgentData['UpAxis'].writeToBuffer(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
buf.writeUInt8((this.AgentData['ChangedGrid']) ? 1 : 0, pos++);
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
|
|
|
{
|
|
|
|
|
const startPos = pos;
|
|
|
|
|
let varLength = 0;
|
|
|
|
|
const newObjAgentData: {
|
|
|
|
|
RegionHandle: Long,
|
|
|
|
|
ViewerCircuitCode: number,
|
|
|
|
|
AgentID: UUID,
|
|
|
|
|
SessionID: UUID,
|
|
|
|
|
AgentPos: Vector3,
|
|
|
|
|
AgentVel: Vector3,
|
|
|
|
|
Center: Vector3,
|
|
|
|
|
Size: Vector3,
|
|
|
|
|
AtAxis: Vector3,
|
|
|
|
|
LeftAxis: Vector3,
|
|
|
|
|
UpAxis: Vector3,
|
|
|
|
|
ChangedGrid: boolean
|
|
|
|
|
} = {
|
|
|
|
|
RegionHandle: Long.ZERO,
|
|
|
|
|
ViewerCircuitCode: 0,
|
|
|
|
|
AgentID: UUID.zero(),
|
|
|
|
|
SessionID: UUID.zero(),
|
|
|
|
|
AgentPos: Vector3.getZero(),
|
|
|
|
|
AgentVel: Vector3.getZero(),
|
|
|
|
|
Center: Vector3.getZero(),
|
|
|
|
|
Size: Vector3.getZero(),
|
|
|
|
|
AtAxis: Vector3.getZero(),
|
|
|
|
|
LeftAxis: Vector3.getZero(),
|
|
|
|
|
UpAxis: Vector3.getZero(),
|
|
|
|
|
ChangedGrid: false
|
|
|
|
|
};
|
|
|
|
|
newObjAgentData['RegionHandle'] = new Long(buf.readInt32LE(pos), buf.readInt32LE(pos+4));
|
|
|
|
|
pos += 8;
|
|
|
|
|
newObjAgentData['ViewerCircuitCode'] = buf.readUInt32LE(pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
newObjAgentData['AgentID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
newObjAgentData['SessionID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
newObjAgentData['AgentPos'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['AgentVel'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['Center'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['Size'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['AtAxis'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['LeftAxis'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['UpAxis'] = new Vector3(buf, pos, false);
|
|
|
|
|
pos += 12;
|
|
|
|
|
newObjAgentData['ChangedGrid'] = (buf.readUInt8(pos++) === 1);
|
|
|
|
|
this.AgentData = newObjAgentData;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|