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 { IPAddress } from '../IPAddress';
|
|
|
|
|
import { MessageFlags } from '../../enums/MessageFlags';
|
|
|
|
|
import { MessageBase } from '../MessageBase';
|
|
|
|
|
import { Message } from '../../enums/Message';
|
2017-11-26 01:14:02 +00:00
|
|
|
|
|
|
|
|
export class RpcScriptRequestInboundForwardMessage implements MessageBase
|
|
|
|
|
{
|
|
|
|
|
name = 'RpcScriptRequestInboundForward';
|
|
|
|
|
messageFlags = MessageFlags.Trusted | MessageFlags.Deprecated | MessageFlags.FrequencyLow;
|
|
|
|
|
id = Message.RpcScriptRequestInboundForward;
|
|
|
|
|
|
|
|
|
|
DataBlock: {
|
|
|
|
|
RPCServerIP: IPAddress;
|
|
|
|
|
RPCServerPort: number;
|
|
|
|
|
TaskID: UUID;
|
|
|
|
|
ItemID: UUID;
|
|
|
|
|
ChannelID: UUID;
|
|
|
|
|
IntValue: number;
|
2017-11-26 19:47:41 +00:00
|
|
|
StringValue: Buffer;
|
2017-11-26 01:14:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getSize(): number
|
|
|
|
|
{
|
|
|
|
|
return (this.DataBlock['StringValue'].length + 2) + 58;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
// @ts-ignore
|
2017-11-26 01:14:02 +00:00
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
|
|
|
{
|
|
|
|
|
const startPos = pos;
|
|
|
|
|
this.DataBlock['RPCServerIP'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeUInt16LE(this.DataBlock['RPCServerPort'], pos);
|
|
|
|
|
pos += 2;
|
|
|
|
|
this.DataBlock['TaskID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
this.DataBlock['ItemID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
this.DataBlock['ChannelID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
buf.writeUInt32LE(this.DataBlock['IntValue'], pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeUInt16LE(this.DataBlock['StringValue'].length, pos);
|
|
|
|
|
pos += 2;
|
2017-11-26 19:47:41 +00:00
|
|
|
this.DataBlock['StringValue'].copy(buf, pos);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += this.DataBlock['StringValue'].length;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-03 13:55:02 +00:00
|
|
|
// @ts-ignore
|
2017-11-26 01:14:02 +00:00
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
|
|
|
{
|
|
|
|
|
const startPos = pos;
|
|
|
|
|
let varLength = 0;
|
|
|
|
|
const newObjDataBlock: {
|
|
|
|
|
RPCServerIP: IPAddress,
|
|
|
|
|
RPCServerPort: number,
|
|
|
|
|
TaskID: UUID,
|
|
|
|
|
ItemID: UUID,
|
|
|
|
|
ChannelID: UUID,
|
|
|
|
|
IntValue: number,
|
2017-11-26 19:47:41 +00:00
|
|
|
StringValue: Buffer
|
2017-11-26 01:14:02 +00:00
|
|
|
} = {
|
|
|
|
|
RPCServerIP: IPAddress.zero(),
|
|
|
|
|
RPCServerPort: 0,
|
|
|
|
|
TaskID: UUID.zero(),
|
|
|
|
|
ItemID: UUID.zero(),
|
|
|
|
|
ChannelID: UUID.zero(),
|
|
|
|
|
IntValue: 0,
|
2017-11-26 19:47:41 +00:00
|
|
|
StringValue: Buffer.allocUnsafe(0)
|
2017-11-26 01:14:02 +00:00
|
|
|
};
|
|
|
|
|
newObjDataBlock['RPCServerIP'] = new IPAddress(buf, pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
newObjDataBlock['RPCServerPort'] = buf.readUInt16LE(pos);
|
|
|
|
|
pos += 2;
|
|
|
|
|
newObjDataBlock['TaskID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
newObjDataBlock['ItemID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
newObjDataBlock['ChannelID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
newObjDataBlock['IntValue'] = buf.readUInt32LE(pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
varLength = buf.readUInt16LE(pos);
|
|
|
|
|
pos += 2;
|
2017-11-30 04:11:59 +00:00
|
|
|
newObjDataBlock['StringValue'] = buf.slice(pos, pos + varLength);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += varLength;
|
|
|
|
|
this.DataBlock = newObjDataBlock;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|