mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-27 13:14:41 -04:00
Fix autoVersion
Simple fix for autoVersion, ends the execution of the `ping` callback if an error is found. Prevents more errors from getting logged to the console if the server is not reachable.
This commit is contained in:
parent
81b94f95ca
commit
5b8536c250
@ -10,7 +10,7 @@ module.exports = function (client, options) {
|
||||
debug('pinging', options.host)
|
||||
// TODO: use 0xfe ping instead for better compatibility/performance? https://github.com/deathcap/node-minecraft-ping
|
||||
ping(options, function (err, response) {
|
||||
if (err) { client.emit('error', err) }
|
||||
if (err) { return client.emit('error', err) }
|
||||
debug('ping response', response)
|
||||
// TODO: could also use ping pre-connect to save description, type, max players, etc.
|
||||
const motd = response.description
|
||||
|
Loading…
x
Reference in New Issue
Block a user