add keepAlive option in createServer

This commit is contained in:
Romain Beaumont 2015-08-04 21:45:46 +02:00
parent 9eeea84e92
commit 1f681ed810

View File

@ -26,6 +26,8 @@ function createServer(options) {
// and returning a modified response object.
var beforePing = options.beforePing || null;
var enableKeepAlive = options.keepAlive == null ? true : options.keepAlive;
var serverKey = ursa.generatePrivateKey(1024);
var server = new Server(options);
@ -194,7 +196,7 @@ function createServer(options) {
client.write(0x02, {uuid: client.uuid, username: client.username});
client.state = states.PLAY;
loggedIn = true;
startKeepAlive();
if(enableKeepAlive) startKeepAlive();
clearTimeout(loginKickTimer);
loginKickTimer = null;