mirror of
https://github.com/unmojang/node-minecraft-protocol.git
synced 2025-09-30 14:41:27 -04:00
Fix missing tcp_dns host option
This commit is contained in:
parent
cf5f8c1c4c
commit
2f60088fdf
@ -6,7 +6,7 @@ module.exports = function(client, options) {
|
|||||||
options.host = options.host || 'localhost';
|
options.host = options.host || 'localhost';
|
||||||
|
|
||||||
options.connect = (client) => {
|
options.connect = (client) => {
|
||||||
if(options.port == 25565 && net.isIP(host) === 0) {
|
if(options.port == 25565 && net.isIP(options.host) === 0) {
|
||||||
dns.resolveSrv("_minecraft._tcp." + options.host, function(err, addresses) {
|
dns.resolveSrv("_minecraft._tcp." + options.host, function(err, addresses) {
|
||||||
if(addresses && addresses.length > 0) {
|
if(addresses && addresses.length > 0) {
|
||||||
client.setSocket(net.connect(addresses[0].port, addresses[0].name));
|
client.setSocket(net.connect(addresses[0].port, addresses[0].name));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user