Skip to content

Commit

Permalink
Allow id less packets exist
Browse files Browse the repository at this point in the history
  • Loading branch information
DryByte committed Oct 18, 2024
1 parent 9b8e355 commit 1569b7a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/packets/BasePacket.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ class BasePacket {
let packet = Buffer.alloc(size+1);
let offset = 0;

packet.writeUInt8(this.id, offset);
offset+=1;
if (typeof this.id == "undefined") {
packet.writeUInt8(this.id, offset);
offset+=1;
}

for (let v in this.fields){
this.fields[v].write(packet, this.fields[v].value, offset);
Expand Down

0 comments on commit 1569b7a

Please sign in to comment.