diff --git a/MultiServer.py b/MultiServer.py index 3ebe07b7..a35450ff 100644 --- a/MultiServer.py +++ b/MultiServer.py @@ -621,7 +621,7 @@ class CommandProcessor(metaclass=CommandMeta): license = getattr(CommandProcessor, "license", None) if not license: with open(Utils.local_path("LICENSE")) as f: - CommandProcessor.license = license = f.read() + CommandProcessor.license = f.read() self.output(CommandProcessor.license) def default(self, raw: str): diff --git a/Utils.py b/Utils.py index 8bb03c18..9dfd72e6 100644 --- a/Utils.py +++ b/Utils.py @@ -36,9 +36,11 @@ def int32_as_bytes(value): def pc_to_snes(value): return ((value<<1) & 0x7F0000)|(value & 0x7FFF)|0x8000 + def snes_to_pc(value): return ((value & 0x7F0000)>>1)|(value & 0x7FFF) + def parse_player_names(names, players, teams): names = tuple(n for n in (n.strip() for n in names.split(",")) if n) ret = [] @@ -52,9 +54,11 @@ def parse_player_names(names, players, teams): names = names[players:] return ret -def is_bundled(): + +def is_bundled() -> bool: return getattr(sys, 'frozen', False) + def local_path(path): if local_path.cached_path: return os.path.join(local_path.cached_path, path) diff --git a/WebHostLib/static/static.css b/WebHostLib/static/tracker.css similarity index 100% rename from WebHostLib/static/static.css rename to WebHostLib/static/tracker.css diff --git a/WebHostLib/templates/host_room.html b/WebHostLib/templates/host_room.html index 8e7c0236..aadab905 100644 --- a/WebHostLib/templates/host_room.html +++ b/WebHostLib/templates/host_room.html @@ -42,7 +42,7 @@ } window.setTimeout(request_new, 1000); - window.setInterval(request_new, 3000); + window.setInterval(request_new, 10000); {% endblock %} diff --git a/WebHostLib/templates/tablepage.html b/WebHostLib/templates/tablepage.html new file mode 100644 index 00000000..3d3b55db --- /dev/null +++ b/WebHostLib/templates/tablepage.html @@ -0,0 +1,6 @@ +{% extends "layout.html" %} +{% block head %} + + + +{% endblock %} \ No newline at end of file diff --git a/WebHostLib/templates/tracker.html b/WebHostLib/templates/tracker.html index 4dd949a8..22c1b175 100644 --- a/WebHostLib/templates/tracker.html +++ b/WebHostLib/templates/tracker.html @@ -1,11 +1,8 @@ -{% extends 'layout.html' %} +{% extends 'tablepage.html' %} {% block head %} + {{ super() }}
Your Rooms:
-Seed | +Room | +Players | +Created | +Last Activity | + +
---|---|---|---|---|
{{ room.seed.id }} | +{{ room.id }} | +{{ room.seed.multidata.names[0]|length }} Total: + {{ room.seed.multidata.names[0]|join(", ")|truncate(256, False, " ...") }} | +{{ room.creation_time.strftime("%Y-%m-%d %H:%M") }} | +{{ room.last_activity.strftime("%Y-%m-%d %H:%M") }} | +
No rooms owned by you were found. Upload a file to get started.
{% endif %} diff --git a/WebHostLib/tracker.py b/WebHostLib/tracker.py index 8fcafdad..cb0f2936 100644 --- a/WebHostLib/tracker.py +++ b/WebHostLib/tracker.py @@ -242,7 +242,7 @@ def get_static_room_data(room: Room): use_door_tracker = False if "tags" in multidata: - use_door_tracker = "DR" in multidata.tags + use_door_tracker = "DR" in multidata["tags"] result = locations, names, use_door_tracker _multidata_cache[room.seed.id] = result return result