From 7331619d6dbb62f6fe3784badcaccc3b0107baa4 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 22 Jun 2019 16:54:40 +0200 Subject: [PATCH] Royalprint: Mcstatus (#72) --- requirements.txt | 1 + royalnet/royalgamesweb.py | 2 +- royalnet/web/royalprints/__init__.py | 3 +- royalnet/web/royalprints/mcstatus/__init__.py | 29 ++++++++++ .../mcstatus/templates/mcstatus.html | 54 ++++++++++++++++++ royalnet/web/static/ryg.css | 44 +++++++++++++++ royalnet/web/static/ryg.css.map | 2 +- royalnet/web/static/ryg.less | 56 +++++++++++++++++++ 8 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 royalnet/web/royalprints/mcstatus/__init__.py create mode 100644 royalnet/web/royalprints/mcstatus/templates/mcstatus.html diff --git a/requirements.txt b/requirements.txt index 51fbdaf4..f64e3932 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,3 +15,4 @@ PyNaCl>=1.3.0 werkzeug>=0.15.4 flask>=1.0.3 markdown2>=2.3.8 +mcstatus>=2.2.1 diff --git a/royalnet/royalgamesweb.py b/royalnet/royalgamesweb.py index 7e912ff8..2339b329 100644 --- a/royalnet/royalgamesweb.py +++ b/royalnet/royalgamesweb.py @@ -8,7 +8,7 @@ class TestConfig: TG_AK = os.environ["TG_AK"] -app = create_app(TestConfig, [rp_home, rp_wikiview, rp_tglogin, rp_docs, rp_wikiedit]) +app = create_app(TestConfig, [rp_home, rp_wikiview, rp_tglogin, rp_docs, rp_wikiedit, rp_mcstatus]) if __name__ == "__main__": diff --git a/royalnet/web/royalprints/__init__.py b/royalnet/web/royalprints/__init__.py index 5a4c8d0d..2b65ff79 100644 --- a/royalnet/web/royalprints/__init__.py +++ b/royalnet/web/royalprints/__init__.py @@ -5,5 +5,6 @@ from .wikiview import rp as rp_wikiview from .tglogin import rp as rp_tglogin from .docs import rp as rp_docs from .wikiedit import rp as rp_wikiedit +from .mcstatus import rp as rp_mcstatus -__all__ = ["rp_home", "rp_wikiview", "rp_tglogin", "rp_docs", "rp_wikiedit"] +__all__ = ["rp_home", "rp_wikiview", "rp_tglogin", "rp_docs", "rp_wikiedit", "rp_mcstatus"] diff --git a/royalnet/web/royalprints/mcstatus/__init__.py b/royalnet/web/royalprints/mcstatus/__init__.py new file mode 100644 index 00000000..50c723a5 --- /dev/null +++ b/royalnet/web/royalprints/mcstatus/__init__.py @@ -0,0 +1,29 @@ +"""Minecraft server status :py:class:`royalnet.web.Royalprint`.""" +import os +import flask as f +import socket +from ... import Royalprint +from mcstatus import MinecraftServer + + +tmpl_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates') +rp = Royalprint("mcstatus", __name__, url_prefix="/mcstatus", template_folder=tmpl_dir) + + +@rp.route("/") +def mcstatus_index(server_str: str): + try: + if ":" not in server_str: + server_str += ":25565" + server = MinecraftServer.lookup(server_str) + status = server.status() + try: + query = server.query() + except (socket.timeout, ConnectionRefusedError, OSError): + query = None + except socket.gaierror: + return "No such address", 404 + except (socket.timeout, ConnectionRefusedError, OSError): + status = None + query = None + return f.render_template("mcstatus.html", server_str=server_str, status=status, query=query) diff --git a/royalnet/web/royalprints/mcstatus/templates/mcstatus.html b/royalnet/web/royalprints/mcstatus/templates/mcstatus.html new file mode 100644 index 00000000..147dba9f --- /dev/null +++ b/royalnet/web/royalprints/mcstatus/templates/mcstatus.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% block title %} + {{ server_str }} - RYG MCstatus +{% endblock %} + +{% block content %} +
+
+ Minecraft Status +
+
+
+ {% if query %} + {% if status.favicon %} +
Server icon
+ {% else %} +
+ {% endif %} +
{{ server_str }}
+
{{ query.motd }}
+
{{ query.players.online }}/{{ query.players.max }}
+
{{ query.software.brand }} {{ query.software.version }} ({{ status.version.protocol }})
+ {% elif status %} + {% if status.favicon %} +
Server icon
+ {% else %} +
+ {% endif %} +
{{ server_str }}
+
{{ status.description }}
+
{{ status.players.online }}/{{ status.players.max }}
+
{{ status.version.name }} ({{ status.version.protocol }})
+ {% else %} +
+
{{ server_str }}
+
-
+
0/0
+
Offline (-)
+ {% endif %} +
+ {% if query %} +
+

Giocatori connessi:

+
    + {% for player in query.players.names %} +
  • {{ player }}
  • + {% endfor %} +
+
+ {% endif %} +
+
+{% endblock %} \ No newline at end of file diff --git a/royalnet/web/static/ryg.css b/royalnet/web/static/ryg.css index 7b50d657..d239a892 100644 --- a/royalnet/web/static/ryg.css +++ b/royalnet/web/static/ryg.css @@ -513,4 +513,48 @@ button[disabled=""] { .wikiedit-form .CodeMirror .cm-header { color: #ffffff !important; } +.mcstatus-grid { + display: grid; + grid-template-columns: 64px auto auto; + grid-column-gap: 12px; + align-items: center; +} +.mcstatus-grid .mcstatus-icon { + grid-column: 1; + grid-row-start: 1; + grid-row-end: 3; + width: 64px; + height: 64px; +} +.mcstatus-grid .mcstatus-icon .mcstatus-icon-img { + width: 64px; + height: 64px; +} +.mcstatus-grid .mcstatus-address { + font-weight: bold; + grid-column: 2; + justify-self: start; + grid-row: 1; +} +.mcstatus-grid .mcstatus-address .server-up { + color: #7dff7d; +} +.mcstatus-grid .mcstatus-address .server-down { + color: #ff7d7d; +} +.mcstatus-grid .mcstatus-description { + grid-column: 2; + justify-self: start; + grid-row: 2; +} +.mcstatus-grid .mcstatus-players { + grid-column: 3; + justify-self: end; + grid-row: 1; +} +.mcstatus-grid .mcstatus-version { + grid-column: 3; + justify-self: end; + grid-row: 2; +} /*# sourceMappingURL=ryg.css.map */ \ No newline at end of file diff --git a/royalnet/web/static/ryg.css.map b/royalnet/web/static/ryg.css.map index a5e2e653..41f70a7f 100644 --- a/royalnet/web/static/ryg.css.map +++ b/royalnet/web/static/ryg.css.map @@ -1 +1 @@ -{"version":3,"sources":["ryg.less"],"names":[],"mappings":"AAiBA;EACI,aALS,SAAS,4BAKlB;EACA,yBAAA;EACA,cAAA;EACA,sBAAA;;AAGJ;EACI,cAAA;EACA,qBAAA;;AAEA,CAAC;EACG,cAAA;;AAGJ,CAAC;EACG,YAAA;;A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K,OAII;EACG,0CAAA;EACA,cAAA;;AA9CpB,cAoDI;EACI,aAAa,qBAAb;EACA,6BAAA;EACA,cAAA;EACA,aAAA;EACA,gBAAA;EACA,+CAAA;EACA,gDAAA;EACA,gBAAA;;AA5DR,cAoDI,YAUI;EACI,cAAA;;AA/DZ,cAoDI,YAcI;EACI,cAAA;;AAnEZ,cAoDI,YAkBI;EACI,cAAA;;AAvEZ,cAoDI,YAsBI;EACI,cAAA;;AA3EZ,cAoDI,YA0BI;EACI,cAAA;;AA/EZ,cAoDI,YA8BI;EACI,cAAA;;AAnFZ,cAoDI,YAkCI;EACI,cAAA;;AAvFZ,cAoDI,YAsCI;EACI,cAAA;;AAMZ;EACI,aAAA;EAEA,qCAAA;EACA,qBAAA;EAEA,mBAAA;;AANJ,cAQI;EACI,cAAA;EACA,iBAAA;EACA,eAAA;EACA,WAAA;EACA,YAAA;;AAbR,cAQI,eAOI;EACI,WAAA;EACA,YAAA;;AAjBZ,cAqBI;EACI,iBAAA;EAEA,cAAA;EACA,mBAAA;EACA,WAAA;;AA1BR,cAqBI,kBAOI;EACI,cAAA;;AA7BZ,cAqBI,kBAWI;EACI,cAAA;;AAjCZ,cAqCI;EACI,cAAA;EACA,mBAAA;EACA,WAAA;;AAxCR,cA2CI;EACI,cAAA;EACA,iBAAA;EACA,WAAA;;AA9CR,cAiDI;EACI,cAAA;EACA,iBAAA;EACA,WAAA","file":"ryg.css"} \ No newline at end of file diff --git a/royalnet/web/static/ryg.less b/royalnet/web/static/ryg.less index a46e3a70..661139c6 100644 --- a/royalnet/web/static/ryg.less +++ b/royalnet/web/static/ryg.less @@ -621,3 +621,59 @@ nav { } } + +.mcstatus-grid { + display: grid; + + grid-template-columns: 64px auto auto; + grid-column-gap: 12px; + + align-items: center; + + .mcstatus-icon { + grid-column: 1; + grid-row-start: 1; + grid-row-end: 3; + width: 64px; + height: 64px; + + .mcstatus-icon-img { + width: 64px; + height: 64px; + } + } + + .mcstatus-address { + font-weight: bold; + + grid-column: 2; + justify-self: start; + grid-row: 1; + + .server-up { + color: @pastel-lime; + } + + .server-down { + color: @pastel-red; + } + } + + .mcstatus-description { + grid-column: 2; + justify-self: start; + grid-row: 2; + } + + .mcstatus-players { + grid-column: 3; + justify-self: end; + grid-row: 1; + } + + .mcstatus-version { + grid-column: 3; + justify-self: end; + grid-row: 2; + } +}