24 lines
690 B
C#
24 lines
690 B
C#
namespace ET.Server
|
|
{
|
|
public static class DBHelper
|
|
{
|
|
public static async ETTask LoadOrCreatePlayer(Player player, DBComponent dbComponent)
|
|
{
|
|
if (player == null || dbComponent == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
Player dbPlayer = await dbComponent.QueryByEntityId<Player>(player.Id);
|
|
if (dbPlayer == null)
|
|
{
|
|
await dbComponent.Save(player.Id, player);
|
|
return;
|
|
}
|
|
|
|
// 当前阶段仅接通登录落库链路,后续在 Hero/Bag/Gacha 落地后补完整反序列化挂载。
|
|
player.Account = dbPlayer.Account;
|
|
}
|
|
}
|
|
}
|