diff --git a/soh/soh/Network/Archipelago/Archipelago.cpp b/soh/soh/Network/Archipelago/Archipelago.cpp index 6b4282208..aa8e7d255 100644 --- a/soh/soh/Network/Archipelago/Archipelago.cpp +++ b/soh/soh/Network/Archipelago/Archipelago.cpp @@ -81,7 +81,7 @@ bool ArchipelagoClient::StartClient() { tags.push_back("DeathLink"); } apClient->ConnectSlot(CVarGetString(CVAR_REMOTE_ARCHIPELAGO("SlotName"), ""), password, 0b0101, tags, - { 0, 6, 4 }); + { 0, 6, 3 }); }); apClient->set_slot_connected_handler([&](const nlohmann::json data) { @@ -91,6 +91,18 @@ bool ArchipelagoClient::StartClient() { slotData = data; + std::string expectedVersion = AP_Client_consts::AP_WORLD_VERSION; + std::string apworldVersion = slotData["apworld_version"]; + if (apworldVersion != expectedVersion) { + disconnecting = true; + std::string errorMessage = + "[ERROR] Client version does not match the APWorld's version.\nExpected version is " + expectedVersion + + ". APWorld is on version " + apworldVersion + + " instead.\nPlease use the SoH AP client matching the APWorld's version.\nDisconnecting..."; + ArchipelagoConsole_SendMessage(errorMessage.c_str()); + return; + } + // if we are already in game when we connect // we won't have to request an itemSynch if (GameInteractor::IsSaveLoaded(true)) { diff --git a/soh/soh/Network/Archipelago/Archipelago.h b/soh/soh/Network/Archipelago/Archipelago.h index 81ba4e232..19eb6f6ac 100644 --- a/soh/soh/Network/Archipelago/Archipelago.h +++ b/soh/soh/Network/Archipelago/Archipelago.h @@ -16,6 +16,7 @@ static constexpr int MAX_PLAYER_NAME_LENGHT = 17; static constexpr int MAX_PASSWORD_LENGTH = 32; static constexpr char const* AP_GAME_NAME = "Ship of Harkinian"; +static constexpr char const* AP_WORLD_VERSION = "0.0.1"; static constexpr int MAX_RETRIES = 3; } // namespace AP_Client_consts