aboutsummaryrefslogtreecommitdiff
path: root/src/server/bnetserver/Server/SessionManager.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2014-10-17 22:48:06 +0200
committerShauren <shauren.trinity@gmail.com>2014-10-17 22:48:06 +0200
commitf773a9e05340d4de7dd16d0e375a12611c3995b6 (patch)
tree37ff1c708f636216d618cd0e7bf51ec140582ac0 /src/server/bnetserver/Server/SessionManager.cpp
parent40cff79b253869ce16f4e6870380a1b63dcbe664 (diff)
Core: Implemented IPC (Inter-process communication) between worldserver and bnetserver using ZeroMQ library.
* Implemented ToonReady and ToonLoggedOut battle.net packets
Diffstat (limited to 'src/server/bnetserver/Server/SessionManager.cpp')
-rw-r--r--src/server/bnetserver/Server/SessionManager.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/server/bnetserver/Server/SessionManager.cpp b/src/server/bnetserver/Server/SessionManager.cpp
index 8dcee55ec6c..9e5836dab8d 100644
--- a/src/server/bnetserver/Server/SessionManager.cpp
+++ b/src/server/bnetserver/Server/SessionManager.cpp
@@ -49,3 +49,22 @@ void Battlenet::SessionManager::RemoveSession(Session* session)
_sessions.erase({ session->GetAccountId(), session->GetGameAccountId() });
_sessionsByAccountId[session->GetAccountId()].remove(session);
}
+
+Battlenet::Session* Battlenet::SessionManager::GetSession(uint32 accountId, uint32 gameAccountId) const
+{
+ auto itr = _sessions.find({ accountId, gameAccountId });
+ if (itr != _sessions.end())
+ return itr->second;
+
+ return nullptr;
+}
+
+std::list<Battlenet::Session*> Battlenet::SessionManager::GetSessions(uint32 accountId) const
+{
+ std::list<Session*> sessions;
+ auto itr = _sessionsByAccountId.find(accountId);
+ if (itr != _sessionsByAccountId.end())
+ sessions = itr->second;
+
+ return sessions;
+}