diff --git a/.idea/runConfigurations/linux_exports_generator__32_.xml b/.idea/runConfigurations/linux_exports_generator__32_.xml index 977b509..74650f1 100644 --- a/.idea/runConfigurations/linux_exports_generator__32_.xml +++ b/.idea/runConfigurations/linux_exports_generator__32_.xml @@ -1,5 +1,5 @@ - + diff --git a/.idea/runConfigurations/steamworks_downloader__prompt_.xml b/.idea/runConfigurations/steamworks_downloader__prompt_.xml index a774a35..75bb294 100644 --- a/.idea/runConfigurations/steamworks_downloader__prompt_.xml +++ b/.idea/runConfigurations/steamworks_downloader__prompt_.xml @@ -1,5 +1,5 @@ - + diff --git a/CMakeLists.txt b/CMakeLists.txt index eafbc59..44192ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.24) -project(SmokeAPI VERSION 4.1.0) +project(SmokeAPI VERSION 4.1.1) include(KoalaBox/cmake/KoalaBox.cmake) add_subdirectory(KoalaBox) diff --git a/KoalaBox b/KoalaBox index d725c86..6a262ff 160000 --- a/KoalaBox +++ b/KoalaBox @@ -1 +1 @@ -Subproject commit d725c86389c8cd411af6e6b764796093b68f7d1e +Subproject commit 6a262ff96b86b058ad32e7f64129cc21c89f30d2 diff --git a/README.md b/README.md index 7198770..7975013 100644 --- a/README.md +++ b/README.md @@ -431,7 +431,8 @@ This project makes use of the following open source projects: - [p-ranav/glob](https://github.com/p-ranav/glob) - [pantor/inja](https://github.com/pantor/inja) - [jarro2783/cxxopts](https://github.com/jarro2783/cxxopts) -- [serge1/ELFIO](https://github.com/serge1/ELFIO) +- [serge1/ELFIO](https://github.com/serge1/ELFIO) +- [Mbed-TLS/mbedtls](https://github.com/Mbed-TLS/mbedtls) - [bshoshany/thread-pool](https://github.com/bshoshany/thread-pool) - [batterycenter/embed](https://github.com/batterycenter/embed) diff --git a/src/smoke_api/smoke_api.cpp b/src/smoke_api/smoke_api.cpp index 5be40df..90d8113 100644 --- a/src/smoke_api/smoke_api.cpp +++ b/src/smoke_api/smoke_api.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -57,6 +58,27 @@ namespace { void* original_steamapi_handle = nullptr; bool is_hook_mode; + void check_for_updates() { + const auto latest_release_url = std::format( + "https://api.github.com/repos/acidicoala/{}/releases/latest", + PROJECT_NAME + ); + const auto res = kb::http_client::get_json(latest_release_url); + const auto latest_tag = res["tag_name"].get(); + const auto current_tag = std::format("v{}", PROJECT_VERSION); + + if(current_tag == latest_tag) { + LOG_DEBUG("Running the latest version"); + } else { + const auto release_page = std::format( + "https://github.com/acidicoala/{}/releases/{}", + PROJECT_NAME, latest_tag + ); + + LOG_WARN("New version {} available: {}", latest_tag, release_page); + } + } + std::set find_steamclient_versions(void* steamapi_handle) { if(!steamapi_handle) { kb::util::panic("Invalid state. steamapi_handle is null."); @@ -255,6 +277,12 @@ namespace smoke_api { kb::win::check_self_duplicates(); #endif +#ifdef KB_DEBUG + // TODO: Add config option to toggle this and show native OS notification + // The real reason behind this is for automatic testing of HTTPs dependencies + std::thread(check_for_updates).detach(); +#endif + // We need to hook functions in either mode kb::hook::init(true);