mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-09-29 19:20:17 +00:00
fixed shardSessions locks
This commit is contained in:
@@ -568,8 +568,10 @@ bool CNLoginServer::isAccountInUse(int accountId) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
// check shard server connections
|
// check shard server connections
|
||||||
std::lock_guard<std::mutex> lock(lsCrit);
|
lsCrit.lock();
|
||||||
return (shardSessions.find(accountId) != shardSessions.end());
|
bool result = shardSessions.find(accountId) != shardSessions.end();
|
||||||
|
lsCrit.unlock();
|
||||||
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CNLoginServer::exitDuplicate(int accountId) {
|
void CNLoginServer::exitDuplicate(int accountId) {
|
||||||
@@ -585,8 +587,10 @@ void CNLoginServer::exitDuplicate(int accountId) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// shard server
|
// shard server
|
||||||
std::lock_guard<std::mutex> lock(lsCrit);
|
lsCrit.lock();
|
||||||
if (shardSessions.find(accountId) == shardSessions.end())
|
bool found = shardSessions.find(accountId) != shardSessions.end();
|
||||||
|
lsCrit.unlock();
|
||||||
|
if (!found)
|
||||||
return;
|
return;
|
||||||
CNSocket* sock = shardSessions[accountId];
|
CNSocket* sock = shardSessions[accountId];
|
||||||
PlayerManager::exitDuplicate(sock);
|
PlayerManager::exitDuplicate(sock);
|
||||||
|
Reference in New Issue
Block a user