Skip to content

Commit 7420409

Browse files
committed
Remove unused callback from writePacket
1 parent d6a5e18 commit 7420409

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/minecraft/connection/index.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ export interface ServerConnection extends events.EventEmitter {
2828
msgSalt?: Buffer
2929
disconnectReason?: string
3030

31-
writePacket: (
32-
packetId: number,
33-
data: Buffer,
34-
cb?: ((err?: Error | undefined) => void) | undefined
35-
) => Promise<boolean>
31+
writePacket: (packetId: number, data: Buffer) => Promise<boolean>
3632

3733
close: () => void
3834

src/minecraft/connection/javascript.ts

+3-6
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,14 @@ export class JavaScriptServerConnection
5555
this.options = options
5656
}
5757

58-
async writePacket(
59-
packetId: number,
60-
data: Buffer,
61-
cb?: ((err?: Error | undefined) => void) | undefined
62-
): Promise<boolean> {
58+
async writePacket(packetId: number, data: Buffer): Promise<boolean> {
6359
const compressionThreshold = this.compressionThreshold
6460
const packet = this.compressionEnabled
6561
? await makeBaseCompressedPacket(compressionThreshold, packetId, data)
6662
: makeBasePacket(packetId, data)
6763
const toWrite = this.aesCipher ? this.aesCipher.update(packet) : packet
68-
return this.socket.write(toWrite, cb)
64+
// Technically, this completes when cb is called, but we don't care.
65+
return this.socket.write(toWrite)
6966
}
7067

7168
onlyOneCloseCall = false

0 commit comments

Comments
 (0)