mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-28 21:52:17 -04:00
Reintroduce writeRaw
This commit is contained in:
parent
6e6b51ca10
commit
f5dda55f81
@ -179,22 +179,9 @@ Client.prototype.write = function(packetId, params, cb = noop) {
|
|||||||
this.serializer.write({ packetId, params }, cb);
|
this.serializer.write({ packetId, params }, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
// TODO : Write to the correct stream. This is currently broken.
|
|
||||||
Client.prototype.writeRaw = function(buffer) {
|
Client.prototype.writeRaw = function(buffer) {
|
||||||
/*var self = this;
|
if (this.compressor === null)
|
||||||
|
this.framer.write(buffer);
|
||||||
var finishWriting = function(error, buffer) {
|
else
|
||||||
if(error)
|
this.compressor.write(buffer);
|
||||||
throw error; // TODO : How do we handle this error ?
|
|
||||||
var out = self.encryptionEnabled ? new Buffer(self.cipher.update(buffer), 'binary') : buffer;
|
|
||||||
self.socket.write(out);
|
|
||||||
};
|
|
||||||
if(this.compressionThreshold >= 0 && buffer.length >= this.compressionThreshold) {
|
|
||||||
compressPacketBuffer(buffer, finishWriting);
|
|
||||||
} else if(this.compressionThreshold >= -1) {
|
|
||||||
newStylePacket(buffer, 0, finishWriting);
|
|
||||||
} else {
|
|
||||||
oldStylePacket(buffer, finishWriting);
|
|
||||||
}*/
|
|
||||||
throw new Error("Pending refactorisation");
|
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user