Multidata: allow SoE/SM/LttP to connect via player name for use in Tracker/Text clients

This commit is contained in:
Fabian Dill 2022-02-09 21:06:34 +01:00
parent 3d17f0d588
commit 14448ad97e
4 changed files with 3 additions and 8 deletions

View File

@ -1323,7 +1323,6 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict):
errors.add('InvalidPassword')
if args['name'] not in ctx.connect_names:
logging.info((args["name"], ctx.connect_names))
errors.add('InvalidSlot')
else:
team, slot = ctx.connect_names[args['name']]

View File

@ -319,9 +319,7 @@ class ALTTPWorld(World):
# we skip in case of error, so that the original error in the output thread is the one that gets raised
if rom_name:
new_name = base64.b64encode(bytes(self.rom_name)).decode()
payload = multidata["connect_names"][self.world.player_name[self.player]]
multidata["connect_names"][new_name] = payload
del (multidata["connect_names"][self.world.player_name[self.player]])
multidata["connect_names"][new_name] = multidata["connect_names"][self.world.player_name[self.player]]
def get_required_client_version(self) -> tuple:
return max((0, 2, 4), super(ALTTPWorld, self).get_required_client_version())

View File

@ -450,9 +450,7 @@ class SMWorld(World):
# we skip in case of error, so that the original error in the output thread is the one that gets raised
if rom_name:
new_name = base64.b64encode(bytes(self.rom_name)).decode()
payload = multidata["connect_names"][self.world.player_name[self.player]]
multidata["connect_names"][new_name] = payload
del (multidata["connect_names"][self.world.player_name[self.player]])
multidata["connect_names"][new_name] = multidata["connect_names"][self.world.player_name[self.player]]
def fill_slot_data(self):

View File

@ -234,7 +234,7 @@ class SoEWorld(World):
if self.connect_name and self.connect_name != self.world.player_name[self.player]:
payload = multidata["connect_names"][self.world.player_name[self.player]]
multidata["connect_names"][self.connect_name] = payload
del (multidata["connect_names"][self.world.player_name[self.player]])
class SoEItem(Item):