2017-11-26 01:14:02 +00:00
|
|
|
// 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 DirPlacesQueryBackendMessage implements MessageBase
|
|
|
|
|
{
|
|
|
|
|
name = 'DirPlacesQueryBackend';
|
|
|
|
|
messageFlags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
|
|
|
id = Message.DirPlacesQueryBackend;
|
|
|
|
|
|
|
|
|
|
AgentData: {
|
|
|
|
|
AgentID: UUID;
|
|
|
|
|
};
|
|
|
|
|
QueryData: {
|
|
|
|
|
QueryID: UUID;
|
2017-11-26 19:47:41 +00:00
|
|
|
QueryText: Buffer;
|
2017-11-26 01:14:02 +00:00
|
|
|
QueryFlags: number;
|
|
|
|
|
Category: number;
|
2017-11-26 19:47:41 +00:00
|
|
|
SimName: Buffer;
|
2017-11-26 01:14:02 +00:00
|
|
|
EstateID: number;
|
|
|
|
|
Godlike: boolean;
|
|
|
|
|
QueryStart: number;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
getSize(): number
|
|
|
|
|
{
|
|
|
|
|
return (this.QueryData['QueryText'].length + 1 + this.QueryData['SimName'].length + 1) + 46;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
|
|
|
{
|
|
|
|
|
const startPos = pos;
|
|
|
|
|
this.AgentData['AgentID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
this.QueryData['QueryID'].writeToBuffer(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
buf.writeUInt8(this.QueryData['QueryText'].length, pos++);
|
2017-11-26 19:47:41 +00:00
|
|
|
this.QueryData['QueryText'].copy(buf, pos);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += this.QueryData['QueryText'].length;
|
|
|
|
|
buf.writeUInt32LE(this.QueryData['QueryFlags'], pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeInt8(this.QueryData['Category'], pos++);
|
|
|
|
|
buf.writeUInt8(this.QueryData['SimName'].length, pos++);
|
2017-11-26 19:47:41 +00:00
|
|
|
this.QueryData['SimName'].copy(buf, pos);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += this.QueryData['SimName'].length;
|
|
|
|
|
buf.writeUInt32LE(this.QueryData['EstateID'], pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
buf.writeUInt8((this.QueryData['Godlike']) ? 1 : 0, pos++);
|
|
|
|
|
buf.writeInt32LE(this.QueryData['QueryStart'], pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
|
|
|
{
|
|
|
|
|
const startPos = pos;
|
|
|
|
|
let varLength = 0;
|
|
|
|
|
const newObjAgentData: {
|
|
|
|
|
AgentID: UUID
|
|
|
|
|
} = {
|
|
|
|
|
AgentID: UUID.zero()
|
|
|
|
|
};
|
|
|
|
|
newObjAgentData['AgentID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
this.AgentData = newObjAgentData;
|
|
|
|
|
const newObjQueryData: {
|
|
|
|
|
QueryID: UUID,
|
2017-11-26 19:47:41 +00:00
|
|
|
QueryText: Buffer,
|
2017-11-26 01:14:02 +00:00
|
|
|
QueryFlags: number,
|
|
|
|
|
Category: number,
|
2017-11-26 19:47:41 +00:00
|
|
|
SimName: Buffer,
|
2017-11-26 01:14:02 +00:00
|
|
|
EstateID: number,
|
|
|
|
|
Godlike: boolean,
|
|
|
|
|
QueryStart: number
|
|
|
|
|
} = {
|
|
|
|
|
QueryID: UUID.zero(),
|
2017-11-26 19:47:41 +00:00
|
|
|
QueryText: Buffer.allocUnsafe(0),
|
2017-11-26 01:14:02 +00:00
|
|
|
QueryFlags: 0,
|
|
|
|
|
Category: 0,
|
2017-11-26 19:47:41 +00:00
|
|
|
SimName: Buffer.allocUnsafe(0),
|
2017-11-26 01:14:02 +00:00
|
|
|
EstateID: 0,
|
|
|
|
|
Godlike: false,
|
|
|
|
|
QueryStart: 0
|
|
|
|
|
};
|
|
|
|
|
newObjQueryData['QueryID'] = new UUID(buf, pos);
|
|
|
|
|
pos += 16;
|
|
|
|
|
varLength = buf.readUInt8(pos++);
|
2017-11-30 04:11:59 +00:00
|
|
|
newObjQueryData['QueryText'] = buf.slice(pos, pos + varLength);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += varLength;
|
|
|
|
|
newObjQueryData['QueryFlags'] = buf.readUInt32LE(pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
newObjQueryData['Category'] = buf.readInt8(pos++);
|
|
|
|
|
varLength = buf.readUInt8(pos++);
|
2017-11-30 04:11:59 +00:00
|
|
|
newObjQueryData['SimName'] = buf.slice(pos, pos + varLength);
|
2017-11-26 01:14:02 +00:00
|
|
|
pos += varLength;
|
|
|
|
|
newObjQueryData['EstateID'] = buf.readUInt32LE(pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
newObjQueryData['Godlike'] = (buf.readUInt8(pos++) === 1);
|
|
|
|
|
newObjQueryData['QueryStart'] = buf.readInt32LE(pos);
|
|
|
|
|
pos += 4;
|
|
|
|
|
this.QueryData = newObjQueryData;
|
|
|
|
|
return pos - startPos;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|