82 lines
2.2 KiB
TypeScript
82 lines
2.2 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 BuyObjectInventoryMessage implements MessageBase
|
|
{
|
|
name = 'BuyObjectInventory';
|
|
messageFlags = MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
id = Message.BuyObjectInventory;
|
|
|
|
AgentData: {
|
|
AgentID: UUID;
|
|
SessionID: UUID;
|
|
};
|
|
Data: {
|
|
ObjectID: UUID;
|
|
ItemID: UUID;
|
|
FolderID: UUID;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return 80;
|
|
}
|
|
|
|
// @ts-ignore
|
|
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.Data['ObjectID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.Data['ItemID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.Data['FolderID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
return pos - startPos;
|
|
}
|
|
|
|
// @ts-ignore
|
|
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 newObjData: {
|
|
ObjectID: UUID,
|
|
ItemID: UUID,
|
|
FolderID: UUID
|
|
} = {
|
|
ObjectID: UUID.zero(),
|
|
ItemID: UUID.zero(),
|
|
FolderID: UUID.zero()
|
|
};
|
|
newObjData['ObjectID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjData['ItemID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjData['FolderID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.Data = newObjData;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|