GameSend Improvement

This commit is contained in:
Anonymous275
2020-11-11 01:01:32 +02:00
parent 726af5bf1d
commit f6166460ff

View File

@@ -31,7 +31,7 @@ bool CheckBytes(uint32_t Bytes){
void GameSend(std::string Data){
static std::mutex Lock;
Lock.lock();
std::scoped_lock Guard(Lock);
if(TCPTerminate || !GConnected || CSocket == -1)return;
static thread_local int32_t Size,Temp,Sent;
Data += '\n';
@@ -47,7 +47,6 @@ void GameSend(std::string Data){
if(!CheckBytes(Temp))return;
Sent += Temp;
}while(Sent < Size);
Lock.unlock();
}
void ServerSend(std::string Data, bool Rel){
if(Terminate || Data.empty())return;