예제 #1
0
        public bool TryGetLoggedInUser(string username, out UserExtension value)
        {
            var result = _loggedInUsers.TryGetValue(username.ToLower(), out var extension);

            value = extension;
            return(result);
        }
예제 #2
0
        private void FinalizeLogin(UserExtension extension)
        {
            extension.Peer.Disconnected += OnUserDisconnect;

            // Add to lookup of logged in users
            _loggedInUsers.Add(extension.Username.ToLower(), extension);

            // Trigger the login event
            LoggedIn?.Invoke(extension);
        }