88 lines
2.7 KiB
TypeScript
88 lines
2.7 KiB
TypeScript
// This file has been automatically generated by writePacketClasses.js
|
|
|
|
import {UUID} from '../UUID';
|
|
import {IPAddress} from '../IPAddress';
|
|
import {MessageFlags} from '../../enums/MessageFlags';
|
|
import {Packet} from '../Packet';
|
|
|
|
export class RpcScriptRequestInboundForwardPacket implements Packet
|
|
{
|
|
name = 'RpcScriptRequestInboundForward';
|
|
flags = MessageFlags.Trusted | MessageFlags.Deprecated | MessageFlags.FrequencyLow;
|
|
id = 4294902176;
|
|
|
|
DataBlock: {
|
|
RPCServerIP: IPAddress;
|
|
RPCServerPort: number;
|
|
TaskID: UUID;
|
|
ItemID: UUID;
|
|
ChannelID: UUID;
|
|
IntValue: number;
|
|
StringValue: string;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return (this.DataBlock['StringValue'].length + 2) + 58;
|
|
}
|
|
|
|
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.write(this.DataBlock['StringValue'], pos);
|
|
pos += this.DataBlock['StringValue'].length;
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
const newObjDataBlock: {
|
|
RPCServerIP: IPAddress,
|
|
RPCServerPort: number,
|
|
TaskID: UUID,
|
|
ItemID: UUID,
|
|
ChannelID: UUID,
|
|
IntValue: number,
|
|
StringValue: string
|
|
} = {
|
|
RPCServerIP: IPAddress.zero(),
|
|
RPCServerPort: 0,
|
|
TaskID: UUID.zero(),
|
|
ItemID: UUID.zero(),
|
|
ChannelID: UUID.zero(),
|
|
IntValue: 0,
|
|
StringValue: ''
|
|
};
|
|
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;
|
|
newObjDataBlock['StringValue'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
this.DataBlock = newObjDataBlock;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|