Example #1
0
        public async Task CreateSession(string userId, bool[] permissions)
        {
            if (SessionHandler.GetUsersSession(userId) == "")
            {
                string sessionId = SessionHandler.CreateSession(permissions);
                userId = SessionHandler.CreateAndAddUser(sessionId);
                SessionHandler.AddHostUser(sessionId, userId);
                await Groups.AddToGroupAsync(Context.ConnectionId, sessionId);

                await Clients.Caller.SendAsync("SessionCreated", sessionId, userId);
            }
        }