Fixed mcping on windows :)
This commit is contained in:
parent
223bef30a5
commit
a7e931541f
1 changed files with 11 additions and 9 deletions
|
@ -106,7 +106,7 @@ def mcping_legacy(host, port):
|
||||||
|
|
||||||
def get_srv_data(domain):
|
def get_srv_data(domain):
|
||||||
""" takes a domain and finds minecraft SRV records """
|
""" takes a domain and finds minecraft SRV records """
|
||||||
DNS.ParseResolvConf()
|
DNS.DiscoverNameServers()
|
||||||
srv_req = DNS.Request(qtype='srv')
|
srv_req = DNS.Request(qtype='srv')
|
||||||
srv_result = srv_req.req('_minecraft._tcp.{}'.format(domain))
|
srv_result = srv_req.req('_minecraft._tcp.{}'.format(domain))
|
||||||
|
|
||||||
|
@ -137,10 +137,10 @@ def parse_input(inp):
|
||||||
@hook.command("mcp6")
|
@hook.command("mcp6")
|
||||||
def mcping6(inp):
|
def mcping6(inp):
|
||||||
"""mcping6 <server>[:port] - Ping a Minecraft server version 1.6 or smaller to check status."""
|
"""mcping6 <server>[:port] - Ping a Minecraft server version 1.6 or smaller to check status."""
|
||||||
try:
|
#try:
|
||||||
host, port = parse_input(inp)
|
host, port = parse_input(inp)
|
||||||
except Exception as ex:
|
#except Exception as ex:
|
||||||
return ex.args[0]
|
# return ex.args[0]
|
||||||
try:
|
try:
|
||||||
return mcping_legacy(host, port)
|
return mcping_legacy(host, port)
|
||||||
except:
|
except:
|
||||||
|
@ -165,10 +165,12 @@ def mcping7(inp):
|
||||||
@hook.command("mcp")
|
@hook.command("mcp")
|
||||||
def mcping(inp):
|
def mcping(inp):
|
||||||
"""mcping <server>[:port] - Ping a Minecraft server to check status."""
|
"""mcping <server>[:port] - Ping a Minecraft server to check status."""
|
||||||
try:
|
# try:
|
||||||
host, port = parse_input(inp)
|
host, port = parse_input(inp)
|
||||||
except Exception as e:
|
#except Exception as e:
|
||||||
return e.args[0]
|
# return e.args[0]
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return mcping_modern(host, port)
|
return mcping_modern(host, port)
|
||||||
|
|
Reference in a new issue