// 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 OfflineNotificationMessage implements MessageBase { name = 'OfflineNotification'; messageFlags = MessageFlags.Trusted | MessageFlags.FrequencyLow; id = Message.OfflineNotification; AgentBlock: { AgentID: UUID; }[]; getSize(): number { return ((16) * this.AgentBlock.length) + 1; } writeToBuffer(buf: Buffer, pos: number): number { const startPos = pos; const count = this.AgentBlock.length; buf.writeUInt8(this.AgentBlock.length, pos++); for (let i = 0; i < count; i++) { this.AgentBlock[i]['AgentID'].writeToBuffer(buf, pos); pos += 16; } return pos - startPos; } readFromBuffer(buf: Buffer, pos: number): number { const startPos = pos; let varLength = 0; const count = buf.readUInt8(pos++); this.AgentBlock = []; for (let i = 0; i < count; i++) { const newObjAgentBlock: { AgentID: UUID } = { AgentID: UUID.zero() }; newObjAgentBlock['AgentID'] = new UUID(buf, pos); pos += 16; this.AgentBlock.push(newObjAgentBlock); } return pos - startPos; } }