CultLib/src/GameCult.Networking/PlayerData.cs

47 lines
1.1 KiB
C#
Raw Normal View History

using System;
2026-04-18 06:04:39 +01:00
using GameCult.Caching;
using MessagePack;
namespace GameCult.Networking
{
/// <summary>
/// Basic player account document used by the sample networking stack.
/// </summary>
[CultDocument("gamecult.player_data", "gamecult.player_data.v2")]
[MessagePackObject]
public class PlayerData
2026-04-18 06:04:39 +01:00
{
/// <summary>
/// Unique player identifier.
/// </summary>
[Key(0)]
[CultIndex]
public Guid PlayerId = Guid.NewGuid();
2026-04-18 06:04:39 +01:00
/// <summary>
/// Player email address.
/// </summary>
2026-04-18 06:04:39 +01:00
[Key(1)]
[CultIndex]
public string Email = string.Empty;
2026-04-18 06:04:39 +01:00
/// <summary>
/// Stored password hash.
/// </summary>
2026-04-18 06:04:39 +01:00
[Key(2)]
public string PasswordHash = string.Empty;
2026-04-18 06:04:39 +01:00
/// <summary>
/// Player display name.
/// </summary>
2026-04-18 06:04:39 +01:00
[Key(3)]
[CultName]
public string Username = string.Empty;
/// <summary>
/// Monotonic session version used to supersede older issued tokens.
/// </summary>
[Key(4)]
public long SessionVersion;
2026-04-18 06:04:39 +01:00
}
}