[Server] Allow multiple sessions with one user

This commit is contained in:
lukeIam committed 2014-12-29 20:45:46 +01:00
1 parent 51dc4391bd
commit f4583b830a
4 files changed
+31 -8

No files matched your search

+9 -1
View File
@@ -34,7 +34,7 @@ namespace ServerLib
int id = _GetProfileIdFormUsername(userName);
EUserRoles roles = _GetUserRoles(id);
CSession session = new CSession(newId, id, roles);
InvalidateSessions(id);
//InvalidateSessions(id);
_ActiveSessions.Add(newId, session);
return newId;
@@ -63,6 +63,14 @@ namespace ServerLib
_ActiveSessions.Remove(s.Key);
}
internal static void InvalidateSessions(Guid sessionId)
{
if (_ActiveSessions.ContainsKey(sessionId))
{
_ActiveSessions.Remove(sessionId);
}
}
internal static bool RequestRight(Guid sessionId, EUserRights requestedRight)
{
return ((CUserRoleControl.GetUserRightsFromUserRole(_ActiveSessions[sessionId].Roles)