From d6126933ed92d232b60f36ac602069c65f17d0f6 Mon Sep 17 00:00:00 2001 From: Patric Stout Date: Sat, 17 Jul 2021 11:34:15 +0200 Subject: [PATCH] Add: show in the server list and server detail if/what GameScript a server uses (#33) --- webclient/pages/servers.py | 10 +++++++++- webclient/static/img/server-gamescript.png | Bin 0 -> 4482 bytes webclient/templates/server_entry.html | 10 ++++++++++ webclient/templates/server_list.html | 6 ++++++ 4 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 webclient/static/img/server-gamescript.png diff --git a/webclient/pages/servers.py b/webclient/pages/servers.py index 8b55d9e..ad42d11 100644 --- a/webclient/pages/servers.py +++ b/webclient/pages/servers.py @@ -10,6 +10,7 @@ template, ) +GAMESCRIPT_VERSION_NONE = 4294967295 # (int32)-1 as uint32 MAPSETS = { 0: "Temperate", 1: "Arctic", @@ -165,6 +166,7 @@ def _list_servers(filter): servers_ipv6=servers_ipv6, filter=filter, mapsets=MAPSETS, + GAMESCRIPT_VERSION_NONE=GAMESCRIPT_VERSION_NONE, ) @@ -199,4 +201,10 @@ def server_entry(server_id): expire = datetime.utcfromtimestamp(_server_entry_cache[server_id]["expire"]).strftime("%Y-%m-%d %H:%M:%S") + " UTC" - return template("server_entry.html", server=server, expire=expire, mapsets=MAPSETS) + return template( + "server_entry.html", + server=server, + expire=expire, + mapsets=MAPSETS, + GAMESCRIPT_VERSION_NONE=GAMESCRIPT_VERSION_NONE, + ) diff --git a/webclient/static/img/server-gamescript.png b/webclient/static/img/server-gamescript.png new file mode 100644 index 0000000000000000000000000000000000000000..501948b651a14541d876f69d814f14a706ceaf7b GIT binary patch literal 4482 zcmV-|5q<87P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+U=TIk|VnfMgO@9FM$&{EQe!+ci`pwfXu2^P5oYn z{pD~eq*P~e1THQvs5a|g|J>#u{Ke#>iIPjIDOvtvjny~46np>b`E)j(&-=HYtNVE0 zyg%^V3S7heXKqjX#(nwK;cX7rKi)UxdE(16(A&(y4PP(iB<+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jNiyhqfDvBY_vXBJ z*O`f0cfC_N7LDpgGF0UISZWgD#s}|^GvwxKv0@NCmHb$K1;Q$u4{?z-srsHG$^%ju za9KnWLV2Vv_=6bk{Tv@m{jFd6uY%e9wvzVYIl?$0mk&$`H}Zr2cI@=9rAy2!#+ya1 zA}7c-rn}VcueQeq1RZHkTk5IATQl-XO(VhteP|NQR?I1TqXs8>wyQqcdJ?pDIY%qx z3}|>ZcTb9}{M6q3X@{TMv!VnyLl&QxpR2~zIQ0f}c1G^^K-OtVQS|T<1=j99LAFmA z55*JFO#$(m9=$s4O*{JkE<)8a8lnMs&2#$T5fxJ_!(>a*lhNp6zl-@~bd3g8OSWsMul zN7f12!_-U-h0hnQXnu2O`A66P5A>f6r1fVt{{|9kogfWfENlP(0flKpLr_UWLm+T+ zZ)Rz1WdHzpoPCi!NW(xJ#a~mUDisksh&W`Z4q`!6#8IkP1Pi6D(5i#UrC-pbAxUv@ z6kH1qek@iUT%2`va1{i>4-hvuCq)-2@qbC7MT`f>{djlparX`o>Sd;y9TR}6Sw=Dz z6*JjYG4P52`q7O6j7iMY|FJxR+ zIB#)Q%T?CACx2lur>&&8PIDMBEFq2rM98S3gfc8dXw^tDk)-{ohkwZNC&(p}s{}@l z1yrCya{S` z9|3*az{Pb-llOqj9boWDmkh~~{4|Ap9(X^aZ^{A#w?NOD+go!Vrw>4yx>~*g4i16Q z0%fmzyt}Ktw|~zx`}+ZRg>tD)EV!Wn000JJOGiWi{{a60|De66lK=n!32;bRa{vGf z6951U69E94oEQKA00(qQO+^Rg2N4MxBh5p6T>t<8tVu*cR4C75{Qv(y19507*qoM6N<$f))yVPyhe` literal 0 HcmV?d00001 diff --git a/webclient/templates/server_entry.html b/webclient/templates/server_entry.html index a498da7..de4f30b 100644 --- a/webclient/templates/server_entry.html +++ b/webclient/templates/server_entry.html @@ -95,6 +95,16 @@

{% block title %}{{ server["info"]["name"] }} {% endblock %}

{% endif %} + + Gamescript: + + {% if server["info"]["gamescript_version"] and server["info"]["gamescript_version"] != GAMESCRIPT_VERSION_NONE %} + {{ server["info"]["gamescript_name"] }} (v{{ server["info"]["gamescript_version"] }}) + {% else %} + None + {% endif %} + + NewGRFs in use: diff --git a/webclient/templates/server_list.html b/webclient/templates/server_list.html index f638388..ad1eef0 100644 --- a/webclient/templates/server_list.html +++ b/webclient/templates/server_list.html @@ -23,6 +23,7 @@

{% block title %} Version + @@ -65,6 +66,11 @@

{% block title %} GRF {% endif %} + + {% if server['info']['gamescript_version'] and server["info"]["gamescript_version"] != GAMESCRIPT_VERSION_NONE %} + GS + {% endif %} + {% endfor %}