Table of Contents

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

guildData CharacterGuildData

The guild membership data to persist.

maxCapacity int

The maximum number of members allowed in the guild.

cancellationToken CancellationToken

Token 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

characterId long

The member the note is about.

guildId long

The guild the note belongs to.

note string

The note text. Capped at 128 characters.

isOfficerNote bool

True for the officer-only note, false for the public one.

cancellationToken CancellationToken

Token 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

characterId long

The character ID.

guildId long

The guild ID.

rank byte

The new rank.

incomingVersion long

The authoritative, monotonic version for this update operation.

cancellationToken CancellationToken

Token to cancel the operation.

Returns

Task<DatabaseResult>

A DatabaseResult indicating success or failure.