Latest packet handling, parsing, enums, generators, etc..
This commit is contained in:
@@ -74,4 +74,310 @@ export class ParcelPropertiesPacket implements Packet
|
||||
return (this.ParcelData['Bitmap'].length + 2 + this.ParcelData['Name'].length + 1 + this.ParcelData['Desc'].length + 1 + this.ParcelData['MusicURL'].length + 1 + this.ParcelData['MediaURL'].length + 1) + 240;
|
||||
}
|
||||
|
||||
writeToBuffer(buf: Buffer, pos: number): number
|
||||
{
|
||||
const startPos = pos;
|
||||
buf.writeInt32LE(this.ParcelData['RequestResult'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['SequenceID'], pos);
|
||||
pos += 4;
|
||||
buf.writeUInt8((this.ParcelData['SnapSelection']) ? 1 : 0, pos++);
|
||||
buf.writeInt32LE(this.ParcelData['SelfCount'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['OtherCount'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['PublicCount'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['LocalID'], pos);
|
||||
pos += 4;
|
||||
this.ParcelData['OwnerID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
buf.writeUInt8((this.ParcelData['IsGroupOwned']) ? 1 : 0, pos++);
|
||||
buf.writeUInt32LE(this.ParcelData['AuctionID'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['ClaimDate'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['ClaimPrice'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['RentPrice'], pos);
|
||||
pos += 4;
|
||||
this.ParcelData['AABBMin'].writeToBuffer(buf, pos, false);
|
||||
pos += 12;
|
||||
this.ParcelData['AABBMax'].writeToBuffer(buf, pos, false);
|
||||
pos += 12;
|
||||
buf.write(this.ParcelData['Bitmap'], pos);
|
||||
pos += this.ParcelData['Bitmap'].length;
|
||||
buf.writeInt32LE(this.ParcelData['Area'], pos);
|
||||
pos += 4;
|
||||
buf.writeUInt8(this.ParcelData['Status'], pos++);
|
||||
buf.writeInt32LE(this.ParcelData['SimWideMaxPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['SimWideTotalPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['MaxPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['TotalPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['OwnerPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['GroupPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['OtherPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['SelectedPrims'], pos);
|
||||
pos += 4;
|
||||
buf.writeFloatLE(this.ParcelData['ParcelPrimBonus'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['OtherCleanTime'], pos);
|
||||
pos += 4;
|
||||
buf.writeUInt32LE(this.ParcelData['ParcelFlags'], pos);
|
||||
pos += 4;
|
||||
buf.writeInt32LE(this.ParcelData['SalePrice'], pos);
|
||||
pos += 4;
|
||||
buf.write(this.ParcelData['Name'], pos);
|
||||
pos += this.ParcelData['Name'].length;
|
||||
buf.write(this.ParcelData['Desc'], pos);
|
||||
pos += this.ParcelData['Desc'].length;
|
||||
buf.write(this.ParcelData['MusicURL'], pos);
|
||||
pos += this.ParcelData['MusicURL'].length;
|
||||
buf.write(this.ParcelData['MediaURL'], pos);
|
||||
pos += this.ParcelData['MediaURL'].length;
|
||||
this.ParcelData['MediaID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
buf.writeUInt8(this.ParcelData['MediaAutoScale'], pos++);
|
||||
this.ParcelData['GroupID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
buf.writeInt32LE(this.ParcelData['PassPrice'], pos);
|
||||
pos += 4;
|
||||
buf.writeFloatLE(this.ParcelData['PassHours'], pos);
|
||||
pos += 4;
|
||||
buf.writeUInt8(this.ParcelData['Category'], pos++);
|
||||
this.ParcelData['AuthBuyerID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
this.ParcelData['SnapshotID'].writeToBuffer(buf, pos);
|
||||
pos += 16;
|
||||
this.ParcelData['UserLocation'].writeToBuffer(buf, pos, false);
|
||||
pos += 12;
|
||||
this.ParcelData['UserLookAt'].writeToBuffer(buf, pos, false);
|
||||
pos += 12;
|
||||
buf.writeUInt8(this.ParcelData['LandingType'], pos++);
|
||||
buf.writeUInt8((this.ParcelData['RegionPushOverride']) ? 1 : 0, pos++);
|
||||
buf.writeUInt8((this.ParcelData['RegionDenyAnonymous']) ? 1 : 0, pos++);
|
||||
buf.writeUInt8((this.ParcelData['RegionDenyIdentified']) ? 1 : 0, pos++);
|
||||
buf.writeUInt8((this.ParcelData['RegionDenyTransacted']) ? 1 : 0, pos++);
|
||||
buf.writeUInt8((this.AgeVerificationBlock['RegionDenyAgeUnverified']) ? 1 : 0, pos++);
|
||||
buf.writeUInt8((this.RegionAllowAccessBlock['RegionAllowAccessOverride']) ? 1 : 0, pos++);
|
||||
return pos - startPos;
|
||||
}
|
||||
|
||||
readFromBuffer(buf: Buffer, pos: number): number
|
||||
{
|
||||
const startPos = pos;
|
||||
const newObjParcelData: {
|
||||
RequestResult: number,
|
||||
SequenceID: number,
|
||||
SnapSelection: boolean,
|
||||
SelfCount: number,
|
||||
OtherCount: number,
|
||||
PublicCount: number,
|
||||
LocalID: number,
|
||||
OwnerID: UUID,
|
||||
IsGroupOwned: boolean,
|
||||
AuctionID: number,
|
||||
ClaimDate: number,
|
||||
ClaimPrice: number,
|
||||
RentPrice: number,
|
||||
AABBMin: Vector3,
|
||||
AABBMax: Vector3,
|
||||
Bitmap: string,
|
||||
Area: number,
|
||||
Status: number,
|
||||
SimWideMaxPrims: number,
|
||||
SimWideTotalPrims: number,
|
||||
MaxPrims: number,
|
||||
TotalPrims: number,
|
||||
OwnerPrims: number,
|
||||
GroupPrims: number,
|
||||
OtherPrims: number,
|
||||
SelectedPrims: number,
|
||||
ParcelPrimBonus: number,
|
||||
OtherCleanTime: number,
|
||||
ParcelFlags: number,
|
||||
SalePrice: number,
|
||||
Name: string,
|
||||
Desc: string,
|
||||
MusicURL: string,
|
||||
MediaURL: string,
|
||||
MediaID: UUID,
|
||||
MediaAutoScale: number,
|
||||
GroupID: UUID,
|
||||
PassPrice: number,
|
||||
PassHours: number,
|
||||
Category: number,
|
||||
AuthBuyerID: UUID,
|
||||
SnapshotID: UUID,
|
||||
UserLocation: Vector3,
|
||||
UserLookAt: Vector3,
|
||||
LandingType: number,
|
||||
RegionPushOverride: boolean,
|
||||
RegionDenyAnonymous: boolean,
|
||||
RegionDenyIdentified: boolean,
|
||||
RegionDenyTransacted: boolean
|
||||
} = {
|
||||
RequestResult: 0,
|
||||
SequenceID: 0,
|
||||
SnapSelection: false,
|
||||
SelfCount: 0,
|
||||
OtherCount: 0,
|
||||
PublicCount: 0,
|
||||
LocalID: 0,
|
||||
OwnerID: UUID.zero(),
|
||||
IsGroupOwned: false,
|
||||
AuctionID: 0,
|
||||
ClaimDate: 0,
|
||||
ClaimPrice: 0,
|
||||
RentPrice: 0,
|
||||
AABBMin: Vector3.getZero(),
|
||||
AABBMax: Vector3.getZero(),
|
||||
Bitmap: '',
|
||||
Area: 0,
|
||||
Status: 0,
|
||||
SimWideMaxPrims: 0,
|
||||
SimWideTotalPrims: 0,
|
||||
MaxPrims: 0,
|
||||
TotalPrims: 0,
|
||||
OwnerPrims: 0,
|
||||
GroupPrims: 0,
|
||||
OtherPrims: 0,
|
||||
SelectedPrims: 0,
|
||||
ParcelPrimBonus: 0,
|
||||
OtherCleanTime: 0,
|
||||
ParcelFlags: 0,
|
||||
SalePrice: 0,
|
||||
Name: '',
|
||||
Desc: '',
|
||||
MusicURL: '',
|
||||
MediaURL: '',
|
||||
MediaID: UUID.zero(),
|
||||
MediaAutoScale: 0,
|
||||
GroupID: UUID.zero(),
|
||||
PassPrice: 0,
|
||||
PassHours: 0,
|
||||
Category: 0,
|
||||
AuthBuyerID: UUID.zero(),
|
||||
SnapshotID: UUID.zero(),
|
||||
UserLocation: Vector3.getZero(),
|
||||
UserLookAt: Vector3.getZero(),
|
||||
LandingType: 0,
|
||||
RegionPushOverride: false,
|
||||
RegionDenyAnonymous: false,
|
||||
RegionDenyIdentified: false,
|
||||
RegionDenyTransacted: false
|
||||
};
|
||||
newObjParcelData['RequestResult'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['SequenceID'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['SnapSelection'] = (buf.readUInt8(pos++) === 1);
|
||||
newObjParcelData['SelfCount'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['OtherCount'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['PublicCount'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['LocalID'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['OwnerID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
newObjParcelData['IsGroupOwned'] = (buf.readUInt8(pos++) === 1);
|
||||
newObjParcelData['AuctionID'] = buf.readUInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['ClaimDate'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['ClaimPrice'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['RentPrice'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['AABBMin'] = new Vector3(buf, pos, false);
|
||||
pos += 12;
|
||||
newObjParcelData['AABBMax'] = new Vector3(buf, pos, false);
|
||||
pos += 12;
|
||||
newObjParcelData['Bitmap'] = buf.toString('utf8', pos, length);
|
||||
pos += length;
|
||||
newObjParcelData['Area'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['Status'] = buf.readUInt8(pos++);
|
||||
newObjParcelData['SimWideMaxPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['SimWideTotalPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['MaxPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['TotalPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['OwnerPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['GroupPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['OtherPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['SelectedPrims'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['ParcelPrimBonus'] = buf.readFloatLE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['OtherCleanTime'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['ParcelFlags'] = buf.readUInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['SalePrice'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['Name'] = buf.toString('utf8', pos, length);
|
||||
pos += length;
|
||||
newObjParcelData['Desc'] = buf.toString('utf8', pos, length);
|
||||
pos += length;
|
||||
newObjParcelData['MusicURL'] = buf.toString('utf8', pos, length);
|
||||
pos += length;
|
||||
newObjParcelData['MediaURL'] = buf.toString('utf8', pos, length);
|
||||
pos += length;
|
||||
newObjParcelData['MediaID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
newObjParcelData['MediaAutoScale'] = buf.readUInt8(pos++);
|
||||
newObjParcelData['GroupID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
newObjParcelData['PassPrice'] = buf.readInt32LE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['PassHours'] = buf.readFloatLE(pos);
|
||||
pos += 4;
|
||||
newObjParcelData['Category'] = buf.readUInt8(pos++);
|
||||
newObjParcelData['AuthBuyerID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
newObjParcelData['SnapshotID'] = new UUID(buf, pos);
|
||||
pos += 16;
|
||||
newObjParcelData['UserLocation'] = new Vector3(buf, pos, false);
|
||||
pos += 12;
|
||||
newObjParcelData['UserLookAt'] = new Vector3(buf, pos, false);
|
||||
pos += 12;
|
||||
newObjParcelData['LandingType'] = buf.readUInt8(pos++);
|
||||
newObjParcelData['RegionPushOverride'] = (buf.readUInt8(pos++) === 1);
|
||||
newObjParcelData['RegionDenyAnonymous'] = (buf.readUInt8(pos++) === 1);
|
||||
newObjParcelData['RegionDenyIdentified'] = (buf.readUInt8(pos++) === 1);
|
||||
newObjParcelData['RegionDenyTransacted'] = (buf.readUInt8(pos++) === 1);
|
||||
this.ParcelData = newObjParcelData;
|
||||
const newObjAgeVerificationBlock: {
|
||||
RegionDenyAgeUnverified: boolean
|
||||
} = {
|
||||
RegionDenyAgeUnverified: false
|
||||
};
|
||||
newObjAgeVerificationBlock['RegionDenyAgeUnverified'] = (buf.readUInt8(pos++) === 1);
|
||||
this.AgeVerificationBlock = newObjAgeVerificationBlock;
|
||||
const newObjRegionAllowAccessBlock: {
|
||||
RegionAllowAccessOverride: boolean
|
||||
} = {
|
||||
RegionAllowAccessOverride: false
|
||||
};
|
||||
newObjRegionAllowAccessBlock['RegionAllowAccessOverride'] = (buf.readUInt8(pos++) === 1);
|
||||
this.RegionAllowAccessBlock = newObjRegionAllowAccessBlock;
|
||||
return pos - startPos;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user