File tree 2 files changed +4
-11
lines changed
2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,7 @@ export interface ServerConnection extends events.EventEmitter {
28
28
msgSalt ?: Buffer
29
29
disconnectReason ?: string
30
30
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 >
36
32
37
33
close : ( ) => void
38
34
Original file line number Diff line number Diff line change @@ -55,17 +55,14 @@ export class JavaScriptServerConnection
55
55
this . options = options
56
56
}
57
57
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 > {
63
59
const compressionThreshold = this . compressionThreshold
64
60
const packet = this . compressionEnabled
65
61
? await makeBaseCompressedPacket ( compressionThreshold , packetId , data )
66
62
: makeBasePacket ( packetId , data )
67
63
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 )
69
66
}
70
67
71
68
onlyOneCloseCall = false
You can’t perform that action at this time.
0 commit comments