mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
Multidata: allow SoE/SM/LttP to connect via player name for use in Tracker/Text clients
This commit is contained in:
@@ -1323,7 +1323,6 @@ async def process_client_cmd(ctx: Context, client: Client, args: dict):
|
|||||||
errors.add('InvalidPassword')
|
errors.add('InvalidPassword')
|
||||||
|
|
||||||
if args['name'] not in ctx.connect_names:
|
if args['name'] not in ctx.connect_names:
|
||||||
logging.info((args["name"], ctx.connect_names))
|
|
||||||
errors.add('InvalidSlot')
|
errors.add('InvalidSlot')
|
||||||
else:
|
else:
|
||||||
team, slot = ctx.connect_names[args['name']]
|
team, slot = ctx.connect_names[args['name']]
|
||||||
|
@@ -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
|
# we skip in case of error, so that the original error in the output thread is the one that gets raised
|
||||||
if rom_name:
|
if rom_name:
|
||||||
new_name = base64.b64encode(bytes(self.rom_name)).decode()
|
new_name = base64.b64encode(bytes(self.rom_name)).decode()
|
||||||
payload = multidata["connect_names"][self.world.player_name[self.player]]
|
multidata["connect_names"][new_name] = 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]])
|
|
||||||
|
|
||||||
def get_required_client_version(self) -> tuple:
|
def get_required_client_version(self) -> tuple:
|
||||||
return max((0, 2, 4), super(ALTTPWorld, self).get_required_client_version())
|
return max((0, 2, 4), super(ALTTPWorld, self).get_required_client_version())
|
||||||
|
@@ -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
|
# we skip in case of error, so that the original error in the output thread is the one that gets raised
|
||||||
if rom_name:
|
if rom_name:
|
||||||
new_name = base64.b64encode(bytes(self.rom_name)).decode()
|
new_name = base64.b64encode(bytes(self.rom_name)).decode()
|
||||||
payload = multidata["connect_names"][self.world.player_name[self.player]]
|
multidata["connect_names"][new_name] = 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]])
|
|
||||||
|
|
||||||
|
|
||||||
def fill_slot_data(self):
|
def fill_slot_data(self):
|
||||||
|
@@ -234,7 +234,7 @@ class SoEWorld(World):
|
|||||||
if self.connect_name and self.connect_name != self.world.player_name[self.player]:
|
if self.connect_name and self.connect_name != self.world.player_name[self.player]:
|
||||||
payload = multidata["connect_names"][self.world.player_name[self.player]]
|
payload = multidata["connect_names"][self.world.player_name[self.player]]
|
||||||
multidata["connect_names"][self.connect_name] = payload
|
multidata["connect_names"][self.connect_name] = payload
|
||||||
del (multidata["connect_names"][self.world.player_name[self.player]])
|
|
||||||
|
|
||||||
|
|
||||||
class SoEItem(Item):
|
class SoEItem(Item):
|
||||||
|
Reference in New Issue
Block a user