diff options
Diffstat (limited to 'tools/datapacker/main.cpp')
| -rw-r--r-- | tools/datapacker/main.cpp | 33 |
1 files changed, 30 insertions, 3 deletions
| diff --git a/tools/datapacker/main.cpp b/tools/datapacker/main.cpp index 5254e5f..8109bf5 100644 --- a/tools/datapacker/main.cpp +++ b/tools/datapacker/main.cpp | |||
| @@ -88,9 +88,17 @@ class DataPacker { | |||
| 88 | uint64_t map_id = container_.FindOrAddMap(map_name); | 88 | uint64_t map_id = container_.FindOrAddMap(map_name); |
| 89 | Map& map = *container_.all_objects().mutable_maps(map_id); | 89 | Map& map = *container_.all_objects().mutable_maps(map_id); |
| 90 | 90 | ||
| 91 | map.set_type(metadata.type()); | ||
| 92 | |||
| 91 | if (metadata.has_display_name()) { | 93 | if (metadata.has_display_name()) { |
| 92 | map.set_display_name(metadata.display_name()); | 94 | map.set_display_name(metadata.display_name()); |
| 93 | } | 95 | } |
| 96 | |||
| 97 | if (metadata.has_worldport_entrance()) { | ||
| 98 | map.set_worldport_entrance(container_.FindOrAddPort( | ||
| 99 | map_name, metadata.worldport_entrance().room(), | ||
| 100 | metadata.worldport_entrance().name(), std::nullopt, std::nullopt)); | ||
| 101 | } | ||
| 94 | } | 102 | } |
| 95 | 103 | ||
| 96 | void ProcessRooms(std::filesystem::path path, | 104 | void ProcessRooms(std::filesystem::path path, |
| @@ -403,8 +411,8 @@ class DataPacker { | |||
| 403 | container_.FindOrAddDoor(map_name, di.name(), current_map_name)); | 411 | container_.FindOrAddDoor(map_name, di.name(), current_map_name)); |
| 404 | } | 412 | } |
| 405 | 413 | ||
| 406 | for (const std::string& ending_name : h_door.endings()) { | 414 | if (h_door.has_white_ending()) { |
| 407 | door.add_endings(container_.FindOrAddEnding(ending_name)); | 415 | door.set_white_ending(h_door.white_ending()); |
| 408 | } | 416 | } |
| 409 | 417 | ||
| 410 | if (h_door.has_control_center_color()) { | 418 | if (h_door.has_control_center_color()) { |
| @@ -424,6 +432,14 @@ class DataPacker { | |||
| 424 | if (h_door.has_double_letters()) { | 432 | if (h_door.has_double_letters()) { |
| 425 | door.set_double_letters(h_door.double_letters()); | 433 | door.set_double_letters(h_door.double_letters()); |
| 426 | } | 434 | } |
| 435 | |||
| 436 | if (h_door.has_latch()) { | ||
| 437 | door.set_latch(h_door.latch()); | ||
| 438 | } | ||
| 439 | |||
| 440 | if (h_door.has_legacy_location()) { | ||
| 441 | door.set_legacy_location(h_door.legacy_location()); | ||
| 442 | } | ||
| 427 | } | 443 | } |
| 428 | 444 | ||
| 429 | void ProcessConnectionsFile(std::filesystem::path path, | 445 | void ProcessConnectionsFile(std::filesystem::path path, |
| @@ -490,6 +506,11 @@ class DataPacker { | |||
| 490 | r_connection.set_cyan_ending(human_connection.cyan_ending()); | 506 | r_connection.set_cyan_ending(human_connection.cyan_ending()); |
| 491 | } | 507 | } |
| 492 | 508 | ||
| 509 | if (human_connection.has_vanilla_only()) { | ||
| 510 | f_connection.set_vanilla_only(human_connection.vanilla_only()); | ||
| 511 | r_connection.set_vanilla_only(human_connection.vanilla_only()); | ||
| 512 | } | ||
| 513 | |||
| 493 | container_.AddConnection(f_connection); | 514 | container_.AddConnection(f_connection); |
| 494 | if (!human_connection.oneway()) { | 515 | if (!human_connection.oneway()) { |
| 495 | container_.AddConnection(r_connection); | 516 | container_.AddConnection(r_connection); |
| @@ -627,7 +648,7 @@ class DataPacker { | |||
| 627 | } | 648 | } |
| 628 | 649 | ||
| 629 | auto h_metadata = ReadMessageFromFile<HumanGlobalMetadata>(path.string()); | 650 | auto h_metadata = ReadMessageFromFile<HumanGlobalMetadata>(path.string()); |
| 630 | container_.all_objects().set_version(h_metadata.version()); | 651 | *container_.all_objects().mutable_version() = h_metadata.version(); |
| 631 | } | 652 | } |
| 632 | 653 | ||
| 633 | void ProcessIdsFile(std::filesystem::path path) { | 654 | void ProcessIdsFile(std::filesystem::path path) { |
| @@ -662,6 +683,12 @@ class DataPacker { | |||
| 662 | .mutable_keyholders(keyholder_id) | 683 | .mutable_keyholders(keyholder_id) |
| 663 | ->set_ap_id(ap_id); | 684 | ->set_ap_id(ap_id); |
| 664 | } | 685 | } |
| 686 | |||
| 687 | for (const auto& [port_name, ap_id] : room.ports()) { | ||
| 688 | uint64_t port_id = container_.FindOrAddPort( | ||
| 689 | map_name, room_name, port_name, std::nullopt, std::nullopt); | ||
| 690 | container_.all_objects().mutable_ports(port_id)->set_ap_id(ap_id); | ||
| 691 | } | ||
| 665 | } | 692 | } |
| 666 | } | 693 | } |
| 667 | 694 | ||
