示例#1
0
        public override Task OnDisconnectedAsync(Exception exception)
        {
            Player player = playerStorage.GetByConnectionId(base.Context.ConnectionId);

            playerStorage.Remove(base.Context.ConnectionId);
            if (player != null)
            {
                Clients.All.SendAsync("TerminatePlayer", player.Name);
            }
            return(base.OnDisconnectedAsync(exception));
        }