121 lines
4.2 KiB
TypeScript
121 lines
4.2 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 AvatarPropertiesReplyPacket implements Packet
|
|
{
|
|
name = 'AvatarPropertiesReply';
|
|
flags = MessageFlags.Trusted | MessageFlags.Zerocoded | MessageFlags.FrequencyLow;
|
|
id = 4294901931;
|
|
|
|
AgentData: {
|
|
AgentID: UUID;
|
|
AvatarID: UUID;
|
|
};
|
|
PropertiesData: {
|
|
ImageID: UUID;
|
|
FLImageID: UUID;
|
|
PartnerID: UUID;
|
|
AboutText: string;
|
|
FLAboutText: string;
|
|
BornOn: string;
|
|
ProfileURL: string;
|
|
CharterMember: string;
|
|
Flags: number;
|
|
};
|
|
|
|
getSize(): number
|
|
{
|
|
return (this.PropertiesData['AboutText'].length + 2 + this.PropertiesData['FLAboutText'].length + 1 + this.PropertiesData['BornOn'].length + 1 + this.PropertiesData['ProfileURL'].length + 1 + this.PropertiesData['CharterMember'].length + 1) + 84;
|
|
}
|
|
|
|
writeToBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
this.AgentData['AgentID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.AgentData['AvatarID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.PropertiesData['ImageID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.PropertiesData['FLImageID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
this.PropertiesData['PartnerID'].writeToBuffer(buf, pos);
|
|
pos += 16;
|
|
buf.write(this.PropertiesData['AboutText'], pos);
|
|
pos += this.PropertiesData['AboutText'].length;
|
|
buf.write(this.PropertiesData['FLAboutText'], pos);
|
|
pos += this.PropertiesData['FLAboutText'].length;
|
|
buf.write(this.PropertiesData['BornOn'], pos);
|
|
pos += this.PropertiesData['BornOn'].length;
|
|
buf.write(this.PropertiesData['ProfileURL'], pos);
|
|
pos += this.PropertiesData['ProfileURL'].length;
|
|
buf.write(this.PropertiesData['CharterMember'], pos);
|
|
pos += this.PropertiesData['CharterMember'].length;
|
|
buf.writeUInt32LE(this.PropertiesData['Flags'], pos);
|
|
pos += 4;
|
|
return pos - startPos;
|
|
}
|
|
|
|
readFromBuffer(buf: Buffer, pos: number): number
|
|
{
|
|
const startPos = pos;
|
|
const newObjAgentData: {
|
|
AgentID: UUID,
|
|
AvatarID: UUID
|
|
} = {
|
|
AgentID: UUID.zero(),
|
|
AvatarID: UUID.zero()
|
|
};
|
|
newObjAgentData['AgentID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjAgentData['AvatarID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
this.AgentData = newObjAgentData;
|
|
const newObjPropertiesData: {
|
|
ImageID: UUID,
|
|
FLImageID: UUID,
|
|
PartnerID: UUID,
|
|
AboutText: string,
|
|
FLAboutText: string,
|
|
BornOn: string,
|
|
ProfileURL: string,
|
|
CharterMember: string,
|
|
Flags: number
|
|
} = {
|
|
ImageID: UUID.zero(),
|
|
FLImageID: UUID.zero(),
|
|
PartnerID: UUID.zero(),
|
|
AboutText: '',
|
|
FLAboutText: '',
|
|
BornOn: '',
|
|
ProfileURL: '',
|
|
CharterMember: '',
|
|
Flags: 0
|
|
};
|
|
newObjPropertiesData['ImageID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjPropertiesData['FLImageID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjPropertiesData['PartnerID'] = new UUID(buf, pos);
|
|
pos += 16;
|
|
newObjPropertiesData['AboutText'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
newObjPropertiesData['FLAboutText'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
newObjPropertiesData['BornOn'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
newObjPropertiesData['ProfileURL'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
newObjPropertiesData['CharterMember'] = buf.toString('utf8', pos, length);
|
|
pos += length;
|
|
newObjPropertiesData['Flags'] = buf.readUInt32LE(pos);
|
|
pos += 4;
|
|
this.PropertiesData = newObjPropertiesData;
|
|
return pos - startPos;
|
|
}
|
|
}
|
|
|