diff options
Diffstat (limited to 'src/ap_state.cpp')
| -rw-r--r-- | src/ap_state.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
| diff --git a/src/ap_state.cpp b/src/ap_state.cpp index 876fdd8..f8d4ee0 100644 --- a/src/ap_state.cpp +++ b/src/ap_state.cpp | |||
| @@ -52,6 +52,8 @@ struct APState { | |||
| 52 | std::list<std::string> tracked_data_storage_keys; | 52 | std::list<std::string> tracked_data_storage_keys; |
| 53 | std::string victory_data_storage_key; | 53 | std::string victory_data_storage_key; |
| 54 | 54 | ||
| 55 | std::string save_name; | ||
| 56 | |||
| 55 | std::map<int64_t, int> inventory; | 57 | std::map<int64_t, int> inventory; |
| 56 | std::set<int64_t> checked_locations; | 58 | std::set<int64_t> checked_locations; |
| 57 | std::map<std::string, std::any> data_storage; | 59 | std::map<std::string, std::any> data_storage; |
| @@ -131,6 +133,7 @@ struct APState { | |||
| 131 | cert_store); | 133 | cert_store); |
| 132 | } | 134 | } |
| 133 | 135 | ||
| 136 | save_name.clear(); | ||
| 134 | inventory.clear(); | 137 | inventory.clear(); |
| 135 | checked_locations.clear(); | 138 | checked_locations.clear(); |
| 136 | data_storage.clear(); | 139 | data_storage.clear(); |
| @@ -221,11 +224,15 @@ struct APState { | |||
| 221 | RefreshTracker(false); | 224 | RefreshTracker(false); |
| 222 | }); | 225 | }); |
| 223 | 226 | ||
| 224 | apclient->set_slot_connected_handler([this, &connection_mutex]( | 227 | apclient->set_slot_connected_handler([this, player, server, |
| 228 | &connection_mutex]( | ||
| 225 | const nlohmann::json& slot_data) { | 229 | const nlohmann::json& slot_data) { |
| 226 | tracker_frame->SetStatusMessage("Connected to Archipelago!"); | 230 | tracker_frame->SetStatusMessage( |
| 231 | fmt::format("Connected to Archipelago! ({}@{})", player, server)); | ||
| 227 | TrackerLog("Connected to Archipelago!"); | 232 | TrackerLog("Connected to Archipelago!"); |
| 228 | 233 | ||
| 234 | save_name = fmt::format("zzAP_{}_{}.save", apclient->get_seed(), | ||
| 235 | apclient->get_player_number()); | ||
| 229 | data_storage_prefix = | 236 | data_storage_prefix = |
| 230 | fmt::format("Lingo_{}_", apclient->get_player_number()); | 237 | fmt::format("Lingo_{}_", apclient->get_player_number()); |
| 231 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); | 238 | door_shuffle_mode = slot_data["shuffle_doors"].get<DoorShuffleMode>(); |
| @@ -507,6 +514,8 @@ void AP_Connect(std::string server, std::string player, std::string password) { | |||
| 507 | GetState().Connect(server, player, password); | 514 | GetState().Connect(server, player, password); |
| 508 | } | 515 | } |
| 509 | 516 | ||
| 517 | std::string AP_GetSaveName() { return GetState().save_name; } | ||
| 518 | |||
| 510 | bool AP_HasCheckedGameLocation(int location_id) { | 519 | bool AP_HasCheckedGameLocation(int location_id) { |
| 511 | return GetState().HasCheckedGameLocation(location_id); | 520 | return GetState().HasCheckedGameLocation(location_id); |
| 512 | } | 521 | } |
