aboutsummaryrefslogtreecommitdiff
path: root/src/server/bnetserver/Server/SessionManager.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-04-11 16:25:21 +0200
committerShauren <shauren.trinity@gmail.com>2015-04-11 16:25:21 +0200
commit685a31010359be6e832611d1666c026f34fb3745 (patch)
tree3ac2265558d2733d51a65e576b7cff81eb846d79 /src/server/bnetserver/Server/SessionManager.cpp
parenta0647a825ad7236aa30546cc8d27257cbd831c30 (diff)
Core/Battle.net: Query optimizations part1 - reduced the amount of queries during authentication
Diffstat (limited to 'src/server/bnetserver/Server/SessionManager.cpp')
-rw-r--r--src/server/bnetserver/Server/SessionManager.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/server/bnetserver/Server/SessionManager.cpp b/src/server/bnetserver/Server/SessionManager.cpp
index b5d4f5e11cc..d56e1f92f06 100644
--- a/src/server/bnetserver/Server/SessionManager.cpp
+++ b/src/server/bnetserver/Server/SessionManager.cpp
@@ -56,6 +56,7 @@ void Battlenet::SessionManager::RemoveSession(Session* session)
Battlenet::Session* Battlenet::SessionManager::GetSession(uint32 accountId, uint32 gameAccountId) const
{
+ boost::shared_lock<boost::shared_mutex> lock(_sessionMutex);
auto itr = _sessions.find({ accountId, gameAccountId });
if (itr != _sessions.end())
return itr->second;
@@ -65,6 +66,7 @@ Battlenet::Session* Battlenet::SessionManager::GetSession(uint32 accountId, uint
std::list<Battlenet::Session*> Battlenet::SessionManager::GetSessions(uint32 accountId) const
{
+ boost::shared_lock<boost::shared_mutex> lock(_sessionMutex);
std::list<Session*> sessions;
auto itr = _sessionsByAccountId.find(accountId);
if (itr != _sessionsByAccountId.end())