From 9bd56a242666a040bd09b2ebbf6faa4ff473775e Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Mon, 29 Sep 2025 15:41:02 -0400 Subject: Change version scheme --- apworld/__init__.py | 3 +-- apworld/static_logic.py | 5 +++-- apworld/version.py | 1 - data/metadata.txtpb | 6 +++++- proto/data.proto | 8 +++++++- proto/human.proto | 2 +- tools/datapacker/main.cpp | 2 +- 7 files changed, 18 insertions(+), 9 deletions(-) delete mode 100644 apworld/version.py diff --git a/apworld/__init__.py b/apworld/__init__.py index 1af31c0..96f6804 100644 --- a/apworld/__init__.py +++ b/apworld/__init__.py @@ -11,7 +11,6 @@ from .options import Lingo2Options from .player_logic import Lingo2PlayerLogic from .regions import create_regions, shuffle_entrances, connect_ports_from_ut from .static_logic import Lingo2StaticLogic -from .version import APWORLD_VERSION from ..LauncherComponents import Component, Type, components, launch as launch_component, icon_paths @@ -138,7 +137,7 @@ class Lingo2World(World): slot_data: dict[str, object] = { **self.options.as_dict(*slot_options), - "version": [self.static_logic.get_data_version(), APWORLD_VERSION], + "version": self.static_logic.get_data_version(), } if self.options.shuffle_worldports: diff --git a/apworld/static_logic.py b/apworld/static_logic.py index ef70b58..e59a47d 100644 --- a/apworld/static_logic.py +++ b/apworld/static_logic.py @@ -166,5 +166,6 @@ class Lingo2StaticLogic: else: return game_map.display_name - def get_data_version(self) -> int: - return self.objects.version + def get_data_version(self) -> list[int]: + version = self.objects.version + return [version.major, version.minor, version.patch] diff --git a/apworld/version.py b/apworld/version.py deleted file mode 100644 index ac799cd..0000000 --- a/apworld/version.py +++ /dev/null @@ -1 +0,0 @@ -APWORLD_VERSION = 6 diff --git a/data/metadata.txtpb b/data/metadata.txtpb index b7ba807..c6e514b 100644 --- a/data/metadata.txtpb +++ b/data/metadata.txtpb @@ -1,4 +1,8 @@ -version: 6 +version { + major: 7 + minor: 0 + patch: 0 +} # Filler item. special_names: "A Job Well Done" # Symbol items. diff --git a/proto/data.proto b/proto/data.proto index 044e32c..808198e 100644 --- a/proto/data.proto +++ b/proto/data.proto @@ -93,6 +93,12 @@ message Vec3d { optional double z = 3; } +message VersionNumber { + optional uint64 major = 1; + optional uint64 minor = 2; + optional uint64 patch = 3; +} + message ProxyIdentifier { optional uint64 panel = 1; optional string answer = 2; @@ -275,7 +281,7 @@ message DoorGroup { } message AllObjects { - optional uint64 version = 15; + optional VersionNumber version = 15; repeated Map maps = 7; repeated Room rooms = 1; diff --git a/proto/human.proto b/proto/human.proto index cd05191..99c1fd7 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -237,7 +237,7 @@ message HumanDoorGroups { message HumanGlobalMetadata { repeated string special_names = 1; - optional uint64 version = 2; + optional VersionNumber version = 2; } message IdMappings { diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 5254e5f..005361d 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp @@ -627,7 +627,7 @@ class DataPacker { } auto h_metadata = ReadMessageFromFile(path.string()); - container_.all_objects().set_version(h_metadata.version()); + *container_.all_objects().mutable_version() = h_metadata.version(); } void ProcessIdsFile(std::filesystem::path path) { -- cgit 1.4.1