public async ValueTask <bool> CanJoinRopeWarContestAsync(string characterId, string contestId, CancellationToken cancellationToken)
    {
        var currentActivity = await _activitiesClient.GetCurrentActivityAsync(characterId, cancellationToken)
                              .ConfigureAwait(false);

        return(currentActivity != null &&
               currentActivity.ActivityId == contestId &&
               currentActivity.Type == ActivityType.RopeWar);
    }
示例#2
0
    public async ValueTask <bool> CanPerformActionsInLayerAsync(string characterId, Layer layer, CancellationToken cancellationToken)
    {
        // Get already started activities.
        var currentActivity = await _activitiesClient.GetCurrentActivityAsync(characterId, cancellationToken)
                              .ConfigureAwait(false);

        // For now whenever we already have any started activity - do not allow any actions in the whole World domain anymore.
        if (currentActivity != null)
        {
            return(false);
        }

        var activity = _activityStore.GetCurrentCharacterActivityOrDefault(characterId);

        return(CanPerformActionsInLayer(activity, layer));
    }