Merge branch 'main' into breaking_changes

# Conflicts:
#	BaseClasses.py
#	Fill.py
#	MultiClient.py
#	MultiServer.py
#	Utils.py
#	test/dungeons/TestDungeon.py
#	test/inverted/TestInverted.py
#	test/inverted_minor_glitches/TestInvertedMinor.py
#	test/inverted_owg/TestInvertedOWG.py
#	test/minor_glitches/TestMinor.py
#	test/owg/TestVanillaOWG.py
#	test/vanilla/TestVanilla.py
#	worlds/alttp/ItemPool.py
#	worlds/alttp/Main.py
#	worlds/alttp/Rom.py
This commit is contained in:
Fabian Dill
2021-01-30 23:29:32 +01:00
33 changed files with 1391 additions and 671 deletions

View File

@@ -32,7 +32,7 @@ from Utils import get_item_name_from_id, get_location_name_from_address, \
from NetUtils import Node, Endpoint, CLIENT_GOAL
colorama.init()
console_names = frozenset(set(Items.item_table) | set(Regions.location_table) | set(Items.item_name_groups) | set(Regions.key_drop_data))
console_names = frozenset(set(Items.item_table) | set(Items.item_name_groups) | set(Regions.lookup_name_to_id))
class Client(Endpoint):
@@ -416,9 +416,10 @@ async def countdown(ctx: Context, timer):
ctx.notify_all(f'[Server]: GO')
ctx.countdown_timer = 0
async def missing(ctx: Context, client: Client, locations: list):
async def missing(ctx: Context, client: Client, locations: list, checked_locations: list):
await ctx.send_msgs(client, [['Missing', {
'locations': dumps(locations)
'locations': dumps(locations),
'checked_locations': json.dumps(checked_locations)
}]])
@@ -827,6 +828,7 @@ class ClientMessageProcessor(CommonCommandProcessor):
"""List all missing location checks from the server's perspective"""
locations = get_missing_checks(self.ctx, self.client)
checked_locations = get_checked_checks(self.ctx, self.client)
if len(locations) > 0:
texts = [f'Missing: {location}\n' for location in locations]
@@ -952,6 +954,13 @@ class ClientMessageProcessor(CommonCommandProcessor):
return False
def get_checked_checks(ctx: Context, client: Client) -> list:
return [Regions.lookup_id_to_name.get(location_id, f'Unknown Location ID: {location_id}') for
location_id, slot in ctx.locations if
slot == client.slot and
location_id in ctx.location_checks[client.team, client.slot]]
def get_missing_checks(ctx: Context, client: Client) -> list:
return [Regions.lookup_id_to_name.get(location_id, f'Unknown Location ID: {location_id}') for
location_id, slot in ctx.locations if
@@ -1024,7 +1033,8 @@ async def process_client_cmd(ctx: Context, client: Client, cmd: str, args: typin
reply = [['Connected', {"team": client.team, "slot": client.slot,
"playernames": [(p, ctx.get_aliased_name(t, p)) for (t, p), n in
ctx.player_names.items() if t == client.team],
"missing_checks": get_missing_checks(ctx, client)}]]
"missing_checks": get_missing_checks(ctx, client),
"items_checked": get_checked_checks(ctx, client)}]]
items = get_received_items(ctx, client.team, client.slot)
if items:
reply.append(['ReceivedItems', {"index": 0, "items": tuplize_received_items(items)}])