Rewrite CultCache as attribute-first storage
This commit is contained in:
parent
1cac14574a
commit
da94389ee2
29 changed files with 1496 additions and 2488 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue