Tracker fine tuning

This commit is contained in:
Fabian Dill 2020-06-22 03:53:00 +02:00
parent 43a713b117
commit f73541bafa
3 changed files with 10 additions and 6 deletions

View File

@ -94,7 +94,7 @@ def new_room(seed: int):
def _read_log(path: str): def _read_log(path: str):
if os.path.exists(path): if os.path.exists(path):
with open(path) as log: with open(path, encoding="utf-8-sig") as log:
yield from log yield from log
else: else:
yield f"Logfile {path} does not exist. " \ yield f"Logfile {path} does not exist. " \
@ -227,7 +227,9 @@ def get_tracker(room: int):
for location in locations_checked: for location in locations_checked:
item, recipient = locations[location, player] item, recipient = locations[location, player]
inventory[team][recipient][links.get(item, item)] += 1 inventory[team][recipient][links.get(item, item)] += 1
for (team, player), game_state in room.multisave.get("client_game_state", []):
if game_state:
inventory[team][player][106] = 1 # Triforce
from MultiServer import get_item_name_from_id from MultiServer import get_item_name_from_id
from Items import lookup_id_to_name from Items import lookup_id_to_name
player_names = {} player_names = {}

View File

@ -76,7 +76,8 @@ def run_server_process(room_id, ponyconfig: dict):
logging.basicConfig(format='[%(asctime)s] %(message)s', logging.basicConfig(format='[%(asctime)s] %(message)s',
level=logging.INFO, level=logging.INFO,
filename=os.path.join(LOGS_FOLDER, f"{room_id}.txt")) handlers=[
logging.FileHandler(os.path.join(LOGS_FOLDER, f"{room_id}.txt"), 'a', 'utf-8-sig')])
ctx = WebHostContext() ctx = WebHostContext()
ctx.load(room_id) ctx.load(room_id)
ctx.auto_shutdown = 24 * 60 * 60 # 24 hours ctx.auto_shutdown = 24 * 60 * 60 # 24 hours

View File

@ -12,8 +12,9 @@
<th>Name</th> <th>Name</th>
{% for name in tracking_names %} {% for name in tracking_names %}
{% if name in icons %} {% if name in icons %}
<th><img height="32" width="32" style="object-fit: contain" src="{{ icons[name] }}" <th style="text-align: center"><img height="32" width="32" style="object-fit: contain"
alt="{{ name }}"></th> src="{{ icons[name] }}"
alt="{{ name }}"></th>
{% else %} {% else %}
<th>{{ name }}</th> <th>{{ name }}</th>
{% endif %} {% endif %}
@ -28,7 +29,7 @@
{% for id in tracking_ids %} {% for id in tracking_ids %}
{% if items[id] %} {% if items[id] %}
<td class="table-success"> <td style="text-align: center" class="table-success">
{% if id in multi_items %}{{ items[id] }}{% else %}✔️{% endif %}</td> {% if id in multi_items %}{{ items[id] }}{% else %}✔️{% endif %}</td>
{% else %} {% else %}
<td></td> <td></td>