mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-27 13:14:41 -04:00
Merge pull request #371 from rom1504/dont_crash_after_an_error
don't stop after an error
This commit is contained in:
commit
ba2d791d75
@ -45,7 +45,7 @@
|
||||
"buffer-equal": "1.0.0",
|
||||
"minecraft-data": "^1.0.3",
|
||||
"prismarine-nbt": "0.2.1",
|
||||
"protodef": "^1.0.0",
|
||||
"protodef": "^1.0.1",
|
||||
"readable-stream": "^2.0.5",
|
||||
"ursa-purejs": "0.0.3",
|
||||
"uuid-1345": "^0.99.6",
|
||||
|
@ -59,6 +59,10 @@ class Client extends EventEmitter
|
||||
const serializerDirection = !this.isServer ? 'toServer' : 'toClient';
|
||||
e.field = [this.protocolState, serializerDirection].concat(parts).join(".");
|
||||
e.message = `Serialization error for ${e.field} : ${e.message}`;
|
||||
if(!this.compressor)
|
||||
this.serializer.pipe(this.framer);
|
||||
else
|
||||
this.serializer.pipe(this.compressor);
|
||||
this.emit('error',e);
|
||||
});
|
||||
|
||||
@ -69,6 +73,10 @@ class Client extends EventEmitter
|
||||
const deserializerDirection = this.isServer ? 'toServer' : 'toClient';
|
||||
e.field = [this.protocolState, deserializerDirection].concat(parts).join(".");
|
||||
e.message = `Deserialization error for ${e.field} : ${e.message}`;
|
||||
if(!this.compressor)
|
||||
this.splitter.pipe(this.deserializer);
|
||||
else
|
||||
this.decompressor.pipe(this.deserializer);
|
||||
this.emit('error',e);
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user