Skip to content

Commit

Permalink
fix: bit stream issues?
Browse files Browse the repository at this point in the history
  • Loading branch information
hsanger committed Apr 1, 2024
1 parent 5e3c144 commit ef27904
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions server/src/objects/player.ts
Original file line number Diff line number Diff line change
Expand Up @@ -750,8 +750,6 @@ export class Player extends BaseGameObject<ObjectCategory.Player> {

private _firstPacket = true;

packetStream = new PacketStream(SuroiBitStream.alloc(1 << 16));

/**
* Calculate visible objects, check team, and send packets
*/
Expand Down Expand Up @@ -922,12 +920,12 @@ export class Player extends BaseGameObject<ObjectCategory.Player> {
this.sendPacket(packet);
this._firstPacket = false;

this.packetStream.stream.index = 0;
const stream = new PacketStream(SuroiBitStream.alloc(1 << 16));
for (const packet of this.packets) {
this.packetStream.serializePacket(packet);
stream.serializePacket(packet);
}
this.packets.length = 0;
this.sendData(this.packetStream.getBuffer());
this.sendData(stream.getBuffer());
}

/**
Expand Down

0 comments on commit ef27904

Please sign in to comment.