mirror of
https://github.com/BeamMP/BeamMP-Launcher.git
synced 2026-04-19 06:40:14 +00:00
GameSend Improvement
This commit is contained in:
@@ -31,7 +31,7 @@ bool CheckBytes(uint32_t Bytes){
|
|||||||
|
|
||||||
void GameSend(std::string Data){
|
void GameSend(std::string Data){
|
||||||
static std::mutex Lock;
|
static std::mutex Lock;
|
||||||
Lock.lock();
|
std::scoped_lock Guard(Lock);
|
||||||
if(TCPTerminate || !GConnected || CSocket == -1)return;
|
if(TCPTerminate || !GConnected || CSocket == -1)return;
|
||||||
static thread_local int32_t Size,Temp,Sent;
|
static thread_local int32_t Size,Temp,Sent;
|
||||||
Data += '\n';
|
Data += '\n';
|
||||||
@@ -47,7 +47,6 @@ void GameSend(std::string Data){
|
|||||||
if(!CheckBytes(Temp))return;
|
if(!CheckBytes(Temp))return;
|
||||||
Sent += Temp;
|
Sent += Temp;
|
||||||
}while(Sent < Size);
|
}while(Sent < Size);
|
||||||
Lock.unlock();
|
|
||||||
}
|
}
|
||||||
void ServerSend(std::string Data, bool Rel){
|
void ServerSend(std::string Data, bool Rel){
|
||||||
if(Terminate || Data.empty())return;
|
if(Terminate || Data.empty())return;
|
||||||
|
|||||||
Reference in New Issue
Block a user