mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 06:03:33 -04:00
Let's use process.nextTick to avoid multiple gigs of ram usage :D
This commit is contained in:
parent
9705990eb4
commit
4601abb333
@ -108,7 +108,7 @@ Client.prototype.setSocket = function(socket) {
|
||||
incomingBuffer = incomingBuffer.slice(packetLengthField.size + packetLengthField.value);
|
||||
if (self.compressionThreshold == -2)
|
||||
{
|
||||
setImmediate(afterParse, null, parsePacketData(buf, self.state, self.isServer, self.packetsToParse));
|
||||
process.nextTick(afterParse.bind(null, null, parsePacketData(buf, self.state, self.isServer, self.packetsToParse)));
|
||||
} else {
|
||||
parseNewStylePacket(buf, self.state, self.isServer, self.packetsToParse, afterParse);
|
||||
}
|
||||
|
@ -1626,7 +1626,7 @@ function parseNewStylePacket(buffer, state, isServer, packetsToParse, cb) {
|
||||
}
|
||||
});
|
||||
} else {
|
||||
setImmediate(cb, null, parsePacketData(buf, state, isServer, packetsToParse));
|
||||
process.nextTick(cb.bind(null, null, parsePacketData(buf, state, isServer, packetsToParse)));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user