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 { MessageFlags } from '../../enums/MessageFlags';
|
|
|
|
|
import { MessageBase } from '../MessageBase';
|
|
|
|
|
import { Message } from '../../enums/Message';
|
2017-11-26 01:14:02 +00:00
|
|
|
|
|
|
|
|
export class UpdateSimulatorMessage implements MessageBase
|
|
|
|
|
{
|
|
|
|
|
name = 'UpdateSimulator';
|
|
|
|
|
messageFlags = MessageFlags.Trusted | MessageFlags.FrequencyLow;
|
|
|
|
|
id = Message.UpdateSimulator;
|
|
|
|
|
|
|
|
|
|
SimulatorInfo: {
|
|
|
|
|
RegionID: UUID;
|
2017-11-26 19:47:41 +00:00
|
|
|
SimName: Buffer;
|
2017-11-26 01:14:02 +00:00
|
|
|
EstateID: number;
|
|
|
|
|
SimAccess: number;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getSize(): number
|
|
|
|
|
{
|
|
|
|
|
return (this.SimulatorInfo['SimName'].length + 1) + 21;
|
|
|
|
|
}
|
|
|
|
|
|
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.SimulatorInfo['RegionID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
buf.writeUInt8(this.SimulatorInfo['SimName'].length, pos++);
|
2017-11-26 19:47:41 +00:00
|
|
|
this.SimulatorInfo['SimName'].copy(buf, pos);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += this.SimulatorInfo['SimName'].length;
|
|
|
|
|
buf.writeUInt32LE(this.SimulatorInfo['EstateID'], pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeUInt8(this.SimulatorInfo['SimAccess'], pos++);
|
|
|
|
|
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 newObjSimulatorInfo: {
|
|
|
|
|
RegionID: UUID,
|
2017-11-26 19:47:41 +00:00
|
|
|
SimName: Buffer,
|
2017-11-26 01:14:02 +00:00
|
|
|
EstateID: number,
|
|
|
|
|
SimAccess: number
|
|
|
|
|
} = {
|
|
|
|
|
RegionID: UUID.zero(),
|
2017-11-26 19:47:41 +00:00
|
|
|
SimName: Buffer.allocUnsafe(0),
|
2017-11-26 01:14:02 +00:00
|
|
|
EstateID: 0,
|
|
|
|
|
SimAccess: 0
|
|
|
|
|
};
|
|
|
|
|
newObjSimulatorInfo['RegionID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
varLength = buf.readUInt8(pos++);
|
2017-11-30 04:11:59 +00:00
|
|
|
newObjSimulatorInfo['SimName'] = buf.slice(pos, pos + varLength);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += varLength;
|
|
|
|
|
newObjSimulatorInfo['EstateID'] = buf.readUInt32LE(pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
newObjSimulatorInfo['SimAccess'] = buf.readUInt8(pos++);
|
|
|
|
|
this.SimulatorInfo = newObjSimulatorInfo;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|