Tracker fine tuning
This commit is contained in:
parent
43a713b117
commit
f73541bafa
|
@ -94,7 +94,7 @@ def new_room(seed: int):
|
|||
|
||||
def _read_log(path: str):
|
||||
if os.path.exists(path):
|
||||
with open(path) as log:
|
||||
with open(path, encoding="utf-8-sig") as log:
|
||||
yield from log
|
||||
else:
|
||||
yield f"Logfile {path} does not exist. " \
|
||||
|
@ -227,7 +227,9 @@ def get_tracker(room: int):
|
|||
for location in locations_checked:
|
||||
item, recipient = locations[location, player]
|
||||
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 Items import lookup_id_to_name
|
||||
player_names = {}
|
||||
|
|
|
@ -76,7 +76,8 @@ def run_server_process(room_id, ponyconfig: dict):
|
|||
|
||||
logging.basicConfig(format='[%(asctime)s] %(message)s',
|
||||
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.load(room_id)
|
||||
ctx.auto_shutdown = 24 * 60 * 60 # 24 hours
|
||||
|
|
|
@ -12,8 +12,9 @@
|
|||
<th>Name</th>
|
||||
{% for name in tracking_names %}
|
||||
{% if name in icons %}
|
||||
<th><img height="32" width="32" style="object-fit: contain" src="{{ icons[name] }}"
|
||||
alt="{{ name }}"></th>
|
||||
<th style="text-align: center"><img height="32" width="32" style="object-fit: contain"
|
||||
src="{{ icons[name] }}"
|
||||
alt="{{ name }}"></th>
|
||||
{% else %}
|
||||
<th>{{ name }}</th>
|
||||
{% endif %}
|
||||
|
@ -28,7 +29,7 @@
|
|||
{% for id in tracking_ids %}
|
||||
|
||||
{% 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>
|
||||
{% else %}
|
||||
<td></td>
|
||||
|
|
Loading…
Reference in New Issue