diff --git a/lib/structures/Client.ts b/lib/structures/Client.ts index f9208a2..877977d 100644 --- a/lib/structures/Client.ts +++ b/lib/structures/Client.ts @@ -61,11 +61,13 @@ export class Client extends EventEmitter { } }); - return this.host.send( - netID, - Buffer.concat(packets.filter((packet): packet is Buffer => packet !== undefined)), - channelID - ); + packets + .filter((packet): packet is Buffer => packet !== undefined) + .forEach((v) => { + this.host.send(netID, v as Buffer, channelID); + }); + + return; } public connect(ipAddress: string, port: number) { diff --git a/lib/structures/Peer.ts b/lib/structures/Peer.ts index 6f65e13..43605a4 100644 --- a/lib/structures/Peer.ts +++ b/lib/structures/Peer.ts @@ -55,11 +55,13 @@ export class Peer { } }); - return _client.send( - netID, - Buffer.concat(packets.filter((packet): packet is Buffer => packet !== undefined)), - channelID - ); + packets + .filter((packet): packet is Buffer => packet !== undefined) + .forEach((v) => { + _client.send(netID, v as Buffer, channelID); + }); + + return; } /** diff --git a/package.json b/package.json index 69f8557..bab322e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "growtopia.js", "description": "A Rust based, cross-platform, high-performance Growtopia private server framework utilizing Node.js, Bun.js.", - "version": "2.0.4", + "version": "2.0.5", "main": "./dist/index.js", "types": "./dist/index.d.ts", "exports": {