mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-05 23:36:23 +00:00
change __WIN32 to WIN32 (oops)
This commit is contained in:
@@ -21,15 +21,15 @@ void TCPSend(Client*c,const std::string&Data){
|
||||
}
|
||||
void TCPHandle(Client*c,const std::string& data){
|
||||
Assert(c);
|
||||
#ifdef __WIN32
|
||||
#ifdef WIN32
|
||||
__try{
|
||||
#endif // __WIN32
|
||||
#endif // WIN32
|
||||
c->Handler.Handle(c,data);
|
||||
#ifdef __WIN32
|
||||
#ifdef WIN32
|
||||
}__except(1){
|
||||
c->Handler.clear();
|
||||
}
|
||||
#endif // __WIN32
|
||||
#endif // WIN32
|
||||
}
|
||||
void TCPRcv(Client*c){
|
||||
Assert(c);
|
||||
@@ -43,11 +43,11 @@ void TCPRcv(Client*c){
|
||||
if(c->GetStatus() > -1)c->SetStatus(-1);
|
||||
return;
|
||||
}else if (BytesRcv < 0) {
|
||||
#ifdef __WIN32
|
||||
#ifdef WIN32
|
||||
debug(Sec("(TCP) recv failed with error: ") + std::to_string(WSAGetLastError()));
|
||||
#else // unix
|
||||
debug(Sec("(TCP) recv failed with error: ") + std::string(strerror(errno)));
|
||||
#endif // __WIN32
|
||||
#endif // WIN32
|
||||
if(c->GetStatus() > -1)c->SetStatus(-1);
|
||||
closesocket(c->GetTCPSock());
|
||||
return;
|
||||
@@ -64,13 +64,13 @@ void TCPClient(Client*c){
|
||||
}
|
||||
OnConnect(c);
|
||||
while (c->GetStatus() > -1)TCPRcv(c);
|
||||
#ifdef __WIN32
|
||||
#ifdef WIN32
|
||||
__try{
|
||||
#endif // __WIN32
|
||||
#endif // WIN32
|
||||
OnDisconnect(c, c->GetStatus() == -2);
|
||||
#ifdef __WIN32
|
||||
#ifdef WIN32
|
||||
}__except(Handle(GetExceptionInformation(),Sec("OnDisconnect"))){}
|
||||
#endif // __WIN32
|
||||
#endif // WIN32
|
||||
}
|
||||
void InitClient(Client*c){
|
||||
std::thread NewClient(TCPClient,c);
|
||||
|
||||
Reference in New Issue
Block a user