Table of Contents

Interface ICharacterQuestService

Namespace
FishMMO.Database.Npgsql.Services.Interfaces
Assembly
FishMMO-DB.dll

Service interface for managing character quests.

public interface ICharacterQuestService : IPersistManyAction<CharacterQuestData>, IPersistManyOwnedAction<CharacterQuestData>, IFetchCollectionByKeyAction<long, CharacterQuestData>
Inherited Members

Remarks

Quest persistence and deletion should be version-gated via the logical Version so stale updates are rejected and newer authoritative updates win.

Methods

DeleteQuestAsync(long, int, long, CancellationToken)

Soft-deletes a specific quest for a character, gated by version. Used when a quest is turned in or abandoned.

Task<DatabaseResult> DeleteQuestAsync(long characterId, int templateId, long incomingVersion, CancellationToken cancellationToken = default)

Parameters

characterId long

Character who owns the quest.

templateId int

Quest template ID to delete.

incomingVersion long

Only deletes if this version exceeds the stored version.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<DatabaseResult>

DeleteQuestOwnedAsync(long, int, long, CharacterSessionLeaseData, CancellationToken)

DeleteQuestAsync(long, int, long, CancellationToken), admitted only while the writer still holds the character's session claim.

Task<DatabaseResult> DeleteQuestOwnedAsync(long characterId, int templateId, long incomingVersion, CharacterSessionLeaseData claim, CancellationToken cancellationToken = default)

Parameters

characterId long

Character who owns the quest.

templateId int

Quest template ID to delete.

incomingVersion long

Only deletes if this version exceeds the stored version.

claim CharacterSessionLeaseData

The claim the delete was captured under. Must name characterId.

cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<DatabaseResult>

Success when the quest is deleted. Fails with Forbidden when the claim is no longer held.

Remarks

The turn-in or abandon a resident character makes. The claim is captured with the request and checked, under the character's share lock, in the delete's own transaction — see CharacterWriteGate — so a delete captured by a session released a moment later cannot land over the next owner's quest log.