feat(Core/Threading): replace ace threading (#4821)

This commit is contained in:
Kargatum
2021-04-17 00:45:29 +07:00
committed by GitHub
parent b9e84d8278
commit b2861be1cd
50 changed files with 300 additions and 342 deletions

View File

@@ -273,7 +273,7 @@ void AuthSocket::OnRead()
std::map<std::string, uint32> LastLoginAttemptTimeForIP;
uint32 LastLoginAttemptCleanTime = 0;
ACE_Thread_Mutex LastLoginAttemptMutex;
std::mutex LastLoginAttemptMutex;
// Logon Challenge command handler
bool AuthSocket::_HandleLogonChallenge()
@@ -289,7 +289,7 @@ bool AuthSocket::_HandleLogonChallenge()
// pussywizard: logon flood protection:
{
ACORE_GUARD(ACE_Thread_Mutex, LastLoginAttemptMutex);
std::lock_guard<std::mutex> guard(LastLoginAttemptMutex);
std::string ipaddr = socket().getRemoteAddress();
uint32 currTime = time(nullptr);
std::map<std::string, uint32>::iterator itr = LastLoginAttemptTimeForIP.find(ipaddr);

View File

@@ -52,7 +52,7 @@ public:
bool _HandleXferAccept();
FILE* pPatch;
ACE_Thread_Mutex patcherLock;
std::mutex patcherLock;
private:
RealmSocket& socket_;