示例#1
0
        public override Task OnConnectedAsync()
        {
            if (Context.User.Identity.IsAuthenticated)
            {
                var steamId = UserExtensions.GetSteamId(Context.User);
                UserConnections.Add(steamId, Context.ConnectionId);
            }

            return(base.OnConnectedAsync());
        }
示例#2
0
        public override Task OnDisconnectedAsync(Exception ex)
        {
            if (Context.User.Identity.IsAuthenticated)
            {
                var steamId = UserExtensions.GetSteamId(Context.User);
                UserConnections.Remove(steamId, Context.ConnectionId);
            }

            return(base.OnDisconnectedAsync(ex));
        }