Interface ICharacterGuildService
- Namespace
- FishMMO.Database.Npgsql.Services.Interfaces
- Assembly
- FishMMO-DB.dll
Service interface for managing a character's guild membership state.
public interface ICharacterGuildService : ICountByKeyAction<long>, IDeleteByKeyVersionedAction<long>, IFetchByKeyAction<long, CharacterGuildData?>, IFetchManyByKeyAction<long, CharacterGuildData>
- Inherited Members
Remarks
Guild membership updates should be version-gated via the logical Version
so stale updates are rejected and newer authoritative updates win.
Methods
PersistAsync(CharacterGuildData, int, CancellationToken)
Persists the provided guild membership data, enforcing capacity limits.
Task<DatabaseResult> PersistAsync(CharacterGuildData guildData, int maxCapacity, CancellationToken cancellationToken = default)
Parameters
guildDataCharacterGuildDataThe guild membership data to persist.
maxCapacityintThe maximum number of members allowed in the guild.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DatabaseResult>
A DatabaseResult indicating success or failure.
UpdateNoteAsync(long, long, string, bool, CancellationToken)
Writes one of a member's two guild notes.
Task<DatabaseResult> UpdateNoteAsync(long characterId, long guildId, string note, bool isOfficerNote, CancellationToken cancellationToken = default)
Parameters
characterIdlongThe member the note is about.
guildIdlongThe guild the note belongs to.
notestringThe note text. Capped at 128 characters.
isOfficerNoteboolTrue for the officer-only note, false for the public one.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DatabaseResult>
A DatabaseResult indicating success or failure.
Remarks
The guild is in the WHERE clause. A note request naming a character who has since left — or who was never in the editor's guild — must not write, and this is where that is guaranteed rather than merely checked earlier.
UpdateRankAsync(long, long, byte, long, CancellationToken)
Updates a character's guild rank if incomingVersion is newer.
Task<DatabaseResult> UpdateRankAsync(long characterId, long guildId, byte rank, long incomingVersion, CancellationToken cancellationToken = default)
Parameters
characterIdlongThe character ID.
guildIdlongThe guild ID.
rankbyteThe new rank.
incomingVersionlongThe authoritative, monotonic version for this update operation.
cancellationTokenCancellationTokenToken to cancel the operation.
Returns
- Task<DatabaseResult>
A DatabaseResult indicating success or failure.