AutoWorld: if any world data_version is set to 0, set it for the main datapackage

This commit is contained in:
Fabian Dill 2021-08-22 04:22:34 +02:00
parent 6a3d1fcaf4
commit b07fc80f3f
2 changed files with 8 additions and 1 deletions

View File

@ -78,7 +78,10 @@ class World(metaclass=AutoWorldRegister):
# maps item group names to sets of items. Example: "Weapons" -> {"Sword", "Bow"}
item_name_groups: Dict[str, Set[str]] = {}
data_version = 1 # increment this every time something in your world's names/id mappings changes.
# increment this every time something in your world's names/id mappings changes.
# While this is set to 0 in *any* AutoWorld, the entire DataPackage is considered in testing mode and will be
# retrieved by clients on every connection.
data_version = 1
hint_blacklist: Set[str] = frozenset() # any names that should not be hintable

View File

@ -34,3 +34,7 @@ network_data_package = {
"version": sum(world.data_version for world in AutoWorldRegister.world_types.values()),
"games": games,
}
# Set entire datapackage to version 0 if any of them are set to 0
if any(not world.data_version for world in AutoWorldRegister.world_types.values()):
network_data_package["version"] = 0