mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-10-02 23:52:07 -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) {
|
setEncryption(sharedSecret) {
|
||||||
if (this.cipher != null)
|
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 = crypto.createCipheriv('aes-128-cfb8', sharedSecret, sharedSecret);
|
||||||
this.cipher.on('error', (err) => this.emit('error', err));
|
this.cipher.on('error', (err) => this.emit('error', err));
|
||||||
this.framer.unpipe(this.socket);
|
this.framer.unpipe(this.socket);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user