Packet descriptions
This commit is contained in:
37
lib/classes/packets/ObjectDescription.ts
Normal file
37
lib/classes/packets/ObjectDescription.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
// This file has been automatically generated by writePacketClasses.js
|
||||
|
||||
import {UUID} from '../UUID';
|
||||
import {MessageFlags} from '../../enums/MessageFlags';
|
||||
import {Packet} from '../Packet';
|
||||
|
||||
export class ObjectDescriptionPacket implements Packet
|
||||
{
|
||||
name = 'ObjectDescription';
|
||||
flags = MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
||||
id = 4294901868;
|
||||
|
||||
AgentData: {
|
||||
AgentID: UUID;
|
||||
SessionID: UUID;
|
||||
};
|
||||
ObjectData: {
|
||||
LocalID: number;
|
||||
Description: string;
|
||||
}[];
|
||||
|
||||
getSize(): number
|
||||
{
|
||||
return ((this.calculateVarVarSize(this.ObjectData, 'Description', 1) + 4) * this.ObjectData.length) + 33;
|
||||
}
|
||||
|
||||
calculateVarVarSize(block: object[], paramName: string, extraPerVar: number): number
|
||||
{
|
||||
let size = 0;
|
||||
block.forEach((bl: any) =>
|
||||
{
|
||||
size += bl[paramName].length + extraPerVar;
|
||||
});
|
||||
return size;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user