mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-29 06:03:33 -04:00
Move wait_connect to client object
This commit is contained in:
parent
a8bc7d1343
commit
a3a2d3d6f1
@ -7,7 +7,7 @@ var assert = require('assert');
|
||||
var minecraft_data = require('minecraft-data');
|
||||
|
||||
module.exports = function(client, options) {
|
||||
options.wait_connect = true; // don't let src/client/setProtocol proceed on socket 'connect' until 'connect_allowed'
|
||||
client.wait_connect = true; // don't let src/client/setProtocol proceed on socket 'connect' until 'connect_allowed'
|
||||
debug('pinging',options.host);
|
||||
var pingOptions = {host: options.host, port: options.port};
|
||||
// TODO: use 0xfe ping instead for better compatibility/performance? https://github.com/deathcap/node-minecraft-ping
|
||||
|
@ -5,7 +5,7 @@ module.exports = function(client, options) {
|
||||
client.on('connect', onConnect);
|
||||
|
||||
function onConnect() {
|
||||
if (options.wait_connect) {
|
||||
if (client.wait_connect) {
|
||||
client.on('connect_allowed', next);
|
||||
} else {
|
||||
next();
|
||||
|
Loading…
x
Reference in New Issue
Block a user