public bool TryGetLoggedInUser(string username, out UserExtension value) { var result = _loggedInUsers.TryGetValue(username.ToLower(), out var extension); value = extension; return(result); }
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); }