Skip to content

Commit

Permalink
MultiServer: alternative data store based DataPackage retrieval
Browse files Browse the repository at this point in the history
  • Loading branch information
Berserker66 committed Dec 4, 2023
1 parent 001fdfb commit 0768bc0
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions MultiServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,25 @@ def _load(self, decoded_obj: dict, game_data_packages: typing.Dict[str, typing.A
del data["location_name_groups"]
del data["item_name_groups"] # remove from data package, but keep in self.item_name_groups
self._init_game_data()
for game_name, game_package in self.gamespackage.items():
key = f"datapackage_checksum_{game_name}"
self.public_stored_data_keys.add(key)
self.read_data[key] = lambda lgame=game_name: self.checksums.get(lgame, None)

key = f"item_name_to_id_{game_name}"
self.public_stored_data_keys.add(key)
self.read_data[key] = lambda lgame=game_name: self.gamespackage[lgame]["item_name_to_id"]

key = f"location_name_to_id_{game_name}"
self.public_stored_data_keys.add(key)
self.read_data[key] = lambda lgame=game_name: self.gamespackage[lgame]["location_name_to_id"]

for game_name, data in self.item_name_groups.items():
self.read_data[f"item_name_groups_{game_name}"] = lambda lgame=game_name: self.item_name_groups[lgame]
self.read_data[f"item_name_groups_{game_name}"] = \
lambda lgame=game_name: self.item_name_groups[lgame]
for game_name, data in self.location_name_groups.items():
self.read_data[f"location_name_groups_{game_name}"] = lambda lgame=game_name: self.location_name_groups[lgame]
self.read_data[f"location_name_groups_{game_name}"] = \
lambda lgame=game_name: self.location_name_groups[lgame]

# saving

Expand Down

0 comments on commit 0768bc0

Please sign in to comment.