Table of Contents

Class PlotUpdateService

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

Records when plots change, so scene servers hosting other channels can notice.

public sealed class PlotUpdateService : BaseService<PlotUpdateEntity>, IPlotUpdateService
Inheritance
PlotUpdateService
Implements
Inherited Members

Remarks

The same polling shape guilds use, for the same reason: a plot is visible from every scene server hosting a channel of its scene, and the server that processed a claim is not the one that has to redraw the foundation everywhere else.

Constructors

PlotUpdateService(INpgsqlDbContextFactory)

public PlotUpdateService(INpgsqlDbContextFactory dbContextFactory)

Parameters

dbContextFactory INpgsqlDbContextFactory

Methods

DeleteAsync(long, CancellationToken)

Removes the update record for a plot.

public Task<DatabaseResult<int>> DeleteAsync(long plotID, CancellationToken cancellationToken = default)

Parameters

plotID long
cancellationToken CancellationToken

Returns

Task<DatabaseResult<int>>

FetchAsync(List<long>, DateTime, CancellationToken)

Fetches the plots among plotIDs that changed at or after lastFetch.

public Task<DatabaseResult<List<PlotUpdateData>>> FetchAsync(List<long> plotIDs, DateTime lastFetch, CancellationToken cancellationToken = default)

Parameters

plotIDs List<long>
lastFetch DateTime
cancellationToken CancellationToken

Returns

Task<DatabaseResult<List<PlotUpdateData>>>

PersistAsync(long, CancellationToken)

Marks a plot as changed as of now.

public Task<DatabaseResult> PersistAsync(long plotID, CancellationToken cancellationToken = default)

Parameters

plotID long
cancellationToken CancellationToken

Returns

Task<DatabaseResult>