revenge of the player number offset

This commit is contained in:
Fabian Dill 2020-06-21 17:04:25 +02:00
parent 5b72fd4e36
commit 26eb44ef15
3 changed files with 5 additions and 6 deletions

View File

@ -451,7 +451,7 @@ def register_location_checks(ctx: Context, team: int, slot: int, locations):
for client in ctx.endpoints:
if client.team == team and client.slot == slot:
asyncio.create_task(ctx.send_msgs(client, [["HintPointUpdate", (get_client_points(ctx, client),)]]))
ctx.save()
ctx.save()
def notify_team(ctx: Context, team: int, text: str):

View File

@ -161,7 +161,7 @@ def get_tracker(room: int):
"Titans Mitts": "Progressive Glove"
}
links = {get_id(key): get_id(value) for key, value in links.items()}
inventory = {teamnumber: {playernumber: collections.Counter() for playernumber in range(len(team))}
inventory = {teamnumber: {playernumber: collections.Counter() for playernumber in range(1, len(team) + 1)}
for teamnumber, team in enumerate(multidata["names"])}
for (team, player), locations_checked in room.multisave.get("location_checks", {}):
for location in locations_checked:

View File

@ -95,10 +95,9 @@ def run_server_process(room_id, ponyconfig: dict):
socketname = wssocket.getsockname()
if wssocket.family == socket.AF_INET6:
logging.info(f'Hosting game at [{get_public_ipv6()}]:{socketname[1]}')
if ctx.port != socketname[1]: # different port
with db_session:
room = Room.get(id=ctx.room_id)
room.last_port = socketname[1]
with db_session:
room = Room.get(id=ctx.room_id)
room.last_port = socketname[1]
elif wssocket.family == socket.AF_INET:
logging.info(f'Hosting game at {get_public_ipv4()}:{socketname[1]}')
ctx.auto_shutdown = 6 * 60