From e9d9da34e86a1e5f0de155bf9086d3e5ff6b2da0 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Thu, 7 Aug 2025 13:34:42 -0400 Subject: Protobuf works! Parsing connections --- proto/CMakeLists.txt | 11 +++++++++++ proto/common.proto | 13 +++++++++++++ proto/data.proto | 13 ++++++++++--- proto/human.proto | 12 ++---------- 4 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 proto/CMakeLists.txt create mode 100644 proto/common.proto (limited to 'proto') diff --git a/proto/CMakeLists.txt b/proto/CMakeLists.txt new file mode 100644 index 0000000..c5abd46 --- /dev/null +++ b/proto/CMakeLists.txt @@ -0,0 +1,11 @@ +find_package(Protobuf REQUIRED) + +add_library(protos) + +protobuf_generate( + LANGUAGE cpp + TARGET protos + PROTOS human.proto data.proto common.proto +) + +target_link_libraries(protos PUBLIC protobuf::libprotobuf) diff --git a/proto/common.proto b/proto/common.proto new file mode 100644 index 0000000..eb1d6b5 --- /dev/null +++ b/proto/common.proto @@ -0,0 +1,13 @@ +edition = "2023"; + +package com.fourisland.lingo2_archipelago; + +message Proxy { + string answer = 1; + string path = 2; +} + +message Letter { + string letter = 1; + bool double = 2; +} diff --git a/proto/data.proto b/proto/data.proto index 71c3aeb..b3b6e6b 100644 --- a/proto/data.proto +++ b/proto/data.proto @@ -1,5 +1,7 @@ edition = "2023"; +import "common.proto"; + package com.fourisland.lingo2_archipelago; message ProxyIdentifier { @@ -8,11 +10,9 @@ message ProxyIdentifier { } message Connection { - uint64 id = 7; - uint64 from_room = 1; uint64 to_room = 2; - repeated uint64 required_door = 3; + uint64 required_door = 3; oneof trigger { uint64 port = 4; @@ -82,6 +82,7 @@ message Port { message Room { uint64 id = 1; + uint64 map_id = 8; string name = 2; string display_name = 3; @@ -91,7 +92,13 @@ message Room { repeated uint64 ports = 7; } +message Map { + uint64 id = 1; + string name = 2; +} + message AllObjects { + repeated Map maps = 7; repeated Room rooms = 1; repeated Door doors = 2; repeated Panel panels = 3; diff --git a/proto/human.proto b/proto/human.proto index 06c89cd..cdbb8b9 100644 --- a/proto/human.proto +++ b/proto/human.proto @@ -1,5 +1,7 @@ edition = "2023"; +import "common.proto"; + package com.fourisland.lingo2_archipelago; message RoomIdentifier { @@ -93,11 +95,6 @@ message HumanDoors { repeated HumanDoor doors = 1; } -message Proxy { - string answer = 1; - string path = 2; -} - message HumanPanel { string name = 1; string path = 5; @@ -125,11 +122,6 @@ message HumanPainting { DoorIdentifier required_door = 5; } -message Letter { - string letter = 1; - bool double = 2; -} - message HumanPort { string name = 1; string path = 2; -- cgit 1.4.1