project64/Source/Project64/UserInterface/ProjectSupport.h

43 lines
1.2 KiB
C
Raw Normal View History

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;
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();
bool ShowSuppotWindow();
2020-10-22 02:11:19 +00:00
inline uint32_t RunCount() const { return m_SupportInfo.RunCount; }
2020-11-11 10:29:13 +00:00
inline const char * Name(void) const { return m_SupportInfo.Name; }
2020-10-22 02:11:19 +00:00
inline const char * MachineID(void) const { return m_SupportInfo.MachineID; }
inline bool Validated(void) const { return m_SupportInfo.Validated; }
private:
CProjectSupport(const CProjectSupport&);
CProjectSupport& operator=(const CProjectSupport&);
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;
};