initial commit
This commit is contained in:
commit
d701598350
67 changed files with 9351 additions and 0 deletions
25
Outnumbered/Data/IPlayerRepository.cs
Normal file
25
Outnumbered/Data/IPlayerRepository.cs
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
namespace Outnumbered.Data;
|
||||
|
||||
// Hides the SQL dialect so SQLite (dev) -> PostgreSQL (prod) is a provider swap,
|
||||
// not a logic change (spec §10). All methods run OFF the game thread.
|
||||
public interface IPlayerRepository
|
||||
{
|
||||
Task EnsureSchemaAsync();
|
||||
Task<LoadedPlayer?> LoadAsync(ulong steamId);
|
||||
Task SaveAsync(PersistPlayer player);
|
||||
Task SaveManyAsync(IReadOnlyList<PersistPlayer> players);
|
||||
Task<IReadOnlyList<TopPlayer>> GetTopAsync(int count);
|
||||
|
||||
// Records (site leaderboards): improve-only writes kept OUT of the SaveMany upsert's column list, so a normal
|
||||
// save can never clobber them and they need no LoadedPlayer/PlayerData round-trip (write-only from the plugin).
|
||||
Task TryImproveBestWavesAsync(IReadOnlyList<ulong> steamIds, int wave); // higher wave wins
|
||||
Task TryImproveGgBestAsync(ulong steamId, long elapsedMs); // lower time wins
|
||||
Task<IReadOnlyList<TopWave>> GetTopWavesAsync(int count);
|
||||
Task<IReadOnlyList<TopGgTime>> GetTopGgAsync(int count);
|
||||
|
||||
// Per-match stats (RAM-first; persisted only on disconnect/shutdown, wiped on round end).
|
||||
Task<MatchState?> LoadMatchAsync(ulong steamId);
|
||||
Task SaveMatchAsync(MatchState state);
|
||||
Task SaveManyMatchAsync(IReadOnlyList<MatchState> states);
|
||||
Task WipeMatchAsync();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue