コード例 #1
0
    public async ValueTask HandleAsync(Connect connect, CancellationToken cancellationToken)
    {
        var characterBelongsToCurrentProfile = await _charactersClient.BelongsToCurrentProfileAsync(connect.ClientId, cancellationToken)
                                               .ConfigureAwait(false);

        if (!characterBelongsToCurrentProfile)
        {
            throw new UnauthorizedAccessException($"Character {connect.ClientId} does not belong to current profile.");
        }
    }
コード例 #2
0
 public ValueTask <bool> CharacterBelongsToCurrentProfileAsync(string characterId, CancellationToken cancellationToken)
 {
     return(_charactersClient.BelongsToCurrentProfileAsync(characterId, cancellationToken));
 }