Fix mcstatus version compatibility
This commit is contained in:
parent
4679909010
commit
b8d9f708ed
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from mcstatus import MinecraftServer
|
from mcstatus import JavaServer
|
||||||
from os.path import join as pathjoin
|
from os.path import join as pathjoin
|
||||||
from bottle import route, run, static_file, template
|
from bottle import route, run, static_file, template
|
||||||
from random import random, choice
|
from random import random, choice
|
||||||
|
@ -153,8 +153,12 @@ def server_details():
|
||||||
return {"hardware": hardware, "versions": versions, "datapacks": datapacks}
|
return {"hardware": hardware, "versions": versions, "datapacks": datapacks}
|
||||||
|
|
||||||
def server_status():
|
def server_status():
|
||||||
server = MinecraftServer.lookup(CONFIG["mcrcon"]["host"])
|
server = JavaServer.lookup(CONFIG["mcrcon"]["host"])
|
||||||
status = server.status()
|
try:
|
||||||
|
status = server.status()
|
||||||
|
except ConnectionRefusedError:
|
||||||
|
status = "UNKNOWN"
|
||||||
|
|
||||||
return status
|
return status
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue