mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 14:13:45 -04:00
Fix error handling and global leak in client.js
This commit is contained in:
parent
43b29cf904
commit
42de90c758
@ -83,12 +83,12 @@ Client.prototype.setSocket = function(socket) {
|
||||
var self = this;
|
||||
function afterParse(err, parsed) {
|
||||
if (err || (parsed && parsed.error)) {
|
||||
this.emit('error', err || parsed.error);
|
||||
this.end("ProtocolError");
|
||||
self.emit('error', err || parsed.error);
|
||||
self.end("ProtocolError");
|
||||
return;
|
||||
}
|
||||
if (! parsed) { return; }
|
||||
packet = parsed.results;
|
||||
var packet = parsed.results;
|
||||
incomingBuffer = incomingBuffer.slice(parsed.size);
|
||||
|
||||
var packetName = protocol.packetNames[self.state][self.isServer ? 'toServer' : 'toClient'][packet.id];
|
||||
|
Loading…
x
Reference in New Issue
Block a user