2021-03-10 16:10:59 -05:00
|
|
|
#pragma once
|
|
|
|
|
2022-01-04 17:33:07 -05:00
|
|
|
/*
|
|
|
|
Update class
|
|
|
|
Checks for menu updates and provides a way to update the menu.
|
|
|
|
*/
|
2021-06-18 12:49:11 -04:00
|
|
|
class Updater
|
2021-03-10 16:10:59 -05:00
|
|
|
{
|
2022-01-04 17:33:07 -05:00
|
|
|
private:
|
2022-01-07 03:18:00 -05:00
|
|
|
enum class States
|
|
|
|
{
|
|
|
|
IDLE,
|
|
|
|
CHECKING,
|
|
|
|
FOUND
|
|
|
|
};
|
|
|
|
static inline States curState = States::IDLE;
|
|
|
|
static inline std::string latestVer;
|
|
|
|
|
2021-03-10 16:10:59 -05:00
|
|
|
public:
|
2021-06-18 12:49:11 -04:00
|
|
|
|
2022-01-07 03:18:00 -05:00
|
|
|
Updater() = delete;
|
|
|
|
Updater(const Updater&) = delete;
|
2022-01-04 17:33:07 -05:00
|
|
|
|
2022-01-07 03:18:00 -05:00
|
|
|
static void CheckUpdate();
|
|
|
|
static std::string GetUpdateVersion();
|
|
|
|
static bool IsUpdateAvailable();
|
2022-01-04 17:33:07 -05:00
|
|
|
|
2022-03-14 02:04:58 -04:00
|
|
|
/*
|
|
|
|
Just downloading file from a click counter site
|
|
|
|
Redirects to the versioninfo.json file of github
|
|
|
|
This probably shouldn't impose any privacy concerns?
|
|
|
|
*/
|
|
|
|
static void IncrementDailyUsageCounter();
|
|
|
|
|
2022-01-07 03:18:00 -05:00
|
|
|
// Needs to run in it's own thread to prevent the game from freezing
|
|
|
|
static void Process();
|
|
|
|
static void ResetUpdaterState();
|
2021-03-10 16:10:59 -05:00
|
|
|
};
|