Skip to content

Commit

Permalink
Allow disabling update checks
Browse files Browse the repository at this point in the history
Must set `no_updates_for_me_please` to any value in the sdk ini
  • Loading branch information
OrfeasZ committed Dec 22, 2024
1 parent 16787fe commit ab7aaed
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
14 changes: 10 additions & 4 deletions ZHMModSDK/Src/ModSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ void ModSDK::LoadConfiguration() {
if (s_Mod.second.has("ignore_version")) {
m_IgnoredVersion = s_Mod.second.get("ignore_version");
}

if (s_Mod.second.has("no_updates_for_me_please")) {
m_DisableUpdateCheck = true;
}
}
}

Expand Down Expand Up @@ -500,11 +504,13 @@ bool ModSDK::Startup() {
// Setup custom multiplayer code.
//Multiplayer::Lobby::Setup();

std::thread s_VersionCheckThread([&]() {
CheckForUpdates();
});
if (!m_DisableUpdateCheck) {
std::thread s_VersionCheckThread([&]() {
CheckForUpdates();
});

s_VersionCheckThread.detach();
s_VersionCheckThread.detach();
}

return true;
}
Expand Down
1 change: 1 addition & 0 deletions ZHMModSDK/Src/ModSDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ class ModSDK : public IModSDK
uint32_t m_SizeOfCode;
uint32_t m_ImageSize;
std::string m_IgnoredVersion;
bool m_DisableUpdateCheck = false;
float m_LoadedModsUIScrollOffset = 0;

std::shared_ptr<ModLoader> m_ModLoader {};
Expand Down

0 comments on commit ab7aaed

Please sign in to comment.