2020-10-22 02:11:19 +00:00
|
|
|
#pragma once
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class CProjectSupport
|
|
|
|
{
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
char Code[300];
|
|
|
|
char Email[300];
|
|
|
|
char Name[300];
|
|
|
|
char MachineID[300];
|
|
|
|
uint32_t RunCount;
|
2020-10-27 06:11:50 +00:00
|
|
|
time_t LastUpdated;
|
|
|
|
time_t LastShown;
|
2020-10-22 02:11:19 +00:00
|
|
|
bool Validated;
|
|
|
|
} SupportInfo;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CProjectSupport();
|
|
|
|
|
|
|
|
bool RequestCode(const char * Email);
|
|
|
|
bool ValidateCode(const char * Code);
|
|
|
|
void IncrementRunCount();
|
2020-10-27 06:11:50 +00:00
|
|
|
bool ShowSuppotWindow();
|
2020-10-22 02:11:19 +00:00
|
|
|
|
2022-09-26 02:31:54 +00:00
|
|
|
inline uint32_t RunCount() const
|
|
|
|
{
|
|
|
|
return m_SupportInfo.RunCount;
|
|
|
|
}
|
|
|
|
inline const char * Name(void) const
|
|
|
|
{
|
|
|
|
return m_SupportInfo.Name;
|
|
|
|
}
|
|
|
|
inline const char * MachineID(void) const
|
|
|
|
{
|
|
|
|
return m_SupportInfo.MachineID;
|
|
|
|
}
|
|
|
|
inline bool Validated(void) const
|
|
|
|
{
|
|
|
|
return m_SupportInfo.Validated;
|
|
|
|
}
|
2020-10-22 02:11:19 +00:00
|
|
|
|
|
|
|
private:
|
2022-09-26 02:31:54 +00:00
|
|
|
CProjectSupport(const CProjectSupport &);
|
|
|
|
CProjectSupport & operator=(const CProjectSupport &);
|
2020-10-22 02:11:19 +00:00
|
|
|
|
|
|
|
std::string GenerateMachineID();
|
|
|
|
bool PerformRequest(const wchar_t * Url, const std::string & PostData, DWORD & StatusCode, std::vector<std::string> & Headers);
|
|
|
|
|
|
|
|
void SaveSupportInfo(void);
|
|
|
|
void LoadSupportInfo(void);
|
|
|
|
|
|
|
|
SupportInfo m_SupportInfo;
|
2021-03-17 08:31:58 +00:00
|
|
|
};
|