水电费
This commit is contained in:
8
Entity/Gate/GameAccountManageComponent.cs
Normal file
8
Entity/Gate/GameAccountManageComponent.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace Fantasy.Gate;
|
||||
|
||||
public sealed class GameAccountManageComponent : Entity
|
||||
{
|
||||
public readonly Dictionary<long, GameAccount> Accounts = new();
|
||||
}
|
||||
11
Entity/Gate/GateJWTComponent.cs
Normal file
11
Entity/Gate/GateJWTComponent.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using Fantasy.Entitas;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
|
||||
namespace Fantasy.Gate;
|
||||
|
||||
public sealed class GateJWTComponent : Entity
|
||||
{
|
||||
public string PublicKeyPem = "MIIBCgKCAQEAqc1moV1nynBYVXhsXeTuDc/DcC7TSQ+dVmTsyeUZP+PaiZjxp/cIo0sj9OCAcAK2nCBpIjBjM7Rbg7Uslb4KvlH8eshsH8LOL9KybNsB0uFg/kPvSvIBcdWsxbbARxDGrTl+Nh1t6s2V1voK9g+OQqK/xIyhvrwFYIjc1/O6FI4uGyMag3D6MJATW2SCrwe1tKU9dfk72VrIqT4FVzbZUDQdFxEKHiQ4vcoBiGxsoYWr6lxbrrtDDNzPzVEgzDbsvaPvSCNRacFaBCJBeGCWGn/fKKBOl5NV2EfXa8oNFgw0VfC4JiRpPUjdhsKvzjtp5P3AYrnloGkTxp9HLkdDjwIDAQAB";
|
||||
public SigningCredentials SigningCredentials;
|
||||
public TokenValidationParameters TokenValidationParameters;
|
||||
}
|
||||
16
Entity/Gate/Model/GameAccount.cs
Normal file
16
Entity/Gate/Model/GameAccount.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Fantasy.Entitas;
|
||||
using MongoDB.Bson.Serialization.Attributes;
|
||||
|
||||
namespace Fantasy.Gate;
|
||||
|
||||
public sealed class GameAccount : Entity
|
||||
{
|
||||
// 1、可以拿ToKen的传递过来的AId来当这个组件的Id.
|
||||
// 2、让这个Id自动生成、在组件里做一个变量来记录ToKen的AId。 public long AuthenticationId;
|
||||
public long CreateTime;
|
||||
public long LoginTime;
|
||||
|
||||
[BsonIgnore]
|
||||
// BsonIgnore特性是让Bson保存到数据库中忽略掉这个字段。
|
||||
public long SessionRunTimeId;
|
||||
}
|
||||
13
Entity/Gate/Model/GameAccountFlagComponent.cs
Normal file
13
Entity/Gate/Model/GameAccountFlagComponent.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using Fantasy.Entitas;
|
||||
|
||||
namespace Fantasy.Gate;
|
||||
|
||||
public sealed class GameAccountFlagComponent : Entity
|
||||
{
|
||||
public long AccountID;
|
||||
|
||||
// 有一种可能,当在Account在其他地方被销毁
|
||||
// 这时候因为这个Account是会回收到池子中,所以这个引用还是有效的
|
||||
// 那这时候就会出现这个引用的Account可能是其他用户的了。
|
||||
public EntityReference<GameAccount> Account;
|
||||
}
|
||||
Reference in New Issue
Block a user