72 lines
1.9 KiB
TypeScript
72 lines
1.9 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 AvatarPickerRequestPacket implements Packet
|
|
{
|
|
name = 'AvatarPickerRequest';
|
|
flags = MessageFlags.FrequencyLow;
|
|
id = 4294901786;
|
|
|
|
AgentData: {
|
|
AgentID: UUID;
|
|
SessionID: UUID;
|
|
QueryID: UUID;
|
|
};
|
|
Data: {
|
|
Name: string;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return (this.Data['Name'].length + 1) + 48;
|
|
}
|
|
|
|
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;
|
|
this.AgentData['QueryID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.write(this.Data['Name'], pos);
|
|
pos += this.Data['Name'].length;
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
const newObjAgentData: {
|
|
AgentID: UUID,
|
|
SessionID: UUID,
|
|
QueryID: UUID
|
|
} = {
|
|
AgentID: UUID.zero(),
|
|
SessionID: UUID.zero(),
|
|
QueryID: UUID.zero()
|
|
};
|
|
newObjAgentData['AgentID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjAgentData['SessionID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjAgentData['QueryID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.AgentData = newObjAgentData;
|
|
const newObjData: {
|
|
Name: string
|
|
} = {
|
|
Name: ''
|
|
};
|
|
newObjData['Name'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
this.Data = newObjData;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|