Dinnerbone / mcstatus

A Python class for checking the status of an enabled Minecraft server

Home Page:http://dinnerbone.com/minecraft/tools/status/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Query times out every time

nondious opened this issue · comments

this is the code, and it just results in it timing out every time.

from mcstatus import MinecraftServer
server = MinecraftServer.lookup("")
query = server.query()
print("The server has the following players online: {0}".format(", ".join(query.players.names)))

I still haven't gotten around to improving this experience as part of #136. Please check firewall ports and make sure UDP is allowed to access the query port that has to also be enabled in server.properties for the Minecraft server.

This exception is not a bug for mcstatus. It is an exception happening in your setup due to misconfiguration of the network/firewall. In Python, it is up to the programmer to handle exceptions with a try-except block and/or fix the underlying issue that was causing the exception in the first place.