Latest packet handling, parsing, enums, generators, etc..
This commit is contained in:
@@ -27,4 +27,62 @@ export class FetchInventoryDescendentsPacket implements Packet
|
||||
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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user