2017-11-26 01:14:02 +00:00
|
|
|
// This file has been automatically generated by writeMessageClasses.js
|
|
|
|
|
|
2020-01-06 12:10:40 +00:00
|
|
|
import { UUID } from '../UUID';
|
|
|
|
|
import { MessageFlags } from '../../enums/MessageFlags';
|
|
|
|
|
import { MessageBase } from '../MessageBase';
|
|
|
|
|
import { Message } from '../../enums/Message';
|
2017-11-26 01:14:02 +00:00
|
|
|
|
|
|
|
|
export class AvatarNotesUpdateMessage implements MessageBase
|
|
|
|
|
{
|
|
|
|
|
name = 'AvatarNotesUpdate';
|
|
|
|
|
messageFlags = MessageFlags.FrequencyLow;
|
|
|
|
|
id = Message.AvatarNotesUpdate;
|
|
|
|
|
|
|
|
|
|
AgentData: {
|
|
|
|
|
AgentID: UUID;
|
|
|
|
|
SessionID: UUID;
|
|
|
|
|
};
|
|
|
|
|
Data: {
|
|
|
|
|
TargetID: UUID;
|
2017-11-26 19:47:41 +00:00
|
|
|
Notes: Buffer;
|
2017-11-26 01:14:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getSize(): number
|
|
|
|
|
{
|
|
|
|
|
return (this.Data['Notes'].length + 2) + 48;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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['TargetID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
buf.writeUInt16LE(this.Data['Notes'].length, pos);
|
|
|
|
|
pos += 2;
|
2017-11-26 19:47:41 +00:00
|
|
|
this.Data['Notes'].copy(buf, pos);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += this.Data['Notes'].length;
|
|
|
|
|
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 newObjData: {
|
|
|
|
|
TargetID: UUID,
|
2017-11-26 19:47:41 +00:00
|
|
|
Notes: Buffer
|
2017-11-26 01:14:02 +00:00
|
|
|
} = {
|
|
|
|
|
TargetID: UUID.zero(),
|
2017-11-26 19:47:41 +00:00
|
|
|
Notes: Buffer.allocUnsafe(0)
|
2017-11-26 01:14:02 +00:00
|
|
|
};
|
|
|
|
|
newObjData['TargetID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
varLength = buf.readUInt16LE(pos);
|
|
|
|
|
pos += 2;
|
2017-11-30 04:11:59 +00:00
|
|
|
newObjData['Notes'] = buf.slice(pos, pos + varLength);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += varLength;
|
|
|
|
|
this.Data = newObjData;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|