This repository was archived by the owner on Dec 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClientManager.h
More file actions
75 lines (62 loc) · 1.91 KB
/
ClientManager.h
File metadata and controls
75 lines (62 loc) · 1.91 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#pragma once
#include "ClientManagerBase.h"
#include "lpstring.h"
/// <summary>
/// A general client-management module.
/// </summary>
class ClientManager : public ClientManagerBase
{
private:
void patchClient();
public:
ClientManager();
void startModule();
// These will hopefully be dynamic at some point
static std::string getBaseDomain();
static std::string getBaseUrl();
static std::string getRobloxDomain();
static std::string getRobloxUrl();
static bool isTrustedContent(const char* url);
static bool trustCheck(const char* url, bool externalRequest);
static std::string buildGenericApiUrl(const std::string& baseUrl, const std::string& serviceNameIn, const std::string& path, const std::string& key);
static bool isHttpUrl(const std::string& s);
static std::string cleanUpIfAssetUrl(const std::string& url);
static bool isValidRobloxAssetUrl(const std::string& url);
static std::string getDefaultReportUrl(const std::string& baseUrl, const std::string& shard);
// HACK: Prevents the compiler from automatically deconstructing a type ( thanks moded :) )
template <typename T>
struct primitive
{
unsigned char b[sizeof(T)];
};
// Wrappers //
// TODO: Figure out a better way...
static string buildGenericApiUrlWrapper(primitive<string> baseUrl, primitive<string> serviceNameIn, primitive<string> path, primitive<string> key)
{
return string(buildGenericApiUrl(
LPSTRING(baseUrl),
LPSTRING(serviceNameIn),
LPSTRING(path),
LPSTRING(key)
).c_str());
}
static string cleanUpIfAssetUrlWrapper(const string& url)
{
return string(cleanUpIfAssetUrl(
LPSTRING(url)
).c_str());
}
static bool isValidRobloxAssetUrlWrapper(primitive<string> url)
{
return isValidRobloxAssetUrl(
LPSTRING(url)
);
}
static string getDefaultReportUrlWrapper(const string& baseUrl, const string& shard)
{
return string(getDefaultReportUrl(
LPSTRING(baseUrl),
LPSTRING(shard)
).c_str());
}
};