clang-format everything

This commit is contained in:
Lion Kortlepel 2020-11-12 17:09:14 +01:00
parent c9f5ee9729
commit 58e65cf43f
29 changed files with 716 additions and 677 deletions

View File

@ -2,10 +2,10 @@
/// Created by Anonymous275 on 4/2/2020.
///
#pragma once
#include "Security/Xor.h"
#include <iostream>
#include <mutex>
#include <string>
#include "Security/Xor.h"
void InitLog();
#define DebugPrintTID() DebugPrintTIDInternal(__func__, false)
void DebugPrintTIDInternal(const std::string& func, bool overwrite = true); // prints the current thread id in debug mode, to make tracing of crashes and asserts easier

View File

@ -17,4 +17,3 @@ using ReadLock = std::shared_lock<RWMutex>;
// Construct with an RWMutex as a non-const reference.
// locks the mutex for writing. Construction may be blocking. Destruction is guaranteed to release the lock.
using WriteLock = std::unique_lock<RWMutex>;

View File

@ -7,8 +7,8 @@
#else
#include <WS2tcpip.h>
#endif
#include <string>
#include "Xor.h"
#include <string>
struct RSA {
int n = 0;
int e = 0;

View File

@ -2,10 +2,10 @@
/// Created by Anonymous275 on 8/11/2020
///
#pragma once
#include <string>
#include <array>
#include <cstdarg>
#include <cstdio>
#include <string>
#define BEGIN_NAMESPACE(x) namespace x {
#define END_NAMESPACE }
@ -69,8 +69,9 @@ BEGIN_NAMESPACE(XorCompileTime)
public:
template <size_t... Is>
constexpr inline XorString(const Char* str, std::index_sequence< Is... >) : _key(RandomChar< K >::value), _encrypted{ enc(str[Is])... }
{}
constexpr inline XorString(const Char* str, std::index_sequence<Is...>)
: _key(RandomChar<K>::value)
, _encrypted { enc(str[Is])... } { }
inline decltype(auto) decrypt() {
for (size_t i = 0; i < N; ++i) {

View File

@ -8,8 +8,8 @@
#include "CustomAssert.h"
#include <cstring>
#include <unistd.h>
#include <sys/socket.h>
#include <unistd.h>
// ZeroMemory is just a {0} or a memset(addr, 0, len), and it's a macro on MSVC
inline void ZeroMemory(void* dst, size_t len) {

View File

@ -2,10 +2,10 @@
/// Created by Anonymous275 on 7/15/2020
///
#include <iostream>
#include <algorithm>
#include <zlib.h>
#include <array>
#include <iostream>
#include <zlib.h>
#define Biggest 30000
std::string Comp(std::string Data) {

View File

@ -2,13 +2,13 @@
/// Created by Anonymous275 on 7/28/2020
///
#include "Security/Enc.h"
#include "Settings.h"
#include "CustomAssert.h"
#include "Settings.h"
//#include <windows.h>
#include "Logger.h"
#include <random>
#include <sstream>
#include <thread>
#include <random>
int Rand() {
std::random_device r;
@ -20,7 +20,8 @@ int Rand(){
int log_power(int n, unsigned int p, int mod) {
int result = 1;
for (; p; p >>= 1u) {
if (p & 1u)result = int((1LL * result * n) % mod);
if (p & 1u)
result = int((1LL * result * n) % mod);
n = int((1LL * n * n) % mod);
}
return result;
@ -36,7 +37,8 @@ bool rabin_miller(int n){
}
int generate_prime() {
int generated = Rand();
while (!rabin_miller(generated))generated = Rand();
while (!rabin_miller(generated))
generated = Rand();
return generated;
}
int gcd(int a, int b) {
@ -50,19 +52,22 @@ int gcd(int a, int b){
int generate_coprime(int n) {
int generated = Rand();
while (gcd(n, generated) != 1)generated = Rand();
while (gcd(n, generated) != 1)
generated = Rand();
return generated;
}
std::pair<int, int> euclid_extended(int a, int b) {
if(!b)return {1, 0};
if (!b)
return { 1, 0 };
auto result = euclid_extended(b, a % b);
return { result.second, result.first - (a / b) * result.second };
}
int modular_inverse(int n, int mod) {
int inverse = euclid_extended(n, mod).first;
while(inverse < 0)inverse += mod;
while (inverse < 0)
inverse += mod;
return inverse;
}
@ -118,7 +123,8 @@ std::string RSA_D(const std::string& Data, RSA*k){
std::stringstream ss(Data);
std::string token, ret;
while (std::getline(ss, token, 'g')) {
if(token.find_first_not_of(Sec("0123456789abcdef")) != std::string::npos)return "";
if (token.find_first_not_of(Sec("0123456789abcdef")) != std::string::npos)
return "";
int c = std::stoi(token, nullptr, 16);
ret += char(Dec(c, k->d, k->n));
}

View File

@ -1,9 +1,9 @@
///
/// Created by Anonymous275 on 7/28/2020
///
#include "Security/Enc.h"
#include "Logger.h"
#include "CustomAssert.h"
#include "Logger.h"
#include "Security/Enc.h"
#include <fstream>
#include <string>
#include <thread>
@ -22,14 +22,19 @@ void SetValues(const std::string& Line, int Index) {
int state = 0;
std::string Data;
bool Switch = false;
if (Index > 5)Switch = true;
if (Index > 5)
Switch = true;
for (char c : Line) {
if (Switch) {
if (c == '\"')state++;
if (state > 0 && state < 2)Data += c;
if (c == '\"')
state++;
if (state > 0 && state < 2)
Data += c;
} else {
if (c == ' ')state++;
if (state > 1)Data += c;
if (c == ' ')
state++;
if (state > 1)
Data += c;
}
}
Data = Data.substr(1);
@ -72,7 +77,8 @@ void SetValues(const std::string& Line, int Index) {
std::string RemoveComments(const std::string& Line) {
std::string Return;
for (char c : Line) {
if(c == '#')break;
if (c == '#')
break;
Return += c;
}
return Return;
@ -139,13 +145,17 @@ void DebugData(){
void InitConfig() {
std::ifstream IFS;
IFS.open(Sec("Server.cfg"));
if(IFS.good())LoadConfig(IFS);
else Default();
if(IFS.is_open())IFS.close();
if (IFS.good())
LoadConfig(IFS);
else
Default();
if (IFS.is_open())
IFS.close();
if (Key.empty()) {
error(Sec("No AuthKey was found"));
std::this_thread::sleep_for(std::chrono::seconds(3));
_Exit(0);
}
if(Debug)DebugData();
if (Debug)
DebugData();
}

View File

@ -1,15 +1,15 @@
///
/// Created by Anonymous275 on 7/28/2020
///
#include "Security/Enc.h"
#include "Curl/Http.h"
#include "Client.hpp"
#include "Settings.h"
#include "Curl/Http.h"
#include "Logger.h"
#include <sstream>
#include <thread>
#include "Security/Enc.h"
#include "Settings.h"
#include <chrono>
#include <future>
#include <sstream>
#include <thread>
void WebsocketInit();
std::string GetPlayers() {
@ -39,7 +39,8 @@ std::string RunPromise(const std::string& IP, const std::string& R) {
std::thread t(std::move(task));
t.detach();
auto status = f1.wait_for(std::chrono::seconds(10));
if (status != std::future_status::timeout)return f1.get();
if (status != std::future_status::timeout)
return f1.get();
error(Sec("Backend system Timeout please try again later"));
std::this_thread::sleep_for(std::chrono::seconds(3));
_Exit(0);
@ -51,7 +52,8 @@ void Heartbeat(){
bool isAuth = false;
while (true) {
R = GenerateCall();
if(!CustomIP.empty())R+="&ip="+CustomIP;
if (!CustomIP.empty())
R += "&ip=" + CustomIP;
std::string link = Sec("https://beammp.com/heartbeatv2");
T = RunPromise(link, R);
if (T.find_first_not_of(Sec("20")) != std::string::npos) {
@ -66,7 +68,8 @@ void Heartbeat(){
}
}
//Server Authenticated
if(T.length() == 4)info(Sec("Server authenticated"));
if (T.length() == 4)
info(Sec("Server authenticated"));
R.clear();
T.clear();
if (!isAuth) {

View File

@ -1,11 +1,11 @@
///
/// Created by Anonymous275 on 7/28/2020
///
#include "Logger.h"
#include "Security/Enc.h"
#include <filesystem>
#include "Settings.h"
#include <algorithm>
#include "Logger.h"
#include <filesystem>
namespace fs = std::filesystem;
@ -16,7 +16,8 @@ int ModsLoaded = 0;
void InitRes() {
std::string Path = Resource + Sec("/Client");
if(!fs::exists(Path))fs::create_directory(Path);
if (!fs::exists(Path))
fs::create_directory(Path);
for (const auto& entry : fs::directory_iterator(Path)) {
auto pos = entry.path().string().find(Sec(".zip"));
if (pos != std::string::npos) {

View File

@ -1,11 +1,11 @@
///
/// Created by Anonymous275 on 7/28/2020
///
#include "Security/Enc.h"
#include "Client.hpp"
#include "Logger.h"
#include <string>
#include "Security/Enc.h"
#include <algorithm>
#include <string>
std::string CustomIP;
std::string GetSVer() {
@ -25,7 +25,8 @@ void Args(int argc, char* argv[]){
if (p != std::string::npos || n != 3 || CustomIP.substr(0, 3) == Sec("127")) {
CustomIP.clear();
warn(Sec("IP Specified is invalid! Ignoring"));
}else info(Sec("Server started with custom IP"));
} else
info(Sec("Server started with custom IP"));
}
}
void InitServer(int argc, char* argv[]) {

View File

@ -11,8 +11,8 @@
#include "UnixCompat.h"
#include <future>
#include <iostream>
#include <utility>
#include <optional>
#include <utility>
std::unique_ptr<LuaArg> CreateArg(lua_State* L, int T, int S) {
if (S > T)

View File

@ -1,19 +1,18 @@
///
/// Created by Anonymous275 on 7/31/2020
///
#include "Security/Enc.h"
#include "Curl/Http.h"
#include "Settings.h"
#include "Network.h"
#include "Logger.h"
#include <sstream>
#include <thread>
#include <cstring>
#include <algorithm>
#include <string>
#include <atomic>
#include "Network.h"
#include "Security/Enc.h"
#include "Settings.h"
#include "UnixCompat.h"
#include <algorithm>
#include <atomic>
#include <cstring>
#include <sstream>
#include <string>
#include <thread>
bool Send(SOCKET TCPSock, std::string Data) {
#ifdef WIN32
@ -68,11 +67,13 @@ std::string GetRole(const std::string &DID){
std::string a = HttpRequest(Sec("https://beammp.com/entitlement?did=") + DID, 443);
std::string b = HttpRequest(Sec("https://backup1.beammp.com/entitlement?did=") + DID, 443);
if (!a.empty() || !b.empty()) {
if(a != b)a = b;
if (a != b)
a = b;
auto pos = a.find('"');
if (pos != std::string::npos) {
return a.substr(pos + 1, a.find('"', pos + 1) - 2);
}else if(a == "[]")return Sec("Member");
} else if (a == "[]")
return Sec("Member");
}
}
return "";
@ -94,7 +95,8 @@ int Max(){
int M = MaxPlayers;
for (auto& c : CI->Clients) {
if (c != nullptr) {
if(c->GetRole() == Sec("MDEV"))M++;
if (c->GetRole() == Sec("MDEV"))
M++;
}
}
return M;
@ -114,12 +116,14 @@ std::pair<int,int> Parse(const std::string& msg){
std::string t;
std::pair<int, int> a = { 0, 0 }; //N then E
while (std::getline(ss, t, 'g')) {
if(t.find_first_not_of(Sec("0123456789abcdef")) != std::string::npos)return a;
if (t.find_first_not_of(Sec("0123456789abcdef")) != std::string::npos)
return a;
if (a.first == 0) {
a.first = std::stoi(t, nullptr, 16);
} else if (a.second == 0) {
a.second = std::stoi(t, nullptr, 16);
}else return a;
} else
return a;
}
return { 0, 0 };
}

View File

@ -103,4 +103,3 @@ void Client::SetCarData(int ident,const std::string&Data){
int Client::GetCarCount() {
return int(VehicleData.size());
}

View File

@ -1,40 +1,40 @@
///
/// Created by Anonymous275 on 8/1/2020
///
#include "Lua/LuaSystem.hpp"
#include "Security/Enc.h"
#include "Client.hpp"
#include "Settings.h"
#include "Network.h"
#include "Logger.h"
#include "Lua/LuaSystem.hpp"
#include "Network.h"
#include "Security/Enc.h"
#include "Settings.h"
#include "UnixCompat.h"
#include <memory>
#include <sstream>
int FC(const std::string& s, const std::string& p, int n) {
auto i = s.find(p);
int j;
for (j = 1; j < n && i != std::string::npos; ++j) {
i = s.find(p, i + 1);
}
if (j == n)return int(i);
else return -1;
if (j == n)
return int(i);
else
return -1;
}
void Apply(Client* c, int VID, const std::string& pckt) {
Assert(c);
std::string Packet = pckt;
std::string VD = c->GetCarData(VID);
Packet = Packet.substr(FC(Packet, ",", 2) + 1);
Packet = VD.substr(0, FC(VD, ",", 2) + 1) +
Packet.substr(0, Packet.find_last_of('"') + 1) +
VD.substr(FC(VD, ",\"", 7));
Packet = VD.substr(0, FC(VD, ",", 2) + 1) + Packet.substr(0, Packet.find_last_of('"') + 1) + VD.substr(FC(VD, ",\"", 7));
c->SetCarData(VID, Packet);
}
void VehicleParser(Client* c, const std::string& Pckt) {
Assert(c);
if(c == nullptr || Pckt.length() < 4)return;
if (c == nullptr || Pckt.length() < 4)
return;
std::string Packet = Pckt;
char Code = Packet.at(1);
int PID = -1;
@ -49,10 +49,7 @@ void VehicleParser(Client*c,const std::string& Pckt){
int CarID = c->GetOpenCarID();
debug(c->GetName() + Sec(" created a car with ID ") + std::to_string(CarID));
Packet = "Os:" + c->GetRole() + ":" + c->GetName() + ":" + std::to_string(c->GetID()) + "-" + std::to_string(CarID) + Packet.substr(4);
if(c->GetCarCount() >= MaxCars ||
TriggerLuaEvent(Sec("onVehicleSpawn"),false,nullptr,
std::make_unique<LuaArg>(LuaArg{{c->GetID(),CarID,Packet.substr(3)}}),
true)){
if (c->GetCarCount() >= MaxCars || TriggerLuaEvent(Sec("onVehicleSpawn"), false, nullptr, std::make_unique<LuaArg>(LuaArg { { c->GetID(), CarID, Packet.substr(3) } }), true)) {
Respond(c, Packet, true);
std::string Destroy = "Od:" + std::to_string(c->GetID()) + "-" + std::to_string(CarID);
Respond(c, Destroy, true);
@ -119,7 +116,8 @@ void VehicleParser(Client*c,const std::string& Pckt){
}
void SyncClient(Client* c) {
Assert(c);
if(c->isSynced)return;
if (c->isSynced)
return;
c->isSynced = true;
std::this_thread::sleep_for(std::chrono::seconds(1));
Respond(c, Sec("Sn") + c->GetName(), true);
@ -166,14 +164,16 @@ void HandleEvent(Client*c ,const std::string&Data){
default:
break;
}
if(a == 2)break;
if (a == 2)
break;
a++;
}
}
void GlobalParser(Client* c, const std::string& Pack) {
Assert(c);
if(Pack.empty() || c == nullptr)return;
if (Pack.empty() || c == nullptr)
return;
std::string Packet = Pack.substr(0, strlen(Pack.c_str()));
std::string pct;
char Code = Packet.at(0);
@ -212,11 +212,13 @@ void GlobalParser(Client*c, const std::string& Pack){
#ifdef DEBUG
debug(std::string(Sec("got 'C' packet: '")) + Pack + Sec("' (") + std::to_string(Packet.size()) + Sec(")"));
#endif
if(Packet.length() < 4 || Packet.find(':', 3) == std::string::npos)break;
if (Packet.length() < 4 || Packet.find(':', 3) == std::string::npos)
break;
if (TriggerLuaEvent(Sec("onChatMessage"), false, nullptr,
std::unique_ptr<LuaArg>(new LuaArg {
{c->GetID(), c->GetName(), Packet.substr(Packet.find(':', 3) + 1)}
}),true))break;
{ c->GetID(), c->GetName(), Packet.substr(Packet.find(':', 3) + 1) } }),
true))
break;
SendToAll(nullptr, Packet, true, true);
return;
case 'E':

View File

@ -2,8 +2,8 @@
/// Created by Anonymous275 on 4/9/2020
///
#include <curl/curl.h>
#include "CustomAssert.h"
#include <curl/curl.h>
#include <iostream>
static size_t WriteCallback(void* contents, size_t size, size_t nmemb, void* userp) {
((std::string*)userp)->append((char*)contents, size * nmemb);
@ -22,7 +22,8 @@ std::string HttpRequest(const std::string& IP,int port){
curl_easy_setopt(curl, CURLOPT_WRITEDATA, &readBuffer);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if(res != CURLE_OK)return "-1";
if (res != CURLE_OK)
return "-1";
}
return readBuffer;
}
@ -44,7 +45,8 @@ std::string PostHTTP(const std::string& IP,const std::string& Fields){
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
if(res != CURLE_OK)return "-1";
if (res != CURLE_OK)
return "-1";
}
return readBuffer;
}

View File

@ -1,12 +1,12 @@
///
/// Created by Anonymous275 on 8/1/2020
///
#include "Lua/LuaSystem.hpp"
#include "Security/Enc.h"
#include "Client.hpp"
#include "Settings.h"
#include "Network.h"
#include "Logger.h"
#include "Lua/LuaSystem.hpp"
#include "Network.h"
#include "Security/Enc.h"
#include "Settings.h"
int OpenID() {
int ID = 0;
bool found;
@ -37,17 +37,20 @@ void Respond(Client* c, const std::string& MSG, bool Rel) {
}
}
void SendToAll(Client* c, const std::string& Data, bool Self, bool Rel) {
if (!Self)Assert(c);
if (!Self)
Assert(c);
char C = Data.at(0);
for (auto& client : CI->Clients) {
if (client != nullptr) {
if (Self || client.get() != c) {
if (client->isSynced) {
if (Rel || C == 'W' || C == 'Y' || C == 'V' || C == 'E') {
if (C == 'O' || C == 'T' ||
Data.length() > 1000)SendLarge(client.get(), Data);
else TCPSend(client.get(), Data);
} else UDPSend(client.get(), Data);
if (C == 'O' || C == 'T' || Data.length() > 1000)
SendLarge(client.get(), Data);
else
TCPSend(client.get(), Data);
} else
UDPSend(client.get(), Data);
}
}
}
@ -56,7 +59,8 @@ void SendToAll(Client*c, const std::string& Data, bool Self, bool Rel){
void UpdatePlayers() {
std::string Packet = Sec("Ss") + std::to_string(CI->Size()) + "/" + std::to_string(MaxPlayers) + ":";
for (auto& c : CI->Clients) {
if(c != nullptr)Packet += c->GetName() + ",";
if (c != nullptr)
Packet += c->GetName() + ",";
}
Packet = Packet.substr(0, Packet.length() - 1);
SendToAll(nullptr, Packet, true, true);
@ -65,7 +69,8 @@ void OnDisconnect(Client*c,bool kicked){
Assert(c);
info(c->GetName() + Sec(" Connection Terminated"));
if(c == nullptr)return;
if (c == nullptr)
return;
std::string Packet;
for (auto& v : c->GetAllCars()) {
if (v != nullptr) {
@ -73,7 +78,8 @@ void OnDisconnect(Client*c,bool kicked){
SendToAll(c, Packet, false, true);
}
}
if(kicked)Packet = Sec("L")+c->GetName()+Sec(" was kicked!");
if (kicked)
Packet = Sec("L") + c->GetName() + Sec(" was kicked!");
Packet = Sec("L") + c->GetName() + Sec(" Left the server!");
SendToAll(c, Packet, false, true);
Packet.clear();
@ -87,7 +93,8 @@ void OnConnect(Client*c){
info(Sec("Assigned ID ") + std::to_string(c->GetID()) + Sec(" to ") + c->GetName());
TriggerLuaEvent(Sec("onPlayerConnecting"), false, nullptr, std::unique_ptr<LuaArg>(new LuaArg { { c->GetID() } }), false);
SyncResources(c);
if(c->GetStatus() < 0)return;
if (c->GetStatus() < 0)
return;
Respond(c, "M" + MapName, true); //Send the Map on connect
info(c->GetName() + Sec(" : Connected"));
TriggerLuaEvent(Sec("onPlayerJoining"), false, nullptr, std::unique_ptr<LuaArg>(new LuaArg { { c->GetID() } }), false);

View File

@ -1,6 +1,6 @@
#include "Network.h"
#include <thread>
#include <memory>
#include <thread>
std::unique_ptr<ClientInterface> CI;
void NetMain() {
std::thread TCP(TCPServerMain);

View File

@ -1,8 +1,8 @@
///
/// Created by Anonymous275 on 6/18/2020
///
#include "Security/Enc.h"
#include "Client.hpp"
#include "Security/Enc.h"
#include <iostream>
#include <string>
#include <thread>

View File

@ -1,17 +1,17 @@
///
/// Created by Anonymous275 on 8/1/2020
///
#include "Compressor.h"
#include "Logger.h"
#include "Network.h"
#include "Security/Enc.h"
#include "UnixCompat.h"
#include "Compressor.h"
#include "Network.h"
#include "Logger.h"
#include <thread>
void TCPSend(Client* c, const std::string& Data) {
Assert(c);
if(c == nullptr)return;
if (c == nullptr)
return;
// Size is BIG ENDIAN now, use only for header!
//auto Size = htonl(int32_t(Data.size()));
///TODO : BIG ENDIAN for other OS
@ -25,10 +25,12 @@ void TCPSend(Client*c,const std::string&Data){
do {
Temp = send(c->GetTCPSock(), &Send[Sent], Size - Sent, 0);
if (Temp == 0) {
if (c->GetStatus() > -1)c->SetStatus(-1);
if (c->GetStatus() > -1)
c->SetStatus(-1);
return;
} else if (Temp < 0) {
if (c->GetStatus() > -1)c->SetStatus(-1);
if (c->GetStatus() > -1)
c->SetStatus(-1);
info(Sec("Closing socket, Temp < 0"));
closesocket(c->GetTCPSock());
return;
@ -41,7 +43,8 @@ bool CheckBytes(Client*c,int32_t BytesRcv){
Assert(c);
if (BytesRcv == 0) {
debug(Sec("(TCP) Connection closing..."));
if(c->GetStatus() > -1)c->SetStatus(-1);
if (c->GetStatus() > -1)
c->SetStatus(-1);
return false;
} else if (BytesRcv < 0) {
#ifdef WIN32
@ -49,7 +52,8 @@ bool CheckBytes(Client*c,int32_t BytesRcv){
#else // unix
debug(Sec("(TCP) recv failed with error: ") + std::string(strerror(errno)));
#endif // WIN32
if(c->GetStatus() > -1)c->SetStatus(-1);
if (c->GetStatus() > -1)
c->SetStatus(-1);
info(Sec("Closing socket in CheckBytes, BytesRcv < 0"));
closesocket(c->GetTCPSock());
return false;
@ -60,7 +64,8 @@ bool CheckBytes(Client*c,int32_t BytesRcv){
void TCPRcv(Client* c) {
Assert(c);
int32_t Header, BytesRcv = 0, Temp;
if(c == nullptr || c->GetStatus() < 0)return;
if (c == nullptr || c->GetStatus() < 0)
return;
std::vector<char> Data(sizeof(Header));
do {
@ -122,7 +127,8 @@ void TCPClient(Client*c){
return;
}
OnConnect(c);
while (c->GetStatus() > -1)TCPRcv(c);
while (c->GetStatus() > -1)
TCPRcv(c);
OnDisconnect(c, c->GetStatus() == -2);
}
void InitClient(Client* c) {

View File

@ -2,14 +2,14 @@
/// Created by Anonymous275 on 11/6/2020
///
/*#include <boost/beast/core.hpp>
#include <boost/beast/websocket.hpp>
#include "Logger.h"
#include "Security/Enc.h"
#include <boost/asio/connect.hpp>
#include <boost/asio/ip/tcp.hpp>*/
#include "Security/Enc.h"
#include <boost/beast/websocket.hpp>
#include <iostream>
#include "Logger.h"
#include <thread>
#include <string>
#include <thread>
/*namespace beast = boost::beast;
namespace http = beast::http;
@ -50,9 +50,7 @@ void SyncData(){
}*/
}
void WebsocketInit() {
/*std::thread t1(SyncData);
t1.detach();*/
}

View File

@ -2,6 +2,7 @@
/// Created by Anonymous275 on 7/17/2020
///
#include "Logger.h"
#include "RWMutex.h"
#include "Security/Enc.h"
#include "Settings.h"
#include <chrono>
@ -10,7 +11,6 @@
#include <sstream>
#include <thread>
#include <unordered_map>
#include "RWMutex.h"
static RWMutex ThreadNameMapMutex;
static std::unordered_map<std::thread::id, std::string> ThreadNameMap;

View File

@ -1,9 +1,9 @@
#include "CustomAssert.h"
#include <curl/curl.h>
#include "Security/Xor.h"
#include "Startup.h"
#include <curl/curl.h>
#include <iostream>
#include <thread>
#include "Security/Xor.h"
#ifndef WIN32
#include <signal.h>
void UnixSignalHandler(int sig) {