149 lines
5.3 KiB
TypeScript
149 lines
5.3 KiB
TypeScript
// This file has been automatically generated by writeMessageClasses.js
|
|
|
|
import { UUID } from '../UUID';
|
|
import { Vector3 } from '../Vector3';
|
|
import { MessageFlags } from '../../enums/MessageFlags';
|
|
import { MessageBase } from '../MessageBase';
|
|
import { Message } from '../../enums/Message';
|
|
|
|
export class UserReportMessage implements MessageBase
|
|
{
|
|
name = 'UserReport';
|
|
messageFlags = MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
id = Message.UserReport;
|
|
|
|
AgentData: {
|
|
AgentID: UUID;
|
|
SessionID: UUID;
|
|
};
|
|
ReportData: {
|
|
ReportType: number;
|
|
Category: number;
|
|
Position: Vector3;
|
|
CheckFlags: number;
|
|
ScreenshotID: UUID;
|
|
ObjectID: UUID;
|
|
AbuserID: UUID;
|
|
AbuseRegionName: Buffer;
|
|
AbuseRegionID: UUID;
|
|
Summary: Buffer;
|
|
Details: Buffer;
|
|
VersionString: Buffer;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return (this.ReportData['AbuseRegionName'].length + 1 + this.ReportData['Summary'].length + 1 + this.ReportData['Details'].length + 2 + this.ReportData['VersionString'].length + 1) + 111;
|
|
}
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
this.AgentData['AgentID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.AgentData['SessionID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.writeUInt8(this.ReportData['ReportType'], pos++);
|
|
buf.writeUInt8(this.ReportData['Category'], pos++);
|
|
this.ReportData['Position'].writeToBuffer(buf, pos, false);
|
|
pos += 12;
|
|
buf.writeUInt8(this.ReportData['CheckFlags'], pos++);
|
|
this.ReportData['ScreenshotID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.ReportData['ObjectID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.ReportData['AbuserID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.writeUInt8(this.ReportData['AbuseRegionName'].length, pos++);
|
|
this.ReportData['AbuseRegionName'].copy(buf, pos);
|
|
pos += this.ReportData['AbuseRegionName'].length;
|
|
this.ReportData['AbuseRegionID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.writeUInt8(this.ReportData['Summary'].length, pos++);
|
|
this.ReportData['Summary'].copy(buf, pos);
|
|
pos += this.ReportData['Summary'].length;
|
|
buf.writeUInt16LE(this.ReportData['Details'].length, pos);
|
|
pos += 2;
|
|
this.ReportData['Details'].copy(buf, pos);
|
|
pos += this.ReportData['Details'].length;
|
|
buf.writeUInt8(this.ReportData['VersionString'].length, pos++);
|
|
this.ReportData['VersionString'].copy(buf, pos);
|
|
pos += this.ReportData['VersionString'].length;
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
let varLength = 0;
|
|
const newObjAgentData: {
|
|
AgentID: UUID,
|
|
SessionID: UUID
|
|
} = {
|
|
AgentID: UUID.zero(),
|
|
SessionID: UUID.zero()
|
|
};
|
|
newObjAgentData['AgentID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjAgentData['SessionID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.AgentData = newObjAgentData;
|
|
const newObjReportData: {
|
|
ReportType: number,
|
|
Category: number,
|
|
Position: Vector3,
|
|
CheckFlags: number,
|
|
ScreenshotID: UUID,
|
|
ObjectID: UUID,
|
|
AbuserID: UUID,
|
|
AbuseRegionName: Buffer,
|
|
AbuseRegionID: UUID,
|
|
Summary: Buffer,
|
|
Details: Buffer,
|
|
VersionString: Buffer
|
|
} = {
|
|
ReportType: 0,
|
|
Category: 0,
|
|
Position: Vector3.getZero(),
|
|
CheckFlags: 0,
|
|
ScreenshotID: UUID.zero(),
|
|
ObjectID: UUID.zero(),
|
|
AbuserID: UUID.zero(),
|
|
AbuseRegionName: Buffer.allocUnsafe(0),
|
|
AbuseRegionID: UUID.zero(),
|
|
Summary: Buffer.allocUnsafe(0),
|
|
Details: Buffer.allocUnsafe(0),
|
|
VersionString: Buffer.allocUnsafe(0)
|
|
};
|
|
newObjReportData['ReportType'] = buf.readUInt8(pos++);
|
|
newObjReportData['Category'] = buf.readUInt8(pos++);
|
|
newObjReportData['Position'] = new Vector3(buf, pos, false);
|
|
pos += 12;
|
|
newObjReportData['CheckFlags'] = buf.readUInt8(pos++);
|
|
newObjReportData['ScreenshotID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjReportData['ObjectID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjReportData['AbuserID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
varLength = buf.readUInt8(pos++);
|
|
newObjReportData['AbuseRegionName'] = buf.slice(pos, pos + varLength);
|
|
pos += varLength;
|
|
newObjReportData['AbuseRegionID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
varLength = buf.readUInt8(pos++);
|
|
newObjReportData['Summary'] = buf.slice(pos, pos + varLength);
|
|
pos += varLength;
|
|
varLength = buf.readUInt16LE(pos);
|
|
pos += 2;
|
|
newObjReportData['Details'] = buf.slice(pos, pos + varLength);
|
|
pos += varLength;
|
|
varLength = buf.readUInt8(pos++);
|
|
newObjReportData['VersionString'] = buf.slice(pos, pos + varLength);
|
|
pos += varLength;
|
|
this.ReportData = newObjReportData;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|