-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanti-family-sharing.h
47 lines (34 loc) · 1.03 KB
/
anti-family-sharing.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef AFS_H
#define AFS_H
#include <deque>
#include <thread>
#include <string>
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/beast.hpp>
#include "json.hpp"
class AntiFamilySharing
{
public:
struct PlayerInfo
{
std::string userid;
std::string steamid64;
};
static void init(std::string steam_web_api_key);
static AntiFamilySharing& getInstance();
AntiFamilySharing(const AntiFamilySharing&) = delete;
void operator = (const AntiFamilySharing&) = delete;
void PushPlayerToCheck(const PlayerInfo&);
bool HavePlayerToKick() const;;
std::string GetPlayerToKick();
std::deque<std::string> m_messages;
private:
AntiFamilySharing(std::string* steam_web_api_key);
static AntiFamilySharing& getInstanceImpl(std::string* steam_web_api_key = nullptr);
bool IsUsingFamilySharing(const std::string& steamid64);
std::deque<std::string> m_userid_to_kick;
std::deque<PlayerInfo> m_to_check;
const std::string m_kSteamWebApiKey;
};
#endif // AFS_H