Files
node-metaverse/lib/classes/messages/DenyTrustedCircuit.ts
2017-11-26 01:14:02 +00:00

47 lines
1.1 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 DenyTrustedCircuitMessage implements MessageBase
{
name = 'DenyTrustedCircuit';
messageFlags = MessageFlags.FrequencyLow;
id = Message.DenyTrustedCircuit;
DataBlock: {
EndPointID: UUID;
};
getSize(): number
{
return 16;
}
writeToBuffer(buf: Buffer, pos: number): number
{
const startPos = pos;
this.DataBlock['EndPointID'].writeToBuffer(buf, pos);
pos += 16;
return pos - startPos;
}
readFromBuffer(buf: Buffer, pos: number): number
{
const startPos = pos;
let varLength = 0;
const newObjDataBlock: {
EndPointID: UUID
} = {
EndPointID: UUID.zero()
};
newObjDataBlock['EndPointID'] = new UUID(buf, pos);
pos += 16;
this.DataBlock = newObjDataBlock;
return pos - startPos;
}
}