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
characterIdlongCharacter who owns the quest.
templateIdintQuest template ID to delete.
incomingVersionlongOnly deletes if this version exceeds the stored version.
cancellationTokenCancellationTokenOptional cancellation token.
Returns
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
characterIdlongCharacter who owns the quest.
templateIdintQuest template ID to delete.
incomingVersionlongOnly deletes if this version exceeds the stored version.
claimCharacterSessionLeaseDataThe claim the delete was captured under. Must name
characterId.cancellationTokenCancellationTokenOptional 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.