Add noPacketFramer option to createClientStream()

This commit is contained in:
deathcap 2016-01-18 01:41:08 -08:00
parent 6125fb7303
commit 73d69e66d7
2 changed files with 8 additions and 0 deletions

View File

@ -51,6 +51,7 @@
"protodef": "0.2.5",
"readable-stream": "^1.1.0",
"superagent": "~0.10.0",
"through": "^2.3.8",
"ursa-purejs": "0.0.3",
"uuid": "^2.0.1",
"uuid-1345": "^0.99.6",

View File

@ -1,6 +1,7 @@
var Client = require('./client');
var assert = require('assert');
var states = require("./states");
var EmptyTransformStream = require('through')();
module.exports=createClientStream;
@ -19,6 +20,12 @@ function createClientStream(options) {
var client = new Client(false,version.majorVersion);
// Options to opt-out of MC protocol packet framing (useful since WS is alreay framed)
// TODO: refactor
if (options.noPacketFramer) {
client.framer = EmptyTransformStream;
}
if(keepAlive) client.on('keep_alive', onKeepAlive);
client.once('success', onLogin);
client.once("compress", onCompressionRequest);