Beispiel #1
0
        public override async Task OnConnectedAsync()
        {
            var currentUser = new UserDetails(Context.ConnectionId, Context.User.Identity.Name);

            userTracker.AddUser(currentUser);
            await OnUsersJoined(currentUser);

            await Clients.Client(Context.ConnectionId).InvokeAsync("SetUsersOnline", userTracker.GetUsers());

            await base.OnConnectedAsync();
        }