lots of work, added atomic queue, changed githuyb workflows and added patterns with memory functions. Changed from MS Detours to MinHook.

now works with lua prototype
This commit is contained in:
Anonymous275
2022-02-22 16:19:53 +02:00
parent 6dfeba1e49
commit 19d7120b13
22 changed files with 189 additions and 164 deletions

View File

@@ -47,7 +47,6 @@ void Server::TCPClientMain() {
char Code = 'C';
send(TCPSocket, &Code, 1, 0);
SyncResources();
UDPConnection = std::thread(&Server::UDPMain, this);
while(!Terminate.load()) {
ServerParser(TCPRcv());
}
@@ -55,6 +54,13 @@ void Server::TCPClientMain() {
KillSocket(TCPSocket);
}
void Server::StartUDP() {
if(TCPConnection.joinable() && !UDPConnection.joinable()) {
LOG(INFO) << "Connecting UDP";
UDPConnection = std::thread(&Server::UDPMain, this);
}
}
void Server::UDPSend(std::string Data) {
if(ClientID == -1 || UDPSocket == -1)return;
if(Data.length() > 400){
@@ -153,6 +159,8 @@ void Server::PingLoop() {
void Server::Close() {
Terminate.store(true);
KillSocket(TCPSocket);
KillSocket(UDPSocket);
Ping = -1;
if(TCPConnection.joinable()) {
TCPConnection.join();
@@ -163,8 +171,6 @@ void Server::Close() {
if(AutoPing.joinable()) {
AutoPing.join();
}
KillSocket(TCPSocket);
KillSocket(UDPSocket);
}
const std::string &Server::getMap() {