64 lines
1.8 KiB
TypeScript
64 lines
1.8 KiB
TypeScript
// This file has been automatically generated by writePacketClasses.js
|
|
|
|
import {UUID} from '../UUID';
|
|
import {MessageFlags} from '../../enums/MessageFlags';
|
|
import {Packet} from '../Packet';
|
|
|
|
export class UpdateSimulatorPacket implements Packet
|
|
{
|
|
name = 'UpdateSimulator';
|
|
flags = MessageFlags.Trusted | MessageFlags.FrequencyLow;
|
|
id = 4294901777;
|
|
|
|
SimulatorInfo: {
|
|
RegionID: UUID;
|
|
SimName: string;
|
|
EstateID: number;
|
|
SimAccess: number;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return (this.SimulatorInfo['SimName'].length + 1) + 21;
|
|
}
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
this.SimulatorInfo['RegionID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.write(this.SimulatorInfo['SimName'], pos);
|
|
pos += this.SimulatorInfo['SimName'].length;
|
|
buf.writeUInt32LE(this.SimulatorInfo['EstateID'], pos);
|
|
pos += 4;
|
|
buf.writeUInt8(this.SimulatorInfo['SimAccess'], pos++);
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
const newObjSimulatorInfo: {
|
|
RegionID: UUID,
|
|
SimName: string,
|
|
EstateID: number,
|
|
SimAccess: number
|
|
} = {
|
|
RegionID: UUID.zero(),
|
|
SimName: '',
|
|
EstateID: 0,
|
|
SimAccess: 0
|
|
};
|
|
newObjSimulatorInfo['RegionID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjSimulatorInfo['SimName'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
newObjSimulatorInfo['EstateID'] = buf.readUInt32LE(pos);
|
|
pos += 4;
|
|
newObjSimulatorInfo['SimAccess'] = buf.readUInt8(pos++);
|
|
this.SimulatorInfo = newObjSimulatorInfo;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|