示例#1
0
        internal MercuryUser GetUser(string userId, HostedMercuryServer server)
        {
            if (_users == null)
            {
                return(null);
            }

            if (!_users.ContainsKey(userId))
            {
                return(null);
            }

            var user = new MercuryUser(_users[userId]);

            user.SetServer(server);

            return(user);
        }
示例#2
0
        internal virtual MercuryUser GetUserWithConnectionId(string connectionId, HostedMercuryServer server)
        {
            if (_users == null)
            {
                return(null);
            }

            foreach (var user in _users)
            {
                if (user.Value.HasConnectionId(connectionId))
                {
                    var result = new MercuryUser(user.Value);
                    result.SetServer(server);
                    return(result);
                }
            }

            return(null);
        }