76 lines
2.1 KiB
TypeScript
76 lines
2.1 KiB
TypeScript
// This file has been automatically generated by writeMessageClasses.js
|
|
|
|
import { UUID } from '../UUID';
|
|
import { Vector3 } from '../Vector3';
|
|
import { MessageFlags } from '../../enums/MessageFlags';
|
|
import { MessageBase } from '../MessageBase';
|
|
import { Message } from '../../enums/Message';
|
|
|
|
export class TeleportLocalMessage implements MessageBase
|
|
{
|
|
name = 'TeleportLocal';
|
|
messageFlags = MessageFlags.Trusted | MessageFlags.FrequencyLow;
|
|
id = Message.TeleportLocal;
|
|
|
|
Info: {
|
|
AgentID: UUID;
|
|
LocationID: number;
|
|
Position: Vector3;
|
|
LookAt: Vector3;
|
|
TeleportFlags: number;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return 48;
|
|
}
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
this.Info['AgentID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.writeUInt32LE(this.Info['LocationID'], pos);
|
|
pos += 4;
|
|
this.Info['Position'].writeToBuffer(buf, pos, false);
|
|
pos += 12;
|
|
this.Info['LookAt'].writeToBuffer(buf, pos, false);
|
|
pos += 12;
|
|
buf.writeUInt32LE(this.Info['TeleportFlags'], pos);
|
|
pos += 4;
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
let varLength = 0;
|
|
const newObjInfo: {
|
|
AgentID: UUID,
|
|
LocationID: number,
|
|
Position: Vector3,
|
|
LookAt: Vector3,
|
|
TeleportFlags: number
|
|
} = {
|
|
AgentID: UUID.zero(),
|
|
LocationID: 0,
|
|
Position: Vector3.getZero(),
|
|
LookAt: Vector3.getZero(),
|
|
TeleportFlags: 0
|
|
};
|
|
newObjInfo['AgentID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjInfo['LocationID'] = buf.readUInt32LE(pos);
|
|
pos += 4;
|
|
newObjInfo['Position'] = new Vector3(buf, pos, false);
|
|
pos += 12;
|
|
newObjInfo['LookAt'] = new Vector3(buf, pos, false);
|
|
pos += 12;
|
|
newObjInfo['TeleportFlags'] = buf.readUInt32LE(pos);
|
|
pos += 4;
|
|
this.Info = newObjInfo;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|