Files
node-metaverse/lib/classes/packets/ChildAgentUpdate.ts
2017-11-24 03:32:37 +00:00

89 lines
2.5 KiB
TypeScript

// This file has been automatically generated by writePacketClasses.js
import {UUID} from '../UUID';
import {Vector3} from '../Vector3';
import Long = require('long');
import {Quaternion} from '../Quaternion';
import {MessageFlags} from '../../enums/MessageFlags';
import {Packet} from '../Packet';
export class ChildAgentUpdatePacket implements Packet
{
name = 'ChildAgentUpdate';
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyHigh;
id = 25;
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;
Far: number;
Aspect: number;
Throttles: string;
LocomotionState: number;
HeadRotation: Quaternion;
BodyRotation: Quaternion;
ControlFlags: number;
EnergyLevel: number;
GodLevel: number;
AlwaysRun: boolean;
PreyAgent: UUID;
AgentAccess: number;
AgentTextures: string;
ActiveGroupID: UUID;
};
GroupData: {
GroupID: UUID;
GroupPowers: Long;
AcceptNotices: boolean;
}[];
AnimationData: {
Animation: UUID;
ObjectID: UUID;
}[];
GranterBlock: {
GranterID: UUID;
}[];
NVPairData: {
NVPairs: string;
}[];
VisualParam: {
ParamValue: number;
}[];
AgentAccess: {
AgentLegacyAccess: number;
AgentMaxAccess: number;
}[];
AgentInfo: {
Flags: number;
}[];
AgentInventoryHost: {
InventoryHost: string;
}[];
getSize(): number
{
return (this.AgentData['Throttles'].length + 1 + this.AgentData['AgentTextures'].length + 2) + ((25) * this.GroupData.length) + ((32) * this.AnimationData.length) + ((16) * this.GranterBlock.length) + ((this.calculateVarVarSize(this.NVPairData, 'NVPairs', 2)) * this.NVPairData.length) + ((1) * this.VisualParam.length) + ((2) * this.AgentAccess.length) + ((4) * this.AgentInfo.length) + ((this.calculateVarVarSize(this.AgentInventoryHost, 'InventoryHost', 1)) * this.AgentInventoryHost.length) + 216;
}
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
{
let size = 0;
block.forEach((bl: any) =>
{
size += bl[paramName].length + extraPerVar;
});
return size;
}
}