91 lines
2.7 KiB
TypeScript
91 lines
2.7 KiB
TypeScript
// This file has been automatically generated by writeMessageClasses.js
|
|
|
|
import { UUID } from '../UUID';
|
|
import { MessageFlags } from '../../enums/MessageFlags';
|
|
import { MessageBase } from '../MessageBase';
|
|
import { Message } from '../../enums/Message';
|
|
|
|
export class FetchInventoryDescendentsMessage implements MessageBase
|
|
{
|
|
name = 'FetchInventoryDescendents';
|
|
messageFlags = MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
id = Message.FetchInventoryDescendents;
|
|
|
|
AgentData: {
|
|
AgentID: UUID;
|
|
SessionID: UUID;
|
|
};
|
|
InventoryData: {
|
|
FolderID: UUID;
|
|
OwnerID: UUID;
|
|
SortOrder: number;
|
|
FetchFolders: boolean;
|
|
FetchItems: boolean;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return 70;
|
|
}
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
this.AgentData['AgentID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.AgentData['SessionID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.InventoryData['FolderID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.InventoryData['OwnerID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.writeInt32LE(this.InventoryData['SortOrder'], pos);
|
|
pos += 4;
|
|
buf.writeUInt8((this.InventoryData['FetchFolders']) ? 1 : 0, pos++);
|
|
buf.writeUInt8((this.InventoryData['FetchItems']) ? 1 : 0, pos++);
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
let varLength = 0;
|
|
const newObjAgentData: {
|
|
AgentID: UUID,
|
|
SessionID: UUID
|
|
} = {
|
|
AgentID: UUID.zero(),
|
|
SessionID: UUID.zero()
|
|
};
|
|
newObjAgentData['AgentID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjAgentData['SessionID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.AgentData = newObjAgentData;
|
|
const newObjInventoryData: {
|
|
FolderID: UUID,
|
|
OwnerID: UUID,
|
|
SortOrder: number,
|
|
FetchFolders: boolean,
|
|
FetchItems: boolean
|
|
} = {
|
|
FolderID: UUID.zero(),
|
|
OwnerID: UUID.zero(),
|
|
SortOrder: 0,
|
|
FetchFolders: false,
|
|
FetchItems: false
|
|
};
|
|
newObjInventoryData['FolderID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjInventoryData['OwnerID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjInventoryData['SortOrder'] = buf.readInt32LE(pos);
|
|
pos += 4;
|
|
newObjInventoryData['FetchFolders'] = (buf.readUInt8(pos++) === 1);
|
|
newObjInventoryData['FetchItems'] = (buf.readUInt8(pos++) === 1);
|
|
this.InventoryData = newObjInventoryData;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|