61 lines
1.5 KiB
TypeScript
61 lines
1.5 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 UseCircuitCodeMessage implements MessageBase
|
||
|
|
{
|
||
|
|
name = 'UseCircuitCode';
|
||
|
|
messageFlags = MessageFlags.FrequencyLow;
|
||
|
|
id = Message.UseCircuitCode;
|
||
|
|
|
||
|
|
CircuitCode: {
|
||
|
|
Code: number;
|
||
|
|
SessionID: UUID;
|
||
|
|
ID: UUID;
|
||
|
|
};
|
||
|
|
|
||
|
|
getSize(): number
|
||
|
|
{
|
||
|
|
return 36;
|
||
|
|
}
|
||
|
|
|
||
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
||
|
|
{
|
||
|
|
const startPos = pos;
|
||
|
|
buf.writeUInt32LE(this.CircuitCode['Code'], pos);
|
||
|
|
pos += 4;
|
||
|
|
this.CircuitCode['SessionID'].writeToBuffer(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
this.CircuitCode['ID'].writeToBuffer(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
return pos - startPos;
|
||
|
|
}
|
||
|
|
|
||
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
||
|
|
{
|
||
|
|
const startPos = pos;
|
||
|
|
let varLength = 0;
|
||
|
|
const newObjCircuitCode: {
|
||
|
|
Code: number,
|
||
|
|
SessionID: UUID,
|
||
|
|
ID: UUID
|
||
|
|
} = {
|
||
|
|
Code: 0,
|
||
|
|
SessionID: UUID.zero(),
|
||
|
|
ID: UUID.zero()
|
||
|
|
};
|
||
|
|
newObjCircuitCode['Code'] = buf.readUInt32LE(pos);
|
||
|
|
pos += 4;
|
||
|
|
newObjCircuitCode['SessionID'] = new UUID(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
newObjCircuitCode['ID'] = new UUID(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
this.CircuitCode = newObjCircuitCode;
|
||
|
|
return pos - startPos;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|