Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: fix when local version > latest
Browse files Browse the repository at this point in the history
would return bogus version numbers before.
surepy committed Mar 27, 2023
1 parent 1a1faeb commit 11a8680
Showing 3 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tf2_bot_detector/UI/MainWindow.cpp
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ namespace tf2_bot_detector
}

MainWindow::MainWindow(ImGuiDesktop::Application& app) :
ImGuiDesktop::Window(app, 800, 600, mh::fmtstr<128>("TF2 Bot Detector v{}", VERSION).c_str()),
ImGuiDesktop::Window(app, 800, 600, mh::fmtstr<128>("TF2 Bot Detector v{} (sleepybuild)", VERSION).c_str()),
m_WorldState(IWorldState::Create(m_Settings)),
m_ActionManager(IRCONActionManager::Create(m_Settings, GetWorld())),
m_TextureManager(ITextureManager::Create()),
17 changes: 10 additions & 7 deletions tf2_bot_detector/UpdateManager.cpp
Original file line number Diff line number Diff line change
@@ -240,19 +240,22 @@ namespace
"Checking for updates...",
std::async([sharedClient, releaseChannel]() -> BuildInfo
{
auto a = sharedClient->shared_from_this();

auto newver = tf2_bot_detector::GithubAPI::CheckForNewVersion(*a);
newver.wait();
auto newver = tf2_bot_detector::GithubAPI::CheckForNewVersion(*sharedClient);
tf2_bot_detector::GithubAPI::NewVersionResult result = newver.get();

BuildInfo ret;

ret.m_GitHubURL = result.GetURL();

// TODO: pre-release == ReleaseChannel::Preview
ret.m_ReleaseChannel = ReleaseChannel::Public;
ret.m_Version = result.m_Stable->m_Version;

if (result.m_Stable) {
ret.m_GitHubURL = result.GetURL();
ret.m_Version = result.m_Stable->m_Version;
}
// if result.m_Stable == null, that means no new versions to look at, so just return our current version.
else {
ret.m_Version = tf2_bot_detector::VERSION;
}

return ret;
}));
2 changes: 0 additions & 2 deletions tf2_bot_detector/Version.base.h
Original file line number Diff line number Diff line change
@@ -51,8 +51,6 @@ namespace tf2_bot_detector
{
os << v.m_Major << '.' << v.m_Minor << '.' << v.m_Patch;

os << " (sleepybuild)";

if (v.IsCustomBuild())
os << " (Custom Build)";
else

0 comments on commit 11a8680

Please sign in to comment.