84 lines
2.6 KiB
TypeScript
84 lines
2.6 KiB
TypeScript
|
|
// This file has been automatically generated by writePacketClasses.js
|
||
|
|
|
||
|
|
import {UUID} from '../UUID';
|
||
|
|
import {Vector3} from '../Vector3';
|
||
|
|
import Long = require('long');
|
||
|
|
import {MessageFlags} from '../../enums/MessageFlags';
|
||
|
|
import {Packet} from '../Packet';
|
||
|
|
|
||
|
|
export class ObjectUpdatePacket implements Packet
|
||
|
|
{
|
||
|
|
name = 'ObjectUpdate';
|
||
|
|
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyHigh;
|
||
|
|
id = 12;
|
||
|
|
|
||
|
|
RegionData: {
|
||
|
|
RegionHandle: Long;
|
||
|
|
TimeDilation: number;
|
||
|
|
};
|
||
|
|
ObjectData: {
|
||
|
|
ID: number;
|
||
|
|
State: number;
|
||
|
|
FullID: UUID;
|
||
|
|
CRC: number;
|
||
|
|
PCode: number;
|
||
|
|
Material: number;
|
||
|
|
ClickAction: number;
|
||
|
|
Scale: Vector3;
|
||
|
|
ObjectData: string;
|
||
|
|
ParentID: number;
|
||
|
|
UpdateFlags: number;
|
||
|
|
PathCurve: number;
|
||
|
|
ProfileCurve: number;
|
||
|
|
PathBegin: number;
|
||
|
|
PathEnd: number;
|
||
|
|
PathScaleX: number;
|
||
|
|
PathScaleY: number;
|
||
|
|
PathShearX: number;
|
||
|
|
PathShearY: number;
|
||
|
|
PathTwist: number;
|
||
|
|
PathTwistBegin: number;
|
||
|
|
PathRadiusOffset: number;
|
||
|
|
PathTaperX: number;
|
||
|
|
PathTaperY: number;
|
||
|
|
PathRevolutions: number;
|
||
|
|
PathSkew: number;
|
||
|
|
ProfileBegin: number;
|
||
|
|
ProfileEnd: number;
|
||
|
|
ProfileHollow: number;
|
||
|
|
TextureEntry: string;
|
||
|
|
TextureAnim: string;
|
||
|
|
NameValue: string;
|
||
|
|
Data: string;
|
||
|
|
Text: string;
|
||
|
|
TextColor: Buffer;
|
||
|
|
MediaURL: string;
|
||
|
|
PSBlock: string;
|
||
|
|
ExtraParams: string;
|
||
|
|
Sound: UUID;
|
||
|
|
OwnerID: UUID;
|
||
|
|
Gain: number;
|
||
|
|
Flags: number;
|
||
|
|
Radius: number;
|
||
|
|
JointType: number;
|
||
|
|
JointPivot: Vector3;
|
||
|
|
JointAxisOrAnchor: Vector3;
|
||
|
|
}[];
|
||
|
|
|
||
|
|
getSize(): number
|
||
|
|
{
|
||
|
|
return ((this.calculateVarVarSize(this.ObjectData, 'ObjectData', 1) + this.calculateVarVarSize(this.ObjectData, 'TextureEntry', 2) + this.calculateVarVarSize(this.ObjectData, 'TextureAnim', 1) + this.calculateVarVarSize(this.ObjectData, 'NameValue', 2) + this.calculateVarVarSize(this.ObjectData, 'Data', 2) + this.calculateVarVarSize(this.ObjectData, 'Text', 1) + this.calculateVarVarSize(this.ObjectData, 'MediaURL', 1) + this.calculateVarVarSize(this.ObjectData, 'PSBlock', 1) + this.calculateVarVarSize(this.ObjectData, 'ExtraParams', 1) + 141) * this.ObjectData.length) + 11;
|
||
|
|
}
|
||
|
|
|
||
|
|
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
|
||
|
|
{
|
||
|
|
let size = 0;
|
||
|
|
block.forEach((bl: any) =>
|
||
|
|
{
|
||
|
|
size += bl[paramName].length + extraPerVar;
|
||
|
|
});
|
||
|
|
return size;
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|