Files
node-metaverse/lib/classes/messages/TerminateFriendship.ts

68 lines
1.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 TerminateFriendshipMessage implements MessageBase
{
name = 'TerminateFriendship';
messageFlags = MessageFlags.FrequencyLow;
id = Message.TerminateFriendship;
AgentData: {
AgentID: UUID;
SessionID: UUID;
};
ExBlock: {
OtherID: UUID;
};
getSize(): number
{
return 48;
}
// @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.ExBlock['OtherID'].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 newObjExBlock: {
OtherID: UUID
} = {
OtherID: UUID.zero()
};
newObjExBlock['OtherID'] = new UUID(buf, pos);
pos += 16;
this.ExBlock = newObjExBlock;
return pos - startPos;
}
}