mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-30 22:51:23 -04:00
Replaced throw for "Set encryption twice!" error with emit.
This commit is contained in:
parent
01f8342f9e
commit
c4fbd81674
@ -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…
x
Reference in New Issue
Block a user