Latest packet handling, parsing, enums, generators, etc..

This commit is contained in:
Casper Warden
2017-11-24 17:45:34 +00:00
parent ec300e33ac
commit 261f28698a
496 changed files with 30448 additions and 57 deletions

View File

@@ -22,4 +22,36 @@ export class EventLocationRequestPacket implements Packet
return 20;
}
writeToBuffer(buf: Buffer, pos: number): number
{
const startPos = pos;
this.QueryData['QueryID'].writeToBuffer(buf, pos);
pos += 16;
buf.writeUInt32LE(this.EventData['EventID'], pos);
pos += 4;
return pos - startPos;
}
readFromBuffer(buf: Buffer, pos: number): number
{
const startPos = pos;
const newObjQueryData: {
QueryID: UUID
} = {
QueryID: UUID.zero()
};
newObjQueryData['QueryID'] = new UUID(buf, pos);
pos += 16;
this.QueryData = newObjQueryData;
const newObjEventData: {
EventID: number
} = {
EventID: 0
};
newObjEventData['EventID'] = buf.readUInt32LE(pos);
pos += 4;
this.EventData = newObjEventData;
return pos - startPos;
}
}