79 lines
2.1 KiB
TypeScript
79 lines
2.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 SetScriptRunningMessage implements MessageBase
|
||
|
|
{
|
||
|
|
name = 'SetScriptRunning';
|
||
|
|
messageFlags = MessageFlags.FrequencyLow;
|
||
|
|
id = Message.SetScriptRunning;
|
||
|
|
|
||
|
|
AgentData: {
|
||
|
|
AgentID: UUID;
|
||
|
|
SessionID: UUID;
|
||
|
|
};
|
||
|
|
Script: {
|
||
|
|
ObjectID: UUID;
|
||
|
|
ItemID: UUID;
|
||
|
|
Running: boolean;
|
||
|
|
};
|
||
|
|
|
||
|
|
getSize(): number
|
||
|
|
{
|
||
|
|
return 65;
|
||
|
|
}
|
||
|
|
|
||
|
|
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.Script['ObjectID'].writeToBuffer(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
this.Script['ItemID'].writeToBuffer(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
buf.writeUInt8((this.Script['Running']) ? 1 : 0, pos++);
|
||
|
|
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 newObjScript: {
|
||
|
|
ObjectID: UUID,
|
||
|
|
ItemID: UUID,
|
||
|
|
Running: boolean
|
||
|
|
} = {
|
||
|
|
ObjectID: UUID.zero(),
|
||
|
|
ItemID: UUID.zero(),
|
||
|
|
Running: false
|
||
|
|
};
|
||
|
|
newObjScript['ObjectID'] = new UUID(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
newObjScript['ItemID'] = new UUID(buf, pos);
|
||
|
|
pos += 16;
|
||
|
|
newObjScript['Running'] = (buf.readUInt8(pos++) === 1);
|
||
|
|
this.Script = newObjScript;
|
||
|
|
return pos - startPos;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|