From 4c8a38dfc0121343396d2a0d734cf1445d05b60c Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Tue, 12 Aug 2025 16:55:17 -0400 Subject: Converted to proto2 This will let us use an older version of protobuf in Python, and allows us to use the Godot protobuf implementation at all. Scalar fields with custom defaults in data.proto were changed to not have a default, because Godot doesn't handle it properly. The equivalent fields in human.proto still have the defaults, and datapacker copies the default value in if necessary. The Panel message in data.proto was also renamed to PanelData because otherwise it conflicts with the native Godot class named Panel. The double field in Letter was renamed to level2, because Godot couldn't handle it well. Finally, common.proto was removed and its contents were moved into data.proto, which allows us to generate code for Python without needing to edit it. NOTE: I had to slightly modify the Godot protobuf code generator. I'll need to upload that somewhere. --- proto/data.proto | 173 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 103 insertions(+), 70 deletions(-) (limited to 'proto/data.proto') diff --git a/proto/data.proto b/proto/data.proto index b590454..f60d54f 100644 --- a/proto/data.proto +++ b/proto/data.proto @@ -1,23 +1,56 @@ -edition = "2023"; - -import "common.proto"; +syntax = "proto2"; package com.fourisland.lingo2_archipelago; +message Proxy { + optional string answer = 1; + optional string path = 2; +} + +enum DoorType { + DOOR_TYPE_UNKNOWN = 0; + + // This door is a location unless panelsanity is on, and it is an item as long as door shuffle is on. + STANDARD = 1; + + // This door is never an item or a location. + EVENT = 2; + + // This door is never a location, and is an item as long as door shuffle is on. + ITEM_ONLY = 3; + + // This door is never a location, and is an item as long as control center color shuffle is on. + CONTROL_CENTER_COLOR = 4; + + // This door is never an item, and is a location as long as panelsanity is not on. + LOCATION_ONLY = 5; +} + +enum AxisDirection { + AXIS_DIRECTION_UNKNOWN = 0; + + X_PLUS = 1; + X_MINUS = 2; + Y_PLUS = 3; + Y_MINUS = 4; + Z_PLUS = 5; + Z_MINUS = 6; +} + message ProxyIdentifier { - uint64 panel = 1; - string answer = 2; + optional uint64 panel = 1; + optional string answer = 2; } message KeyholderAnswer { - uint64 keyholder = 1; - string key = 2; + optional uint64 keyholder = 1; + optional string key = 2; } message Connection { - uint64 from_room = 1; - uint64 to_room = 2; - uint64 required_door = 3; + optional uint64 from_room = 1; + optional uint64 to_room = 2; + optional uint64 required_door = 3; oneof trigger { uint64 port = 4; @@ -27,105 +60,105 @@ message Connection { } message Door { - uint64 id = 1; - uint64 ap_id = 11; - uint64 map_id = 9; - uint64 room_id = 10; - string name = 2; + optional uint64 id = 1; + optional uint64 ap_id = 11; + optional uint64 map_id = 9; + optional uint64 room_id = 10; + optional string name = 2; repeated string receivers = 3; repeated uint64 move_paintings = 4; repeated ProxyIdentifier panels = 5; - uint64 complete_at = 12; + optional uint64 complete_at = 12; - string control_center_color = 6; + optional string control_center_color = 6; repeated string switches = 7; repeated KeyholderAnswer keyholders = 13; repeated uint64 rooms = 14; - DoorType type = 8; + optional DoorType type = 8; } -message Panel { - uint64 id = 1; - uint64 ap_id = 10; - uint64 room_id = 2; - string name = 3; +message PanelData { + optional uint64 id = 1; + optional uint64 ap_id = 10; + optional uint64 room_id = 2; + optional string name = 3; - string path = 4; - string clue = 5; - string answer = 6; + optional string path = 4; + optional string clue = 5; + optional string answer = 6; repeated string symbols = 7; repeated Proxy proxies = 8; - uint64 required_door = 9; - uint64 required_room = 11; + optional uint64 required_door = 9; + optional uint64 required_room = 11; } message Painting { - uint64 id = 1; - uint64 room_id = 2; - string name = 9; - - string path = 10; - string display_name = 4; - - string orientation = 3; - bool move = 6; - bool enter_only = 7; - AxisDirection gravity = 8 [default = Y_MINUS]; - bool exit_only = 11; + optional uint64 id = 1; + optional uint64 room_id = 2; + optional string name = 9; + + optional string path = 10; + optional string display_name = 4; + + optional string orientation = 3; + optional bool move = 6; + optional bool enter_only = 7; + optional AxisDirection gravity = 8; + optional bool exit_only = 11; - uint64 required_door = 5; + optional uint64 required_door = 5; } message Port { - uint64 id = 1; - uint64 room_id = 2; - string name = 3; + optional uint64 id = 1; + optional uint64 room_id = 2; + optional string name = 3; - string path = 4; - string orientation = 5; - AxisDirection gravity = 7 [default = Y_MINUS]; + optional string path = 4; + optional string orientation = 5; + optional AxisDirection gravity = 7; - uint64 required_door = 6; + optional uint64 required_door = 6; } message Keyholder { - uint64 id = 1; - uint64 room_id = 2; + optional uint64 id = 1; + optional uint64 room_id = 2; - string name = 3; - string path = 4; + optional string name = 3; + optional string path = 4; } message Letter { - uint64 id = 3; - uint64 ap_id = 5; - uint64 room_id = 4; + optional uint64 id = 3; + optional uint64 ap_id = 5; + optional uint64 room_id = 4; - string key = 1; - bool double = 2; + optional string key = 1; + optional bool level2 = 2; - string path = 6; + optional string path = 6; } message Mastery { - uint64 id = 1; - uint64 ap_id = 2; - uint64 room_id = 3; + optional uint64 id = 1; + optional uint64 ap_id = 2; + optional uint64 room_id = 3; - string name = 4; - string path = 5; + optional string name = 4; + optional string path = 5; } message Room { - uint64 id = 1; - uint64 map_id = 8; - string name = 2; - string display_name = 3; + optional uint64 id = 1; + optional uint64 map_id = 8; + optional string name = 2; + optional string display_name = 3; repeated uint64 panels = 4; repeated uint64 paintings = 5; @@ -137,15 +170,15 @@ message Room { } message Map { - uint64 id = 1; - string name = 2; + optional uint64 id = 1; + optional string name = 2; } message AllObjects { repeated Map maps = 7; repeated Room rooms = 1; repeated Door doors = 2; - repeated Panel panels = 3; + repeated PanelData panels = 3; repeated Painting paintings = 4; repeated Port ports = 5; repeated Keyholder keyholders = 11; -- cgit 1.4.1