mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-14 19:56:17 +00:00
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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user