From c2de96dd9df74027f7cb282e074c1b8a5101e468 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 4 Jul 2025 13:58:32 -0500 Subject: [PATCH 1/9] Converts the repository into a proper python package that can be installed and imported. Adds scripts for fetching protobuf files from DFHack git repo, and generating the python protobuf files for the client to use. Fleshes out the README with for detailed instructions using the newly added scripts. --- .gitignore | 9 +- CMakeLists.txt | 25 - README.md | 74 +- cmake/CMakeLists.txt | 26 + blendwarf.py => examples/blendwarf.py | 4 +- proto/51.13-r1/AdventureControl.proto | 109 ++ proto/51.13-r1/Basic.proto | 207 +++ proto/51.13-r1/BasicApi.proto | 109 ++ proto/51.13-r1/CoreProtocol.proto | 92 ++ proto/51.13-r1/DwarfControl.proto | 97 ++ proto/51.13-r1/ItemdefInstrument.proto | 108 ++ proto/51.13-r1/RemoteFortressReader.proto | 1127 +++++++++++++++++ proto/51.13-r1/stockpiles.proto | 190 +++ proto/51.13-r1/ui_sidebar_mode.proto | 65 + proto/README.md | 4 + pyproject.toml | 14 + scripts/fetch_proto_files.py | 99 ++ scripts/generate_python.py | 71 ++ src/dfhack_client_python/__init__.py | 5 + .../dfhack_client_python/dfhack_remote.py | 12 +- .../py_export/AdventureControl_pb2.py | 50 + .../py_export/BasicApi_pb2.py | 58 + .../py_export/Basic_pb2.py | 71 ++ .../py_export/CoreProtocol_pb2.py | 63 + .../py_export/DwarfControl_pb2.py | 55 + .../py_export/ItemdefInstrument_pb2.py | 49 + .../py_export/RemoteFortressReader_pb2.py | 236 ++++ .../py_export/__init__.py | 0 .../py_export/stockpiles_pb2.py | 77 ++ .../py_export/ui_sidebar_mode_pb2.py | 37 + 30 files changed, 3101 insertions(+), 42 deletions(-) delete mode 100644 CMakeLists.txt create mode 100644 cmake/CMakeLists.txt rename blendwarf.py => examples/blendwarf.py (79%) create mode 100644 proto/51.13-r1/AdventureControl.proto create mode 100644 proto/51.13-r1/Basic.proto create mode 100644 proto/51.13-r1/BasicApi.proto create mode 100644 proto/51.13-r1/CoreProtocol.proto create mode 100644 proto/51.13-r1/DwarfControl.proto create mode 100644 proto/51.13-r1/ItemdefInstrument.proto create mode 100644 proto/51.13-r1/RemoteFortressReader.proto create mode 100644 proto/51.13-r1/stockpiles.proto create mode 100644 proto/51.13-r1/ui_sidebar_mode.proto create mode 100644 proto/README.md create mode 100644 pyproject.toml create mode 100644 scripts/fetch_proto_files.py create mode 100644 scripts/generate_python.py create mode 100644 src/dfhack_client_python/__init__.py rename dfhack_remote.py => src/dfhack_client_python/dfhack_remote.py (92%) create mode 100644 src/dfhack_client_python/py_export/AdventureControl_pb2.py create mode 100644 src/dfhack_client_python/py_export/BasicApi_pb2.py create mode 100644 src/dfhack_client_python/py_export/Basic_pb2.py create mode 100644 src/dfhack_client_python/py_export/CoreProtocol_pb2.py create mode 100644 src/dfhack_client_python/py_export/DwarfControl_pb2.py create mode 100644 src/dfhack_client_python/py_export/ItemdefInstrument_pb2.py create mode 100644 src/dfhack_client_python/py_export/RemoteFortressReader_pb2.py create mode 100644 src/dfhack_client_python/py_export/__init__.py create mode 100644 src/dfhack_client_python/py_export/stockpiles_pb2.py create mode 100644 src/dfhack_client_python/py_export/ui_sidebar_mode_pb2.py diff --git a/.gitignore b/.gitignore index 188bae5..c27869f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,12 @@ +# CMake Makefile -py_export CMakeFiles CMakeCache.txt +*.cmake + +# Python __pycache__ +.python-version +.venv +*.egg-info/ +uv.lock diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 8d13c7d..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -cmake_minimum_required(VERSION 3.13) -project(blendwarf NONE) - -set(PROTOC-BIN "protoc") -set(PROTO-DIR-CORE "${CMAKE_CURRENT_SOURCE_DIR}/../dfhack/library/proto") -set(PROTO-DIR-PLUGINS "${CMAKE_CURRENT_SOURCE_DIR}/../dfhack/plugins/proto") -set(PY-DIR "${CMAKE_CURRENT_BINARY_DIR}/py_export") - -add_custom_command(OUTPUT protos - COMMAND mkdir -p ${PY-DIR} - COMMAND touch ${PY-DIR}/__init__.py - COMMAND "${PROTOC-BIN}" - -I${PROTO-DIR-CORE} - -I${PROTO-DIR-PLUGINS} - --python_out=${PY-DIR} - ${PROTO-DIR-PLUGINS}/RemoteFortressReader.proto - ${PROTO-DIR-PLUGINS}/ItemdefInstrument.proto - ${PROTO-DIR-CORE}/CoreProtocol.proto - ${PROTO-DIR-CORE}/Basic.proto - ${PROTO-DIR-CORE}/BasicApi.proto -) - -add_custom_target(DONE ALL - DEPENDS protos -) diff --git a/README.md b/README.md index 52ffe68..f2e3b35 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,71 @@ -## Python DFHack RPC client +# Python DFHack RPC client (originally 'Blendwarf' by Alef - http://www.bay12forums.com/smf/index.php?topic=178089.0) -### Instructions for Linux: -(requires packages cmake, python3-protobuf) +## Usage -Generate python protobuf code: -`$ cmake . && make` +By default this package includes all of the code necessary to connect to DFHack (version 51.13-r1) through its custom RPC protocal. Use the following steps to test this out. -Test some remote calls: -`$ python3 ./blendwarf.py` +### Clone dfhack-client-python Repository + +```bash +git clone https://github.com/McArcady/dfhack-client-python.git +``` + +### Install dfhack-client-python + +```bash +cd dfhack-client-python +pip install . +``` + +### Run Dwarf Fortress with DFHack + +At this point make sure both Dwarf Fortress and DFHack are installed. Open Dwarf Fortress and load into a game (the game can be paused). + +### Run the Example Script + +```bash +python ./example/blendwarf.py +``` +If everything is working and you have successfully connected to your game via RPC, you will see a print out containing the number of units in your currently open game! + +## Development + +In order to make changes to this package or generate python files for other version of DFHack. Follow the steps below. + +### Requirements + +- python 3 +- cmake +- protobuf + +### Fetch Protobuf Files (Optional) + +If you need to fetch a different version of .proto files, you can run the `./scripts/fetch_proto_files.py` script. You must pass a valid DFHack tag name as an argument. +```bash +python ./scripts/fetch_proto_files.py --tag="51.13-r1" +``` +*This will dump all `.proto` files into the `./proto/51.13-r1/` directory* + +### Generate Python Protobuf Code + +To generate the necessary python files from the `./proto//` directory, run the `./scripts/generate_python.py` script. You must pass the `` in as an argument + +```bash +python ./scripts/generate_python.py --tag="51.13-r1" +``` +*This will generate one python file in `./src/dfhack_client_python/py_export/` per .proto file in `./proto//` for the provided ``* + +### Install the Package + +Now that all the python code is generated, make sure to install the package + +```bash +pip install -e . +``` + +### Test Your Changes +At this point you can run the `./examples/blendwarf.py` script to test your changes. Make sure Dwarf Fortress is running, DFHack is installed, and you are loaded into a game. +```bash +python ./examples/blendwarf.py +``` diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt new file mode 100644 index 0000000..7eec980 --- /dev/null +++ b/cmake/CMakeLists.txt @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 3.13) +project(blendwarf NONE) + +# Make version configurable via command line +option(TAG "DFHack version tag to use (e.g., 51.13-r1)" "51.13-r1") + +set(PROTOC-BIN "protoc") +set(PROTO-DIR "${CMAKE_CURRENT_SOURCE_DIR}/../proto/${TAG}") +set(PY-DIR "${CMAKE_CURRENT_SOURCE_DIR}/../src/dfhack_client_python/py_export") + +# Dynamically find all .proto files in the PROTO-DIR +file(GLOB PROTO_FILES "${PROTO-DIR}/*.proto") + +# Create the protoc command with all found .proto files +add_custom_command(OUTPUT protos + COMMAND ${CMAKE_COMMAND} -E make_directory ${PY-DIR} + COMMAND ${CMAKE_COMMAND} -E touch ${PY-DIR}/__init__.py + COMMAND "${PROTOC-BIN}" + -I${PROTO-DIR} + --python_out=${PY-DIR} + ${PROTO_FILES} +) + +add_custom_target(DONE ALL + DEPENDS protos +) diff --git a/blendwarf.py b/examples/blendwarf.py similarity index 79% rename from blendwarf.py rename to examples/blendwarf.py index bf10de9..79a6120 100644 --- a/blendwarf.py +++ b/examples/blendwarf.py @@ -1,11 +1,11 @@ import asyncio -from dfhack_remote import remote, connect, close, StringMessage, EmptyMessage +from dfhack_client_python.dfhack_remote import remote, connect, close, StringMessage, EmptyMessage ## Declare DFHack exported interfaces @remote async def GetVersion(output: StringMessage = None): pass -from BasicApi_pb2 import GetWorldInfoOut +from dfhack_client_python.py_export.BasicApi_pb2 import GetWorldInfoOut @remote async def GetWorldInfo(output: GetWorldInfoOut = None): pass diff --git a/proto/51.13-r1/AdventureControl.proto b/proto/51.13-r1/AdventureControl.proto new file mode 100644 index 0000000..6fc6020 --- /dev/null +++ b/proto/51.13-r1/AdventureControl.proto @@ -0,0 +1,109 @@ +syntax = "proto2"; + +//Attempts to provide a complete framework for reading everything from a fortress needed for vizualization +package AdventureControl; + +option optimize_for = LITE_RUNTIME; + +import "RemoteFortressReader.proto"; + +// Plugin: RemoteFortressReader + +enum AdvmodeMenu +{ + Default = 0; + Look = 1; + ConversationAddress = 2; + ConversationSelect = 3; + ConversationSpeak = 4; + Inventory = 5; + Drop = 6; + ThrowItem = 7; + Wear = 8; + Remove = 9; + Interact = 10; + Put = 11; + PutContainer = 12; + Eat = 13; + ThrowAim = 14; + Fire = 15; + Get = 16; + Unk17 = 17; + CombatPrefs = 18; + Companions = 19; + MovementPrefs = 20; + SpeedPrefs = 21; + InteractAction = 22; + MoveCarefully = 23; + Announcements = 24; + UseBuilding = 25; + Travel = 26; + Unk27 = 27; + Unk28 = 28; + SleepConfirm = 29; + SelectInteractionTarget = 30; + Unk31 = 31; + Unk32 = 32; + FallAction = 33; + ViewTracks = 34; + Jump = 35; + Unk36 = 36; + AttackConfirm = 37; + AttackType = 38; + AttackBodypart = 39; + AttackStrike = 40; + Unk41 = 41; + Unk42 = 42; + DodgeDirection = 43; + Unk44 = 44; + Unk45 = 45; + Build = 46; +} + +enum CarefulMovementType +{ + DEFAULT_MOVEMENT = 0; + RELEASE_ITEM_HOLD = 1; + RELEASE_TILE_HOLD = 2; + ATTACK_CREATURE = 3; + HOLD_TILE = 4; + MOVE = 5; + CLIMB = 6; + HOLD_ITEM = 7; + BUILDING_INTERACT = 8; + ITEM_INTERACT = 9; + ITEM_INTERACT_GUIDE = 10; + ITEM_INTERACT_RIDE = 11; + ITEM_INTERACT_PUSH = 12; +} + +enum MiscMoveType +{ + SET_CLIMB = 0; + SET_STAND = 1; + SET_CANCEL = 2; +} + +message MoveCommandParams +{ + optional RemoteFortressReader.Coord direction = 1; +} + +message MovementOption +{ + optional RemoteFortressReader.Coord dest = 1; + optional RemoteFortressReader.Coord source = 2; + optional RemoteFortressReader.Coord grab = 3; + optional CarefulMovementType movement_type = 4; +} + +message MenuContents +{ + optional AdvmodeMenu current_menu = 1; + repeated MovementOption movements = 2; +} + +message MiscMoveParams +{ + optional MiscMoveType type = 1; +} diff --git a/proto/51.13-r1/Basic.proto b/proto/51.13-r1/Basic.proto new file mode 100644 index 0000000..f4ca826 --- /dev/null +++ b/proto/51.13-r1/Basic.proto @@ -0,0 +1,207 @@ +syntax = "proto2"; + +package dfproto; + +option optimize_for = LITE_RUNTIME; + +message EnumItemName { + required int32 value = 1; + optional string name = 2; + + // For bitfield members + optional int32 bit_size = 3 [default = 1]; +}; + +message BasicMaterialId { + required int32 type = 1; + required sint32 index = 2; +}; + +message BasicMaterialInfo { + required int32 type = 1; + required sint32 index = 2; + + // The raw token + required string token = 3; + + // IF mask.flags: + // List of material_flags indices + repeated int32 flags = 4; + + // Material type/index expanded: + optional int32 subtype = 5 [default = -1]; + optional int32 creature_id = 6 [default = -1]; + optional int32 plant_id = 7 [default = -1]; + optional int32 histfig_id = 8 [default = -1]; + + optional string name_prefix = 9 [default = ""]; + + // IF mask.states: in listed order; + // ELSE: one state matching mask.temperature + repeated fixed32 state_color = 10; + repeated string state_name = 11; + repeated string state_adj = 12; + + // IF mask.reaction: + message Product { + required string id = 1; + required int32 type = 2; + required sint32 index = 3; + }; + repeated string reaction_class = 13; + repeated Product reaction_product = 14; + + // IF mask.flags: + repeated int32 inorganic_flags = 15; +}; + +message BasicMaterialInfoMask { + enum StateType { + Solid = 0; + Liquid = 1; + Gas = 2; + Powder = 3; + Paste = 4; + Pressed = 5; + }; + repeated StateType states = 1; + optional int32 temperature = 4 [default = 10015]; + + optional bool flags = 2 [default = false]; + optional bool reaction = 3 [default = false]; +}; + +message JobSkillAttr { + required int32 id = 1; + required string key = 2; + + optional string caption = 3; + optional string caption_noun = 4; + + optional int32 profession = 5; + optional int32 labor = 6; + optional string type = 7; +}; + +message ProfessionAttr { + required int32 id = 1; + required string key = 2; + + optional string caption = 3; + optional bool military = 4; + optional bool can_assign_labor = 5; + + optional int32 parent = 6; +}; + +message UnitLaborAttr { + required int32 id = 1; + required string key = 2; + + optional string caption = 3; +}; + +message NameInfo { + optional string first_name = 1; + optional string nickname = 2; + + optional int32 language_id = 3 [default = -1]; + + optional string last_name = 4; + optional string english_name = 5; +}; + +message NameTriple { + required string normal = 1; + optional string plural = 2; + optional string adjective = 3; +}; + +message UnitCurseInfo { + required fixed32 add_tags1 = 1; + required fixed32 rem_tags1 = 2; + required fixed32 add_tags2 = 3; + required fixed32 rem_tags2 = 4; + + optional NameTriple name = 5; +}; + +message SkillInfo { + required int32 id = 1; + required int32 level = 2; + required int32 experience = 3; +}; + +message UnitMiscTrait { + required int32 id = 1; + required int32 value = 2; +}; + +message BasicUnitInfo { + required int32 unit_id = 1; + + required int32 pos_x = 13; + required int32 pos_y = 14; + required int32 pos_z = 15; + + optional NameInfo name = 2; + + required fixed32 flags1 = 3; + required fixed32 flags2 = 4; + required fixed32 flags3 = 5; + + required int32 race = 6; + required int32 caste = 7; + optional int32 gender = 8 [default = -1]; + + optional int32 civ_id = 9 [default = -1]; + optional int32 histfig_id = 10 [default = -1]; + + optional int32 death_id = 17 [default = -1]; + optional uint32 death_flags = 18; + + // IF mask.profession: + optional int32 squad_id = 19 [default = -1]; + optional int32 squad_position = 20 [default = -1]; + + optional int32 profession = 22 [default = -1]; + optional string custom_profession = 23; + + // IF mask.labors: + repeated int32 labors = 11; + + // IF mask.skills: + repeated SkillInfo skills = 12; + + // IF mask.misc_traits: + repeated UnitMiscTrait misc_traits = 24; + + optional UnitCurseInfo curse = 16; + + repeated int32 burrows = 21; +}; + +message BasicUnitInfoMask { + optional bool labors = 1 [default = false]; + optional bool skills = 2 [default = false]; + optional bool profession = 3 [default = false]; + optional bool misc_traits = 4 [default = false]; +}; + +message BasicSquadInfo { + required int32 squad_id = 1; + + optional NameInfo name = 2; + + // A special field completely overriding the name: + optional string alias = 3; + + // Member histfig ids: + repeated sint32 members = 4; +}; + +message UnitLaborState { + required int32 unit_id = 1; + required int32 labor = 2; + required bool value = 3; +}; diff --git a/proto/51.13-r1/BasicApi.proto b/proto/51.13-r1/BasicApi.proto new file mode 100644 index 0000000..3c0fb1a --- /dev/null +++ b/proto/51.13-r1/BasicApi.proto @@ -0,0 +1,109 @@ +syntax = "proto2"; + +package dfproto; + +option optimize_for = LITE_RUNTIME; + +import "Basic.proto"; + +// RPC GetVersion : EmptyMessage -> StringMessage +// RPC GetDFVersion : EmptyMessage -> StringMessage + +// RPC GetWorldInfo : EmptyMessage -> GetWorldInfoOut +message GetWorldInfoOut { + enum Mode { + MODE_DWARF = 1; + MODE_ADVENTURE = 2; + MODE_LEGENDS = 3; + }; + required Mode mode = 1; + + required string save_dir = 2; + optional NameInfo world_name = 3; + + // Dwarf mode + optional int32 civ_id = 4; + optional int32 site_id = 5; + optional int32 group_id = 6; + optional int32 race_id = 7; + + // Adventure mode + optional int32 player_unit_id = 8; + optional int32 player_histfig_id = 9; + repeated int32 companion_histfig_ids = 10; +}; + +// RPC ListEnums : EmptyMessage -> ListEnumsOut +message ListEnumsOut { + repeated EnumItemName material_flags = 1; + repeated EnumItemName inorganic_flags = 2; + + repeated EnumItemName unit_flags1 = 3; + repeated EnumItemName unit_flags2 = 4; + repeated EnumItemName unit_flags3 = 5; + + repeated EnumItemName unit_labor = 6; + repeated EnumItemName job_skill = 7; + + repeated EnumItemName cie_add_tag_mask1 = 8; + repeated EnumItemName cie_add_tag_mask2 = 9; + + repeated EnumItemName death_info_flags = 10; + + repeated EnumItemName profession = 11; +}; + +// RPC ListJobSkills : EmptyMessage -> ListJobSkillsOut +message ListJobSkillsOut { + repeated JobSkillAttr skill = 1; + repeated ProfessionAttr profession = 2; + repeated UnitLaborAttr labor = 3; +}; + +// RPC ListMaterials : ListMaterialsIn -> ListMaterialsOut +message ListMaterialsIn { + optional BasicMaterialInfoMask mask = 1; + + // Specific materials: + repeated BasicMaterialId id_list = 2; + + // Complete list by type: + optional bool builtin = 3; + optional bool inorganic = 4; + optional bool creatures = 5; + optional bool plants = 6; +}; +message ListMaterialsOut { + repeated BasicMaterialInfo value = 1; +}; + +// RPC ListUnits : ListUnitsIn -> ListUnitsOut +message ListUnitsIn { + optional BasicUnitInfoMask mask = 1; + + // Specific units: + repeated int32 id_list = 2; + + // All units matching: + optional bool scan_all = 5; + + optional int32 race = 3; + optional int32 civ_id = 4; + optional bool dead = 6; // i.e. passive corpse + optional bool alive = 7; // i.e. not dead or undead + optional bool sane = 8; // not dead, ghost, zombie, or insane +}; +message ListUnitsOut { + repeated BasicUnitInfo value = 1; +}; + +// RPC ListSquads : ListSquadsIn -> ListSquadsOut +message ListSquadsIn {} +message ListSquadsOut { + repeated BasicSquadInfo value = 1; +}; + +// RPC SetUnitLabors : SetUnitLaborsIn -> EmptyMessage +message SetUnitLaborsIn { + repeated UnitLaborState change = 1; +}; diff --git a/proto/51.13-r1/CoreProtocol.proto b/proto/51.13-r1/CoreProtocol.proto new file mode 100644 index 0000000..b2f7d2b --- /dev/null +++ b/proto/51.13-r1/CoreProtocol.proto @@ -0,0 +1,92 @@ +syntax = "proto2"; + +package dfproto; + +option optimize_for = LITE_RUNTIME; + +message CoreTextFragment { + required string text = 1; + + enum Color { + COLOR_BLACK = 0; + COLOR_BLUE = 1; + COLOR_GREEN = 2; + COLOR_CYAN = 3; + COLOR_RED = 4; + COLOR_MAGENTA = 5; + COLOR_BROWN = 6; + COLOR_GREY = 7; + COLOR_DARKGREY = 8; + COLOR_LIGHTBLUE = 9; + COLOR_LIGHTGREEN = 10; + COLOR_LIGHTCYAN = 11; + COLOR_LIGHTRED = 12; + COLOR_LIGHTMAGENTA = 13; + COLOR_YELLOW = 14; + COLOR_WHITE = 15; + }; + optional Color color = 2; +} + +message CoreTextNotification { + repeated CoreTextFragment fragments = 1; +} + +message CoreErrorNotification { + enum ErrorCode { + CR_LINK_FAILURE = -3; + CR_WOULD_BREAK = -2; + CR_NOT_IMPLEMENTED = -1; + CR_OK = 0; + CR_FAILURE = 1; + CR_WRONG_USAGE = 2; + CR_NOT_FOUND = 3; + }; + + required ErrorCode code = 1; +} + +message EmptyMessage {} + +message IntMessage { + required int32 value = 1; +} + +message IntListMessage { + repeated int32 value = 1; +} + +message StringMessage { + required string value = 1; +} + +message StringListMessage { + repeated string value = 1; +} + +// RPC BindMethod : CoreBindRequest -> CoreBindReply +message CoreBindRequest { + required string method = 1; + required string input_msg = 2; + required string output_msg = 3; + optional string plugin = 4; +} +message CoreBindReply { + required int32 assigned_id = 1; +} + +// RPC RunCommand : CoreRunCommandRequest -> EmptyMessage +message CoreRunCommandRequest { + required string command = 1; + repeated string arguments = 2; +} + +// RPC CoreSuspend : EmptyMessage -> IntMessage +// RPC CoreResume : EmptyMessage -> IntMessage + +// RPC RunLua : CoreRunLuaRequest -> StringListMessage +message CoreRunLuaRequest { + required string module = 1; + required string function = 2; + repeated string arguments = 3; +} diff --git a/proto/51.13-r1/DwarfControl.proto b/proto/51.13-r1/DwarfControl.proto new file mode 100644 index 0000000..2babc99 --- /dev/null +++ b/proto/51.13-r1/DwarfControl.proto @@ -0,0 +1,97 @@ +syntax = "proto2"; + +//Attempts to provide a complete framework for reading everything from a fortress needed for vizualization +package DwarfControl; + +option optimize_for = LITE_RUNTIME; + +// Plugin: RemoteFortressReader + +import "ui_sidebar_mode.proto"; +import "RemoteFortressReader.proto"; + +// RPC GetSideMenu : EmptyMessage -> SidebarState +// RPC SetSideMenu : SidebarCommand -> EmptyMessage + + +enum BuildCategory +{ + NotCategory = 0; + SiegeEngines = 1; + Traps = 2; + Workshops = 3; + Furnaces = 4; + Constructions = 5; + MachineComponents = 6; + Track = 7; +} + +enum MenuAction +{ + MenuNone = 0; + MenuSelect = 1; + MenuCancel = 2; + MenuSelectAll = 3; +} + +enum BuildSelectorStage +{ + StageNoMat = 0; + StagePlace = 1; + StageItemSelect = 2; +} + +message SidebarState +{ + optional proto.enums.ui_sidebar_mode.ui_sidebar_mode mode = 1; + repeated MenuItem menu_items = 2; + optional BuildSelector build_selector = 3; +} + +message MenuItem +{ + optional RemoteFortressReader.BuildingType building_type = 1; + optional int32 existing_count = 2; + optional BuildCategory build_category = 3; +} + +message SidebarCommand +{ + optional proto.enums.ui_sidebar_mode.ui_sidebar_mode mode = 1; + optional int32 menu_index = 2; + optional MenuAction action = 3; + optional RemoteFortressReader.Coord selection_coord = 4; +} + +message BuiildReqChoice +{ + optional int32 distance = 1; + optional string name = 2; + optional int32 num_candidates = 3; + optional int32 used_count = 4; +} + +message BuildItemReq +{ + //Put filter here = 1 + optional int32 count_required = 2; + optional int32 count_max = 3; + optional int32 count_provided = 4; +} + +message BuildSelector +{ + optional RemoteFortressReader.BuildingType building_type = 1; + optional BuildSelectorStage stage = 2; + repeated BuiildReqChoice choices = 3; + optional int32 sel_index = 4; + repeated BuildItemReq requirements = 5; + optional int32 req_index = 6; + repeated string errors = 7; + optional int32 radius_x_low = 8; + optional int32 radius_y_low = 9; + optional int32 radius_x_high = 10; + optional int32 radius_y_high = 11; + optional RemoteFortressReader.Coord cursor = 12; + repeated int32 tiles = 13; +} diff --git a/proto/51.13-r1/ItemdefInstrument.proto b/proto/51.13-r1/ItemdefInstrument.proto new file mode 100644 index 0000000..45c35f6 --- /dev/null +++ b/proto/51.13-r1/ItemdefInstrument.proto @@ -0,0 +1,108 @@ +syntax = "proto2"; + +//Attempts to provide a complete framework for reading everything from a fortress needed for vizualization +package ItemdefInstrument; + +option optimize_for = LITE_RUNTIME; + +// Plugin: RemoteFortressReader + +message InstrumentFlags + { + optional bool indefinite_pitch = 1; + optional bool placed_as_building = 2; + optional bool metal_mat = 3; + optional bool stone_mat = 4; + optional bool wood_mat = 5; + optional bool glass_mat = 6; + optional bool ceramic_mat = 7; + optional bool shell_mat = 8; + optional bool bone_mat = 9; +} + +enum PitchChoiceType +{ + MEMBRANE_POSITION = 0; + SUBPART_CHOICE = 1; + KEYBOARD = 2; + STOPPING_FRET = 3; + STOPPING_AGAINST_BODY = 4; + STOPPING_HOLE = 5; + STOPPING_HOLE_KEY = 6; + SLIDE = 7; + HARMONIC_SERIES = 8; + VALVE_ROUTES_AIR = 9; + BP_IN_BELL = 10; + FOOT_PEDALS = 11; +} + +enum SoundProductionType +{ + PLUCKED_BY_BP = 0; + PLUCKED = 1; + BOWED = 2; + STRUCK_BY_BP = 3; + STRUCK = 4; + VIBRATE_BP_AGAINST_OPENING = 5; + BLOW_AGAINST_FIPPLE = 6; + BLOW_OVER_OPENING_SIDE = 7; + BLOW_OVER_OPENING_END = 8; + BLOW_OVER_SINGLE_REED = 9; + BLOW_OVER_DOUBLE_REED = 10; + BLOW_OVER_FREE_REED = 11; + STRUCK_TOGETHER = 12; + SHAKEN = 13; + SCRAPED = 14; + FRICTION = 15; + RESONATOR = 16; + BAG_OVER_REED = 17; + AIR_OVER_REED = 18; + AIR_OVER_FREE_REED = 19; + AIR_AGAINST_FIPPLE = 20; +} + +enum TuningType +{ + PEGS = 0; + ADJUSTABLE_BRIDGES = 1; + CROOKS = 2; + TIGHTENING = 3; + LEVERS = 4; +} + +message InstrumentPiece +{ + optional string type = 1; + optional string id = 2; + optional string name = 3; + optional string name_plural = 4; +} + +message InstrumentRegister +{ + optional int32 pitch_range_min = 1; + optional int32 pitch_range_max = 2; +} + +message InstrumentDef +{ + optional InstrumentFlags flags = 1; + optional int32 size = 2; + optional int32 value = 3; + optional int32 material_size = 4; + repeated InstrumentPiece pieces = 5; + optional int32 pitch_range_min = 6; + optional int32 pitch_range_max = 7; + optional int32 volume_mb_min = 8; + optional int32 volume_mb_max = 9; + repeated SoundProductionType sound_production = 10; + repeated string sound_production_parm1 = 11; + repeated string sound_production_parm2 = 12; + repeated PitchChoiceType pitch_choice = 13; + repeated string pitch_choice_parm1 = 14; + repeated string pitch_choice_parm2 = 15; + repeated TuningType tuning = 16; + repeated string tuning_parm = 17; + repeated InstrumentRegister registers = 18; + optional string description = 19; +} diff --git a/proto/51.13-r1/RemoteFortressReader.proto b/proto/51.13-r1/RemoteFortressReader.proto new file mode 100644 index 0000000..a092a12 --- /dev/null +++ b/proto/51.13-r1/RemoteFortressReader.proto @@ -0,0 +1,1127 @@ +syntax = "proto2"; + +//Attempts to provide a complete framework for reading everything from a fortress needed for vizualization +package RemoteFortressReader; + +option optimize_for = LITE_RUNTIME; + +// Plugin: RemoteFortressReader + +import "ItemdefInstrument.proto"; + +// RPC GetMaterialList : EmptyMessage -> MaterialList +// RPC GetGrowthList : EmptyMessage -> MaterialList +// RPC GetBlockList : BlockRequest -> BlockList +// RPC CheckHashes : EmptyMessage -> EmptyMessage +// RPC GetTiletypeList : EmptyMessage -> TiletypeList +// RPC GetPlantList : BlockRequest -> PlantList +// RPC GetUnitList : EmptyMessage -> UnitList +// RPC GetUnitListInside : BlockRequest -> UnitList +// RPC GetViewInfo : EmptyMessage -> ViewInfo +// RPC GetMapInfo : EmptyMessage -> MapInfo +// RPC ResetMapHashes : EmptyMessage -> EmptyMessage +// RPC GetItemList : EmptyMessage -> MaterialList +// RPC GetBuildingDefList : EmptyMessage -> BuildingList +// RPC GetWorldMap : EmptyMessage -> WorldMap +// RPC GetWorldMapNew : EmptyMessage -> WorldMap +// RPC GetRegionMaps : EmptyMessage -> RegionMaps +// RPC GetRegionMapsNew : EmptyMessage -> RegionMaps +// RPC GetCreatureRaws : EmptyMessage -> CreatureRawList +// RPC GetPartialCreatureRaws : ListRequest -> CreatureRawList +// RPC GetWorldMapCenter : EmptyMessage -> WorldMap +// RPC GetPlantRaws : EmptyMessage -> PlantRawList +// RPC GetPartialPlantRaws : ListRequest -> PlantRawList +// RPC CopyScreen : EmptyMessage -> ScreenCapture +// RPC PassKeyboardEvent : KeyboardEvent -> EmptyMessage +// RPC SendDigCommand : DigCommand -> EmptyMessage +// RPC SetPauseState : SingleBool -> EmptyMessage +// RPC GetPauseState : EmptyMessage -> SingleBool +// RPC GetVersionInfo : EmptyMessage -> VersionInfo +// RPC GetReports : EmptyMessage -> Status +// RPC MoveCommand : MoveCommandParams -> EmptyMessage +// RPC JumpCommand : MoveCommandParams -> EmptyMessage +// RPC MenuQuery : EmptyMessage -> MenuContents +// RPC MovementSelectCommand : IntMessage -> EmptyMessage +// RPC MiscMoveCommand : MiscMoveParams -> EmptyMessage +// RPC GetLanguage : EmptyMessage -> Language +// RPC GetGameValidity : EmptyMessage -> SingleBool + +//We use shapes, etc, because the actual tiletypes may differ between DF versions. +enum TiletypeShape +{ + NO_SHAPE = -1; + EMPTY = 0; + FLOOR = 1; + BOULDER = 2; + PEBBLES = 3; + WALL = 4; + FORTIFICATION = 5; + STAIR_UP = 6; + STAIR_DOWN = 7; + STAIR_UPDOWN = 8; + RAMP = 9; + RAMP_TOP = 10; + BROOK_BED = 11; + BROOK_TOP = 12; + TREE_SHAPE = 13; + SAPLING = 14; + SHRUB = 15; + ENDLESS_PIT = 16; + BRANCH = 17; + TRUNK_BRANCH = 18; + TWIG = 19; +} + +enum TiletypeSpecial +{ + NO_SPECIAL = -1; + NORMAL = 0; + RIVER_SOURCE = 1; + WATERFALL = 2; + SMOOTH = 3; + FURROWED = 4; + WET = 5; + DEAD = 6; + WORN_1 = 7; + WORN_2 = 8; + WORN_3 = 9; + TRACK = 10; + SMOOTH_DEAD = 11; +}; +enum TiletypeMaterial +{ + NO_MATERIAL = -1; + AIR = 0; + SOIL = 1; + STONE = 2; + FEATURE = 3; + LAVA_STONE = 4; + MINERAL = 5; + FROZEN_LIQUID = 6; + CONSTRUCTION = 7; + GRASS_LIGHT = 8; + GRASS_DARK = 9; + GRASS_DRY = 10; + GRASS_DEAD = 11; + PLANT = 12; + HFS = 13; + CAMPFIRE = 14; + FIRE = 15; + ASHES = 16; + MAGMA = 17; + DRIFTWOOD = 18; + POOL = 19; + BROOK = 20; + RIVER = 21; + ROOT = 22; + TREE_MATERIAL = 23; + MUSHROOM = 24; + UNDERWORLD_GATE = 25; +} +enum TiletypeVariant +{ + NO_VARIANT = -1; + VAR_1 = 0; + VAR_2 = 1; + VAR_3 = 2; + VAR_4 = 3; +}; + +enum WorldPoles +{ + NO_POLES = 0; + NORTH_POLE = 1; + SOUTH_POLE = 2; + BOTH_POLES = 3; +} + +enum BuildingDirection +{ + NORTH = 0; + EAST = 1; + SOUTH = 2; + WEST = 3; + NONE = 4; +} + +enum TileDigDesignation +{ + /** + * no designation + */ + NO_DIG = 0; + /** + * dig walls, remove stairs and ramps, gather plants, fell trees + */ + DEFAULT_DIG = 1; + UP_DOWN_STAIR_DIG = 2; + CHANNEL_DIG = 3; + RAMP_DIG = 4; + DOWN_STAIR_DIG = 5; + UP_STAIR_DIG = 6; +} + +enum HairStyle +{ + UNKEMPT = -1; + NEATLY_COMBED = 0; + BRAIDED = 1; + DOUBLE_BRAID = 2; + PONY_TAILS = 3; + CLEAN_SHAVEN = 4; +} + +enum InventoryMode +{ + Hauled = 0; + /** + * also shield, crutch + */ + Weapon = 1; + /** + * quiver + */ + Worn = 2; + Piercing = 3; + /** + * attached to clothing + */ + Flask = 4; + /** + * e.g. bandage + */ + WrappedAround = 5; + StuckIn = 6; + /** + * string descr like Worn + */ + InMouth = 7; + /** + * Left shoulder, right shoulder, or head, selected randomly using pet_seed + */ + Pet = 8; + SewnInto = 9; + Strapped = 10; +} + +enum ArmorLayer +{ + LAYER_UNDER = 0; + LAYER_OVER = 1; + LAYER_ARMOR = 2; + LAYER_COVER = 3; +} + +message Coord +{ + optional int32 x = 1; + optional int32 y = 2; + optional int32 z = 3; +} + +message Tiletype +{ + required int32 id = 1; + optional string name = 2; + optional string caption = 3; + optional TiletypeShape shape = 4; + optional TiletypeSpecial special = 5; + optional TiletypeMaterial material = 6; + optional TiletypeVariant variant = 7; + optional string direction = 8; +}; + +message TiletypeList +{ + repeated Tiletype tiletype_list = 1; +} + +message BuildingExtents +{ + required int32 pos_x = 1; + required int32 pos_y = 2; + required int32 width = 3; + required int32 height = 4; + repeated int32 extents = 5; +} + +message BuildingItem +{ + optional Item item = 1; + optional int32 mode = 2; +} + +message BuildingInstance +{ + required int32 index = 1; + optional int32 pos_x_min = 2; + optional int32 pos_y_min = 3; + optional int32 pos_z_min = 4; + optional int32 pos_x_max = 5; + optional int32 pos_y_max = 6; + optional int32 pos_z_max = 7; + optional BuildingType building_type = 8; + optional MatPair material = 9; + optional uint32 building_flags = 10; + optional bool is_room = 11; + optional BuildingExtents room = 12; + optional BuildingDirection direction = 13; //Doesn't mean anything for most buildings + repeated BuildingItem items = 14; + optional int32 active = 15; +} + +message RiverEdge +{ + optional int32 min_pos = 1; + optional int32 max_pos = 2; + optional int32 active = 3; + optional int32 elevation = 4; +} + +message RiverTile +{ + optional RiverEdge north = 1; + optional RiverEdge south = 2; + optional RiverEdge east = 3; + optional RiverEdge west = 4; +} + +enum MatterState +{ + Solid = 0; + Liquid = 1; + Gas = 2; + Powder = 3; + Paste = 4; + Pressed = 5; +} + +message Spatter +{ + optional MatPair material = 1; + optional int32 amount = 2; + optional MatterState state = 3; + optional MatPair item = 4; +} + +message SpatterPile +{ + repeated Spatter spatters = 1; +} + +message Item +{ + optional int32 id = 1; + optional Coord pos = 2; + optional uint32 flags1 = 3; + optional uint32 flags2 = 4; + optional MatPair type = 5; + optional MatPair material = 6; + optional ColorDefinition dye = 7; + optional int32 stack_size = 8; + optional float subpos_x = 9; + optional float subpos_y = 10; + optional float subpos_z = 11; + optional bool projectile = 12; + optional float velocity_x = 13; + optional float velocity_y = 14; + optional float velocity_z = 15; + optional int32 volume = 16; + repeated ItemImprovement improvements = 17; + optional ArtImage image = 18; +} + +message PlantTile +{ + optional bool trunk = 1; + optional bool connection_east = 2; + optional bool connection_south = 3; + optional bool connection_west = 4; + optional bool connection_north = 5; + optional bool branches = 6; + optional bool twigs = 7; + optional TiletypeSpecial tile_type = 8; +} + +message TreeInfo +{ + optional Coord size = 1; + repeated PlantTile tiles = 2; +} + +message PlantInstance +{ + optional int32 plant_type = 1; + optional Coord pos = 2; + optional TreeInfo tree_info = 3; +} + +message MapBlock +{ + required int32 map_x = 1; + required int32 map_y = 2; + required int32 map_z = 3; + repeated int32 tiles = 4; + repeated MatPair materials = 5; + repeated MatPair layer_materials = 6; + repeated MatPair vein_materials = 7; + repeated MatPair base_materials = 8; + repeated int32 magma = 9; + repeated int32 water = 10; + repeated bool hidden = 11; + repeated bool light = 12; + repeated bool subterranean = 13; + repeated bool outside = 14; + repeated bool aquifer = 15; + repeated bool water_stagnant = 16; + repeated bool water_salt = 17; + repeated MatPair construction_items = 18; + repeated BuildingInstance buildings = 19; + repeated int32 tree_percent = 20; + repeated int32 tree_x = 21; + repeated int32 tree_y = 22; + repeated int32 tree_z = 23; + repeated TileDigDesignation tile_dig_designation = 24; + repeated SpatterPile spatterPile = 25; + repeated Item items = 26; + repeated bool tile_dig_designation_marker = 27; + repeated bool tile_dig_designation_auto = 28; + repeated int32 grass_percent = 29; + repeated FlowInfo flows = 30; +} + +message MatPair { + required int32 mat_type = 1; + required int32 mat_index = 2; +} + +message ColorDefinition { + required int32 red = 1; + required int32 green = 2; + required int32 blue = 3; +} + +message MaterialDefinition{ + required MatPair mat_pair = 1; + optional string id = 2; + optional string name = 3; + optional ColorDefinition state_color = 4; //Simplifying colors to assume room temperature. + optional ItemdefInstrument.InstrumentDef instrument = 5; + optional int32 up_step = 6; + optional int32 down_step = 7; + optional ArmorLayer layer = 8; +} + +message BuildingType +{ + required int32 building_type = 1; + required int32 building_subtype = 2; + required int32 building_custom = 3; +} + +message BuildingDefinition { + required BuildingType building_type = 1; + optional string id = 2; + optional string name = 3; +} + +message BuildingList { + repeated BuildingDefinition building_list = 1; +} + +message MaterialList{ + repeated MaterialDefinition material_list = 1; +} + +message Hair +{ + optional int32 length = 1; + optional HairStyle style = 2; +} + +message BodySizeInfo +{ + optional int32 size_cur = 1; + optional int32 size_base = 2; + optional int32 area_cur = 3; /*!< size_cur^0.666 */ + optional int32 area_base = 4; /*!< size_base^0.666 */ + optional int32 length_cur = 5; /*!< (size_cur*10000)^0.333 */ + optional int32 length_base = 6; /*!< (size_base*10000)^0.333 */ +} + +message UnitAppearance +{ + repeated int32 body_modifiers = 1; + repeated int32 bp_modifiers = 2; + optional int32 size_modifier = 3; + repeated int32 colors = 4; + optional Hair hair = 5; + optional Hair beard = 6; + optional Hair moustache = 7; + optional Hair sideburns = 8; + optional string physical_description = 9; +} + +message InventoryItem +{ + optional InventoryMode mode = 1; + optional Item item = 2; + optional int32 body_part_id = 3; +} + +message WoundPart +{ + optional int32 global_layer_idx = 1; + optional int32 body_part_id = 2; + optional int32 layer_idx = 3; +} + +message UnitWound +{ + repeated WoundPart parts = 1; + optional bool severed_part = 2; +} + +message UnitDefinition +{ + required int32 id = 1; + optional bool isValid = 2; + optional int32 pos_x = 3; + optional int32 pos_y = 4; + optional int32 pos_z = 5; + optional MatPair race = 6; + optional ColorDefinition profession_color = 7; + optional uint32 flags1 = 8; + optional uint32 flags2 = 9; + optional uint32 flags3 = 10; + optional bool is_soldier = 11; + optional BodySizeInfo size_info = 12; + optional string name = 13; + optional int32 blood_max = 14; + optional int32 blood_count = 15; + optional UnitAppearance appearance = 16; + optional int32 profession_id = 17; + repeated string noble_positions = 18; + optional int32 rider_id = 19; + repeated InventoryItem inventory = 20; + optional float subpos_x = 21; + optional float subpos_y = 22; + optional float subpos_z = 23; + optional Coord facing = 24; + optional int32 age = 25; + repeated UnitWound wounds = 26; +} + +message UnitList +{ + repeated UnitDefinition creature_list = 1; +} + +message BlockRequest +{ + optional int32 blocks_needed = 1; + optional int32 min_x = 2; + optional int32 max_x = 3; + optional int32 min_y = 4; + optional int32 max_y = 5; + optional int32 min_z = 6; + optional int32 max_z = 7; + optional bool force_reload = 8; +} + +message BlockList +{ + repeated MapBlock map_blocks = 1; + optional int32 map_x = 2; + optional int32 map_y = 3; + repeated Engraving engravings = 4; + repeated Wave ocean_waves = 5; +} + +message PlantDef +{ + required int32 pos_x = 1; + required int32 pos_y = 2; + required int32 pos_z = 3; + required int32 index = 4; +} + +message PlantList +{ + repeated PlantDef plant_list = 1; +} + +message ViewInfo +{ + optional int32 view_pos_x = 1; + optional int32 view_pos_y = 2; + optional int32 view_pos_z = 3; + optional int32 view_size_x = 4; + optional int32 view_size_y = 5; + optional int32 cursor_pos_x = 6; + optional int32 cursor_pos_y = 7; + optional int32 cursor_pos_z = 8; + optional int32 follow_unit_id = 9 [default = -1]; + optional int32 follow_item_id = 10 [default = -1]; +} + +message MapInfo +{ + optional int32 block_size_x = 1; + optional int32 block_size_y = 2; + optional int32 block_size_z = 3; + optional int32 block_pos_x = 4; + optional int32 block_pos_y = 5; + optional int32 block_pos_z = 6; + optional string world_name = 7; + optional string world_name_english = 8; + optional string save_name = 9; +} + +enum FrontType +{ + FRONT_NONE = 0; + FRONT_WARM = 1; + FRONT_COLD = 2; + FRONT_OCCLUDED = 3; +} +enum CumulusType +{ + CUMULUS_NONE = 0; + CUMULUS_MEDIUM = 1; + CUMULUS_MULTI = 2; + CUMULUS_NIMBUS = 3; +} +enum StratusType +{ + STRATUS_NONE = 0; + STRATUS_ALTO = 1; + STRATUS_PROPER = 2; + STRATUS_NIMBUS = 3; +} +enum FogType +{ + FOG_NONE = 0; + FOG_MIST = 1; + FOG_NORMAL = 2; + F0G_THICK = 3; +} + +message Cloud +{ + optional FrontType front = 1; + optional CumulusType cumulus = 2; + optional bool cirrus = 3; + optional StratusType stratus = 4; + optional FogType fog = 5; +} + +message WorldMap +{ + required int32 world_width = 1; + required int32 world_height = 2; + optional string name = 3; + optional string name_english = 4; + repeated int32 elevation = 5; + repeated int32 rainfall = 6; + repeated int32 vegetation = 7; + repeated int32 temperature = 8; + repeated int32 evilness = 9; + repeated int32 drainage = 10; + repeated int32 volcanism = 11; + repeated int32 savagery = 12; + repeated Cloud clouds = 13; + repeated int32 salinity = 14; + optional int32 map_x = 15; + optional int32 map_y = 16; + optional int32 center_x = 17; + optional int32 center_y = 18; + optional int32 center_z = 19; + optional int32 cur_year = 20; + optional int32 cur_year_tick = 21; + optional WorldPoles world_poles = 22; + repeated RiverTile river_tiles = 23; + repeated int32 water_elevation = 24; + repeated RegionTile region_tiles = 25; +} + +message SiteRealizationBuildingWall +{ + optional int32 start_x = 1; + optional int32 start_y = 2; + optional int32 start_z = 3; + optional int32 end_x = 4; + optional int32 end_y = 5; + optional int32 end_z = 6; +} + +message SiteRealizationBuildingTower +{ + optional int32 roof_z = 1; + optional bool round = 2; + optional bool goblin = 3; +} + +message TrenchSpoke +{ + optional int32 mound_start = 1; + optional int32 trench_start = 2; + optional int32 trench_end = 3; + optional int32 mound_end = 4; +} + +message SiteRealizationBuildingTrenches +{ + repeated TrenchSpoke spokes = 1; +} + +message SiteRealizationBuilding +{ + optional int32 id = 1; + optional int32 min_x = 3; + optional int32 min_y = 4; + optional int32 max_x = 5; + optional int32 max_y = 6; + optional MatPair material = 7; + optional SiteRealizationBuildingWall wall_info = 8; + optional SiteRealizationBuildingTower tower_info = 9; + optional SiteRealizationBuildingTrenches trench_info = 10; + optional int32 type = 11; +} + +message RegionTile +{ + optional int32 elevation = 1; + optional int32 rainfall = 2; + optional int32 vegetation = 3; + optional int32 temperature = 4; + optional int32 evilness = 5; + optional int32 drainage = 6; + optional int32 volcanism = 7; + optional int32 savagery = 8; + optional int32 salinity = 9; + optional RiverTile river_tiles = 10; + optional int32 water_elevation = 11; + optional MatPair surface_material = 12; + repeated MatPair plant_materials = 13; + repeated SiteRealizationBuilding buildings = 14; + repeated MatPair stone_materials = 15; + repeated MatPair tree_materials = 16; + optional int32 snow = 17; +} + +message RegionMap +{ + optional int32 map_x = 1; + optional int32 map_y = 2; + optional string name = 3; + optional string name_english = 4; + repeated RegionTile tiles = 5; +} + +message RegionMaps +{ + repeated WorldMap world_maps = 1; + repeated RegionMap region_maps = 2; +} + +enum PatternType +{ + MONOTONE = 0; + STRIPES = 1; + IRIS_EYE = 2; + SPOTS = 3; + PUPIL_EYE = 4; + MOTTLED = 5; +} + +message PatternDescriptor +{ + optional string id = 1; + repeated ColorDefinition colors = 2; + optional PatternType pattern = 3; +} + +message ColorModifierRaw +{ + repeated PatternDescriptor patterns = 1; + repeated int32 body_part_id = 2; + repeated int32 tissue_layer_id = 3; + optional int32 start_date = 4; + optional int32 end_date = 5; + optional string part = 6; +} + +message BodyPartLayerRaw +{ + optional string layer_name = 1; + optional int32 tissue_id = 2; + optional int32 layer_depth = 3; + repeated int32 bp_modifiers = 4; +} + +message BodyPartRaw +{ + optional string token = 1; + optional string category = 2; + optional int32 parent = 3; + repeated bool flags = 4; + repeated BodyPartLayerRaw layers = 5; + optional int32 relsize = 6; +} + +message BpAppearanceModifier +{ + optional string type = 1; + optional int32 mod_min = 2; + optional int32 mod_max = 3; +} + +message TissueRaw +{ + optional string id = 1; + optional string name = 2; + optional MatPair material = 3; + optional string subordinate_to_tissue = 4; +} + +message CasteRaw +{ + optional int32 index = 1; + optional string caste_id = 2; + repeated string caste_name = 3; + repeated string baby_name = 4; + repeated string child_name = 5; + optional int32 gender = 6; + repeated BodyPartRaw body_parts = 7; + optional int32 total_relsize = 8; + repeated BpAppearanceModifier modifiers = 9; + repeated int32 modifier_idx = 10; + repeated int32 part_idx = 11; + repeated int32 layer_idx = 12; + repeated BpAppearanceModifier body_appearance_modifiers = 13; + repeated ColorModifierRaw color_modifiers = 14; + optional string description = 15; + optional int32 adult_size = 16; +} + +message CreatureRaw +{ + optional int32 index = 1; + optional string creature_id = 2; + repeated string name = 3; + repeated string general_baby_name = 4; + repeated string general_child_name = 5; + optional int32 creature_tile = 6; + optional int32 creature_soldier_tile = 7; + optional ColorDefinition color = 8; + optional int32 adultsize = 9; + repeated CasteRaw caste = 10; + repeated TissueRaw tissues = 11; + repeated bool flags = 12; +} + +message CreatureRawList +{ + repeated CreatureRaw creature_raws = 1; +} + +message Army +{ + optional int32 id = 1; + optional int32 pos_x = 2; + optional int32 pos_y = 3; + optional int32 pos_z = 4; + optional UnitDefinition leader = 5; + repeated UnitDefinition members = 6; + optional uint32 flags = 7; +} + +message ArmyList +{ + repeated Army armies = 1; +} + +message GrowthPrint +{ + optional int32 priority = 1; + optional int32 color = 2; + optional int32 timing_start = 3; + optional int32 timing_end = 4; + optional int32 tile = 5; +} + +message TreeGrowth +{ + optional int32 index = 1; + optional string id = 2; + optional string name = 3; + optional MatPair mat = 4; + repeated GrowthPrint prints = 5; + optional int32 timing_start = 6; + optional int32 timing_end = 7; + optional bool twigs = 8; + optional bool light_branches = 9; + optional bool heavy_branches = 10; + optional bool trunk = 11; + optional bool roots = 12; + optional bool cap = 13; + optional bool sapling = 14; + optional int32 trunk_height_start = 15; + optional int32 trunk_height_end = 16; +} + +message PlantRaw +{ + optional int32 index = 1; + optional string id = 2; + optional string name = 3; + repeated TreeGrowth growths = 4; + optional int32 tile = 5; +} + +message PlantRawList +{ + repeated PlantRaw plant_raws = 1; +} + +message ScreenTile +{ + optional uint32 character = 1; + optional uint32 foreground = 2; + optional uint32 background = 3; +} + +message ScreenCapture +{ + optional uint32 width = 1; + optional uint32 height = 2; + repeated ScreenTile tiles = 3; +} + +message KeyboardEvent +{ + optional uint32 type = 1; + optional uint32 which = 2; + optional uint32 state = 3; + optional uint32 scancode = 4; + optional uint32 sym = 5; + optional uint32 mod = 6; + optional uint32 unicode = 7; +} + +message DigCommand +{ + optional TileDigDesignation designation = 1; + repeated Coord locations = 2; +} + +message SingleBool +{ + optional bool Value = 1; +} + +message VersionInfo +{ + optional string dwarf_fortress_version = 1; + optional string dfhack_version = 2; + optional string remote_fortress_reader_version = 3; +} + +message ListRequest +{ + optional int32 list_start = 1; + optional int32 list_end = 2; +} + +message Report +{ + optional int32 type = 1; + optional string text = 2; + optional ColorDefinition color = 3; + optional int32 duration = 4; + optional bool continuation = 5; + optional bool unconscious = 6; + optional bool announcement = 7; + optional int32 repeat_count = 8; + optional Coord pos = 9; + optional int32 id = 10; + optional int32 year = 11; + optional int32 time = 12; +} + +message Status +{ + repeated Report reports = 1; +} + +message ShapeDescriptior +{ + optional string id = 1; + optional int32 tile = 2; +} + +message Language +{ + repeated ShapeDescriptior shapes = 1; +} + +message ItemImprovement +{ + optional MatPair material = 1; + optional int32 shape = 3; + optional int32 specific_type= 4; + optional ArtImage image = 5; + optional int32 type = 6; +} + +enum ArtImageElementType +{ + IMAGE_CREATURE = 0; + IMAGE_PLANT = 1; + IMAGE_TREE = 2; + IMAGE_SHAPE = 3; + IMAGE_ITEM = 4; +} + +message ArtImageElement +{ + optional int32 count = 1; + optional ArtImageElementType type = 2; + optional MatPair creature_item = 3; + optional MatPair material = 5; + optional int32 id = 6; +} + +enum ArtImagePropertyType +{ + TRANSITIVE_VERB = 0; + INTRANSITIVE_VERB = 1; +} + +message ArtImageProperty +{ + optional int32 subject = 1; + optional int32 object = 2; + optional ArtImageVerb verb = 3; + optional ArtImagePropertyType type = 4; +} + +message ArtImage +{ + repeated ArtImageElement elements = 1; + optional MatPair id = 2; + repeated ArtImageProperty properties = 3; +} + +message Engraving +{ + optional Coord pos = 1; + optional int32 quality = 2; + optional int32 tile = 3; + optional ArtImage image = 4; + optional bool floor = 5; + optional bool west = 6; + optional bool east = 7; + optional bool north = 8; + optional bool south = 9; + optional bool hidden = 10; + optional bool northwest = 11; + optional bool northeast = 12; + optional bool southwest = 13; + optional bool southeast = 14; +} + +enum ArtImageVerb +{ + VERB_WITHERING = 0; + VERB_SURROUNDEDBY = 1; + VERB_MASSACRING = 2; + VERB_FIGHTING = 3; + VERB_LABORING = 4; + VERB_GREETING = 5; + VERB_REFUSING = 6; + VERB_SPEAKING = 7; + VERB_EMBRACING = 8; + VERB_STRIKINGDOWN = 9; + VERB_MENACINGPOSE = 10; + VERB_TRAVELING = 11; + VERB_RAISING = 12; + VERB_HIDING = 13; + VERB_LOOKINGCONFUSED = 14; + VERB_LOOKINGTERRIFIED = 15; + VERB_DEVOURING = 16; + VERB_ADMIRING = 17; + VERB_BURNING = 18; + VERB_WEEPING = 19; + VERB_LOOKINGDEJECTED = 20; + VERB_CRINGING = 21; + VERB_SCREAMING = 22; + VERB_SUBMISSIVEGESTURE = 23; + VERB_FETALPOSITION = 24; + VERB_SMEAREDINTOSPIRAL = 25; + VERB_FALLING = 26; + VERB_DEAD = 27; + VERB_LAUGHING = 28; + VERB_LOOKINGOFFENDED = 29; + VERB_BEINGSHOT = 30; + VERB_PLAINTIVEGESTURE = 31; + VERB_MELTING = 32; + VERB_SHOOTING = 33; + VERB_TORTURING = 34; + VERB_COMMITTINGDEPRAVEDACT = 35; + VERB_PRAYING = 36; + VERB_CONTEMPLATING = 37; + VERB_COOKING = 38; + VERB_ENGRAVING = 39; + VERB_PROSTRATING = 40; + VERB_SUFFERING = 41; + VERB_BEINGIMPALED = 42; + VERB_BEINGCONTORTED = 43; + VERB_BEINGFLAYED = 44; + VERB_HANGINGFROM = 45; + VERB_BEINGMUTILATED = 46; + VERB_TRIUMPHANTPOSE = 47; +} + +enum FlowType +{ + Miasma = 0; + Steam = 1; + Mist = 2; + MaterialDust = 3; + MagmaMist = 4; + Smoke = 5; + Dragonfire = 6; + Fire = 7; + Web = 8; + MaterialGas = 9; + MaterialVapor = 10; + OceanWave = 11; + SeaFoam = 12; + ItemCloud = 13; + CampFire = -1; +} + +message FlowInfo +{ + optional int32 index = 1; + optional FlowType type = 2; + optional int32 density = 3; + optional Coord pos = 4; + optional Coord dest = 5; + optional bool expanding = 6; + optional bool reuse = 7 [deprecated=true]; + optional int32 guide_id = 8; + optional MatPair material = 9; + optional MatPair item = 10; + optional bool dead = 11; + optional bool fast = 12; + optional bool creeping = 13; +} + +message Wave +{ + optional Coord dest = 1; + optional Coord pos = 2; +} diff --git a/proto/51.13-r1/stockpiles.proto b/proto/51.13-r1/stockpiles.proto new file mode 100644 index 0000000..681e7d9 --- /dev/null +++ b/proto/51.13-r1/stockpiles.proto @@ -0,0 +1,190 @@ +syntax = "proto2"; + +package dfstockpiles; + +option optimize_for = LITE_RUNTIME; + +message StockpileSettings { + + message AnimalsSet { + optional bool all = 4; + optional bool empty_cages = 1; + optional bool empty_traps = 2; + repeated string enabled = 3; + } + + message FoodSet { + optional bool all = 21; + repeated string meat = 1; + repeated string fish = 2; + repeated string unprepared_fish = 20; + repeated string egg = 3 ; + repeated string plants = 4 ; + repeated string drink_plant = 5 ; + repeated string drink_animal = 6 ; + repeated string cheese_plant = 7 ; + repeated string cheese_animal = 8 ; + repeated string seeds = 9 ; + repeated string leaves = 10 ; + repeated string powder_plant = 11 ; + repeated string powder_creature = 12 ; + repeated string glob = 13; + repeated string glob_paste = 14 ; + repeated string glob_pressed = 15 ; + repeated string liquid_plant = 16 ; + repeated string liquid_animal = 17; + repeated string liquid_misc = 18; + optional bool prepared_meals = 19; + } + + message FurnitureSet { + optional bool all = 7; + repeated string type = 1; + repeated string other_mats = 2; + repeated string mats = 3; + repeated string quality_core = 4; + repeated string quality_total = 5; + // UNUSED: optional bool sand_bags = 6; + } + message RefuseSet { + optional bool all = 12; + repeated string type = 1; + repeated string corpses = 2; + repeated string body_parts = 3; + repeated string skulls = 4; + repeated string bones = 5; + repeated string hair = 6; + repeated string shells = 7; + repeated string teeth= 8; + repeated string horns = 9; + optional bool fresh_raw_hide = 10; + optional bool rotten_raw_hide = 11; + } + message StoneSet { + optional bool all = 2; + repeated string mats = 1; + } + message OreSet { + repeated string mats = 1; + } + message AmmoSet { + optional bool all = 6; + repeated string type = 1; + repeated string other_mats = 2; + repeated string mats = 3; + repeated string quality_core = 4; + repeated string quality_total = 5; + } + message CoinSet { + optional bool all = 2; + repeated string mats = 1; + } + message BarsBlocksSet { + optional bool all = 5; + repeated string bars_other_mats = 1; + repeated string blocks_other_mats = 2; + repeated string bars_mats = 3; + repeated string blocks_mats = 4; + } + message GemsSet { + optional bool all = 5; + repeated string rough_other_mats = 1; + repeated string cut_other_mats = 2; + repeated string rough_mats = 3; + repeated string cut_mats = 4; + } + message FinishedGoodsSet { + optional bool all = 6; + repeated string type = 1; + repeated string other_mats = 2; + repeated string mats = 3; + repeated string quality_core = 4; + repeated string quality_total = 5; + } + message LeatherSet { + optional bool all = 2; + repeated string mats = 1; + } + message ClothSet { + optional bool all = 9; + repeated string thread_silk = 1; + repeated string thread_plant = 2; + repeated string thread_yarn = 3; + repeated string thread_metal = 4; + repeated string cloth_silk = 5; + repeated string cloth_plant = 6; + repeated string cloth_yarn = 7; + repeated string cloth_metal = 8; + } + message WoodSet { + optional bool all = 2; + repeated string mats = 1; + } + message WeaponsSet { + optional bool all = 9; + repeated string weapon_type = 1; + repeated string trapcomp_type = 2; + repeated string other_mats = 3; + repeated string mats = 4; + repeated string quality_core = 5; + repeated string quality_total = 6; + optional bool usable = 7; + optional bool unusable = 8; + } + message ArmorSet { + optional bool all = 13; + repeated string body = 1; + repeated string head = 2; + repeated string feet = 3; + repeated string hands = 4; + repeated string legs = 5; + repeated string shield = 6; + repeated string other_mats = 7; + repeated string mats = 8; + repeated string quality_core = 9; + repeated string quality_total = 10; + optional bool usable = 11; + optional bool unusable = 12; + } + message CorpsesSet { + optional bool all = 1; + repeated string corpses = 2; + } + message SheetSet { + optional bool all = 1; + repeated string paper = 2; + repeated string parchment = 3; + } + + // general settings + optional int32 max_barrels = 20; + optional int32 max_bins = 21; + optional int32 max_wheelbarrows = 22; + optional bool use_links_only = 23; + optional bool allow_organic = 18; + optional bool allow_inorganic = 19; + + // categories + optional AmmoSet ammo = 8; + optional AnimalsSet animals = 1; + optional ArmorSet armor = 17; + optional BarsBlocksSet barsblocks = 10; + optional ClothSet cloth = 14; + optional CoinSet coin = 9; + optional FinishedGoodsSet finished_goods = 12; + optional FoodSet food = 2; + optional FurnitureSet furniture = 3; + optional GemsSet gems = 11; + optional LeatherSet leather = 13; + optional CorpsesSet corpses_v50 = 25; + optional RefuseSet refuse = 5; + optional SheetSet sheet = 26; + optional StoneSet stone = 6; + optional WeaponsSet weapons = 16; + optional WoodSet wood = 15; + + // deprecated + optional bool corpses = 24; // not marked as deprecated since we still read it + optional OreSet ore = 7 [deprecated=true]; + optional int32 unknown1 = 4 [deprecated=true]; +} diff --git a/proto/51.13-r1/ui_sidebar_mode.proto b/proto/51.13-r1/ui_sidebar_mode.proto new file mode 100644 index 0000000..df81d6b --- /dev/null +++ b/proto/51.13-r1/ui_sidebar_mode.proto @@ -0,0 +1,65 @@ +syntax = "proto2"; + +//Attempts to provide a complete framework for reading everything from a fortress needed for vizualization +package proto.enums.ui_sidebar_mode; + +option optimize_for = LITE_RUNTIME; + +enum ui_sidebar_mode +{ + Default = 0; + Squads = 1; + DesignateMine = 2; + DesignateRemoveRamps = 3; + DesignateUpStair = 4; + DesignateDownStair = 5; + DesignateUpDownStair = 6; + DesignateUpRamp = 7; + DesignateChannel = 8; + DesignateGatherPlants = 9; + DesignateRemoveDesignation = 10; + DesignateSmooth = 11; + DesignateCarveTrack = 12; + DesignateEngrave = 13; + DesignateCarveFortification = 14; + Stockpiles = 15; + Build = 16; + QueryBuilding = 17; + Orders = 18; + OrdersForbid = 19; + OrdersRefuse = 20; + OrdersWorkshop = 21; + OrdersZone = 22; + BuildingItems = 23; + ViewUnits = 24; + LookAround = 25; + DesignateItemsClaim = 26; + DesignateItemsForbid = 27; + DesignateItemsMelt = 28; + DesignateItemsUnmelt = 29; + DesignateItemsDump = 30; + DesignateItemsUndump = 31; + DesignateItemsHide = 32; + DesignateItemsUnhide = 33; + DesignateChopTrees = 34; + DesignateToggleEngravings = 35; + DesignateToggleMarker = 36; + Hotkeys = 37; + DesignateTrafficHigh = 38; + DesignateTrafficNormal = 39; + DesignateTrafficLow = 40; + DesignateTrafficRestricted = 41; + Zones = 42; + ZonesPenInfo = 43; + ZonesPitInfo = 44; + ZonesHospitalInfo = 45; + ZonesGatherInfo = 46; + DesignateRemoveConstruction = 47; + DepotAccess = 48; + NotesPoints = 49; + NotesRoutes = 50; + Burrows = 51; + Hauling = 52; + ArenaWeather = 53; + ArenaTrees = 54; +} diff --git a/proto/README.md b/proto/README.md new file mode 100644 index 0000000..b19a813 --- /dev/null +++ b/proto/README.md @@ -0,0 +1,4 @@ +# DFHack Proto Files + +The `.proto` files in this directory are sourced from the DFHack GitHub repository and are subject to the terms of their license. For more information, please see: +https://github.com/DFHack/dfhack/blob/develop/LICENSE.rst diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1f4ef0c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,14 @@ +[project] +name = "dfhack_client_python" +version = "0.1.0" +description = "A python library for interacting with the DFHack through its custom RPC protocol." +readme = "README.md" +requires-python = ">=3.12" +dependencies = [ + "protobuf>=6.31.1", + "requests>=2.32.4", +] + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" diff --git a/scripts/fetch_proto_files.py b/scripts/fetch_proto_files.py new file mode 100644 index 0000000..e310b6f --- /dev/null +++ b/scripts/fetch_proto_files.py @@ -0,0 +1,99 @@ +#!/usr/bin/env python3 +import shutil +import time +from pathlib import Path +import argparse +import requests + +# Configuration +OWNER = "DFHack" +REPO = "dfhack" +API_BASE_URL = f"https://api.github.com/repos/{OWNER}/{REPO}" +SCRIPT_DIR = Path(__file__).parent +OUTPUT_DIR = str(SCRIPT_DIR / ".." / "proto") + +def get_api_json(url: str) -> dict | list | None: + """Makes a GET request to the GitHub API, handles rate limiting, and returns the JSON response.""" + try: + response = requests.get(url, timeout=10) + if response.status_code == 403 and 'rate limit' in response.text.lower(): + print("GitHub API rate limit exceeded. Waiting for 10 seconds...") + time.sleep(10) + return get_api_json(url) + + response.raise_for_status() + return response.json() + except requests.exceptions.RequestException as e: + print(f"Error fetching API endpoint {url}: {e}") + return None + +def download_file(download_url: str, local_path: Path): + """Downloads a file from a URL and saves it to a local path.""" + try: + with requests.get(download_url, stream=True, timeout=10) as r: + r.raise_for_status() + with open(local_path, 'wb') as f: + for chunk in r.iter_content(chunk_size=8192): + f.write(chunk) + print(f" Downloaded {local_path.name}") + except requests.exceptions.RequestException as e: + print(f"Error downloading file {download_url}: {e}") + +def fetch_proto_files_from_path(base_path: str, tag: str, output_dir: Path): + """Finds and downloads all .proto files from a given path in the repo.""" + print(f"\nChecking path: {base_path}") + contents_url = f"{API_BASE_URL}/contents/{base_path}?ref={tag}" + items = get_api_json(contents_url) + + if not items or not isinstance(items, list): + print(" -> Path not found or is not a directory.") + return + + for item in items: + if item['type'] == 'file' and Path(item['path']).suffix == '.proto': + local_save_path = output_dir / item['name'] + download_file(item['download_url'], local_save_path) + +def main(): + """Main function to parse arguments and orchestrate the download process.""" + parser = argparse.ArgumentParser( + description="Fetch all .proto files from a specific DFHack git tag." + ) + parser.add_argument( + "--tag", + required=True, + help="The DFHack git tag to pull .proto files from (e.g., '51.13-r1')." + ) + tag = parser.parse_args().tag + + output_dir = Path(f"{OUTPUT_DIR}/{tag}") + + print(f"Preparing output directory: {output_dir.resolve()}") + if output_dir.exists(): + shutil.rmtree(output_dir) + output_dir.mkdir(parents=True) + + # 1. Fetch from the core library + fetch_proto_files_from_path("library/proto", tag, output_dir) + + # 2. Discover and fetch from all plugins + print("\nDiscovering plugins with .proto files...") + plugins_url = f"{API_BASE_URL}/contents/plugins?ref={tag}" + plugins = get_api_json(plugins_url) + + if plugins and isinstance(plugins, list): + for plugin in plugins: + if plugin['type'] == 'dir': + plugin_proto_path = f"{plugin['path']}/proto" + proto_check_url = f"{API_BASE_URL}/contents/{plugin_proto_path}?ref={tag}" + + proto_contents = get_api_json(proto_check_url) + if proto_contents and isinstance(proto_contents, list): + fetch_proto_files_from_path(plugin_proto_path, tag, output_dir) + else: + print(f"No plugins found for tag '{tag}'") + + print(f"\n✅ Done. All .proto files for tag '{tag}' have been downloaded to {output_dir.resolve()}") + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/scripts/generate_python.py b/scripts/generate_python.py new file mode 100644 index 0000000..6c4c2c1 --- /dev/null +++ b/scripts/generate_python.py @@ -0,0 +1,71 @@ +#!/usr/bin/env python3 +""" +Script to generate Python protobuf code using cmake and make. +This script runs the cmake and make commands inside the /cmake directory. +It requires a DFHack git tag (e.g. 51.13-r1) to be passed as an argument. +""" + +import argparse +import subprocess +import sys +import platform +import shutil +from pathlib import Path + +def check_dependencies(): + """Check if required tools are installed and accessible.""" + required_tools = ["cmake", "make", "protoc"] + missing_tools = [] + + for tool in required_tools: + if shutil.which(tool) is None: + missing_tools.append(tool) + + if missing_tools: + print(f"Error: Missing required tools: {', '.join(missing_tools)}") + print("Please install the missing tools and ensure they are in your PATH.") + return False + + return True + +def generate_windows(tag, cmake_dir): + """Generate protobuf code on Windows using MinGW Makefiles.""" + subprocess.run([ + "cmake", "-G", "MinGW Makefiles", f"-DTAG={tag}", "." + ], cwd=cmake_dir, check=True) + + subprocess.run(["make"], cwd=cmake_dir, check=True) + +def generate_linux(tag, cmake_dir): + """Generate protobuf code on Linux using Unix Makefiles.""" + subprocess.run([ + "cmake", "-G", "Unix Makefiles", f"-DTAG={tag}", "." + ], cwd=cmake_dir, check=True) + + subprocess.run(["make"], cwd=cmake_dir, check=True) + +def main(): + """Main entry point for the script.""" + parser = argparse.ArgumentParser( + description="Generate Python protobuf code" + ) + parser.add_argument( + "--tag", + required=True, + help="The DFHack git tag to use. the .proto files must already be in the ./proto/ directory. (e.g., '51.13-r1')." + ) + tag = parser.parse_args().tag + + if not check_dependencies(): + sys.exit(1) + + project_root = Path(__file__).parent.parent + cmake_dir = project_root / "cmake" + + if platform.system() == "Windows": + generate_windows(tag, cmake_dir) + else: + generate_linux(tag, cmake_dir) + +if __name__ == "__main__": + main() diff --git a/src/dfhack_client_python/__init__.py b/src/dfhack_client_python/__init__.py new file mode 100644 index 0000000..8ef61ab --- /dev/null +++ b/src/dfhack_client_python/__init__.py @@ -0,0 +1,5 @@ +import sys +import os + +# Add the generated protobuf files to the path +sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'py_export')) diff --git a/dfhack_remote.py b/src/dfhack_client_python/dfhack_remote.py similarity index 92% rename from dfhack_remote.py rename to src/dfhack_client_python/dfhack_remote.py index a1627aa..3b5ffd8 100644 --- a/dfhack_remote.py +++ b/src/dfhack_client_python/dfhack_remote.py @@ -1,11 +1,9 @@ -import os, sys +import sys import asyncio import functools from enum import IntEnum -sys.path.append('./py_export/'); -import py_export.CoreProtocol_pb2 as CoreProtocol_pb2 -from py_export.CoreProtocol_pb2 import EmptyMessage, StringMessage +from .py_export.CoreProtocol_pb2 import EmptyMessage, StringMessage, CoreBindReply, CoreBindRequest, CoreTextNotification _reader, _writer = None, None @@ -33,11 +31,11 @@ def request(id, msg): def unmarshal(id, msg): if id == DFHackReplyCode.RPC_REPLY_RESULT: - obj = CoreProtocol_pb2.CoreBindReply() + obj = CoreBindReply() obj.ParseFromString(msg) return obj.assigned_id elif id == DFHackReplyCode.RPC_REPLY_TEXT: - obj = CoreProtocol_pb2.CoreTextNotification() + obj = CoreTextNotification() obj.ParseFromString(msg) raise Exception(obj) # TODO others @@ -46,7 +44,7 @@ def unmarshal(id, msg): async def BindMethod(method, input_msg, output_msg, plugin=''): """Issue a CoreBindRequest to DFHack and caches the returned identifier number """ - br = CoreProtocol_pb2.CoreBindRequest() + br = CoreBindRequest() br.method, br.input_msg, br.output_msg, br.plugin = \ method, input_msg.DESCRIPTOR.full_name, output_msg.DESCRIPTOR.full_name, plugin _writer.write( request(0, br) ) diff --git a/src/dfhack_client_python/py_export/AdventureControl_pb2.py b/src/dfhack_client_python/py_export/AdventureControl_pb2.py new file mode 100644 index 0000000..8c5d03a --- /dev/null +++ b/src/dfhack_client_python/py_export/AdventureControl_pb2.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: AdventureControl.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'AdventureControl.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import RemoteFortressReader_pb2 as RemoteFortressReader__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16\x41\x64ventureControl.proto\x12\x10\x41\x64ventureControl\x1a\x1aRemoteFortressReader.proto\"C\n\x11MoveCommandParams\x12.\n\tdirection\x18\x01 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\"\xd1\x01\n\x0eMovementOption\x12)\n\x04\x64\x65st\x18\x01 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12+\n\x06source\x18\x02 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12)\n\x04grab\x18\x03 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12<\n\rmovement_type\x18\x04 \x01(\x0e\x32%.AdventureControl.CarefulMovementType\"x\n\x0cMenuContents\x12\x33\n\x0c\x63urrent_menu\x18\x01 \x01(\x0e\x32\x1d.AdventureControl.AdvmodeMenu\x12\x33\n\tmovements\x18\x02 \x03(\x0b\x32 .AdventureControl.MovementOption\">\n\x0eMiscMoveParams\x12,\n\x04type\x18\x01 \x01(\x0e\x32\x1e.AdventureControl.MiscMoveType*\xc7\x05\n\x0b\x41\x64vmodeMenu\x12\x0b\n\x07\x44\x65\x66\x61ult\x10\x00\x12\x08\n\x04Look\x10\x01\x12\x17\n\x13\x43onversationAddress\x10\x02\x12\x16\n\x12\x43onversationSelect\x10\x03\x12\x15\n\x11\x43onversationSpeak\x10\x04\x12\r\n\tInventory\x10\x05\x12\x08\n\x04\x44rop\x10\x06\x12\r\n\tThrowItem\x10\x07\x12\x08\n\x04Wear\x10\x08\x12\n\n\x06Remove\x10\t\x12\x0c\n\x08Interact\x10\n\x12\x07\n\x03Put\x10\x0b\x12\x10\n\x0cPutContainer\x10\x0c\x12\x07\n\x03\x45\x61t\x10\r\x12\x0c\n\x08ThrowAim\x10\x0e\x12\x08\n\x04\x46ire\x10\x0f\x12\x07\n\x03Get\x10\x10\x12\t\n\x05Unk17\x10\x11\x12\x0f\n\x0b\x43ombatPrefs\x10\x12\x12\x0e\n\nCompanions\x10\x13\x12\x11\n\rMovementPrefs\x10\x14\x12\x0e\n\nSpeedPrefs\x10\x15\x12\x12\n\x0eInteractAction\x10\x16\x12\x11\n\rMoveCarefully\x10\x17\x12\x11\n\rAnnouncements\x10\x18\x12\x0f\n\x0bUseBuilding\x10\x19\x12\n\n\x06Travel\x10\x1a\x12\t\n\x05Unk27\x10\x1b\x12\t\n\x05Unk28\x10\x1c\x12\x10\n\x0cSleepConfirm\x10\x1d\x12\x1b\n\x17SelectInteractionTarget\x10\x1e\x12\t\n\x05Unk31\x10\x1f\x12\t\n\x05Unk32\x10 \x12\x0e\n\nFallAction\x10!\x12\x0e\n\nViewTracks\x10\"\x12\x08\n\x04Jump\x10#\x12\t\n\x05Unk36\x10$\x12\x11\n\rAttackConfirm\x10%\x12\x0e\n\nAttackType\x10&\x12\x12\n\x0e\x41ttackBodypart\x10\'\x12\x10\n\x0c\x41ttackStrike\x10(\x12\t\n\x05Unk41\x10)\x12\t\n\x05Unk42\x10*\x12\x12\n\x0e\x44odgeDirection\x10+\x12\t\n\x05Unk44\x10,\x12\t\n\x05Unk45\x10-\x12\t\n\x05\x42uild\x10.*\x94\x02\n\x13\x43\x61refulMovementType\x12\x14\n\x10\x44\x45\x46\x41ULT_MOVEMENT\x10\x00\x12\x15\n\x11RELEASE_ITEM_HOLD\x10\x01\x12\x15\n\x11RELEASE_TILE_HOLD\x10\x02\x12\x13\n\x0f\x41TTACK_CREATURE\x10\x03\x12\r\n\tHOLD_TILE\x10\x04\x12\x08\n\x04MOVE\x10\x05\x12\t\n\x05\x43LIMB\x10\x06\x12\r\n\tHOLD_ITEM\x10\x07\x12\x15\n\x11\x42UILDING_INTERACT\x10\x08\x12\x11\n\rITEM_INTERACT\x10\t\x12\x17\n\x13ITEM_INTERACT_GUIDE\x10\n\x12\x16\n\x12ITEM_INTERACT_RIDE\x10\x0b\x12\x16\n\x12ITEM_INTERACT_PUSH\x10\x0c*<\n\x0cMiscMoveType\x12\r\n\tSET_CLIMB\x10\x00\x12\r\n\tSET_STAND\x10\x01\x12\x0e\n\nSET_CANCEL\x10\x02\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'AdventureControl_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_ADVMODEMENU']._serialized_start=540 + _globals['_ADVMODEMENU']._serialized_end=1251 + _globals['_CAREFULMOVEMENTTYPE']._serialized_start=1254 + _globals['_CAREFULMOVEMENTTYPE']._serialized_end=1530 + _globals['_MISCMOVETYPE']._serialized_start=1532 + _globals['_MISCMOVETYPE']._serialized_end=1592 + _globals['_MOVECOMMANDPARAMS']._serialized_start=72 + _globals['_MOVECOMMANDPARAMS']._serialized_end=139 + _globals['_MOVEMENTOPTION']._serialized_start=142 + _globals['_MOVEMENTOPTION']._serialized_end=351 + _globals['_MENUCONTENTS']._serialized_start=353 + _globals['_MENUCONTENTS']._serialized_end=473 + _globals['_MISCMOVEPARAMS']._serialized_start=475 + _globals['_MISCMOVEPARAMS']._serialized_end=537 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/BasicApi_pb2.py b/src/dfhack_client_python/py_export/BasicApi_pb2.py new file mode 100644 index 0000000..a3562d0 --- /dev/null +++ b/src/dfhack_client_python/py_export/BasicApi_pb2.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: BasicApi.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'BasicApi.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import Basic_pb2 as Basic__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0e\x42\x61sicApi.proto\x12\x07\x64\x66proto\x1a\x0b\x42\x61sic.proto\"\xcb\x02\n\x0fGetWorldInfoOut\x12+\n\x04mode\x18\x01 \x02(\x0e\x32\x1d.dfproto.GetWorldInfoOut.Mode\x12\x10\n\x08save_dir\x18\x02 \x02(\t\x12%\n\nworld_name\x18\x03 \x01(\x0b\x32\x11.dfproto.NameInfo\x12\x0e\n\x06\x63iv_id\x18\x04 \x01(\x05\x12\x0f\n\x07site_id\x18\x05 \x01(\x05\x12\x10\n\x08group_id\x18\x06 \x01(\x05\x12\x0f\n\x07race_id\x18\x07 \x01(\x05\x12\x16\n\x0eplayer_unit_id\x18\x08 \x01(\x05\x12\x19\n\x11player_histfig_id\x18\t \x01(\x05\x12\x1d\n\x15\x63ompanion_histfig_ids\x18\n \x03(\x05\"<\n\x04Mode\x12\x0e\n\nMODE_DWARF\x10\x01\x12\x12\n\x0eMODE_ADVENTURE\x10\x02\x12\x10\n\x0cMODE_LEGENDS\x10\x03\"\x86\x04\n\x0cListEnumsOut\x12-\n\x0ematerial_flags\x18\x01 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12.\n\x0finorganic_flags\x18\x02 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12*\n\x0bunit_flags1\x18\x03 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12*\n\x0bunit_flags2\x18\x04 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12*\n\x0bunit_flags3\x18\x05 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12)\n\nunit_labor\x18\x06 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12(\n\tjob_skill\x18\x07 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12\x30\n\x11\x63ie_add_tag_mask1\x18\x08 \x03(\x0b\x32\x15.dfproto.EnumItemName\x12\x30\n\x11\x63ie_add_tag_mask2\x18\t \x03(\x0b\x32\x15.dfproto.EnumItemName\x12/\n\x10\x64\x65\x61th_info_flags\x18\n \x03(\x0b\x32\x15.dfproto.EnumItemName\x12)\n\nprofession\x18\x0b \x03(\x0b\x32\x15.dfproto.EnumItemName\"\x8c\x01\n\x10ListJobSkillsOut\x12$\n\x05skill\x18\x01 \x03(\x0b\x32\x15.dfproto.JobSkillAttr\x12+\n\nprofession\x18\x02 \x03(\x0b\x32\x17.dfproto.ProfessionAttr\x12%\n\x05labor\x18\x03 \x03(\x0b\x32\x16.dfproto.UnitLaborAttr\"\xb1\x01\n\x0fListMaterialsIn\x12,\n\x04mask\x18\x01 \x01(\x0b\x32\x1e.dfproto.BasicMaterialInfoMask\x12)\n\x07id_list\x18\x02 \x03(\x0b\x32\x18.dfproto.BasicMaterialId\x12\x0f\n\x07\x62uiltin\x18\x03 \x01(\x08\x12\x11\n\tinorganic\x18\x04 \x01(\x08\x12\x11\n\tcreatures\x18\x05 \x01(\x08\x12\x0e\n\x06plants\x18\x06 \x01(\x08\"=\n\x10ListMaterialsOut\x12)\n\x05value\x18\x01 \x03(\x0b\x32\x1a.dfproto.BasicMaterialInfo\"\xa3\x01\n\x0bListUnitsIn\x12(\n\x04mask\x18\x01 \x01(\x0b\x32\x1a.dfproto.BasicUnitInfoMask\x12\x0f\n\x07id_list\x18\x02 \x03(\x05\x12\x10\n\x08scan_all\x18\x05 \x01(\x08\x12\x0c\n\x04race\x18\x03 \x01(\x05\x12\x0e\n\x06\x63iv_id\x18\x04 \x01(\x05\x12\x0c\n\x04\x64\x65\x61\x64\x18\x06 \x01(\x08\x12\r\n\x05\x61live\x18\x07 \x01(\x08\x12\x0c\n\x04sane\x18\x08 \x01(\x08\"5\n\x0cListUnitsOut\x12%\n\x05value\x18\x01 \x03(\x0b\x32\x16.dfproto.BasicUnitInfo\"\x0e\n\x0cListSquadsIn\"7\n\rListSquadsOut\x12&\n\x05value\x18\x01 \x03(\x0b\x32\x17.dfproto.BasicSquadInfo\":\n\x0fSetUnitLaborsIn\x12\'\n\x06\x63hange\x18\x01 \x03(\x0b\x32\x17.dfproto.UnitLaborStateB\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'BasicApi_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_GETWORLDINFOOUT']._serialized_start=41 + _globals['_GETWORLDINFOOUT']._serialized_end=372 + _globals['_GETWORLDINFOOUT_MODE']._serialized_start=312 + _globals['_GETWORLDINFOOUT_MODE']._serialized_end=372 + _globals['_LISTENUMSOUT']._serialized_start=375 + _globals['_LISTENUMSOUT']._serialized_end=893 + _globals['_LISTJOBSKILLSOUT']._serialized_start=896 + _globals['_LISTJOBSKILLSOUT']._serialized_end=1036 + _globals['_LISTMATERIALSIN']._serialized_start=1039 + _globals['_LISTMATERIALSIN']._serialized_end=1216 + _globals['_LISTMATERIALSOUT']._serialized_start=1218 + _globals['_LISTMATERIALSOUT']._serialized_end=1279 + _globals['_LISTUNITSIN']._serialized_start=1282 + _globals['_LISTUNITSIN']._serialized_end=1445 + _globals['_LISTUNITSOUT']._serialized_start=1447 + _globals['_LISTUNITSOUT']._serialized_end=1500 + _globals['_LISTSQUADSIN']._serialized_start=1502 + _globals['_LISTSQUADSIN']._serialized_end=1516 + _globals['_LISTSQUADSOUT']._serialized_start=1518 + _globals['_LISTSQUADSOUT']._serialized_end=1573 + _globals['_SETUNITLABORSIN']._serialized_start=1575 + _globals['_SETUNITLABORSIN']._serialized_end=1633 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/Basic_pb2.py b/src/dfhack_client_python/py_export/Basic_pb2.py new file mode 100644 index 0000000..c946f11 --- /dev/null +++ b/src/dfhack_client_python/py_export/Basic_pb2.py @@ -0,0 +1,71 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: Basic.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'Basic.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0b\x42\x61sic.proto\x12\x07\x64\x66proto\"@\n\x0c\x45numItemName\x12\r\n\x05value\x18\x01 \x02(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x13\n\x08\x62it_size\x18\x03 \x01(\x05:\x01\x31\".\n\x0f\x42\x61sicMaterialId\x12\x0c\n\x04type\x18\x01 \x02(\x05\x12\r\n\x05index\x18\x02 \x02(\x11\"\xa0\x03\n\x11\x42\x61sicMaterialInfo\x12\x0c\n\x04type\x18\x01 \x02(\x05\x12\r\n\x05index\x18\x02 \x02(\x11\x12\r\n\x05token\x18\x03 \x02(\t\x12\r\n\x05\x66lags\x18\x04 \x03(\x05\x12\x13\n\x07subtype\x18\x05 \x01(\x05:\x02-1\x12\x17\n\x0b\x63reature_id\x18\x06 \x01(\x05:\x02-1\x12\x14\n\x08plant_id\x18\x07 \x01(\x05:\x02-1\x12\x16\n\nhistfig_id\x18\x08 \x01(\x05:\x02-1\x12\x15\n\x0bname_prefix\x18\t \x01(\t:\x00\x12\x13\n\x0bstate_color\x18\n \x03(\x07\x12\x12\n\nstate_name\x18\x0b \x03(\t\x12\x11\n\tstate_adj\x18\x0c \x03(\t\x12\x16\n\x0ereaction_class\x18\r \x03(\t\x12<\n\x10reaction_product\x18\x0e \x03(\x0b\x32\".dfproto.BasicMaterialInfo.Product\x12\x17\n\x0finorganic_flags\x18\x0f \x03(\x05\x1a\x32\n\x07Product\x12\n\n\x02id\x18\x01 \x02(\t\x12\x0c\n\x04type\x18\x02 \x02(\x05\x12\r\n\x05index\x18\x03 \x02(\x11\"\xed\x01\n\x15\x42\x61sicMaterialInfoMask\x12\x38\n\x06states\x18\x01 \x03(\x0e\x32(.dfproto.BasicMaterialInfoMask.StateType\x12\x1a\n\x0btemperature\x18\x04 \x01(\x05:\x05\x31\x30\x30\x31\x35\x12\x14\n\x05\x66lags\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x17\n\x08reaction\x18\x03 \x01(\x08:\x05\x66\x61lse\"O\n\tStateType\x12\t\n\x05Solid\x10\x00\x12\n\n\x06Liquid\x10\x01\x12\x07\n\x03Gas\x10\x02\x12\n\n\x06Powder\x10\x03\x12\t\n\x05Paste\x10\x04\x12\x0b\n\x07Pressed\x10\x05\"\x7f\n\x0cJobSkillAttr\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0b\n\x03key\x18\x02 \x02(\t\x12\x0f\n\x07\x63\x61ption\x18\x03 \x01(\t\x12\x14\n\x0c\x63\x61ption_noun\x18\x04 \x01(\t\x12\x12\n\nprofession\x18\x05 \x01(\x05\x12\r\n\x05labor\x18\x06 \x01(\x05\x12\x0c\n\x04type\x18\x07 \x01(\t\"v\n\x0eProfessionAttr\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0b\n\x03key\x18\x02 \x02(\t\x12\x0f\n\x07\x63\x61ption\x18\x03 \x01(\t\x12\x10\n\x08military\x18\x04 \x01(\x08\x12\x18\n\x10\x63\x61n_assign_labor\x18\x05 \x01(\x08\x12\x0e\n\x06parent\x18\x06 \x01(\x05\"9\n\rUnitLaborAttr\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0b\n\x03key\x18\x02 \x02(\t\x12\x0f\n\x07\x63\x61ption\x18\x03 \x01(\t\"r\n\x08NameInfo\x12\x12\n\nfirst_name\x18\x01 \x01(\t\x12\x10\n\x08nickname\x18\x02 \x01(\t\x12\x17\n\x0blanguage_id\x18\x03 \x01(\x05:\x02-1\x12\x11\n\tlast_name\x18\x04 \x01(\t\x12\x14\n\x0c\x65nglish_name\x18\x05 \x01(\t\"?\n\nNameTriple\x12\x0e\n\x06normal\x18\x01 \x02(\t\x12\x0e\n\x06plural\x18\x02 \x01(\t\x12\x11\n\tadjective\x18\x03 \x01(\t\"~\n\rUnitCurseInfo\x12\x11\n\tadd_tags1\x18\x01 \x02(\x07\x12\x11\n\trem_tags1\x18\x02 \x02(\x07\x12\x11\n\tadd_tags2\x18\x03 \x02(\x07\x12\x11\n\trem_tags2\x18\x04 \x02(\x07\x12!\n\x04name\x18\x05 \x01(\x0b\x32\x13.dfproto.NameTriple\":\n\tSkillInfo\x12\n\n\x02id\x18\x01 \x02(\x05\x12\r\n\x05level\x18\x02 \x02(\x05\x12\x12\n\nexperience\x18\x03 \x02(\x05\"*\n\rUnitMiscTrait\x12\n\n\x02id\x18\x01 \x02(\x05\x12\r\n\x05value\x18\x02 \x02(\x05\"\xa4\x04\n\rBasicUnitInfo\x12\x0f\n\x07unit_id\x18\x01 \x02(\x05\x12\r\n\x05pos_x\x18\r \x02(\x05\x12\r\n\x05pos_y\x18\x0e \x02(\x05\x12\r\n\x05pos_z\x18\x0f \x02(\x05\x12\x1f\n\x04name\x18\x02 \x01(\x0b\x32\x11.dfproto.NameInfo\x12\x0e\n\x06\x66lags1\x18\x03 \x02(\x07\x12\x0e\n\x06\x66lags2\x18\x04 \x02(\x07\x12\x0e\n\x06\x66lags3\x18\x05 \x02(\x07\x12\x0c\n\x04race\x18\x06 \x02(\x05\x12\r\n\x05\x63\x61ste\x18\x07 \x02(\x05\x12\x12\n\x06gender\x18\x08 \x01(\x05:\x02-1\x12\x12\n\x06\x63iv_id\x18\t \x01(\x05:\x02-1\x12\x16\n\nhistfig_id\x18\n \x01(\x05:\x02-1\x12\x14\n\x08\x64\x65\x61th_id\x18\x11 \x01(\x05:\x02-1\x12\x13\n\x0b\x64\x65\x61th_flags\x18\x12 \x01(\r\x12\x14\n\x08squad_id\x18\x13 \x01(\x05:\x02-1\x12\x1a\n\x0esquad_position\x18\x14 \x01(\x05:\x02-1\x12\x16\n\nprofession\x18\x16 \x01(\x05:\x02-1\x12\x19\n\x11\x63ustom_profession\x18\x17 \x01(\t\x12\x0e\n\x06labors\x18\x0b \x03(\x05\x12\"\n\x06skills\x18\x0c \x03(\x0b\x32\x12.dfproto.SkillInfo\x12+\n\x0bmisc_traits\x18\x18 \x03(\x0b\x32\x16.dfproto.UnitMiscTrait\x12%\n\x05\x63urse\x18\x10 \x01(\x0b\x32\x16.dfproto.UnitCurseInfo\x12\x0f\n\x07\x62urrows\x18\x15 \x03(\x05\"x\n\x11\x42\x61sicUnitInfoMask\x12\x15\n\x06labors\x18\x01 \x01(\x08:\x05\x66\x61lse\x12\x15\n\x06skills\x18\x02 \x01(\x08:\x05\x66\x61lse\x12\x19\n\nprofession\x18\x03 \x01(\x08:\x05\x66\x61lse\x12\x1a\n\x0bmisc_traits\x18\x04 \x01(\x08:\x05\x66\x61lse\"c\n\x0e\x42\x61sicSquadInfo\x12\x10\n\x08squad_id\x18\x01 \x02(\x05\x12\x1f\n\x04name\x18\x02 \x01(\x0b\x32\x11.dfproto.NameInfo\x12\r\n\x05\x61lias\x18\x03 \x01(\t\x12\x0f\n\x07members\x18\x04 \x03(\x11\"?\n\x0eUnitLaborState\x12\x0f\n\x07unit_id\x18\x01 \x02(\x05\x12\r\n\x05labor\x18\x02 \x02(\x05\x12\r\n\x05value\x18\x03 \x02(\x08\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'Basic_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_ENUMITEMNAME']._serialized_start=24 + _globals['_ENUMITEMNAME']._serialized_end=88 + _globals['_BASICMATERIALID']._serialized_start=90 + _globals['_BASICMATERIALID']._serialized_end=136 + _globals['_BASICMATERIALINFO']._serialized_start=139 + _globals['_BASICMATERIALINFO']._serialized_end=555 + _globals['_BASICMATERIALINFO_PRODUCT']._serialized_start=505 + _globals['_BASICMATERIALINFO_PRODUCT']._serialized_end=555 + _globals['_BASICMATERIALINFOMASK']._serialized_start=558 + _globals['_BASICMATERIALINFOMASK']._serialized_end=795 + _globals['_BASICMATERIALINFOMASK_STATETYPE']._serialized_start=716 + _globals['_BASICMATERIALINFOMASK_STATETYPE']._serialized_end=795 + _globals['_JOBSKILLATTR']._serialized_start=797 + _globals['_JOBSKILLATTR']._serialized_end=924 + _globals['_PROFESSIONATTR']._serialized_start=926 + _globals['_PROFESSIONATTR']._serialized_end=1044 + _globals['_UNITLABORATTR']._serialized_start=1046 + _globals['_UNITLABORATTR']._serialized_end=1103 + _globals['_NAMEINFO']._serialized_start=1105 + _globals['_NAMEINFO']._serialized_end=1219 + _globals['_NAMETRIPLE']._serialized_start=1221 + _globals['_NAMETRIPLE']._serialized_end=1284 + _globals['_UNITCURSEINFO']._serialized_start=1286 + _globals['_UNITCURSEINFO']._serialized_end=1412 + _globals['_SKILLINFO']._serialized_start=1414 + _globals['_SKILLINFO']._serialized_end=1472 + _globals['_UNITMISCTRAIT']._serialized_start=1474 + _globals['_UNITMISCTRAIT']._serialized_end=1516 + _globals['_BASICUNITINFO']._serialized_start=1519 + _globals['_BASICUNITINFO']._serialized_end=2067 + _globals['_BASICUNITINFOMASK']._serialized_start=2069 + _globals['_BASICUNITINFOMASK']._serialized_end=2189 + _globals['_BASICSQUADINFO']._serialized_start=2191 + _globals['_BASICSQUADINFO']._serialized_end=2290 + _globals['_UNITLABORSTATE']._serialized_start=2292 + _globals['_UNITLABORSTATE']._serialized_end=2355 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/CoreProtocol_pb2.py b/src/dfhack_client_python/py_export/CoreProtocol_pb2.py new file mode 100644 index 0000000..ff28714 --- /dev/null +++ b/src/dfhack_client_python/py_export/CoreProtocol_pb2.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: CoreProtocol.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'CoreProtocol.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x43oreProtocol.proto\x12\x07\x64\x66proto\"\x82\x03\n\x10\x43oreTextFragment\x12\x0c\n\x04text\x18\x01 \x02(\t\x12.\n\x05\x63olor\x18\x02 \x01(\x0e\x32\x1f.dfproto.CoreTextFragment.Color\"\xaf\x02\n\x05\x43olor\x12\x0f\n\x0b\x43OLOR_BLACK\x10\x00\x12\x0e\n\nCOLOR_BLUE\x10\x01\x12\x0f\n\x0b\x43OLOR_GREEN\x10\x02\x12\x0e\n\nCOLOR_CYAN\x10\x03\x12\r\n\tCOLOR_RED\x10\x04\x12\x11\n\rCOLOR_MAGENTA\x10\x05\x12\x0f\n\x0b\x43OLOR_BROWN\x10\x06\x12\x0e\n\nCOLOR_GREY\x10\x07\x12\x12\n\x0e\x43OLOR_DARKGREY\x10\x08\x12\x13\n\x0f\x43OLOR_LIGHTBLUE\x10\t\x12\x14\n\x10\x43OLOR_LIGHTGREEN\x10\n\x12\x13\n\x0f\x43OLOR_LIGHTCYAN\x10\x0b\x12\x12\n\x0e\x43OLOR_LIGHTRED\x10\x0c\x12\x16\n\x12\x43OLOR_LIGHTMAGENTA\x10\r\x12\x10\n\x0c\x43OLOR_YELLOW\x10\x0e\x12\x0f\n\x0b\x43OLOR_WHITE\x10\x0f\"D\n\x14\x43oreTextNotification\x12,\n\tfragments\x18\x01 \x03(\x0b\x32\x19.dfproto.CoreTextFragment\"\xfa\x01\n\x15\x43oreErrorNotification\x12\x36\n\x04\x63ode\x18\x01 \x02(\x0e\x32(.dfproto.CoreErrorNotification.ErrorCode\"\xa8\x01\n\tErrorCode\x12\x1c\n\x0f\x43R_LINK_FAILURE\x10\xfd\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x1b\n\x0e\x43R_WOULD_BREAK\x10\xfe\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x1f\n\x12\x43R_NOT_IMPLEMENTED\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\t\n\x05\x43R_OK\x10\x00\x12\x0e\n\nCR_FAILURE\x10\x01\x12\x12\n\x0e\x43R_WRONG_USAGE\x10\x02\x12\x10\n\x0c\x43R_NOT_FOUND\x10\x03\"\x0e\n\x0c\x45mptyMessage\"\x1b\n\nIntMessage\x12\r\n\x05value\x18\x01 \x02(\x05\"\x1f\n\x0eIntListMessage\x12\r\n\x05value\x18\x01 \x03(\x05\"\x1e\n\rStringMessage\x12\r\n\x05value\x18\x01 \x02(\t\"\"\n\x11StringListMessage\x12\r\n\x05value\x18\x01 \x03(\t\"X\n\x0f\x43oreBindRequest\x12\x0e\n\x06method\x18\x01 \x02(\t\x12\x11\n\tinput_msg\x18\x02 \x02(\t\x12\x12\n\noutput_msg\x18\x03 \x02(\t\x12\x0e\n\x06plugin\x18\x04 \x01(\t\"$\n\rCoreBindReply\x12\x13\n\x0b\x61ssigned_id\x18\x01 \x02(\x05\";\n\x15\x43oreRunCommandRequest\x12\x0f\n\x07\x63ommand\x18\x01 \x02(\t\x12\x11\n\targuments\x18\x02 \x03(\t\"H\n\x11\x43oreRunLuaRequest\x12\x0e\n\x06module\x18\x01 \x02(\t\x12\x10\n\x08\x66unction\x18\x02 \x02(\t\x12\x11\n\targuments\x18\x03 \x03(\tB\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'CoreProtocol_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_CORETEXTFRAGMENT']._serialized_start=32 + _globals['_CORETEXTFRAGMENT']._serialized_end=418 + _globals['_CORETEXTFRAGMENT_COLOR']._serialized_start=115 + _globals['_CORETEXTFRAGMENT_COLOR']._serialized_end=418 + _globals['_CORETEXTNOTIFICATION']._serialized_start=420 + _globals['_CORETEXTNOTIFICATION']._serialized_end=488 + _globals['_COREERRORNOTIFICATION']._serialized_start=491 + _globals['_COREERRORNOTIFICATION']._serialized_end=741 + _globals['_COREERRORNOTIFICATION_ERRORCODE']._serialized_start=573 + _globals['_COREERRORNOTIFICATION_ERRORCODE']._serialized_end=741 + _globals['_EMPTYMESSAGE']._serialized_start=743 + _globals['_EMPTYMESSAGE']._serialized_end=757 + _globals['_INTMESSAGE']._serialized_start=759 + _globals['_INTMESSAGE']._serialized_end=786 + _globals['_INTLISTMESSAGE']._serialized_start=788 + _globals['_INTLISTMESSAGE']._serialized_end=819 + _globals['_STRINGMESSAGE']._serialized_start=821 + _globals['_STRINGMESSAGE']._serialized_end=851 + _globals['_STRINGLISTMESSAGE']._serialized_start=853 + _globals['_STRINGLISTMESSAGE']._serialized_end=887 + _globals['_COREBINDREQUEST']._serialized_start=889 + _globals['_COREBINDREQUEST']._serialized_end=977 + _globals['_COREBINDREPLY']._serialized_start=979 + _globals['_COREBINDREPLY']._serialized_end=1015 + _globals['_CORERUNCOMMANDREQUEST']._serialized_start=1017 + _globals['_CORERUNCOMMANDREQUEST']._serialized_end=1076 + _globals['_CORERUNLUAREQUEST']._serialized_start=1078 + _globals['_CORERUNLUAREQUEST']._serialized_end=1150 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/DwarfControl_pb2.py b/src/dfhack_client_python/py_export/DwarfControl_pb2.py new file mode 100644 index 0000000..ecb7b1f --- /dev/null +++ b/src/dfhack_client_python/py_export/DwarfControl_pb2.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: DwarfControl.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'DwarfControl.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import ui_sidebar_mode_pb2 as ui__sidebar__mode__pb2 +import RemoteFortressReader_pb2 as RemoteFortressReader__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x12\x44warfControl.proto\x12\x0c\x44warfControl\x1a\x15ui_sidebar_mode.proto\x1a\x1aRemoteFortressReader.proto\"\xab\x01\n\x0cSidebarState\x12:\n\x04mode\x18\x01 \x01(\x0e\x32,.proto.enums.ui_sidebar_mode.ui_sidebar_mode\x12*\n\nmenu_items\x18\x02 \x03(\x0b\x32\x16.DwarfControl.MenuItem\x12\x33\n\x0e\x62uild_selector\x18\x03 \x01(\x0b\x32\x1b.DwarfControl.BuildSelector\"\x92\x01\n\x08MenuItem\x12\x39\n\rbuilding_type\x18\x01 \x01(\x0b\x32\".RemoteFortressReader.BuildingType\x12\x16\n\x0e\x65xisting_count\x18\x02 \x01(\x05\x12\x33\n\x0e\x62uild_category\x18\x03 \x01(\x0e\x32\x1b.DwarfControl.BuildCategory\"\xc0\x01\n\x0eSidebarCommand\x12:\n\x04mode\x18\x01 \x01(\x0e\x32,.proto.enums.ui_sidebar_mode.ui_sidebar_mode\x12\x12\n\nmenu_index\x18\x02 \x01(\x05\x12(\n\x06\x61\x63tion\x18\x03 \x01(\x0e\x32\x18.DwarfControl.MenuAction\x12\x34\n\x0fselection_coord\x18\x04 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\"]\n\x0f\x42uiildReqChoice\x12\x10\n\x08\x64istance\x18\x01 \x01(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x16\n\x0enum_candidates\x18\x03 \x01(\x05\x12\x12\n\nused_count\x18\x04 \x01(\x05\"Q\n\x0c\x42uildItemReq\x12\x16\n\x0e\x63ount_required\x18\x02 \x01(\x05\x12\x11\n\tcount_max\x18\x03 \x01(\x05\x12\x16\n\x0e\x63ount_provided\x18\x04 \x01(\x05\"\xa9\x03\n\rBuildSelector\x12\x39\n\rbuilding_type\x18\x01 \x01(\x0b\x32\".RemoteFortressReader.BuildingType\x12/\n\x05stage\x18\x02 \x01(\x0e\x32 .DwarfControl.BuildSelectorStage\x12.\n\x07\x63hoices\x18\x03 \x03(\x0b\x32\x1d.DwarfControl.BuiildReqChoice\x12\x11\n\tsel_index\x18\x04 \x01(\x05\x12\x30\n\x0crequirements\x18\x05 \x03(\x0b\x32\x1a.DwarfControl.BuildItemReq\x12\x11\n\treq_index\x18\x06 \x01(\x05\x12\x0e\n\x06\x65rrors\x18\x07 \x03(\t\x12\x14\n\x0cradius_x_low\x18\x08 \x01(\x05\x12\x14\n\x0cradius_y_low\x18\t \x01(\x05\x12\x15\n\rradius_x_high\x18\n \x01(\x05\x12\x15\n\rradius_y_high\x18\x0b \x01(\x05\x12+\n\x06\x63ursor\x18\x0c \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\r\n\x05tiles\x18\r \x03(\x05*\x8f\x01\n\rBuildCategory\x12\x0f\n\x0bNotCategory\x10\x00\x12\x10\n\x0cSiegeEngines\x10\x01\x12\t\n\x05Traps\x10\x02\x12\r\n\tWorkshops\x10\x03\x12\x0c\n\x08\x46urnaces\x10\x04\x12\x11\n\rConstructions\x10\x05\x12\x15\n\x11MachineComponents\x10\x06\x12\t\n\x05Track\x10\x07*M\n\nMenuAction\x12\x0c\n\x08MenuNone\x10\x00\x12\x0e\n\nMenuSelect\x10\x01\x12\x0e\n\nMenuCancel\x10\x02\x12\x11\n\rMenuSelectAll\x10\x03*I\n\x12\x42uildSelectorStage\x12\x0e\n\nStageNoMat\x10\x00\x12\x0e\n\nStagePlace\x10\x01\x12\x13\n\x0fStageItemSelect\x10\x02\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'DwarfControl_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_BUILDCATEGORY']._serialized_start=1212 + _globals['_BUILDCATEGORY']._serialized_end=1355 + _globals['_MENUACTION']._serialized_start=1357 + _globals['_MENUACTION']._serialized_end=1434 + _globals['_BUILDSELECTORSTAGE']._serialized_start=1436 + _globals['_BUILDSELECTORSTAGE']._serialized_end=1509 + _globals['_SIDEBARSTATE']._serialized_start=88 + _globals['_SIDEBARSTATE']._serialized_end=259 + _globals['_MENUITEM']._serialized_start=262 + _globals['_MENUITEM']._serialized_end=408 + _globals['_SIDEBARCOMMAND']._serialized_start=411 + _globals['_SIDEBARCOMMAND']._serialized_end=603 + _globals['_BUIILDREQCHOICE']._serialized_start=605 + _globals['_BUIILDREQCHOICE']._serialized_end=698 + _globals['_BUILDITEMREQ']._serialized_start=700 + _globals['_BUILDITEMREQ']._serialized_end=781 + _globals['_BUILDSELECTOR']._serialized_start=784 + _globals['_BUILDSELECTOR']._serialized_end=1209 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/ItemdefInstrument_pb2.py b/src/dfhack_client_python/py_export/ItemdefInstrument_pb2.py new file mode 100644 index 0000000..ea09ce4 --- /dev/null +++ b/src/dfhack_client_python/py_export/ItemdefInstrument_pb2.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: ItemdefInstrument.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'ItemdefInstrument.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x17ItemdefInstrument.proto\x12\x11ItemdefInstrument\"\xcc\x01\n\x0fInstrumentFlags\x12\x18\n\x10indefinite_pitch\x18\x01 \x01(\x08\x12\x1a\n\x12placed_as_building\x18\x02 \x01(\x08\x12\x11\n\tmetal_mat\x18\x03 \x01(\x08\x12\x11\n\tstone_mat\x18\x04 \x01(\x08\x12\x10\n\x08wood_mat\x18\x05 \x01(\x08\x12\x11\n\tglass_mat\x18\x06 \x01(\x08\x12\x13\n\x0b\x63\x65ramic_mat\x18\x07 \x01(\x08\x12\x11\n\tshell_mat\x18\x08 \x01(\x08\x12\x10\n\x08\x62one_mat\x18\t \x01(\x08\"N\n\x0fInstrumentPiece\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x13\n\x0bname_plural\x18\x04 \x01(\t\"F\n\x12InstrumentRegister\x12\x17\n\x0fpitch_range_min\x18\x01 \x01(\x05\x12\x17\n\x0fpitch_range_max\x18\x02 \x01(\x05\"\x91\x05\n\rInstrumentDef\x12\x31\n\x05\x66lags\x18\x01 \x01(\x0b\x32\".ItemdefInstrument.InstrumentFlags\x12\x0c\n\x04size\x18\x02 \x01(\x05\x12\r\n\x05value\x18\x03 \x01(\x05\x12\x15\n\rmaterial_size\x18\x04 \x01(\x05\x12\x32\n\x06pieces\x18\x05 \x03(\x0b\x32\".ItemdefInstrument.InstrumentPiece\x12\x17\n\x0fpitch_range_min\x18\x06 \x01(\x05\x12\x17\n\x0fpitch_range_max\x18\x07 \x01(\x05\x12\x15\n\rvolume_mb_min\x18\x08 \x01(\x05\x12\x15\n\rvolume_mb_max\x18\t \x01(\x05\x12@\n\x10sound_production\x18\n \x03(\x0e\x32&.ItemdefInstrument.SoundProductionType\x12\x1e\n\x16sound_production_parm1\x18\x0b \x03(\t\x12\x1e\n\x16sound_production_parm2\x18\x0c \x03(\t\x12\x38\n\x0cpitch_choice\x18\r \x03(\x0e\x32\".ItemdefInstrument.PitchChoiceType\x12\x1a\n\x12pitch_choice_parm1\x18\x0e \x03(\t\x12\x1a\n\x12pitch_choice_parm2\x18\x0f \x03(\t\x12-\n\x06tuning\x18\x10 \x03(\x0e\x32\x1d.ItemdefInstrument.TuningType\x12\x13\n\x0btuning_parm\x18\x11 \x03(\t\x12\x38\n\tregisters\x18\x12 \x03(\x0b\x32%.ItemdefInstrument.InstrumentRegister\x12\x13\n\x0b\x64\x65scription\x18\x13 \x01(\t*\xf9\x01\n\x0fPitchChoiceType\x12\x15\n\x11MEMBRANE_POSITION\x10\x00\x12\x12\n\x0eSUBPART_CHOICE\x10\x01\x12\x0c\n\x08KEYBOARD\x10\x02\x12\x11\n\rSTOPPING_FRET\x10\x03\x12\x19\n\x15STOPPING_AGAINST_BODY\x10\x04\x12\x11\n\rSTOPPING_HOLE\x10\x05\x12\x15\n\x11STOPPING_HOLE_KEY\x10\x06\x12\t\n\x05SLIDE\x10\x07\x12\x13\n\x0fHARMONIC_SERIES\x10\x08\x12\x14\n\x10VALVE_ROUTES_AIR\x10\t\x12\x0e\n\nBP_IN_BELL\x10\n\x12\x0f\n\x0b\x46OOT_PEDALS\x10\x0b*\xbe\x03\n\x13SoundProductionType\x12\x11\n\rPLUCKED_BY_BP\x10\x00\x12\x0b\n\x07PLUCKED\x10\x01\x12\t\n\x05\x42OWED\x10\x02\x12\x10\n\x0cSTRUCK_BY_BP\x10\x03\x12\n\n\x06STRUCK\x10\x04\x12\x1e\n\x1aVIBRATE_BP_AGAINST_OPENING\x10\x05\x12\x17\n\x13\x42LOW_AGAINST_FIPPLE\x10\x06\x12\x1a\n\x16\x42LOW_OVER_OPENING_SIDE\x10\x07\x12\x19\n\x15\x42LOW_OVER_OPENING_END\x10\x08\x12\x19\n\x15\x42LOW_OVER_SINGLE_REED\x10\t\x12\x19\n\x15\x42LOW_OVER_DOUBLE_REED\x10\n\x12\x17\n\x13\x42LOW_OVER_FREE_REED\x10\x0b\x12\x13\n\x0fSTRUCK_TOGETHER\x10\x0c\x12\n\n\x06SHAKEN\x10\r\x12\x0b\n\x07SCRAPED\x10\x0e\x12\x0c\n\x08\x46RICTION\x10\x0f\x12\r\n\tRESONATOR\x10\x10\x12\x11\n\rBAG_OVER_REED\x10\x11\x12\x11\n\rAIR_OVER_REED\x10\x12\x12\x16\n\x12\x41IR_OVER_FREE_REED\x10\x13\x12\x16\n\x12\x41IR_AGAINST_FIPPLE\x10\x14*V\n\nTuningType\x12\x08\n\x04PEGS\x10\x00\x12\x16\n\x12\x41\x44JUSTABLE_BRIDGES\x10\x01\x12\n\n\x06\x43ROOKS\x10\x02\x12\x0e\n\nTIGHTENING\x10\x03\x12\n\n\x06LEVERS\x10\x04\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ItemdefInstrument_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_PITCHCHOICETYPE']._serialized_start=1066 + _globals['_PITCHCHOICETYPE']._serialized_end=1315 + _globals['_SOUNDPRODUCTIONTYPE']._serialized_start=1318 + _globals['_SOUNDPRODUCTIONTYPE']._serialized_end=1764 + _globals['_TUNINGTYPE']._serialized_start=1766 + _globals['_TUNINGTYPE']._serialized_end=1852 + _globals['_INSTRUMENTFLAGS']._serialized_start=47 + _globals['_INSTRUMENTFLAGS']._serialized_end=251 + _globals['_INSTRUMENTPIECE']._serialized_start=253 + _globals['_INSTRUMENTPIECE']._serialized_end=331 + _globals['_INSTRUMENTREGISTER']._serialized_start=333 + _globals['_INSTRUMENTREGISTER']._serialized_end=403 + _globals['_INSTRUMENTDEF']._serialized_start=406 + _globals['_INSTRUMENTDEF']._serialized_end=1063 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/RemoteFortressReader_pb2.py b/src/dfhack_client_python/py_export/RemoteFortressReader_pb2.py new file mode 100644 index 0000000..00eb8f0 --- /dev/null +++ b/src/dfhack_client_python/py_export/RemoteFortressReader_pb2.py @@ -0,0 +1,236 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: RemoteFortressReader.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'RemoteFortressReader.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +import ItemdefInstrument_pb2 as ItemdefInstrument__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aRemoteFortressReader.proto\x12\x14RemoteFortressReader\x1a\x17ItemdefInstrument.proto\"(\n\x05\x43oord\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\x12\t\n\x01z\x18\x03 \x01(\x05\"\xa6\x02\n\x08Tiletype\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07\x63\x61ption\x18\x03 \x01(\t\x12\x32\n\x05shape\x18\x04 \x01(\x0e\x32#.RemoteFortressReader.TiletypeShape\x12\x36\n\x07special\x18\x05 \x01(\x0e\x32%.RemoteFortressReader.TiletypeSpecial\x12\x38\n\x08material\x18\x06 \x01(\x0e\x32&.RemoteFortressReader.TiletypeMaterial\x12\x36\n\x07variant\x18\x07 \x01(\x0e\x32%.RemoteFortressReader.TiletypeVariant\x12\x11\n\tdirection\x18\x08 \x01(\t\"E\n\x0cTiletypeList\x12\x35\n\rtiletype_list\x18\x01 \x03(\x0b\x32\x1e.RemoteFortressReader.Tiletype\"_\n\x0f\x42uildingExtents\x12\r\n\x05pos_x\x18\x01 \x02(\x05\x12\r\n\x05pos_y\x18\x02 \x02(\x05\x12\r\n\x05width\x18\x03 \x02(\x05\x12\x0e\n\x06height\x18\x04 \x02(\x05\x12\x0f\n\x07\x65xtents\x18\x05 \x03(\x05\"F\n\x0c\x42uildingItem\x12(\n\x04item\x18\x01 \x01(\x0b\x32\x1a.RemoteFortressReader.Item\x12\x0c\n\x04mode\x18\x02 \x01(\x05\"\xdc\x03\n\x10\x42uildingInstance\x12\r\n\x05index\x18\x01 \x02(\x05\x12\x11\n\tpos_x_min\x18\x02 \x01(\x05\x12\x11\n\tpos_y_min\x18\x03 \x01(\x05\x12\x11\n\tpos_z_min\x18\x04 \x01(\x05\x12\x11\n\tpos_x_max\x18\x05 \x01(\x05\x12\x11\n\tpos_y_max\x18\x06 \x01(\x05\x12\x11\n\tpos_z_max\x18\x07 \x01(\x05\x12\x39\n\rbuilding_type\x18\x08 \x01(\x0b\x32\".RemoteFortressReader.BuildingType\x12/\n\x08material\x18\t \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x16\n\x0e\x62uilding_flags\x18\n \x01(\r\x12\x0f\n\x07is_room\x18\x0b \x01(\x08\x12\x33\n\x04room\x18\x0c \x01(\x0b\x32%.RemoteFortressReader.BuildingExtents\x12:\n\tdirection\x18\r \x01(\x0e\x32\'.RemoteFortressReader.BuildingDirection\x12\x31\n\x05items\x18\x0e \x03(\x0b\x32\".RemoteFortressReader.BuildingItem\x12\x0e\n\x06\x61\x63tive\x18\x0f \x01(\x05\"P\n\tRiverEdge\x12\x0f\n\x07min_pos\x18\x01 \x01(\x05\x12\x0f\n\x07max_pos\x18\x02 \x01(\x05\x12\x0e\n\x06\x61\x63tive\x18\x03 \x01(\x05\x12\x11\n\televation\x18\x04 \x01(\x05\"\xc9\x01\n\tRiverTile\x12.\n\x05north\x18\x01 \x01(\x0b\x32\x1f.RemoteFortressReader.RiverEdge\x12.\n\x05south\x18\x02 \x01(\x0b\x32\x1f.RemoteFortressReader.RiverEdge\x12-\n\x04\x65\x61st\x18\x03 \x01(\x0b\x32\x1f.RemoteFortressReader.RiverEdge\x12-\n\x04west\x18\x04 \x01(\x0b\x32\x1f.RemoteFortressReader.RiverEdge\"\xa9\x01\n\x07Spatter\x12/\n\x08material\x18\x01 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x0e\n\x06\x61mount\x18\x02 \x01(\x05\x12\x30\n\x05state\x18\x03 \x01(\x0e\x32!.RemoteFortressReader.MatterState\x12+\n\x04item\x18\x04 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\">\n\x0bSpatterPile\x12/\n\x08spatters\x18\x01 \x03(\x0b\x32\x1d.RemoteFortressReader.Spatter\"\x84\x04\n\x04Item\x12\n\n\x02id\x18\x01 \x01(\x05\x12(\n\x03pos\x18\x02 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\x0e\n\x06\x66lags1\x18\x03 \x01(\r\x12\x0e\n\x06\x66lags2\x18\x04 \x01(\r\x12+\n\x04type\x18\x05 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12/\n\x08material\x18\x06 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x32\n\x03\x64ye\x18\x07 \x01(\x0b\x32%.RemoteFortressReader.ColorDefinition\x12\x12\n\nstack_size\x18\x08 \x01(\x05\x12\x10\n\x08subpos_x\x18\t \x01(\x02\x12\x10\n\x08subpos_y\x18\n \x01(\x02\x12\x10\n\x08subpos_z\x18\x0b \x01(\x02\x12\x12\n\nprojectile\x18\x0c \x01(\x08\x12\x12\n\nvelocity_x\x18\r \x01(\x02\x12\x12\n\nvelocity_y\x18\x0e \x01(\x02\x12\x12\n\nvelocity_z\x18\x0f \x01(\x02\x12\x0e\n\x06volume\x18\x10 \x01(\x05\x12;\n\x0cimprovements\x18\x11 \x03(\x0b\x32%.RemoteFortressReader.ItemImprovement\x12-\n\x05image\x18\x12 \x01(\x0b\x32\x1e.RemoteFortressReader.ArtImage\"\xdb\x01\n\tPlantTile\x12\r\n\x05trunk\x18\x01 \x01(\x08\x12\x17\n\x0f\x63onnection_east\x18\x02 \x01(\x08\x12\x18\n\x10\x63onnection_south\x18\x03 \x01(\x08\x12\x17\n\x0f\x63onnection_west\x18\x04 \x01(\x08\x12\x18\n\x10\x63onnection_north\x18\x05 \x01(\x08\x12\x10\n\x08\x62ranches\x18\x06 \x01(\x08\x12\r\n\x05twigs\x18\x07 \x01(\x08\x12\x38\n\ttile_type\x18\x08 \x01(\x0e\x32%.RemoteFortressReader.TiletypeSpecial\"e\n\x08TreeInfo\x12)\n\x04size\x18\x01 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12.\n\x05tiles\x18\x02 \x03(\x0b\x32\x1f.RemoteFortressReader.PlantTile\"\x80\x01\n\rPlantInstance\x12\x12\n\nplant_type\x18\x01 \x01(\x05\x12(\n\x03pos\x18\x02 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\x31\n\ttree_info\x18\x03 \x01(\x0b\x32\x1e.RemoteFortressReader.TreeInfo\"\xb4\x07\n\x08MapBlock\x12\r\n\x05map_x\x18\x01 \x02(\x05\x12\r\n\x05map_y\x18\x02 \x02(\x05\x12\r\n\x05map_z\x18\x03 \x02(\x05\x12\r\n\x05tiles\x18\x04 \x03(\x05\x12\x30\n\tmaterials\x18\x05 \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x36\n\x0flayer_materials\x18\x06 \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x35\n\x0evein_materials\x18\x07 \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x35\n\x0e\x62\x61se_materials\x18\x08 \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\r\n\x05magma\x18\t \x03(\x05\x12\r\n\x05water\x18\n \x03(\x05\x12\x0e\n\x06hidden\x18\x0b \x03(\x08\x12\r\n\x05light\x18\x0c \x03(\x08\x12\x14\n\x0csubterranean\x18\r \x03(\x08\x12\x0f\n\x07outside\x18\x0e \x03(\x08\x12\x0f\n\x07\x61quifer\x18\x0f \x03(\x08\x12\x16\n\x0ewater_stagnant\x18\x10 \x03(\x08\x12\x12\n\nwater_salt\x18\x11 \x03(\x08\x12\x39\n\x12\x63onstruction_items\x18\x12 \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x39\n\tbuildings\x18\x13 \x03(\x0b\x32&.RemoteFortressReader.BuildingInstance\x12\x14\n\x0ctree_percent\x18\x14 \x03(\x05\x12\x0e\n\x06tree_x\x18\x15 \x03(\x05\x12\x0e\n\x06tree_y\x18\x16 \x03(\x05\x12\x0e\n\x06tree_z\x18\x17 \x03(\x05\x12\x46\n\x14tile_dig_designation\x18\x18 \x03(\x0e\x32(.RemoteFortressReader.TileDigDesignation\x12\x36\n\x0bspatterPile\x18\x19 \x03(\x0b\x32!.RemoteFortressReader.SpatterPile\x12)\n\x05items\x18\x1a \x03(\x0b\x32\x1a.RemoteFortressReader.Item\x12#\n\x1btile_dig_designation_marker\x18\x1b \x03(\x08\x12!\n\x19tile_dig_designation_auto\x18\x1c \x03(\x08\x12\x15\n\rgrass_percent\x18\x1d \x03(\x05\x12-\n\x05\x66lows\x18\x1e \x03(\x0b\x32\x1e.RemoteFortressReader.FlowInfo\".\n\x07MatPair\x12\x10\n\x08mat_type\x18\x01 \x02(\x05\x12\x11\n\tmat_index\x18\x02 \x02(\x05\";\n\x0f\x43olorDefinition\x12\x0b\n\x03red\x18\x01 \x02(\x05\x12\r\n\x05green\x18\x02 \x02(\x05\x12\x0c\n\x04\x62lue\x18\x03 \x02(\x05\"\xa6\x02\n\x12MaterialDefinition\x12/\n\x08mat_pair\x18\x01 \x02(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12:\n\x0bstate_color\x18\x04 \x01(\x0b\x32%.RemoteFortressReader.ColorDefinition\x12\x34\n\ninstrument\x18\x05 \x01(\x0b\x32 .ItemdefInstrument.InstrumentDef\x12\x0f\n\x07up_step\x18\x06 \x01(\x05\x12\x11\n\tdown_step\x18\x07 \x01(\x05\x12/\n\x05layer\x18\x08 \x01(\x0e\x32 .RemoteFortressReader.ArmorLayer\"X\n\x0c\x42uildingType\x12\x15\n\rbuilding_type\x18\x01 \x02(\x05\x12\x18\n\x10\x62uilding_subtype\x18\x02 \x02(\x05\x12\x17\n\x0f\x62uilding_custom\x18\x03 \x02(\x05\"i\n\x12\x42uildingDefinition\x12\x39\n\rbuilding_type\x18\x01 \x02(\x0b\x32\".RemoteFortressReader.BuildingType\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\"O\n\x0c\x42uildingList\x12?\n\rbuilding_list\x18\x01 \x03(\x0b\x32(.RemoteFortressReader.BuildingDefinition\"O\n\x0cMaterialList\x12?\n\rmaterial_list\x18\x01 \x03(\x0b\x32(.RemoteFortressReader.MaterialDefinition\"F\n\x04Hair\x12\x0e\n\x06length\x18\x01 \x01(\x05\x12.\n\x05style\x18\x02 \x01(\x0e\x32\x1f.RemoteFortressReader.HairStyle\"\x81\x01\n\x0c\x42odySizeInfo\x12\x10\n\x08size_cur\x18\x01 \x01(\x05\x12\x11\n\tsize_base\x18\x02 \x01(\x05\x12\x10\n\x08\x61rea_cur\x18\x03 \x01(\x05\x12\x11\n\tarea_base\x18\x04 \x01(\x05\x12\x12\n\nlength_cur\x18\x05 \x01(\x05\x12\x13\n\x0blength_base\x18\x06 \x01(\x05\"\xb6\x02\n\x0eUnitAppearance\x12\x16\n\x0e\x62ody_modifiers\x18\x01 \x03(\x05\x12\x14\n\x0c\x62p_modifiers\x18\x02 \x03(\x05\x12\x15\n\rsize_modifier\x18\x03 \x01(\x05\x12\x0e\n\x06\x63olors\x18\x04 \x03(\x05\x12(\n\x04hair\x18\x05 \x01(\x0b\x32\x1a.RemoteFortressReader.Hair\x12)\n\x05\x62\x65\x61rd\x18\x06 \x01(\x0b\x32\x1a.RemoteFortressReader.Hair\x12-\n\tmoustache\x18\x07 \x01(\x0b\x32\x1a.RemoteFortressReader.Hair\x12-\n\tsideburns\x18\x08 \x01(\x0b\x32\x1a.RemoteFortressReader.Hair\x12\x1c\n\x14physical_description\x18\t \x01(\t\"\x82\x01\n\rInventoryItem\x12\x31\n\x04mode\x18\x01 \x01(\x0e\x32#.RemoteFortressReader.InventoryMode\x12(\n\x04item\x18\x02 \x01(\x0b\x32\x1a.RemoteFortressReader.Item\x12\x14\n\x0c\x62ody_part_id\x18\x03 \x01(\x05\"N\n\tWoundPart\x12\x18\n\x10global_layer_idx\x18\x01 \x01(\x05\x12\x14\n\x0c\x62ody_part_id\x18\x02 \x01(\x05\x12\x11\n\tlayer_idx\x18\x03 \x01(\x05\"Q\n\tUnitWound\x12.\n\x05parts\x18\x01 \x03(\x0b\x32\x1f.RemoteFortressReader.WoundPart\x12\x14\n\x0csevered_part\x18\x02 \x01(\x08\"\xce\x05\n\x0eUnitDefinition\x12\n\n\x02id\x18\x01 \x02(\x05\x12\x0f\n\x07isValid\x18\x02 \x01(\x08\x12\r\n\x05pos_x\x18\x03 \x01(\x05\x12\r\n\x05pos_y\x18\x04 \x01(\x05\x12\r\n\x05pos_z\x18\x05 \x01(\x05\x12+\n\x04race\x18\x06 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12?\n\x10profession_color\x18\x07 \x01(\x0b\x32%.RemoteFortressReader.ColorDefinition\x12\x0e\n\x06\x66lags1\x18\x08 \x01(\r\x12\x0e\n\x06\x66lags2\x18\t \x01(\r\x12\x0e\n\x06\x66lags3\x18\n \x01(\r\x12\x12\n\nis_soldier\x18\x0b \x01(\x08\x12\x35\n\tsize_info\x18\x0c \x01(\x0b\x32\".RemoteFortressReader.BodySizeInfo\x12\x0c\n\x04name\x18\r \x01(\t\x12\x11\n\tblood_max\x18\x0e \x01(\x05\x12\x13\n\x0b\x62lood_count\x18\x0f \x01(\x05\x12\x38\n\nappearance\x18\x10 \x01(\x0b\x32$.RemoteFortressReader.UnitAppearance\x12\x15\n\rprofession_id\x18\x11 \x01(\x05\x12\x17\n\x0fnoble_positions\x18\x12 \x03(\t\x12\x10\n\x08rider_id\x18\x13 \x01(\x05\x12\x36\n\tinventory\x18\x14 \x03(\x0b\x32#.RemoteFortressReader.InventoryItem\x12\x10\n\x08subpos_x\x18\x15 \x01(\x02\x12\x10\n\x08subpos_y\x18\x16 \x01(\x02\x12\x10\n\x08subpos_z\x18\x17 \x01(\x02\x12+\n\x06\x66\x61\x63ing\x18\x18 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\x0b\n\x03\x61ge\x18\x19 \x01(\x05\x12/\n\x06wounds\x18\x1a \x03(\x0b\x32\x1f.RemoteFortressReader.UnitWound\"G\n\x08UnitList\x12;\n\rcreature_list\x18\x01 \x03(\x0b\x32$.RemoteFortressReader.UnitDefinition\"\x95\x01\n\x0c\x42lockRequest\x12\x15\n\rblocks_needed\x18\x01 \x01(\x05\x12\r\n\x05min_x\x18\x02 \x01(\x05\x12\r\n\x05max_x\x18\x03 \x01(\x05\x12\r\n\x05min_y\x18\x04 \x01(\x05\x12\r\n\x05max_y\x18\x05 \x01(\x05\x12\r\n\x05min_z\x18\x06 \x01(\x05\x12\r\n\x05max_z\x18\x07 \x01(\x05\x12\x14\n\x0c\x66orce_reload\x18\x08 \x01(\x08\"\xc3\x01\n\tBlockList\x12\x32\n\nmap_blocks\x18\x01 \x03(\x0b\x32\x1e.RemoteFortressReader.MapBlock\x12\r\n\x05map_x\x18\x02 \x01(\x05\x12\r\n\x05map_y\x18\x03 \x01(\x05\x12\x33\n\nengravings\x18\x04 \x03(\x0b\x32\x1f.RemoteFortressReader.Engraving\x12/\n\x0bocean_waves\x18\x05 \x03(\x0b\x32\x1a.RemoteFortressReader.Wave\"F\n\x08PlantDef\x12\r\n\x05pos_x\x18\x01 \x02(\x05\x12\r\n\x05pos_y\x18\x02 \x02(\x05\x12\r\n\x05pos_z\x18\x03 \x02(\x05\x12\r\n\x05index\x18\x04 \x02(\x05\"?\n\tPlantList\x12\x32\n\nplant_list\x18\x01 \x03(\x0b\x32\x1e.RemoteFortressReader.PlantDef\"\xea\x01\n\x08ViewInfo\x12\x12\n\nview_pos_x\x18\x01 \x01(\x05\x12\x12\n\nview_pos_y\x18\x02 \x01(\x05\x12\x12\n\nview_pos_z\x18\x03 \x01(\x05\x12\x13\n\x0bview_size_x\x18\x04 \x01(\x05\x12\x13\n\x0bview_size_y\x18\x05 \x01(\x05\x12\x14\n\x0c\x63ursor_pos_x\x18\x06 \x01(\x05\x12\x14\n\x0c\x63ursor_pos_y\x18\x07 \x01(\x05\x12\x14\n\x0c\x63ursor_pos_z\x18\x08 \x01(\x05\x12\x1a\n\x0e\x66ollow_unit_id\x18\t \x01(\x05:\x02-1\x12\x1a\n\x0e\x66ollow_item_id\x18\n \x01(\x05:\x02-1\"\xcd\x01\n\x07MapInfo\x12\x14\n\x0c\x62lock_size_x\x18\x01 \x01(\x05\x12\x14\n\x0c\x62lock_size_y\x18\x02 \x01(\x05\x12\x14\n\x0c\x62lock_size_z\x18\x03 \x01(\x05\x12\x13\n\x0b\x62lock_pos_x\x18\x04 \x01(\x05\x12\x13\n\x0b\x62lock_pos_y\x18\x05 \x01(\x05\x12\x13\n\x0b\x62lock_pos_z\x18\x06 \x01(\x05\x12\x12\n\nworld_name\x18\x07 \x01(\t\x12\x1a\n\x12world_name_english\x18\x08 \x01(\t\x12\x11\n\tsave_name\x18\t \x01(\t\"\xdb\x01\n\x05\x43loud\x12.\n\x05\x66ront\x18\x01 \x01(\x0e\x32\x1f.RemoteFortressReader.FrontType\x12\x32\n\x07\x63umulus\x18\x02 \x01(\x0e\x32!.RemoteFortressReader.CumulusType\x12\x0e\n\x06\x63irrus\x18\x03 \x01(\x08\x12\x32\n\x07stratus\x18\x04 \x01(\x0e\x32!.RemoteFortressReader.StratusType\x12*\n\x03\x66og\x18\x05 \x01(\x0e\x32\x1d.RemoteFortressReader.FogType\"\xea\x04\n\x08WorldMap\x12\x13\n\x0bworld_width\x18\x01 \x02(\x05\x12\x14\n\x0cworld_height\x18\x02 \x02(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x14\n\x0cname_english\x18\x04 \x01(\t\x12\x11\n\televation\x18\x05 \x03(\x05\x12\x10\n\x08rainfall\x18\x06 \x03(\x05\x12\x12\n\nvegetation\x18\x07 \x03(\x05\x12\x13\n\x0btemperature\x18\x08 \x03(\x05\x12\x10\n\x08\x65vilness\x18\t \x03(\x05\x12\x10\n\x08\x64rainage\x18\n \x03(\x05\x12\x11\n\tvolcanism\x18\x0b \x03(\x05\x12\x10\n\x08savagery\x18\x0c \x03(\x05\x12+\n\x06\x63louds\x18\r \x03(\x0b\x32\x1b.RemoteFortressReader.Cloud\x12\x10\n\x08salinity\x18\x0e \x03(\x05\x12\r\n\x05map_x\x18\x0f \x01(\x05\x12\r\n\x05map_y\x18\x10 \x01(\x05\x12\x10\n\x08\x63\x65nter_x\x18\x11 \x01(\x05\x12\x10\n\x08\x63\x65nter_y\x18\x12 \x01(\x05\x12\x10\n\x08\x63\x65nter_z\x18\x13 \x01(\x05\x12\x10\n\x08\x63ur_year\x18\x14 \x01(\x05\x12\x15\n\rcur_year_tick\x18\x15 \x01(\x05\x12\x35\n\x0bworld_poles\x18\x16 \x01(\x0e\x32 .RemoteFortressReader.WorldPoles\x12\x34\n\x0briver_tiles\x18\x17 \x03(\x0b\x32\x1f.RemoteFortressReader.RiverTile\x12\x17\n\x0fwater_elevation\x18\x18 \x03(\x05\x12\x36\n\x0cregion_tiles\x18\x19 \x03(\x0b\x32 .RemoteFortressReader.RegionTile\"}\n\x1bSiteRealizationBuildingWall\x12\x0f\n\x07start_x\x18\x01 \x01(\x05\x12\x0f\n\x07start_y\x18\x02 \x01(\x05\x12\x0f\n\x07start_z\x18\x03 \x01(\x05\x12\r\n\x05\x65nd_x\x18\x04 \x01(\x05\x12\r\n\x05\x65nd_y\x18\x05 \x01(\x05\x12\r\n\x05\x65nd_z\x18\x06 \x01(\x05\"M\n\x1cSiteRealizationBuildingTower\x12\x0e\n\x06roof_z\x18\x01 \x01(\x05\x12\r\n\x05round\x18\x02 \x01(\x08\x12\x0e\n\x06goblin\x18\x03 \x01(\x08\"_\n\x0bTrenchSpoke\x12\x13\n\x0bmound_start\x18\x01 \x01(\x05\x12\x14\n\x0ctrench_start\x18\x02 \x01(\x05\x12\x12\n\ntrench_end\x18\x03 \x01(\x05\x12\x11\n\tmound_end\x18\x04 \x01(\x05\"T\n\x1fSiteRealizationBuildingTrenches\x12\x31\n\x06spokes\x18\x01 \x03(\x0b\x32!.RemoteFortressReader.TrenchSpoke\"\xfa\x02\n\x17SiteRealizationBuilding\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05min_x\x18\x03 \x01(\x05\x12\r\n\x05min_y\x18\x04 \x01(\x05\x12\r\n\x05max_x\x18\x05 \x01(\x05\x12\r\n\x05max_y\x18\x06 \x01(\x05\x12/\n\x08material\x18\x07 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x44\n\twall_info\x18\x08 \x01(\x0b\x32\x31.RemoteFortressReader.SiteRealizationBuildingWall\x12\x46\n\ntower_info\x18\t \x01(\x0b\x32\x32.RemoteFortressReader.SiteRealizationBuildingTower\x12J\n\x0btrench_info\x18\n \x01(\x0b\x32\x35.RemoteFortressReader.SiteRealizationBuildingTrenches\x12\x0c\n\x04type\x18\x0b \x01(\x05\"\xb4\x04\n\nRegionTile\x12\x11\n\televation\x18\x01 \x01(\x05\x12\x10\n\x08rainfall\x18\x02 \x01(\x05\x12\x12\n\nvegetation\x18\x03 \x01(\x05\x12\x13\n\x0btemperature\x18\x04 \x01(\x05\x12\x10\n\x08\x65vilness\x18\x05 \x01(\x05\x12\x10\n\x08\x64rainage\x18\x06 \x01(\x05\x12\x11\n\tvolcanism\x18\x07 \x01(\x05\x12\x10\n\x08savagery\x18\x08 \x01(\x05\x12\x10\n\x08salinity\x18\t \x01(\x05\x12\x34\n\x0briver_tiles\x18\n \x01(\x0b\x32\x1f.RemoteFortressReader.RiverTile\x12\x17\n\x0fwater_elevation\x18\x0b \x01(\x05\x12\x37\n\x10surface_material\x18\x0c \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x36\n\x0fplant_materials\x18\r \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12@\n\tbuildings\x18\x0e \x03(\x0b\x32-.RemoteFortressReader.SiteRealizationBuilding\x12\x36\n\x0fstone_materials\x18\x0f \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x35\n\x0etree_materials\x18\x10 \x03(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x0c\n\x04snow\x18\x11 \x01(\x05\"~\n\tRegionMap\x12\r\n\x05map_x\x18\x01 \x01(\x05\x12\r\n\x05map_y\x18\x02 \x01(\x05\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x14\n\x0cname_english\x18\x04 \x01(\t\x12/\n\x05tiles\x18\x05 \x03(\x0b\x32 .RemoteFortressReader.RegionTile\"v\n\nRegionMaps\x12\x32\n\nworld_maps\x18\x01 \x03(\x0b\x32\x1e.RemoteFortressReader.WorldMap\x12\x34\n\x0bregion_maps\x18\x02 \x03(\x0b\x32\x1f.RemoteFortressReader.RegionMap\"\x8a\x01\n\x11PatternDescriptor\x12\n\n\x02id\x18\x01 \x01(\t\x12\x35\n\x06\x63olors\x18\x02 \x03(\x0b\x32%.RemoteFortressReader.ColorDefinition\x12\x32\n\x07pattern\x18\x03 \x01(\x0e\x32!.RemoteFortressReader.PatternType\"\xb0\x01\n\x10\x43olorModifierRaw\x12\x39\n\x08patterns\x18\x01 \x03(\x0b\x32\'.RemoteFortressReader.PatternDescriptor\x12\x14\n\x0c\x62ody_part_id\x18\x02 \x03(\x05\x12\x17\n\x0ftissue_layer_id\x18\x03 \x03(\x05\x12\x12\n\nstart_date\x18\x04 \x01(\x05\x12\x10\n\x08\x65nd_date\x18\x05 \x01(\x05\x12\x0c\n\x04part\x18\x06 \x01(\t\"d\n\x10\x42odyPartLayerRaw\x12\x12\n\nlayer_name\x18\x01 \x01(\t\x12\x11\n\ttissue_id\x18\x02 \x01(\x05\x12\x13\n\x0blayer_depth\x18\x03 \x01(\x05\x12\x14\n\x0c\x62p_modifiers\x18\x04 \x03(\x05\"\x96\x01\n\x0b\x42odyPartRaw\x12\r\n\x05token\x18\x01 \x01(\t\x12\x10\n\x08\x63\x61tegory\x18\x02 \x01(\t\x12\x0e\n\x06parent\x18\x03 \x01(\x05\x12\r\n\x05\x66lags\x18\x04 \x03(\x08\x12\x36\n\x06layers\x18\x05 \x03(\x0b\x32&.RemoteFortressReader.BodyPartLayerRaw\x12\x0f\n\x07relsize\x18\x06 \x01(\x05\"F\n\x14\x42pAppearanceModifier\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0f\n\x07mod_min\x18\x02 \x01(\x05\x12\x0f\n\x07mod_max\x18\x03 \x01(\x05\"u\n\tTissueRaw\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12/\n\x08material\x18\x03 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x1d\n\x15subordinate_to_tissue\x18\x04 \x01(\t\"\xf7\x03\n\x08\x43\x61steRaw\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x10\n\x08\x63\x61ste_id\x18\x02 \x01(\t\x12\x12\n\ncaste_name\x18\x03 \x03(\t\x12\x11\n\tbaby_name\x18\x04 \x03(\t\x12\x12\n\nchild_name\x18\x05 \x03(\t\x12\x0e\n\x06gender\x18\x06 \x01(\x05\x12\x35\n\nbody_parts\x18\x07 \x03(\x0b\x32!.RemoteFortressReader.BodyPartRaw\x12\x15\n\rtotal_relsize\x18\x08 \x01(\x05\x12=\n\tmodifiers\x18\t \x03(\x0b\x32*.RemoteFortressReader.BpAppearanceModifier\x12\x14\n\x0cmodifier_idx\x18\n \x03(\x05\x12\x10\n\x08part_idx\x18\x0b \x03(\x05\x12\x11\n\tlayer_idx\x18\x0c \x03(\x05\x12M\n\x19\x62ody_appearance_modifiers\x18\r \x03(\x0b\x32*.RemoteFortressReader.BpAppearanceModifier\x12?\n\x0f\x63olor_modifiers\x18\x0e \x03(\x0b\x32&.RemoteFortressReader.ColorModifierRaw\x12\x13\n\x0b\x64\x65scription\x18\x0f \x01(\t\x12\x12\n\nadult_size\x18\x10 \x01(\x05\"\xe5\x02\n\x0b\x43reatureRaw\x12\r\n\x05index\x18\x01 \x01(\x05\x12\x13\n\x0b\x63reature_id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x03(\t\x12\x19\n\x11general_baby_name\x18\x04 \x03(\t\x12\x1a\n\x12general_child_name\x18\x05 \x03(\t\x12\x15\n\rcreature_tile\x18\x06 \x01(\x05\x12\x1d\n\x15\x63reature_soldier_tile\x18\x07 \x01(\x05\x12\x34\n\x05\x63olor\x18\x08 \x01(\x0b\x32%.RemoteFortressReader.ColorDefinition\x12\x11\n\tadultsize\x18\t \x01(\x05\x12-\n\x05\x63\x61ste\x18\n \x03(\x0b\x32\x1e.RemoteFortressReader.CasteRaw\x12\x30\n\x07tissues\x18\x0b \x03(\x0b\x32\x1f.RemoteFortressReader.TissueRaw\x12\r\n\x05\x66lags\x18\x0c \x03(\x08\"K\n\x0f\x43reatureRawList\x12\x38\n\rcreature_raws\x18\x01 \x03(\x0b\x32!.RemoteFortressReader.CreatureRaw\"\xbb\x01\n\x04\x41rmy\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05pos_x\x18\x02 \x01(\x05\x12\r\n\x05pos_y\x18\x03 \x01(\x05\x12\r\n\x05pos_z\x18\x04 \x01(\x05\x12\x34\n\x06leader\x18\x05 \x01(\x0b\x32$.RemoteFortressReader.UnitDefinition\x12\x35\n\x07members\x18\x06 \x03(\x0b\x32$.RemoteFortressReader.UnitDefinition\x12\r\n\x05\x66lags\x18\x07 \x01(\r\"6\n\x08\x41rmyList\x12*\n\x06\x61rmies\x18\x01 \x03(\x0b\x32\x1a.RemoteFortressReader.Army\"f\n\x0bGrowthPrint\x12\x10\n\x08priority\x18\x01 \x01(\x05\x12\r\n\x05\x63olor\x18\x02 \x01(\x05\x12\x14\n\x0ctiming_start\x18\x03 \x01(\x05\x12\x12\n\ntiming_end\x18\x04 \x01(\x05\x12\x0c\n\x04tile\x18\x05 \x01(\x05\"\xef\x02\n\nTreeGrowth\x12\r\n\x05index\x18\x01 \x01(\x05\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12*\n\x03mat\x18\x04 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x31\n\x06prints\x18\x05 \x03(\x0b\x32!.RemoteFortressReader.GrowthPrint\x12\x14\n\x0ctiming_start\x18\x06 \x01(\x05\x12\x12\n\ntiming_end\x18\x07 \x01(\x05\x12\r\n\x05twigs\x18\x08 \x01(\x08\x12\x16\n\x0elight_branches\x18\t \x01(\x08\x12\x16\n\x0eheavy_branches\x18\n \x01(\x08\x12\r\n\x05trunk\x18\x0b \x01(\x08\x12\r\n\x05roots\x18\x0c \x01(\x08\x12\x0b\n\x03\x63\x61p\x18\r \x01(\x08\x12\x0f\n\x07sapling\x18\x0e \x01(\x08\x12\x1a\n\x12trunk_height_start\x18\x0f \x01(\x05\x12\x18\n\x10trunk_height_end\x18\x10 \x01(\x05\"t\n\x08PlantRaw\x12\r\n\x05index\x18\x01 \x01(\x05\x12\n\n\x02id\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\x31\n\x07growths\x18\x04 \x03(\x0b\x32 .RemoteFortressReader.TreeGrowth\x12\x0c\n\x04tile\x18\x05 \x01(\x05\"B\n\x0cPlantRawList\x12\x32\n\nplant_raws\x18\x01 \x03(\x0b\x32\x1e.RemoteFortressReader.PlantRaw\"G\n\nScreenTile\x12\x11\n\tcharacter\x18\x01 \x01(\r\x12\x12\n\nforeground\x18\x02 \x01(\r\x12\x12\n\nbackground\x18\x03 \x01(\r\"_\n\rScreenCapture\x12\r\n\x05width\x18\x01 \x01(\r\x12\x0e\n\x06height\x18\x02 \x01(\r\x12/\n\x05tiles\x18\x03 \x03(\x0b\x32 .RemoteFortressReader.ScreenTile\"x\n\rKeyboardEvent\x12\x0c\n\x04type\x18\x01 \x01(\r\x12\r\n\x05which\x18\x02 \x01(\r\x12\r\n\x05state\x18\x03 \x01(\r\x12\x10\n\x08scancode\x18\x04 \x01(\r\x12\x0b\n\x03sym\x18\x05 \x01(\r\x12\x0b\n\x03mod\x18\x06 \x01(\r\x12\x0f\n\x07unicode\x18\x07 \x01(\r\"{\n\nDigCommand\x12=\n\x0b\x64\x65signation\x18\x01 \x01(\x0e\x32(.RemoteFortressReader.TileDigDesignation\x12.\n\tlocations\x18\x02 \x03(\x0b\x32\x1b.RemoteFortressReader.Coord\"\x1b\n\nSingleBool\x12\r\n\x05Value\x18\x01 \x01(\x08\"m\n\x0bVersionInfo\x12\x1e\n\x16\x64warf_fortress_version\x18\x01 \x01(\t\x12\x16\n\x0e\x64\x66hack_version\x18\x02 \x01(\t\x12&\n\x1eremote_fortress_reader_version\x18\x03 \x01(\t\"3\n\x0bListRequest\x12\x12\n\nlist_start\x18\x01 \x01(\x05\x12\x10\n\x08list_end\x18\x02 \x01(\x05\"\x95\x02\n\x06Report\x12\x0c\n\x04type\x18\x01 \x01(\x05\x12\x0c\n\x04text\x18\x02 \x01(\t\x12\x34\n\x05\x63olor\x18\x03 \x01(\x0b\x32%.RemoteFortressReader.ColorDefinition\x12\x10\n\x08\x64uration\x18\x04 \x01(\x05\x12\x14\n\x0c\x63ontinuation\x18\x05 \x01(\x08\x12\x13\n\x0bunconscious\x18\x06 \x01(\x08\x12\x14\n\x0c\x61nnouncement\x18\x07 \x01(\x08\x12\x14\n\x0crepeat_count\x18\x08 \x01(\x05\x12(\n\x03pos\x18\t \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\n\n\x02id\x18\n \x01(\x05\x12\x0c\n\x04year\x18\x0b \x01(\x05\x12\x0c\n\x04time\x18\x0c \x01(\x05\"7\n\x06Status\x12-\n\x07reports\x18\x01 \x03(\x0b\x32\x1c.RemoteFortressReader.Report\",\n\x10ShapeDescriptior\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04tile\x18\x02 \x01(\x05\"B\n\x08Language\x12\x36\n\x06shapes\x18\x01 \x03(\x0b\x32&.RemoteFortressReader.ShapeDescriptior\"\xa5\x01\n\x0fItemImprovement\x12/\n\x08material\x18\x01 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\r\n\x05shape\x18\x03 \x01(\x05\x12\x15\n\rspecific_type\x18\x04 \x01(\x05\x12-\n\x05image\x18\x05 \x01(\x0b\x32\x1e.RemoteFortressReader.ArtImage\x12\x0c\n\x04type\x18\x06 \x01(\x05\"\xcc\x01\n\x0f\x41rtImageElement\x12\r\n\x05\x63ount\x18\x01 \x01(\x05\x12\x37\n\x04type\x18\x02 \x01(\x0e\x32).RemoteFortressReader.ArtImageElementType\x12\x34\n\rcreature_item\x18\x03 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12/\n\x08material\x18\x05 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\n\n\x02id\x18\x06 \x01(\x05\"\x9f\x01\n\x10\x41rtImageProperty\x12\x0f\n\x07subject\x18\x01 \x01(\x05\x12\x0e\n\x06object\x18\x02 \x01(\x05\x12\x30\n\x04verb\x18\x03 \x01(\x0e\x32\".RemoteFortressReader.ArtImageVerb\x12\x38\n\x04type\x18\x04 \x01(\x0e\x32*.RemoteFortressReader.ArtImagePropertyType\"\xaa\x01\n\x08\x41rtImage\x12\x37\n\x08\x65lements\x18\x01 \x03(\x0b\x32%.RemoteFortressReader.ArtImageElement\x12)\n\x02id\x18\x02 \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12:\n\nproperties\x18\x03 \x03(\x0b\x32&.RemoteFortressReader.ArtImageProperty\"\xa8\x02\n\tEngraving\x12(\n\x03pos\x18\x01 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\x0f\n\x07quality\x18\x02 \x01(\x05\x12\x0c\n\x04tile\x18\x03 \x01(\x05\x12-\n\x05image\x18\x04 \x01(\x0b\x32\x1e.RemoteFortressReader.ArtImage\x12\r\n\x05\x66loor\x18\x05 \x01(\x08\x12\x0c\n\x04west\x18\x06 \x01(\x08\x12\x0c\n\x04\x65\x61st\x18\x07 \x01(\x08\x12\r\n\x05north\x18\x08 \x01(\x08\x12\r\n\x05south\x18\t \x01(\x08\x12\x0e\n\x06hidden\x18\n \x01(\x08\x12\x11\n\tnorthwest\x18\x0b \x01(\x08\x12\x11\n\tnortheast\x18\x0c \x01(\x08\x12\x11\n\tsouthwest\x18\r \x01(\x08\x12\x11\n\tsoutheast\x18\x0e \x01(\x08\"\xf1\x02\n\x08\x46lowInfo\x12\r\n\x05index\x18\x01 \x01(\x05\x12,\n\x04type\x18\x02 \x01(\x0e\x32\x1e.RemoteFortressReader.FlowType\x12\x0f\n\x07\x64\x65nsity\x18\x03 \x01(\x05\x12(\n\x03pos\x18\x04 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12)\n\x04\x64\x65st\x18\x05 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12\x11\n\texpanding\x18\x06 \x01(\x08\x12\x11\n\x05reuse\x18\x07 \x01(\x08\x42\x02\x18\x01\x12\x10\n\x08guide_id\x18\x08 \x01(\x05\x12/\n\x08material\x18\t \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12+\n\x04item\x18\n \x01(\x0b\x32\x1d.RemoteFortressReader.MatPair\x12\x0c\n\x04\x64\x65\x61\x64\x18\x0b \x01(\x08\x12\x0c\n\x04\x66\x61st\x18\x0c \x01(\x08\x12\x10\n\x08\x63reeping\x18\r \x01(\x08\"[\n\x04Wave\x12)\n\x04\x64\x65st\x18\x01 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord\x12(\n\x03pos\x18\x02 \x01(\x0b\x32\x1b.RemoteFortressReader.Coord*\xba\x02\n\rTiletypeShape\x12\x15\n\x08NO_SHAPE\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\t\n\x05\x45MPTY\x10\x00\x12\t\n\x05\x46LOOR\x10\x01\x12\x0b\n\x07\x42OULDER\x10\x02\x12\x0b\n\x07PEBBLES\x10\x03\x12\x08\n\x04WALL\x10\x04\x12\x11\n\rFORTIFICATION\x10\x05\x12\x0c\n\x08STAIR_UP\x10\x06\x12\x0e\n\nSTAIR_DOWN\x10\x07\x12\x10\n\x0cSTAIR_UPDOWN\x10\x08\x12\x08\n\x04RAMP\x10\t\x12\x0c\n\x08RAMP_TOP\x10\n\x12\r\n\tBROOK_BED\x10\x0b\x12\r\n\tBROOK_TOP\x10\x0c\x12\x0e\n\nTREE_SHAPE\x10\r\x12\x0b\n\x07SAPLING\x10\x0e\x12\t\n\x05SHRUB\x10\x0f\x12\x0f\n\x0b\x45NDLESS_PIT\x10\x10\x12\n\n\x06\x42RANCH\x10\x11\x12\x10\n\x0cTRUNK_BRANCH\x10\x12\x12\x08\n\x04TWIG\x10\x13*\xc4\x01\n\x0fTiletypeSpecial\x12\x17\n\nNO_SPECIAL\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\n\n\x06NORMAL\x10\x00\x12\x10\n\x0cRIVER_SOURCE\x10\x01\x12\r\n\tWATERFALL\x10\x02\x12\n\n\x06SMOOTH\x10\x03\x12\x0c\n\x08\x46URROWED\x10\x04\x12\x07\n\x03WET\x10\x05\x12\x08\n\x04\x44\x45\x41\x44\x10\x06\x12\n\n\x06WORN_1\x10\x07\x12\n\n\x06WORN_2\x10\x08\x12\n\n\x06WORN_3\x10\t\x12\t\n\x05TRACK\x10\n\x12\x0f\n\x0bSMOOTH_DEAD\x10\x0b*\x8a\x03\n\x10TiletypeMaterial\x12\x18\n\x0bNO_MATERIAL\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x07\n\x03\x41IR\x10\x00\x12\x08\n\x04SOIL\x10\x01\x12\t\n\x05STONE\x10\x02\x12\x0b\n\x07\x46\x45\x41TURE\x10\x03\x12\x0e\n\nLAVA_STONE\x10\x04\x12\x0b\n\x07MINERAL\x10\x05\x12\x11\n\rFROZEN_LIQUID\x10\x06\x12\x10\n\x0c\x43ONSTRUCTION\x10\x07\x12\x0f\n\x0bGRASS_LIGHT\x10\x08\x12\x0e\n\nGRASS_DARK\x10\t\x12\r\n\tGRASS_DRY\x10\n\x12\x0e\n\nGRASS_DEAD\x10\x0b\x12\t\n\x05PLANT\x10\x0c\x12\x07\n\x03HFS\x10\r\x12\x0c\n\x08\x43\x41MPFIRE\x10\x0e\x12\x08\n\x04\x46IRE\x10\x0f\x12\t\n\x05\x41SHES\x10\x10\x12\t\n\x05MAGMA\x10\x11\x12\r\n\tDRIFTWOOD\x10\x12\x12\x08\n\x04POOL\x10\x13\x12\t\n\x05\x42ROOK\x10\x14\x12\t\n\x05RIVER\x10\x15\x12\x08\n\x04ROOT\x10\x16\x12\x11\n\rTREE_MATERIAL\x10\x17\x12\x0c\n\x08MUSHROOM\x10\x18\x12\x13\n\x0fUNDERWORLD_GATE\x10\x19*V\n\x0fTiletypeVariant\x12\x17\n\nNO_VARIANT\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\t\n\x05VAR_1\x10\x00\x12\t\n\x05VAR_2\x10\x01\x12\t\n\x05VAR_3\x10\x02\x12\t\n\x05VAR_4\x10\x03*J\n\nWorldPoles\x12\x0c\n\x08NO_POLES\x10\x00\x12\x0e\n\nNORTH_POLE\x10\x01\x12\x0e\n\nSOUTH_POLE\x10\x02\x12\x0e\n\nBOTH_POLES\x10\x03*G\n\x11\x42uildingDirection\x12\t\n\x05NORTH\x10\x00\x12\x08\n\x04\x45\x41ST\x10\x01\x12\t\n\x05SOUTH\x10\x02\x12\x08\n\x04WEST\x10\x03\x12\x08\n\x04NONE\x10\x04*\x8d\x01\n\x12TileDigDesignation\x12\n\n\x06NO_DIG\x10\x00\x12\x0f\n\x0b\x44\x45\x46\x41ULT_DIG\x10\x01\x12\x15\n\x11UP_DOWN_STAIR_DIG\x10\x02\x12\x0f\n\x0b\x43HANNEL_DIG\x10\x03\x12\x0c\n\x08RAMP_DIG\x10\x04\x12\x12\n\x0e\x44OWN_STAIR_DIG\x10\x05\x12\x10\n\x0cUP_STAIR_DIG\x10\x06*u\n\tHairStyle\x12\x14\n\x07UNKEMPT\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x12\x11\n\rNEATLY_COMBED\x10\x00\x12\x0b\n\x07\x42RAIDED\x10\x01\x12\x10\n\x0c\x44OUBLE_BRAID\x10\x02\x12\x0e\n\nPONY_TAILS\x10\x03\x12\x10\n\x0c\x43LEAN_SHAVEN\x10\x04*\x9c\x01\n\rInventoryMode\x12\n\n\x06Hauled\x10\x00\x12\n\n\x06Weapon\x10\x01\x12\x08\n\x04Worn\x10\x02\x12\x0c\n\x08Piercing\x10\x03\x12\t\n\x05\x46lask\x10\x04\x12\x11\n\rWrappedAround\x10\x05\x12\x0b\n\x07StuckIn\x10\x06\x12\x0b\n\x07InMouth\x10\x07\x12\x07\n\x03Pet\x10\x08\x12\x0c\n\x08SewnInto\x10\t\x12\x0c\n\x08Strapped\x10\n*O\n\nArmorLayer\x12\x0f\n\x0bLAYER_UNDER\x10\x00\x12\x0e\n\nLAYER_OVER\x10\x01\x12\x0f\n\x0bLAYER_ARMOR\x10\x02\x12\x0f\n\x0bLAYER_COVER\x10\x03*Q\n\x0bMatterState\x12\t\n\x05Solid\x10\x00\x12\n\n\x06Liquid\x10\x01\x12\x07\n\x03Gas\x10\x02\x12\n\n\x06Powder\x10\x03\x12\t\n\x05Paste\x10\x04\x12\x0b\n\x07Pressed\x10\x05*O\n\tFrontType\x12\x0e\n\nFRONT_NONE\x10\x00\x12\x0e\n\nFRONT_WARM\x10\x01\x12\x0e\n\nFRONT_COLD\x10\x02\x12\x12\n\x0e\x46RONT_OCCLUDED\x10\x03*Z\n\x0b\x43umulusType\x12\x10\n\x0c\x43UMULUS_NONE\x10\x00\x12\x12\n\x0e\x43UMULUS_MEDIUM\x10\x01\x12\x11\n\rCUMULUS_MULTI\x10\x02\x12\x12\n\x0e\x43UMULUS_NIMBUS\x10\x03*Y\n\x0bStratusType\x12\x10\n\x0cSTRATUS_NONE\x10\x00\x12\x10\n\x0cSTRATUS_ALTO\x10\x01\x12\x12\n\x0eSTRATUS_PROPER\x10\x02\x12\x12\n\x0eSTRATUS_NIMBUS\x10\x03*D\n\x07\x46ogType\x12\x0c\n\x08\x46OG_NONE\x10\x00\x12\x0c\n\x08\x46OG_MIST\x10\x01\x12\x0e\n\nFOG_NORMAL\x10\x02\x12\r\n\tF0G_THICK\x10\x03*]\n\x0bPatternType\x12\x0c\n\x08MONOTONE\x10\x00\x12\x0b\n\x07STRIPES\x10\x01\x12\x0c\n\x08IRIS_EYE\x10\x02\x12\t\n\x05SPOTS\x10\x03\x12\r\n\tPUPIL_EYE\x10\x04\x12\x0b\n\x07MOTTLED\x10\x05*k\n\x13\x41rtImageElementType\x12\x12\n\x0eIMAGE_CREATURE\x10\x00\x12\x0f\n\x0bIMAGE_PLANT\x10\x01\x12\x0e\n\nIMAGE_TREE\x10\x02\x12\x0f\n\x0bIMAGE_SHAPE\x10\x03\x12\x0e\n\nIMAGE_ITEM\x10\x04*B\n\x14\x41rtImagePropertyType\x12\x13\n\x0fTRANSITIVE_VERB\x10\x00\x12\x15\n\x11INTRANSITIVE_VERB\x10\x01*\x95\x08\n\x0c\x41rtImageVerb\x12\x12\n\x0eVERB_WITHERING\x10\x00\x12\x15\n\x11VERB_SURROUNDEDBY\x10\x01\x12\x13\n\x0fVERB_MASSACRING\x10\x02\x12\x11\n\rVERB_FIGHTING\x10\x03\x12\x11\n\rVERB_LABORING\x10\x04\x12\x11\n\rVERB_GREETING\x10\x05\x12\x11\n\rVERB_REFUSING\x10\x06\x12\x11\n\rVERB_SPEAKING\x10\x07\x12\x12\n\x0eVERB_EMBRACING\x10\x08\x12\x15\n\x11VERB_STRIKINGDOWN\x10\t\x12\x15\n\x11VERB_MENACINGPOSE\x10\n\x12\x12\n\x0eVERB_TRAVELING\x10\x0b\x12\x10\n\x0cVERB_RAISING\x10\x0c\x12\x0f\n\x0bVERB_HIDING\x10\r\x12\x18\n\x14VERB_LOOKINGCONFUSED\x10\x0e\x12\x19\n\x15VERB_LOOKINGTERRIFIED\x10\x0f\x12\x12\n\x0eVERB_DEVOURING\x10\x10\x12\x11\n\rVERB_ADMIRING\x10\x11\x12\x10\n\x0cVERB_BURNING\x10\x12\x12\x10\n\x0cVERB_WEEPING\x10\x13\x12\x18\n\x14VERB_LOOKINGDEJECTED\x10\x14\x12\x11\n\rVERB_CRINGING\x10\x15\x12\x12\n\x0eVERB_SCREAMING\x10\x16\x12\x1a\n\x16VERB_SUBMISSIVEGESTURE\x10\x17\x12\x16\n\x12VERB_FETALPOSITION\x10\x18\x12\x1a\n\x16VERB_SMEAREDINTOSPIRAL\x10\x19\x12\x10\n\x0cVERB_FALLING\x10\x1a\x12\r\n\tVERB_DEAD\x10\x1b\x12\x11\n\rVERB_LAUGHING\x10\x1c\x12\x18\n\x14VERB_LOOKINGOFFENDED\x10\x1d\x12\x12\n\x0eVERB_BEINGSHOT\x10\x1e\x12\x19\n\x15VERB_PLAINTIVEGESTURE\x10\x1f\x12\x10\n\x0cVERB_MELTING\x10 \x12\x11\n\rVERB_SHOOTING\x10!\x12\x12\n\x0eVERB_TORTURING\x10\"\x12\x1e\n\x1aVERB_COMMITTINGDEPRAVEDACT\x10#\x12\x10\n\x0cVERB_PRAYING\x10$\x12\x16\n\x12VERB_CONTEMPLATING\x10%\x12\x10\n\x0cVERB_COOKING\x10&\x12\x12\n\x0eVERB_ENGRAVING\x10\'\x12\x14\n\x10VERB_PROSTRATING\x10(\x12\x12\n\x0eVERB_SUFFERING\x10)\x12\x15\n\x11VERB_BEINGIMPALED\x10*\x12\x17\n\x13VERB_BEINGCONTORTED\x10+\x12\x14\n\x10VERB_BEINGFLAYED\x10,\x12\x14\n\x10VERB_HANGINGFROM\x10-\x12\x17\n\x13VERB_BEINGMUTILATED\x10.\x12\x17\n\x13VERB_TRIUMPHANTPOSE\x10/*\xe0\x01\n\x08\x46lowType\x12\n\n\x06Miasma\x10\x00\x12\t\n\x05Steam\x10\x01\x12\x08\n\x04Mist\x10\x02\x12\x10\n\x0cMaterialDust\x10\x03\x12\r\n\tMagmaMist\x10\x04\x12\t\n\x05Smoke\x10\x05\x12\x0e\n\nDragonfire\x10\x06\x12\x08\n\x04\x46ire\x10\x07\x12\x07\n\x03Web\x10\x08\x12\x0f\n\x0bMaterialGas\x10\t\x12\x11\n\rMaterialVapor\x10\n\x12\r\n\tOceanWave\x10\x0b\x12\x0b\n\x07SeaFoam\x10\x0c\x12\r\n\tItemCloud\x10\r\x12\x15\n\x08\x43\x61mpFire\x10\xff\xff\xff\xff\xff\xff\xff\xff\xff\x01\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'RemoteFortressReader_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_FLOWINFO'].fields_by_name['reuse']._loaded_options = None + _globals['_FLOWINFO'].fields_by_name['reuse']._serialized_options = b'\030\001' + _globals['_TILETYPESHAPE']._serialized_start=14466 + _globals['_TILETYPESHAPE']._serialized_end=14780 + _globals['_TILETYPESPECIAL']._serialized_start=14783 + _globals['_TILETYPESPECIAL']._serialized_end=14979 + _globals['_TILETYPEMATERIAL']._serialized_start=14982 + _globals['_TILETYPEMATERIAL']._serialized_end=15376 + _globals['_TILETYPEVARIANT']._serialized_start=15378 + _globals['_TILETYPEVARIANT']._serialized_end=15464 + _globals['_WORLDPOLES']._serialized_start=15466 + _globals['_WORLDPOLES']._serialized_end=15540 + _globals['_BUILDINGDIRECTION']._serialized_start=15542 + _globals['_BUILDINGDIRECTION']._serialized_end=15613 + _globals['_TILEDIGDESIGNATION']._serialized_start=15616 + _globals['_TILEDIGDESIGNATION']._serialized_end=15757 + _globals['_HAIRSTYLE']._serialized_start=15759 + _globals['_HAIRSTYLE']._serialized_end=15876 + _globals['_INVENTORYMODE']._serialized_start=15879 + _globals['_INVENTORYMODE']._serialized_end=16035 + _globals['_ARMORLAYER']._serialized_start=16037 + _globals['_ARMORLAYER']._serialized_end=16116 + _globals['_MATTERSTATE']._serialized_start=16118 + _globals['_MATTERSTATE']._serialized_end=16199 + _globals['_FRONTTYPE']._serialized_start=16201 + _globals['_FRONTTYPE']._serialized_end=16280 + _globals['_CUMULUSTYPE']._serialized_start=16282 + _globals['_CUMULUSTYPE']._serialized_end=16372 + _globals['_STRATUSTYPE']._serialized_start=16374 + _globals['_STRATUSTYPE']._serialized_end=16463 + _globals['_FOGTYPE']._serialized_start=16465 + _globals['_FOGTYPE']._serialized_end=16533 + _globals['_PATTERNTYPE']._serialized_start=16535 + _globals['_PATTERNTYPE']._serialized_end=16628 + _globals['_ARTIMAGEELEMENTTYPE']._serialized_start=16630 + _globals['_ARTIMAGEELEMENTTYPE']._serialized_end=16737 + _globals['_ARTIMAGEPROPERTYTYPE']._serialized_start=16739 + _globals['_ARTIMAGEPROPERTYTYPE']._serialized_end=16805 + _globals['_ARTIMAGEVERB']._serialized_start=16808 + _globals['_ARTIMAGEVERB']._serialized_end=17853 + _globals['_FLOWTYPE']._serialized_start=17856 + _globals['_FLOWTYPE']._serialized_end=18080 + _globals['_COORD']._serialized_start=77 + _globals['_COORD']._serialized_end=117 + _globals['_TILETYPE']._serialized_start=120 + _globals['_TILETYPE']._serialized_end=414 + _globals['_TILETYPELIST']._serialized_start=416 + _globals['_TILETYPELIST']._serialized_end=485 + _globals['_BUILDINGEXTENTS']._serialized_start=487 + _globals['_BUILDINGEXTENTS']._serialized_end=582 + _globals['_BUILDINGITEM']._serialized_start=584 + _globals['_BUILDINGITEM']._serialized_end=654 + _globals['_BUILDINGINSTANCE']._serialized_start=657 + _globals['_BUILDINGINSTANCE']._serialized_end=1133 + _globals['_RIVEREDGE']._serialized_start=1135 + _globals['_RIVEREDGE']._serialized_end=1215 + _globals['_RIVERTILE']._serialized_start=1218 + _globals['_RIVERTILE']._serialized_end=1419 + _globals['_SPATTER']._serialized_start=1422 + _globals['_SPATTER']._serialized_end=1591 + _globals['_SPATTERPILE']._serialized_start=1593 + _globals['_SPATTERPILE']._serialized_end=1655 + _globals['_ITEM']._serialized_start=1658 + _globals['_ITEM']._serialized_end=2174 + _globals['_PLANTTILE']._serialized_start=2177 + _globals['_PLANTTILE']._serialized_end=2396 + _globals['_TREEINFO']._serialized_start=2398 + _globals['_TREEINFO']._serialized_end=2499 + _globals['_PLANTINSTANCE']._serialized_start=2502 + _globals['_PLANTINSTANCE']._serialized_end=2630 + _globals['_MAPBLOCK']._serialized_start=2633 + _globals['_MAPBLOCK']._serialized_end=3581 + _globals['_MATPAIR']._serialized_start=3583 + _globals['_MATPAIR']._serialized_end=3629 + _globals['_COLORDEFINITION']._serialized_start=3631 + _globals['_COLORDEFINITION']._serialized_end=3690 + _globals['_MATERIALDEFINITION']._serialized_start=3693 + _globals['_MATERIALDEFINITION']._serialized_end=3987 + _globals['_BUILDINGTYPE']._serialized_start=3989 + _globals['_BUILDINGTYPE']._serialized_end=4077 + _globals['_BUILDINGDEFINITION']._serialized_start=4079 + _globals['_BUILDINGDEFINITION']._serialized_end=4184 + _globals['_BUILDINGLIST']._serialized_start=4186 + _globals['_BUILDINGLIST']._serialized_end=4265 + _globals['_MATERIALLIST']._serialized_start=4267 + _globals['_MATERIALLIST']._serialized_end=4346 + _globals['_HAIR']._serialized_start=4348 + _globals['_HAIR']._serialized_end=4418 + _globals['_BODYSIZEINFO']._serialized_start=4421 + _globals['_BODYSIZEINFO']._serialized_end=4550 + _globals['_UNITAPPEARANCE']._serialized_start=4553 + _globals['_UNITAPPEARANCE']._serialized_end=4863 + _globals['_INVENTORYITEM']._serialized_start=4866 + _globals['_INVENTORYITEM']._serialized_end=4996 + _globals['_WOUNDPART']._serialized_start=4998 + _globals['_WOUNDPART']._serialized_end=5076 + _globals['_UNITWOUND']._serialized_start=5078 + _globals['_UNITWOUND']._serialized_end=5159 + _globals['_UNITDEFINITION']._serialized_start=5162 + _globals['_UNITDEFINITION']._serialized_end=5880 + _globals['_UNITLIST']._serialized_start=5882 + _globals['_UNITLIST']._serialized_end=5953 + _globals['_BLOCKREQUEST']._serialized_start=5956 + _globals['_BLOCKREQUEST']._serialized_end=6105 + _globals['_BLOCKLIST']._serialized_start=6108 + _globals['_BLOCKLIST']._serialized_end=6303 + _globals['_PLANTDEF']._serialized_start=6305 + _globals['_PLANTDEF']._serialized_end=6375 + _globals['_PLANTLIST']._serialized_start=6377 + _globals['_PLANTLIST']._serialized_end=6440 + _globals['_VIEWINFO']._serialized_start=6443 + _globals['_VIEWINFO']._serialized_end=6677 + _globals['_MAPINFO']._serialized_start=6680 + _globals['_MAPINFO']._serialized_end=6885 + _globals['_CLOUD']._serialized_start=6888 + _globals['_CLOUD']._serialized_end=7107 + _globals['_WORLDMAP']._serialized_start=7110 + _globals['_WORLDMAP']._serialized_end=7728 + _globals['_SITEREALIZATIONBUILDINGWALL']._serialized_start=7730 + _globals['_SITEREALIZATIONBUILDINGWALL']._serialized_end=7855 + _globals['_SITEREALIZATIONBUILDINGTOWER']._serialized_start=7857 + _globals['_SITEREALIZATIONBUILDINGTOWER']._serialized_end=7934 + _globals['_TRENCHSPOKE']._serialized_start=7936 + _globals['_TRENCHSPOKE']._serialized_end=8031 + _globals['_SITEREALIZATIONBUILDINGTRENCHES']._serialized_start=8033 + _globals['_SITEREALIZATIONBUILDINGTRENCHES']._serialized_end=8117 + _globals['_SITEREALIZATIONBUILDING']._serialized_start=8120 + _globals['_SITEREALIZATIONBUILDING']._serialized_end=8498 + _globals['_REGIONTILE']._serialized_start=8501 + _globals['_REGIONTILE']._serialized_end=9065 + _globals['_REGIONMAP']._serialized_start=9067 + _globals['_REGIONMAP']._serialized_end=9193 + _globals['_REGIONMAPS']._serialized_start=9195 + _globals['_REGIONMAPS']._serialized_end=9313 + _globals['_PATTERNDESCRIPTOR']._serialized_start=9316 + _globals['_PATTERNDESCRIPTOR']._serialized_end=9454 + _globals['_COLORMODIFIERRAW']._serialized_start=9457 + _globals['_COLORMODIFIERRAW']._serialized_end=9633 + _globals['_BODYPARTLAYERRAW']._serialized_start=9635 + _globals['_BODYPARTLAYERRAW']._serialized_end=9735 + _globals['_BODYPARTRAW']._serialized_start=9738 + _globals['_BODYPARTRAW']._serialized_end=9888 + _globals['_BPAPPEARANCEMODIFIER']._serialized_start=9890 + _globals['_BPAPPEARANCEMODIFIER']._serialized_end=9960 + _globals['_TISSUERAW']._serialized_start=9962 + _globals['_TISSUERAW']._serialized_end=10079 + _globals['_CASTERAW']._serialized_start=10082 + _globals['_CASTERAW']._serialized_end=10585 + _globals['_CREATURERAW']._serialized_start=10588 + _globals['_CREATURERAW']._serialized_end=10945 + _globals['_CREATURERAWLIST']._serialized_start=10947 + _globals['_CREATURERAWLIST']._serialized_end=11022 + _globals['_ARMY']._serialized_start=11025 + _globals['_ARMY']._serialized_end=11212 + _globals['_ARMYLIST']._serialized_start=11214 + _globals['_ARMYLIST']._serialized_end=11268 + _globals['_GROWTHPRINT']._serialized_start=11270 + _globals['_GROWTHPRINT']._serialized_end=11372 + _globals['_TREEGROWTH']._serialized_start=11375 + _globals['_TREEGROWTH']._serialized_end=11742 + _globals['_PLANTRAW']._serialized_start=11744 + _globals['_PLANTRAW']._serialized_end=11860 + _globals['_PLANTRAWLIST']._serialized_start=11862 + _globals['_PLANTRAWLIST']._serialized_end=11928 + _globals['_SCREENTILE']._serialized_start=11930 + _globals['_SCREENTILE']._serialized_end=12001 + _globals['_SCREENCAPTURE']._serialized_start=12003 + _globals['_SCREENCAPTURE']._serialized_end=12098 + _globals['_KEYBOARDEVENT']._serialized_start=12100 + _globals['_KEYBOARDEVENT']._serialized_end=12220 + _globals['_DIGCOMMAND']._serialized_start=12222 + _globals['_DIGCOMMAND']._serialized_end=12345 + _globals['_SINGLEBOOL']._serialized_start=12347 + _globals['_SINGLEBOOL']._serialized_end=12374 + _globals['_VERSIONINFO']._serialized_start=12376 + _globals['_VERSIONINFO']._serialized_end=12485 + _globals['_LISTREQUEST']._serialized_start=12487 + _globals['_LISTREQUEST']._serialized_end=12538 + _globals['_REPORT']._serialized_start=12541 + _globals['_REPORT']._serialized_end=12818 + _globals['_STATUS']._serialized_start=12820 + _globals['_STATUS']._serialized_end=12875 + _globals['_SHAPEDESCRIPTIOR']._serialized_start=12877 + _globals['_SHAPEDESCRIPTIOR']._serialized_end=12921 + _globals['_LANGUAGE']._serialized_start=12923 + _globals['_LANGUAGE']._serialized_end=12989 + _globals['_ITEMIMPROVEMENT']._serialized_start=12992 + _globals['_ITEMIMPROVEMENT']._serialized_end=13157 + _globals['_ARTIMAGEELEMENT']._serialized_start=13160 + _globals['_ARTIMAGEELEMENT']._serialized_end=13364 + _globals['_ARTIMAGEPROPERTY']._serialized_start=13367 + _globals['_ARTIMAGEPROPERTY']._serialized_end=13526 + _globals['_ARTIMAGE']._serialized_start=13529 + _globals['_ARTIMAGE']._serialized_end=13699 + _globals['_ENGRAVING']._serialized_start=13702 + _globals['_ENGRAVING']._serialized_end=13998 + _globals['_FLOWINFO']._serialized_start=14001 + _globals['_FLOWINFO']._serialized_end=14370 + _globals['_WAVE']._serialized_start=14372 + _globals['_WAVE']._serialized_end=14463 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/__init__.py b/src/dfhack_client_python/py_export/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/dfhack_client_python/py_export/stockpiles_pb2.py b/src/dfhack_client_python/py_export/stockpiles_pb2.py new file mode 100644 index 0000000..631c006 --- /dev/null +++ b/src/dfhack_client_python/py_export/stockpiles_pb2.py @@ -0,0 +1,77 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: stockpiles.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'stockpiles.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x10stockpiles.proto\x12\x0c\x64\x66stockpiles\"\x96\x1b\n\x11StockpileSettings\x12\x13\n\x0bmax_barrels\x18\x14 \x01(\x05\x12\x10\n\x08max_bins\x18\x15 \x01(\x05\x12\x18\n\x10max_wheelbarrows\x18\x16 \x01(\x05\x12\x16\n\x0euse_links_only\x18\x17 \x01(\x08\x12\x15\n\rallow_organic\x18\x12 \x01(\x08\x12\x17\n\x0f\x61llow_inorganic\x18\x13 \x01(\x08\x12\x35\n\x04\x61mmo\x18\x08 \x01(\x0b\x32\'.dfstockpiles.StockpileSettings.AmmoSet\x12;\n\x07\x61nimals\x18\x01 \x01(\x0b\x32*.dfstockpiles.StockpileSettings.AnimalsSet\x12\x37\n\x05\x61rmor\x18\x11 \x01(\x0b\x32(.dfstockpiles.StockpileSettings.ArmorSet\x12\x41\n\nbarsblocks\x18\n \x01(\x0b\x32-.dfstockpiles.StockpileSettings.BarsBlocksSet\x12\x37\n\x05\x63loth\x18\x0e \x01(\x0b\x32(.dfstockpiles.StockpileSettings.ClothSet\x12\x35\n\x04\x63oin\x18\t \x01(\x0b\x32\'.dfstockpiles.StockpileSettings.CoinSet\x12H\n\x0e\x66inished_goods\x18\x0c \x01(\x0b\x32\x30.dfstockpiles.StockpileSettings.FinishedGoodsSet\x12\x35\n\x04\x66ood\x18\x02 \x01(\x0b\x32\'.dfstockpiles.StockpileSettings.FoodSet\x12?\n\tfurniture\x18\x03 \x01(\x0b\x32,.dfstockpiles.StockpileSettings.FurnitureSet\x12\x35\n\x04gems\x18\x0b \x01(\x0b\x32\'.dfstockpiles.StockpileSettings.GemsSet\x12;\n\x07leather\x18\r \x01(\x0b\x32*.dfstockpiles.StockpileSettings.LeatherSet\x12?\n\x0b\x63orpses_v50\x18\x19 \x01(\x0b\x32*.dfstockpiles.StockpileSettings.CorpsesSet\x12\x39\n\x06refuse\x18\x05 \x01(\x0b\x32).dfstockpiles.StockpileSettings.RefuseSet\x12\x37\n\x05sheet\x18\x1a \x01(\x0b\x32(.dfstockpiles.StockpileSettings.SheetSet\x12\x37\n\x05stone\x18\x06 \x01(\x0b\x32(.dfstockpiles.StockpileSettings.StoneSet\x12;\n\x07weapons\x18\x10 \x01(\x0b\x32*.dfstockpiles.StockpileSettings.WeaponsSet\x12\x35\n\x04wood\x18\x0f \x01(\x0b\x32\'.dfstockpiles.StockpileSettings.WoodSet\x12\x0f\n\x07\x63orpses\x18\x18 \x01(\x08\x12\x37\n\x03ore\x18\x07 \x01(\x0b\x32&.dfstockpiles.StockpileSettings.OreSetB\x02\x18\x01\x12\x14\n\x08unknown1\x18\x04 \x01(\x05\x42\x02\x18\x01\x1aT\n\nAnimalsSet\x12\x0b\n\x03\x61ll\x18\x04 \x01(\x08\x12\x13\n\x0b\x65mpty_cages\x18\x01 \x01(\x08\x12\x13\n\x0b\x65mpty_traps\x18\x02 \x01(\x08\x12\x0f\n\x07\x65nabled\x18\x03 \x03(\t\x1a\xa0\x03\n\x07\x46oodSet\x12\x0b\n\x03\x61ll\x18\x15 \x01(\x08\x12\x0c\n\x04meat\x18\x01 \x03(\t\x12\x0c\n\x04\x66ish\x18\x02 \x03(\t\x12\x17\n\x0funprepared_fish\x18\x14 \x03(\t\x12\x0b\n\x03\x65gg\x18\x03 \x03(\t\x12\x0e\n\x06plants\x18\x04 \x03(\t\x12\x13\n\x0b\x64rink_plant\x18\x05 \x03(\t\x12\x14\n\x0c\x64rink_animal\x18\x06 \x03(\t\x12\x14\n\x0c\x63heese_plant\x18\x07 \x03(\t\x12\x15\n\rcheese_animal\x18\x08 \x03(\t\x12\r\n\x05seeds\x18\t \x03(\t\x12\x0e\n\x06leaves\x18\n \x03(\t\x12\x14\n\x0cpowder_plant\x18\x0b \x03(\t\x12\x17\n\x0fpowder_creature\x18\x0c \x03(\t\x12\x0c\n\x04glob\x18\r \x03(\t\x12\x12\n\nglob_paste\x18\x0e \x03(\t\x12\x14\n\x0cglob_pressed\x18\x0f \x03(\t\x12\x14\n\x0cliquid_plant\x18\x10 \x03(\t\x12\x15\n\rliquid_animal\x18\x11 \x03(\t\x12\x13\n\x0bliquid_misc\x18\x12 \x03(\t\x12\x16\n\x0eprepared_meals\x18\x13 \x01(\x08\x1ax\n\x0c\x46urnitureSet\x12\x0b\n\x03\x61ll\x18\x07 \x01(\x08\x12\x0c\n\x04type\x18\x01 \x03(\t\x12\x12\n\nother_mats\x18\x02 \x03(\t\x12\x0c\n\x04mats\x18\x03 \x03(\t\x12\x14\n\x0cquality_core\x18\x04 \x03(\t\x12\x15\n\rquality_total\x18\x05 \x03(\t\x1a\xd7\x01\n\tRefuseSet\x12\x0b\n\x03\x61ll\x18\x0c \x01(\x08\x12\x0c\n\x04type\x18\x01 \x03(\t\x12\x0f\n\x07\x63orpses\x18\x02 \x03(\t\x12\x12\n\nbody_parts\x18\x03 \x03(\t\x12\x0e\n\x06skulls\x18\x04 \x03(\t\x12\r\n\x05\x62ones\x18\x05 \x03(\t\x12\x0c\n\x04hair\x18\x06 \x03(\t\x12\x0e\n\x06shells\x18\x07 \x03(\t\x12\r\n\x05teeth\x18\x08 \x03(\t\x12\r\n\x05horns\x18\t \x03(\t\x12\x16\n\x0e\x66resh_raw_hide\x18\n \x01(\x08\x12\x17\n\x0frotten_raw_hide\x18\x0b \x01(\x08\x1a%\n\x08StoneSet\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12\x0c\n\x04mats\x18\x01 \x03(\t\x1a\x16\n\x06OreSet\x12\x0c\n\x04mats\x18\x01 \x03(\t\x1as\n\x07\x41mmoSet\x12\x0b\n\x03\x61ll\x18\x06 \x01(\x08\x12\x0c\n\x04type\x18\x01 \x03(\t\x12\x12\n\nother_mats\x18\x02 \x03(\t\x12\x0c\n\x04mats\x18\x03 \x03(\t\x12\x14\n\x0cquality_core\x18\x04 \x03(\t\x12\x15\n\rquality_total\x18\x05 \x03(\t\x1a$\n\x07\x43oinSet\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12\x0c\n\x04mats\x18\x01 \x03(\t\x1ax\n\rBarsBlocksSet\x12\x0b\n\x03\x61ll\x18\x05 \x01(\x08\x12\x17\n\x0f\x62\x61rs_other_mats\x18\x01 \x03(\t\x12\x19\n\x11\x62locks_other_mats\x18\x02 \x03(\t\x12\x11\n\tbars_mats\x18\x03 \x03(\t\x12\x13\n\x0b\x62locks_mats\x18\x04 \x03(\t\x1an\n\x07GemsSet\x12\x0b\n\x03\x61ll\x18\x05 \x01(\x08\x12\x18\n\x10rough_other_mats\x18\x01 \x03(\t\x12\x16\n\x0e\x63ut_other_mats\x18\x02 \x03(\t\x12\x12\n\nrough_mats\x18\x03 \x03(\t\x12\x10\n\x08\x63ut_mats\x18\x04 \x03(\t\x1a|\n\x10\x46inishedGoodsSet\x12\x0b\n\x03\x61ll\x18\x06 \x01(\x08\x12\x0c\n\x04type\x18\x01 \x03(\t\x12\x12\n\nother_mats\x18\x02 \x03(\t\x12\x0c\n\x04mats\x18\x03 \x03(\t\x12\x14\n\x0cquality_core\x18\x04 \x03(\t\x12\x15\n\rquality_total\x18\x05 \x03(\t\x1a\'\n\nLeatherSet\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12\x0c\n\x04mats\x18\x01 \x03(\t\x1a\xbf\x01\n\x08\x43lothSet\x12\x0b\n\x03\x61ll\x18\t \x01(\x08\x12\x13\n\x0bthread_silk\x18\x01 \x03(\t\x12\x14\n\x0cthread_plant\x18\x02 \x03(\t\x12\x13\n\x0bthread_yarn\x18\x03 \x03(\t\x12\x14\n\x0cthread_metal\x18\x04 \x03(\t\x12\x12\n\ncloth_silk\x18\x05 \x03(\t\x12\x13\n\x0b\x63loth_plant\x18\x06 \x03(\t\x12\x12\n\ncloth_yarn\x18\x07 \x03(\t\x12\x13\n\x0b\x63loth_metal\x18\x08 \x03(\t\x1a$\n\x07WoodSet\x12\x0b\n\x03\x61ll\x18\x02 \x01(\x08\x12\x0c\n\x04mats\x18\x01 \x03(\t\x1a\xb6\x01\n\nWeaponsSet\x12\x0b\n\x03\x61ll\x18\t \x01(\x08\x12\x13\n\x0bweapon_type\x18\x01 \x03(\t\x12\x15\n\rtrapcomp_type\x18\x02 \x03(\t\x12\x12\n\nother_mats\x18\x03 \x03(\t\x12\x0c\n\x04mats\x18\x04 \x03(\t\x12\x14\n\x0cquality_core\x18\x05 \x03(\t\x12\x15\n\rquality_total\x18\x06 \x03(\t\x12\x0e\n\x06usable\x18\x07 \x01(\x08\x12\x10\n\x08unusable\x18\x08 \x01(\x08\x1a\xdf\x01\n\x08\x41rmorSet\x12\x0b\n\x03\x61ll\x18\r \x01(\x08\x12\x0c\n\x04\x62ody\x18\x01 \x03(\t\x12\x0c\n\x04head\x18\x02 \x03(\t\x12\x0c\n\x04\x66\x65\x65t\x18\x03 \x03(\t\x12\r\n\x05hands\x18\x04 \x03(\t\x12\x0c\n\x04legs\x18\x05 \x03(\t\x12\x0e\n\x06shield\x18\x06 \x03(\t\x12\x12\n\nother_mats\x18\x07 \x03(\t\x12\x0c\n\x04mats\x18\x08 \x03(\t\x12\x14\n\x0cquality_core\x18\t \x03(\t\x12\x15\n\rquality_total\x18\n \x03(\t\x12\x0e\n\x06usable\x18\x0b \x01(\x08\x12\x10\n\x08unusable\x18\x0c \x01(\x08\x1a*\n\nCorpsesSet\x12\x0b\n\x03\x61ll\x18\x01 \x01(\x08\x12\x0f\n\x07\x63orpses\x18\x02 \x03(\t\x1a\x39\n\x08SheetSet\x12\x0b\n\x03\x61ll\x18\x01 \x01(\x08\x12\r\n\x05paper\x18\x02 \x03(\t\x12\x11\n\tparchment\x18\x03 \x03(\tB\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'stockpiles_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_STOCKPILESETTINGS'].fields_by_name['ore']._loaded_options = None + _globals['_STOCKPILESETTINGS'].fields_by_name['ore']._serialized_options = b'\030\001' + _globals['_STOCKPILESETTINGS'].fields_by_name['unknown1']._loaded_options = None + _globals['_STOCKPILESETTINGS'].fields_by_name['unknown1']._serialized_options = b'\030\001' + _globals['_STOCKPILESETTINGS']._serialized_start=35 + _globals['_STOCKPILESETTINGS']._serialized_end=3513 + _globals['_STOCKPILESETTINGS_ANIMALSSET']._serialized_start=1305 + _globals['_STOCKPILESETTINGS_ANIMALSSET']._serialized_end=1389 + _globals['_STOCKPILESETTINGS_FOODSET']._serialized_start=1392 + _globals['_STOCKPILESETTINGS_FOODSET']._serialized_end=1808 + _globals['_STOCKPILESETTINGS_FURNITURESET']._serialized_start=1810 + _globals['_STOCKPILESETTINGS_FURNITURESET']._serialized_end=1930 + _globals['_STOCKPILESETTINGS_REFUSESET']._serialized_start=1933 + _globals['_STOCKPILESETTINGS_REFUSESET']._serialized_end=2148 + _globals['_STOCKPILESETTINGS_STONESET']._serialized_start=2150 + _globals['_STOCKPILESETTINGS_STONESET']._serialized_end=2187 + _globals['_STOCKPILESETTINGS_ORESET']._serialized_start=2189 + _globals['_STOCKPILESETTINGS_ORESET']._serialized_end=2211 + _globals['_STOCKPILESETTINGS_AMMOSET']._serialized_start=2213 + _globals['_STOCKPILESETTINGS_AMMOSET']._serialized_end=2328 + _globals['_STOCKPILESETTINGS_COINSET']._serialized_start=2330 + _globals['_STOCKPILESETTINGS_COINSET']._serialized_end=2366 + _globals['_STOCKPILESETTINGS_BARSBLOCKSSET']._serialized_start=2368 + _globals['_STOCKPILESETTINGS_BARSBLOCKSSET']._serialized_end=2488 + _globals['_STOCKPILESETTINGS_GEMSSET']._serialized_start=2490 + _globals['_STOCKPILESETTINGS_GEMSSET']._serialized_end=2600 + _globals['_STOCKPILESETTINGS_FINISHEDGOODSSET']._serialized_start=2602 + _globals['_STOCKPILESETTINGS_FINISHEDGOODSSET']._serialized_end=2726 + _globals['_STOCKPILESETTINGS_LEATHERSET']._serialized_start=2728 + _globals['_STOCKPILESETTINGS_LEATHERSET']._serialized_end=2767 + _globals['_STOCKPILESETTINGS_CLOTHSET']._serialized_start=2770 + _globals['_STOCKPILESETTINGS_CLOTHSET']._serialized_end=2961 + _globals['_STOCKPILESETTINGS_WOODSET']._serialized_start=2963 + _globals['_STOCKPILESETTINGS_WOODSET']._serialized_end=2999 + _globals['_STOCKPILESETTINGS_WEAPONSSET']._serialized_start=3002 + _globals['_STOCKPILESETTINGS_WEAPONSSET']._serialized_end=3184 + _globals['_STOCKPILESETTINGS_ARMORSET']._serialized_start=3187 + _globals['_STOCKPILESETTINGS_ARMORSET']._serialized_end=3410 + _globals['_STOCKPILESETTINGS_CORPSESSET']._serialized_start=3412 + _globals['_STOCKPILESETTINGS_CORPSESSET']._serialized_end=3454 + _globals['_STOCKPILESETTINGS_SHEETSET']._serialized_start=3456 + _globals['_STOCKPILESETTINGS_SHEETSET']._serialized_end=3513 +# @@protoc_insertion_point(module_scope) diff --git a/src/dfhack_client_python/py_export/ui_sidebar_mode_pb2.py b/src/dfhack_client_python/py_export/ui_sidebar_mode_pb2.py new file mode 100644 index 0000000..1dede6b --- /dev/null +++ b/src/dfhack_client_python/py_export/ui_sidebar_mode_pb2.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# NO CHECKED-IN PROTOBUF GENCODE +# source: ui_sidebar_mode.proto +# Protobuf Python Version: 6.31.1 +"""Generated protocol buffer code.""" +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import runtime_version as _runtime_version +from google.protobuf import symbol_database as _symbol_database +from google.protobuf.internal import builder as _builder +_runtime_version.ValidateProtobufRuntimeVersion( + _runtime_version.Domain.PUBLIC, + 6, + 31, + 1, + '', + 'ui_sidebar_mode.proto' +) +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15ui_sidebar_mode.proto\x12\x1bproto.enums.ui_sidebar_mode*\xa0\t\n\x0fui_sidebar_mode\x12\x0b\n\x07\x44\x65\x66\x61ult\x10\x00\x12\n\n\x06Squads\x10\x01\x12\x11\n\rDesignateMine\x10\x02\x12\x18\n\x14\x44\x65signateRemoveRamps\x10\x03\x12\x14\n\x10\x44\x65signateUpStair\x10\x04\x12\x16\n\x12\x44\x65signateDownStair\x10\x05\x12\x18\n\x14\x44\x65signateUpDownStair\x10\x06\x12\x13\n\x0f\x44\x65signateUpRamp\x10\x07\x12\x14\n\x10\x44\x65signateChannel\x10\x08\x12\x19\n\x15\x44\x65signateGatherPlants\x10\t\x12\x1e\n\x1a\x44\x65signateRemoveDesignation\x10\n\x12\x13\n\x0f\x44\x65signateSmooth\x10\x0b\x12\x17\n\x13\x44\x65signateCarveTrack\x10\x0c\x12\x14\n\x10\x44\x65signateEngrave\x10\r\x12\x1f\n\x1b\x44\x65signateCarveFortification\x10\x0e\x12\x0e\n\nStockpiles\x10\x0f\x12\t\n\x05\x42uild\x10\x10\x12\x11\n\rQueryBuilding\x10\x11\x12\n\n\x06Orders\x10\x12\x12\x10\n\x0cOrdersForbid\x10\x13\x12\x10\n\x0cOrdersRefuse\x10\x14\x12\x12\n\x0eOrdersWorkshop\x10\x15\x12\x0e\n\nOrdersZone\x10\x16\x12\x11\n\rBuildingItems\x10\x17\x12\r\n\tViewUnits\x10\x18\x12\x0e\n\nLookAround\x10\x19\x12\x17\n\x13\x44\x65signateItemsClaim\x10\x1a\x12\x18\n\x14\x44\x65signateItemsForbid\x10\x1b\x12\x16\n\x12\x44\x65signateItemsMelt\x10\x1c\x12\x18\n\x14\x44\x65signateItemsUnmelt\x10\x1d\x12\x16\n\x12\x44\x65signateItemsDump\x10\x1e\x12\x18\n\x14\x44\x65signateItemsUndump\x10\x1f\x12\x16\n\x12\x44\x65signateItemsHide\x10 \x12\x18\n\x14\x44\x65signateItemsUnhide\x10!\x12\x16\n\x12\x44\x65signateChopTrees\x10\"\x12\x1d\n\x19\x44\x65signateToggleEngravings\x10#\x12\x19\n\x15\x44\x65signateToggleMarker\x10$\x12\x0b\n\x07Hotkeys\x10%\x12\x18\n\x14\x44\x65signateTrafficHigh\x10&\x12\x1a\n\x16\x44\x65signateTrafficNormal\x10\'\x12\x17\n\x13\x44\x65signateTrafficLow\x10(\x12\x1e\n\x1a\x44\x65signateTrafficRestricted\x10)\x12\t\n\x05Zones\x10*\x12\x10\n\x0cZonesPenInfo\x10+\x12\x10\n\x0cZonesPitInfo\x10,\x12\x15\n\x11ZonesHospitalInfo\x10-\x12\x13\n\x0fZonesGatherInfo\x10.\x12\x1f\n\x1b\x44\x65signateRemoveConstruction\x10/\x12\x0f\n\x0b\x44\x65potAccess\x10\x30\x12\x0f\n\x0bNotesPoints\x10\x31\x12\x0f\n\x0bNotesRoutes\x10\x32\x12\x0b\n\x07\x42urrows\x10\x33\x12\x0b\n\x07Hauling\x10\x34\x12\x10\n\x0c\x41renaWeather\x10\x35\x12\x0e\n\nArenaTrees\x10\x36\x42\x02H\x03') + +_globals = globals() +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ui_sidebar_mode_pb2', _globals) +if not _descriptor._USE_C_DESCRIPTORS: + _globals['DESCRIPTOR']._loaded_options = None + _globals['DESCRIPTOR']._serialized_options = b'H\003' + _globals['_UI_SIDEBAR_MODE']._serialized_start=55 + _globals['_UI_SIDEBAR_MODE']._serialized_end=1239 +# @@protoc_insertion_point(module_scope) From 552a1e9f6111e544f8a78d7858efc3d62b4dde29 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 4 Jul 2025 17:38:56 -0500 Subject: [PATCH 2/9] Cleaned up the blendwarf.py example to be more clear. Uses one function from CoreProtocal and one from the RemoteFortressReader plugin. Properly imports protobuff types from the _pb2 files. --- examples/blendwarf.py | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/examples/blendwarf.py b/examples/blendwarf.py index 79a6120..5767e25 100644 --- a/examples/blendwarf.py +++ b/examples/blendwarf.py @@ -1,27 +1,22 @@ import asyncio -from dfhack_client_python.dfhack_remote import remote, connect, close, StringMessage, EmptyMessage +# Import connection management functions +from dfhack_client_python.dfhack_remote import remote, connect, close +# Import protobuf message types +from dfhack_client_python.py_export.CoreProtocol_pb2 import StringMessage +from dfhack_client_python.py_export.RemoteFortressReader_pb2 import UnitList ## Declare DFHack exported interfaces @remote -async def GetVersion(output: StringMessage = None): pass +async def GetVersion(output: StringMessage = None): pass -from dfhack_client_python.py_export.BasicApi_pb2 import GetWorldInfoOut -@remote -async def GetWorldInfo(output: GetWorldInfoOut = None): pass - -from RemoteFortressReader_pb2 import VersionInfo -@remote(plugin='RemoteFortressReader') -async def GetVersionInfo(output: VersionInfo = None): pass - -from RemoteFortressReader_pb2 import UnitList @remote(plugin='RemoteFortressReader') async def GetUnitList(output: UnitList = None): pass # Test async def main(): await connect() - print( await GetVersionInfo() ) - print( "Units: ", len((await GetUnitList()).creature_list) ) + print( "DFHack Version: ", (await GetVersion()).value ) + print( "Units: ", len((await GetUnitList()).creature_list)) await close() asyncio.run(main()) From de5fcfd368ef3e3ee81049dc0fd01e713666d610 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 4 Jul 2025 18:31:51 -0500 Subject: [PATCH 3/9] Add DFHackError exception handling and improve RPC response processing - Introduced DFHackError class for better error management in DFHack commands. - Enhanced get_header function to handle RPC_REPLY_FAIL and raise DFHackError. - Updated remote function to process RPC_REPLY_TEXT and RPC_REPLY_RESULT messages and log text notifications to standard output. - Adjusted byte size handling in get_header for consistency (python slice is non inclusive for the end). --- src/dfhack_client_python/dfhack_remote.py | 83 +++++++++++++++++------ 1 file changed, 62 insertions(+), 21 deletions(-) diff --git a/src/dfhack_client_python/dfhack_remote.py b/src/dfhack_client_python/dfhack_remote.py index 3b5ffd8..4f4e99d 100644 --- a/src/dfhack_client_python/dfhack_remote.py +++ b/src/dfhack_client_python/dfhack_remote.py @@ -3,10 +3,21 @@ import functools from enum import IntEnum -from .py_export.CoreProtocol_pb2 import EmptyMessage, StringMessage, CoreBindReply, CoreBindRequest, CoreTextNotification +from .py_export.CoreProtocol_pb2 import EmptyMessage, CoreBindReply, CoreBindRequest, CoreTextNotification, CoreErrorNotification _reader, _writer = None, None +class DFHackError(Exception): + """Exception raised when a DFHack command fails""" + def __init__(self, code, message=None): + self.code = code + try: + self.code_name = CoreErrorNotification.ErrorCode.Name(code) + except ValueError: + self.code_name = f"Unknown({code})" + self.message = message or f"DFHack command failed with error code: {self.code} ({self.code_name})" + super().__init__(self.message) + class DFHackReplyCode(IntEnum): RPC_REPLY_RESULT = -1 RPC_REPLY_FAIL = -2 @@ -21,7 +32,13 @@ def header(id, size): async def get_header(): h = await _reader.read(8) id = int.from_bytes(h[0:2], sys.byteorder, signed=True) - size = int.from_bytes(h[4:7], sys.byteorder) + size = int.from_bytes(h[4:8], sys.byteorder) + + # For RPC_REPLY_FAIL, the size field is reused for command_result + if id == DFHackReplyCode.RPC_REPLY_FAIL: + command_result = size + raise DFHackError(command_result) + return id, size def request(id, msg): @@ -38,18 +55,20 @@ def unmarshal(id, msg): obj = CoreTextNotification() obj.ParseFromString(msg) raise Exception(obj) - # TODO others + elif id == DFHackReplyCode.RPC_REPLY_FAIL: + error_code = int.from_bytes(msg, sys.byteorder, signed=True) + raise DFHackError(error_code) + else: + raise DFHackError(f"Unknown reply code: {id}") @functools.lru_cache(maxsize=65534) async def BindMethod(method, input_msg, output_msg, plugin=''): - """Issue a CoreBindRequest to DFHack and caches the returned identifier number - """ + """Issue a CoreBindRequest to DFHack and caches the returned identifier number""" br = CoreBindRequest() br.method, br.input_msg, br.output_msg, br.plugin = \ method, input_msg.DESCRIPTOR.full_name, output_msg.DESCRIPTOR.full_name, plugin _writer.write( request(0, br) ) - h = await _reader.read(8) - id, size = int.from_bytes(h[0:2], sys.byteorder, signed=True), int.from_bytes(h[4:7], sys.byteorder) + id, size = await get_header() return unmarshal(id, await _reader.read(size)) async def close(): @@ -80,28 +99,50 @@ async def GetVersionInfo(input: EmptyMessage = None, output: VersionInfo = None) async def GetVersion(output: StringMessage = None): """ - from functools import wraps, update_wrapper + from functools import update_wrapper from inspect import signature input, output, function, _plugin = None, None, None, None async def wrapper(*args, **kwds): - #if isinstance(plugin, str): - # kwds['plugin'] = plugin _id = await BindMethod(function.__name__, input, output, plugin=_plugin, **kwds) _writer.write( request(_id, input()) ) - id, size = await get_header() - if id == DFHackReplyCode.RPC_REPLY_RESULT: - buffer = await _reader.read(size) - size -= len(buffer) - while size: - more = await _reader.read(size) - buffer += more - size -= len(more) - obj = output() - obj.ParseFromString(buffer) - return obj + # According to the protocol, the server may send zero or more RPC_REPLY_TEXT + # messages followed by either RPC_REPLY_RESULT or RPC_REPLY_FAIL + while True: + id, size = await get_header() + + if id == DFHackReplyCode.RPC_REPLY_TEXT: + # Handle text notification + buffer = await _reader.read(size) + size -= len(buffer) + while size: + more = await _reader.read(size) + buffer += more + size -= len(more) + text_obj = CoreTextNotification() + text_obj.ParseFromString(buffer) + # Log text notifications to standard output + print(f"[INFO] DFHack: {text_obj.text}") + continue + elif id == DFHackReplyCode.RPC_REPLY_RESULT: + # Handle successful result + buffer = await _reader.read(size) + size -= len(buffer) + while size: + more = await _reader.read(size) + buffer += more + size -= len(more) + obj = output() + obj.ParseFromString(buffer) + return obj + elif id == DFHackReplyCode.RPC_REPLY_FAIL: + # This should have been handled in get_header(), but just in case + error_code = size + raise DFHackError(error_code) + else: + raise DFHackError(f"Unexpected reply code: {id}") def parse(f): nonlocal input, output, function From 1821d3942807cf4f83d402a8e448dbb5b208e398 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 4 Jul 2025 18:32:05 -0500 Subject: [PATCH 4/9] Update .gitignore to include build directory --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c27869f..073bbb9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__ .venv *.egg-info/ uv.lock +build/ From 930d3833f6e764bc016b2a807650e7ff6bed2559 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 4 Jul 2025 23:29:05 -0500 Subject: [PATCH 5/9] Replaced functools.lru_cache (used by the BindMethod()) with alru_cache from async_lru. This fixes a bug where the cache was storing coroutines instead of the final result of the function execution which caused an issue whenever you called the same method twice in one session. --- pyproject.toml | 1 + src/dfhack_client_python/dfhack_remote.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1f4ef0c..368b272 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,6 +5,7 @@ description = "A python library for interacting with the DFHack through its cust readme = "README.md" requires-python = ">=3.12" dependencies = [ + "async-lru>=2.0.5", "protobuf>=6.31.1", "requests>=2.32.4", ] diff --git a/src/dfhack_client_python/dfhack_remote.py b/src/dfhack_client_python/dfhack_remote.py index 4f4e99d..0927edb 100644 --- a/src/dfhack_client_python/dfhack_remote.py +++ b/src/dfhack_client_python/dfhack_remote.py @@ -1,6 +1,6 @@ import sys import asyncio -import functools +from async_lru import alru_cache from enum import IntEnum from .py_export.CoreProtocol_pb2 import EmptyMessage, CoreBindReply, CoreBindRequest, CoreTextNotification, CoreErrorNotification @@ -61,7 +61,7 @@ def unmarshal(id, msg): else: raise DFHackError(f"Unknown reply code: {id}") -@functools.lru_cache(maxsize=65534) +@alru_cache(maxsize=65534) async def BindMethod(method, input_msg, output_msg, plugin=''): """Issue a CoreBindRequest to DFHack and caches the returned identifier number""" br = CoreBindRequest() From 4945fe6b42f6e5318ab4b9f6b16810f873bb9b7b Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Sat, 5 Jul 2025 00:57:27 -0500 Subject: [PATCH 6/9] Made output type optional for the @remote annotation to work (defaults to EmptyMessage, same as input type) --- src/dfhack_client_python/dfhack_remote.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/dfhack_client_python/dfhack_remote.py b/src/dfhack_client_python/dfhack_remote.py index 0927edb..e1ad309 100644 --- a/src/dfhack_client_python/dfhack_remote.py +++ b/src/dfhack_client_python/dfhack_remote.py @@ -152,7 +152,10 @@ def parse(f): input = p['input'].annotation except KeyError: input = EmptyMessage - output = p['output'].annotation + try: + output = p['output'].annotation + except KeyError: + output = EmptyMessage return update_wrapper(wrapper, f) # For ease of writing signatures, let's use 'plugin' also for plain decorator From cbc4045375301cd24adafd75f5b78f7f7455cf4a Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Mon, 7 Jul 2025 01:46:52 -0500 Subject: [PATCH 7/9] fixing a bug with calling methods that require an input. Need to pass in the actual value of the input instead of the type when making the RPC call --- src/dfhack_client_python/dfhack_remote.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dfhack_client_python/dfhack_remote.py b/src/dfhack_client_python/dfhack_remote.py index e1ad309..aa22828 100644 --- a/src/dfhack_client_python/dfhack_remote.py +++ b/src/dfhack_client_python/dfhack_remote.py @@ -105,8 +105,8 @@ async def GetVersion(output: StringMessage = None): async def wrapper(*args, **kwds): _id = await BindMethod(function.__name__, input, output, plugin=_plugin, **kwds) - - _writer.write( request(_id, input()) ) + input_value = kwds.get('input') if 'input' in kwds else (args[0] if args else None) + _writer.write( request(_id, input_value) ) # According to the protocol, the server may send zero or more RPC_REPLY_TEXT # messages followed by either RPC_REPLY_RESULT or RPC_REPLY_FAIL From 69d4de68fba48cdc51d82bc5116a2d224035b391 Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 11 Jul 2025 00:54:00 -0500 Subject: [PATCH 8/9] Adding interface will all current dfhack RPC methods and signatures --- src/dfhack_client_python/dfhack.py | 195 +++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 src/dfhack_client_python/dfhack.py diff --git a/src/dfhack_client_python/dfhack.py b/src/dfhack_client_python/dfhack.py new file mode 100644 index 0000000..7f84974 --- /dev/null +++ b/src/dfhack_client_python/dfhack.py @@ -0,0 +1,195 @@ +""" +Interfaces for DFHack functions available through its RPC connection. +""" + +from dfhack_client_python.dfhack_remote import remote + +# Core Protocol imports +from dfhack_client_python.py_export.CoreProtocol_pb2 import ( + StringMessage, EmptyMessage, IntMessage, CoreBindRequest, CoreBindReply, + CoreRunCommandRequest, CoreRunLuaRequest, StringListMessage +) + +# Basic API imports +from dfhack_client_python.py_export.BasicApi_pb2 import ( + GetWorldInfoOut, ListEnumsOut, ListJobSkillsOut, ListMaterialsIn, + ListMaterialsOut, ListUnitsIn, ListUnitsOut, ListSquadsIn, + ListSquadsOut, SetUnitLaborsIn +) + +# Remote Fortress Reader imports +from dfhack_client_python.py_export.RemoteFortressReader_pb2 import ( + UnitList, MaterialList, BlockRequest, BlockList, TiletypeList, PlantList, + ViewInfo, MapInfo, BuildingList, WorldMap, RegionMaps, CreatureRawList, + ListRequest, PlantRawList, ScreenCapture, KeyboardEvent, DigCommand, + SingleBool, VersionInfo, Status, Language +) + +from dfhack_client_python.py_export.AdventureControl_pb2 import ( + MoveCommandParams, MenuContents, MiscMoveParams +) + +# Dwarf Control imports +from dfhack_client_python.py_export.DwarfControl_pb2 import ( + SidebarState, SidebarCommand +) + +## Core Protocol Methods +@remote +async def GetVersion(output: StringMessage = None): pass + +@remote +async def GetDFVersion(output: StringMessage = None): pass + +@remote +async def BindMethod(input: CoreBindRequest, output: CoreBindReply = None): pass + +@remote +async def RunCommand(input: CoreRunCommandRequest): pass + +@remote +async def CoreSuspend(output: IntMessage = None): pass + +@remote +async def CoreResume(output: IntMessage = None): pass + +@remote +async def RunLua(input: CoreRunLuaRequest, output: StringListMessage = None): pass + +## Basic API Methods +@remote +async def GetWorldInfo(output: GetWorldInfoOut = None): pass + +@remote +async def ListEnums(output: ListEnumsOut = None): pass + +@remote +async def ListJobSkills(output: ListJobSkillsOut = None): pass + +@remote +async def ListMaterials(input: ListMaterialsIn, output: ListMaterialsOut = None): pass + +@remote +async def ListUnits(input: ListUnitsIn, output: ListUnitsOut = None): pass + +@remote +async def ListSquads(input: ListSquadsIn, output: ListSquadsOut = None): pass + +@remote +async def SetUnitLabors(input: SetUnitLaborsIn): pass + +## Remote Fortress Reader Methods +@remote(plugin='RemoteFortressReader') +async def GetMaterialList(output: MaterialList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetGrowthList(output: MaterialList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetBlockList(input: BlockRequest, output: BlockList = None): pass + +@remote(plugin='RemoteFortressReader') +async def CheckHashes(): pass + +@remote(plugin='RemoteFortressReader') +async def GetTiletypeList(output: TiletypeList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetPlantList(input: BlockRequest, output: PlantList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetUnitList(output: UnitList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetUnitListInside(input: BlockRequest, output: UnitList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetViewInfo(output: ViewInfo = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetMapInfo(output: MapInfo = None): pass + +@remote(plugin='RemoteFortressReader') +async def ResetMapHashes(): pass + +@remote(plugin='RemoteFortressReader') +async def GetItemList(output: MaterialList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetBuildingDefList(output: BuildingList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetWorldMap(output: WorldMap = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetWorldMapNew(output: WorldMap = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetRegionMaps(output: RegionMaps = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetRegionMapsNew(output: RegionMaps = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetCreatureRaws(output: CreatureRawList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetPartialCreatureRaws(input: ListRequest, output: CreatureRawList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetWorldMapCenter(output: WorldMap = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetPlantRaws(output: PlantRawList = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetPartialPlantRaws(input: ListRequest, output: PlantRawList = None): pass + +@remote(plugin='RemoteFortressReader') +async def CopyScreen(output: ScreenCapture = None): pass + +@remote(plugin='RemoteFortressReader') +async def PassKeyboardEvent(input: KeyboardEvent): pass + +@remote(plugin='RemoteFortressReader') +async def SendDigCommand(input: DigCommand): pass + +@remote(plugin='RemoteFortressReader') +async def SetPauseState(input: SingleBool): pass + +@remote(plugin='RemoteFortressReader') +async def GetPauseState(output: SingleBool = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetVersionInfo(output: VersionInfo = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetReports(output: Status = None): pass + +@remote(plugin='RemoteFortressReader') +async def MoveCommand(input: MoveCommandParams): pass + +@remote(plugin='RemoteFortressReader') +async def JumpCommand(input: MoveCommandParams): pass + +@remote(plugin='RemoteFortressReader') +async def MenuQuery(output: MenuContents = None): pass + +@remote(plugin='RemoteFortressReader') +async def MovementSelectCommand(input: IntMessage): pass + +@remote(plugin='RemoteFortressReader') +async def MiscMoveCommand(input: MiscMoveParams): pass + +@remote(plugin='RemoteFortressReader') +async def GetLanguage(output: Language = None): pass + +@remote(plugin='RemoteFortressReader') +async def GetGameValidity(output: SingleBool = None): pass + +## Dwarf Control Methods +@remote(plugin='RemoteFortressReader') +async def GetSideMenu(output: SidebarState = None): pass + +@remote(plugin='RemoteFortressReader') +async def SetSideMenu(input: SidebarCommand): pass \ No newline at end of file From de6e584fbdf2951a1f0d3f4f6e0b266094944cae Mon Sep 17 00:00:00 2001 From: Oleksiy Date: Fri, 11 Jul 2025 00:55:26 -0500 Subject: [PATCH 9/9] Refactored dfhack_remote to properly handle methods that take an input object, as well as to have a slightly cleaner @remote annotaion structure. --- src/dfhack_client_python/dfhack_remote.py | 141 +++++++++++----------- 1 file changed, 69 insertions(+), 72 deletions(-) diff --git a/src/dfhack_client_python/dfhack_remote.py b/src/dfhack_client_python/dfhack_remote.py index aa22828..0e32817 100644 --- a/src/dfhack_client_python/dfhack_remote.py +++ b/src/dfhack_client_python/dfhack_remote.py @@ -2,6 +2,7 @@ import asyncio from async_lru import alru_cache from enum import IntEnum +from inspect import signature, Parameter from .py_export.CoreProtocol_pb2 import EmptyMessage, CoreBindReply, CoreBindRequest, CoreTextNotification, CoreErrorNotification @@ -88,80 +89,76 @@ async def connect(): if b'DFHack!\n\x01\x00\x00\x00' != msg: # handshake_reply _reader, _writer = None, None -def remote(plugin=''): - """ Decorator that uses type annotations to bind DFHack Remote functions +def get_param_type(param): + if param and param.annotation != Parameter.empty: + return param.annotation + return EmptyMessage - Example: - @remote(plugin='RemoteFortressReader') - async def GetVersionInfo(input: EmptyMessage = None, output: VersionInfo = None): - - @remote - async def GetVersion(output: StringMessage = None): +def remote(func=None, *, plugin=''): + """Decorator for DFHack remote functions. + + Usage: + @remote + async def GetVersion(output: StringMessage = None): + pass + + @remote(plugin='RemoteFortressReader') + async def GetVersionInfo(input: EmptyMessage = None, output: VersionInfo = None): + pass """ - from functools import update_wrapper - from inspect import signature - input, output, function, _plugin = None, None, None, None - - async def wrapper(*args, **kwds): - _id = await BindMethod(function.__name__, input, output, plugin=_plugin, **kwds) - input_value = kwds.get('input') if 'input' in kwds else (args[0] if args else None) - _writer.write( request(_id, input_value) ) - - # According to the protocol, the server may send zero or more RPC_REPLY_TEXT - # messages followed by either RPC_REPLY_RESULT or RPC_REPLY_FAIL - while True: - id, size = await get_header() - - if id == DFHackReplyCode.RPC_REPLY_TEXT: - # Handle text notification - buffer = await _reader.read(size) - size -= len(buffer) - while size: - more = await _reader.read(size) - buffer += more - size -= len(more) - text_obj = CoreTextNotification() - text_obj.ParseFromString(buffer) - # Log text notifications to standard output - print(f"[INFO] DFHack: {text_obj.text}") - continue - elif id == DFHackReplyCode.RPC_REPLY_RESULT: - # Handle successful result - buffer = await _reader.read(size) - size -= len(buffer) - while size: - more = await _reader.read(size) - buffer += more - size -= len(more) - obj = output() - obj.ParseFromString(buffer) - return obj - elif id == DFHackReplyCode.RPC_REPLY_FAIL: - # This should have been handled in get_header(), but just in case - error_code = size - raise DFHackError(error_code) - else: - raise DFHackError(f"Unexpected reply code: {id}") - - def parse(f): - nonlocal input, output, function - function = f - p = signature(f).parameters - try: - input = p['input'].annotation - except KeyError: - input = EmptyMessage - try: - output = p['output'].annotation - except KeyError: - output = EmptyMessage - return update_wrapper(wrapper, f) + + def decorator(f): + params = signature(f).parameters + input_type = get_param_type(params.get('input')) + output_type = get_param_type(params.get('output')) + + async def wrapper(*args, **kwargs): + _id = await BindMethod(f.__name__, input_type, output_type, plugin=plugin) + input_value = kwargs.get('input') if kwargs.get('input') else input_type() + _writer.write( request(_id, input_value) ) + + # According to the protocol, the server may send zero or more RPC_REPLY_TEXT + # messages followed by either RPC_REPLY_RESULT or RPC_REPLY_FAIL + while True: + id, size = await get_header() + + if id == DFHackReplyCode.RPC_REPLY_TEXT: + # Handle text notification + buffer = await _reader.read(size) + size -= len(buffer) + while size: + more = await _reader.read(size) + buffer += more + size -= len(more) + text_obj = CoreTextNotification() + text_obj.ParseFromString(buffer) + # Log text notifications to standard output + print(f"[INFO] DFHack: {text_obj.text}") + continue + elif id == DFHackReplyCode.RPC_REPLY_RESULT: + # Handle successful result + buffer = await _reader.read(size) + size -= len(buffer) + while size: + more = await _reader.read(size) + buffer += more + size -= len(more) + obj = output_type() + obj.ParseFromString(buffer) + return obj + elif id == DFHackReplyCode.RPC_REPLY_FAIL: + # This should have been handled in get_header(), but just in case + error_code = size + raise DFHackError(error_code) + else: + raise DFHackError(f"Unexpected reply code: {id}") - # For ease of writing signatures, let's use 'plugin' also for plain decorator - if isinstance(plugin, str): # The plugin name - _plugin = plugin - return parse + return update_wrapper(wrapper, f) + + if func is None: + # Called as @remote(plugin='SomePlugin') + return decorator else: - _plugin = '' - return parse(plugin) # The decorated function + # Called as @remote + return decorator(func)