Exemple #1
0
        public override async Task OnDisconnectedAsync(Exception exception)
        {
            if (_connectionCache.TryGetValue(Context.ConnectionId, out var player))
            {
                _connectionCache.Remove(Context.ConnectionId);
                await _httpClient.DeleteAsync($"enqueued-teams/{player.PlayerId}?api_key=secret");

                await Clients.All.SendAsync("PlayerLeft", player);
            }

            await base.OnDisconnectedAsync(exception);
        }