mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-10-02 23:52:07 -04:00
add keepAlive option in createServer
This commit is contained in:
parent
9eeea84e92
commit
1f681ed810
@ -26,6 +26,8 @@ function createServer(options) {
|
|||||||
// and returning a modified response object.
|
// and returning a modified response object.
|
||||||
var beforePing = options.beforePing || null;
|
var beforePing = options.beforePing || null;
|
||||||
|
|
||||||
|
var enableKeepAlive = options.keepAlive == null ? true : options.keepAlive;
|
||||||
|
|
||||||
var serverKey = ursa.generatePrivateKey(1024);
|
var serverKey = ursa.generatePrivateKey(1024);
|
||||||
|
|
||||||
var server = new Server(options);
|
var server = new Server(options);
|
||||||
@ -194,7 +196,7 @@ function createServer(options) {
|
|||||||
client.write(0x02, {uuid: client.uuid, username: client.username});
|
client.write(0x02, {uuid: client.uuid, username: client.username});
|
||||||
client.state = states.PLAY;
|
client.state = states.PLAY;
|
||||||
loggedIn = true;
|
loggedIn = true;
|
||||||
startKeepAlive();
|
if(enableKeepAlive) startKeepAlive();
|
||||||
|
|
||||||
clearTimeout(loginKickTimer);
|
clearTimeout(loginKickTimer);
|
||||||
loginKickTimer = null;
|
loginKickTimer = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user