mirror of
https://github.com/PrismarineJS/node-minecraft-protocol.git
synced 2024-11-14 19:04:59 -05:00
Replaced throw for "Set encryption twice!" error with emit.
This commit is contained in:
parent
01f8342f9e
commit
c4fbd81674
1 changed files with 1 additions and 1 deletions
|
@ -194,7 +194,7 @@ class Client extends EventEmitter
|
|||
|
||||
setEncryption(sharedSecret) {
|
||||
if (this.cipher != null)
|
||||
throw new Error("Set encryption twice !");
|
||||
this.emit('error','Set encryption twice!');
|
||||
this.cipher = crypto.createCipheriv('aes-128-cfb8', sharedSecret, sharedSecret);
|
||||
this.cipher.on('error', (err) => this.emit('error', err));
|
||||
this.framer.unpipe(this.socket);
|
||||
|
|
Loading…
Reference in a new issue