Esempio n. 1
0
 /// <summary>
 /// Removes all scopes from a scope set that have a specific status.
 /// </summary>
 /// <param name="ctx">The call context.</param>
 /// <param name="actorId">The acting actor identifier.</param>
 /// <param name="scopeSetId">The target scope set identifier.</param>
 /// <param name="status">The status that must match for the scope to be removed.</param>
 /// <returns>The awaitable.</returns>
 public Task RemoveScopesAsync(ISqlCallContext ctx, int actorId, int scopeSetId, ScopeWARStatus status)
 {
     return(DoRemoveScopesAsync(ctx, actorId, scopeSetId, null, false, 'W', status.ToString()[0]));
 }
Esempio n. 2
0
 /// <summary>
 /// Creates a scope set with an optional initial set of scopes.
 /// </summary>
 /// <param name="ctx">The call context.</param>
 /// <param name="actorId">The acting actor identifier.</param>
 /// <param name="scopes">Optional initial scopes.</param>
 /// <param name="scopesHaveStatus">True to handle [W], [A] or [R] prefix from scopes.</param>
 /// <param name="defaultStatus">Initial status of of initial scopes.</param>
 /// <returns>The scope set identifier.</returns>
 public virtual Task <int> CreateScopeSetAsync(ISqlCallContext ctx, int actorId, string scopes = null, bool scopesHaveStatus = false, ScopeWARStatus defaultStatus = ScopeWARStatus.Waiting)
 {
     return(DoCreateScopeSetAsync(ctx, actorId, scopes, scopesHaveStatus, defaultStatus.ToString()[0]));
 }
Esempio n. 3
0
 /// <summary>
 /// Removes the given scopes from a scope set.
 /// </summary>
 /// <param name="ctx">The call context.</param>
 /// <param name="actorId">The acting actor identifier.</param>
 /// <param name="scopeSetId">The target scope set identifier.</param>
 /// <param name="scopes">Whitespace separated list of scopes to remove.</param>
 /// <param name="scopesHaveStatus">True to handle [W], [A] or [R] prefixes from <paramref name="scopes"/>.</param>
 /// <param name="defaultWARStatus">The status ('W', 'A' or 'R') to use when no explicit prefix are handled.</param>
 /// <param name="statusFilter">Optional filter status: only scopes with this status will be removed.</param>
 /// <returns>The awaitable.</returns>
 public Task RemoveScopesAsync(ISqlCallContext ctx, int actorId, int scopeSetId, string scopes, bool scopesHaveStatus, ScopeWARStatus defaultWARStatus = ScopeWARStatus.Waiting, ScopeWARStatus?statusFilter = null)
 {
     return(DoRemoveScopesAsync(ctx, actorId, scopeSetId, scopes, scopesHaveStatus, defaultWARStatus.ToString()[0], statusFilter?.ToString()[0]));
 }
Esempio n. 4
0
 /// <summary>
 /// Sets the scopes of a scope set: existing scopes that do not appear in <paramref name="scopes"/>
 /// are removed.
 /// </summary>
 /// <param name="ctx">The call context.</param>
 /// <param name="actorId">The acting actor identifier.</param>
 /// <param name="scopeSetId">The target scope set identifier.</param>
 /// <param name="scopes">Whitespace separated list of scopes.</param>
 /// <param name="scopesHaveStatus">True to handle [W], [A] or [R] prefixes from <paramref name="scopes"/>.</param>
 /// <param name="defaultWARStatus">The status ('W', 'A' or 'R') to use when no explicit prefix are handled.</param>
 /// <returns>The awaitable.</returns>
 public virtual Task SetScopesAsync(ISqlCallContext ctx, int actorId, int scopeSetId, string scopes, bool scopesHaveStatus, ScopeWARStatus defaultWARStatus = ScopeWARStatus.Waiting)
 {
     return(DoAddOrUpdateScopesAsync(ctx, actorId, scopeSetId, scopes, scopesHaveStatus, defaultWARStatus.ToString()[0], true));
 }
Esempio n. 5
0
 /// <summary>
 /// Removes all scopes from a scope set that have a specific status.
 /// </summary>
 /// <param name="ctx">The call context.</param>
 /// <param name="actorId">The acting actor identifier.</param>
 /// <param name="scopeSetId">The target scope set identifier.</param>
 /// <param name="status">The status that must match for the scope to be removed.</param>
 public void RemoveScopes(ISqlCallContext ctx, int actorId, int scopeSetId, ScopeWARStatus status)
 {
     DoRemoveScopes(ctx, actorId, scopeSetId, null, false, 'W', status.ToString()[0]);
 }
Esempio n. 6
0
 /// <summary>
 /// Sets the scopes of a scope set: existing scopes that do not appear in <paramref name="scopes"/>
 /// are removed.
 /// </summary>
 /// <param name="ctx">The call context.</param>
 /// <param name="actorId">The acting actor identifier.</param>
 /// <param name="scopeSetId">The target scope set identifier.</param>
 /// <param name="scopes">Whitespace separated list of scopes.</param>
 /// <param name="scopesHaveStatus">True to handle [W], [A] or [R] prefixes from <paramref name="scopes"/>.</param>
 /// <param name="defaultWARstatus">The status ('W', 'A' or 'R') to use when no explicit prefix are handled.</param>
 public virtual void SetScopes(ISqlCallContext ctx, int actorId, int scopeSetId, string scopes, bool scopesHaveStatus, ScopeWARStatus defaultWARstatus = ScopeWARStatus.Waiting)
 {
     DoAddScopes(ctx, actorId, scopeSetId, scopes, scopesHaveStatus, defaultWARstatus.ToString()[0], true);
 }
Esempio n. 7
0
 /// <summary>
 /// Overridden to return the [<see cref="Status"/>]<see cref="ScopeName"/>.
 /// </summary>
 /// <returns>The status and name of this scope.</returns>
 public override sealed string ToString() => $"[{Status.ToString()[0]}]{ScopeName}";