Rewrite CultCache as attribute-first storage

This commit is contained in:
Meta Vens 2026-05-08 01:13:15 +01:00
commit da94389ee2
29 changed files with 1496 additions and 2488 deletions

View file

@ -1,39 +1,26 @@
using System;
using GameCult.Caching;
using MessagePack;
namespace GameCult.Networking
{
/// <summary>
/// Player data stored in the database.
/// For MessagePack serialization, uses [MessagePackObject] and [Key(n)] attributes.
/// </summary>
public class PlayerData : DatabaseEntry, INamedEntry
[CultDocument("gamecult.player_data", "gamecult.player_data.v1")]
[MessagePackObject]
public class PlayerData
{
[Key(0)]
[CultIndex]
public Guid PlayerId = Guid.NewGuid();
/// <summary>
/// Email address of the player.
/// </summary>
[Key(1)]
[CultIndex]
public string Email = string.Empty;
/// <summary>
/// Password hash of the player.
/// </summary>
[Key(2)]
public string PasswordHash = string.Empty;
/// <summary>
/// Username of the player.
/// </summary>
[Key(3)]
[CultName]
public string Username = string.Empty;
/// <inheritdoc/>
[IgnoreMember]
public string EntryName
{
get => Username;
set => Username = value;
}
}
}