对对对

This commit is contained in:
bob
2025-07-26 17:58:25 +08:00
parent 4d8748e866
commit 6311c7cb12
57 changed files with 458 additions and 317 deletions

View File

@@ -1,7 +1,7 @@
using System.Reflection; using System.Reflection;
using System.Runtime.Loader; using System.Runtime.Loader;
namespace Fantasy namespace NB
{ {
public static class AssemblyHelper public static class AssemblyHelper
{ {

View File

@@ -1,6 +1,8 @@
namespace Fantasy; using Fantasy.Entitas;
public sealed class AuthenticationComponent : Entitas.Entity namespace NB;
public sealed class AuthenticationComponent : Entity
{ {
/// <summary> /// <summary>
/// 代表当前服务器在鉴权服务器中的位置 /// 代表当前服务器在鉴权服务器中的位置

View File

@@ -1,7 +1,7 @@
using Fantasy.Entitas; using Fantasy.Entitas;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
namespace Fantasy; namespace NB;
public sealed class AuthenticationJwtComponent : Entity public sealed class AuthenticationJwtComponent : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB;
public sealed class Account : Entity public sealed class Account : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB;
public class AccountCacheInfo : Entity public class AccountCacheInfo : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB;
public class AccountCacheInfoTimeOut : Entity public class AccountCacheInfoTimeOut : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB;
public class AccountTimeOut : Entity public class AccountTimeOut : Entity
{ {

View File

@@ -27,8 +27,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Battle\" />
<Folder Include="Game\" />
<Folder Include="Gate\" /> <Folder Include="Gate\" />
</ItemGroup> </ItemGroup>

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB;
public class EntityTimeOutComponent : Entity public class EntityTimeOutComponent : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class Activity : Entity public class Activity : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class BasicInfo : Entity public class BasicInfo : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class Currency : Entity public class Currency : Entity
{ {

View File

@@ -1,4 +1,4 @@
namespace Fantasy; namespace NB.Game;
public class DayFlags public class DayFlags
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class GamingInfo : Entity public class GamingInfo : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class Guide : Entity public class Guide : Entity
{ {

View File

@@ -1,21 +1,21 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class Item : Entity public class Item : Entity
{ {
/// <summary>
/// 配置id
/// </summary>
public int ConfigId;
/// <summary> /// <summary>
/// 拥有的数量 /// 拥有的数量
/// </summary> /// </summary>
public int Count; public int Count;
/// <summary> /// <summary>
/// 耐久度 /// 配置id
/// </summary> /// </summary>
public int Durability; public int ConfigId;
/// <summary>
/// 是否绑定
/// </summary>
public bool IsBind;
} }

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class MapMatter : Entity public class MapMatter : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class Mission : Entity public class Mission : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class Skill : Entity public class Skill : Entity
{ {

View File

@@ -1,6 +1,7 @@
using Fantasy.Entitas; using Fantasy.Entitas;
using NB.Game;
namespace Fantasy; namespace NB;
public class UserInfo : Entity public class UserInfo : Entity
{ {
@@ -29,11 +30,6 @@ public class UserInfo : Entity
/// </summary> /// </summary>
public List<Item> Items; public List<Item> Items;
/// <summary>
/// 鱼护
/// </summary>
public List<Fish> Fishes;
/// <summary> /// <summary>
/// 参与的活动 /// 参与的活动
/// </summary> /// </summary>

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy; namespace NB.Game;
public class UserStatisticsInfo : Entity public class UserStatisticsInfo : Entity
{ {

View File

@@ -1,7 +1,7 @@
using Fantasy.Entitas; using Fantasy.Entitas;
using MongoDB.Bson.Serialization.Attributes; using MongoDB.Bson.Serialization.Attributes;
namespace Fantasy.Gate; namespace NB.Gate;
public sealed class GameAccount : Entity public sealed class GameAccount : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy.Gate; namespace NB.Gate;
public sealed class GameAccountFlagComponent : Entity public sealed class GameAccountFlagComponent : Entity
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy.Entitas; using Fantasy.Entitas;
namespace Fantasy.Gate; namespace NB.Gate;
public sealed class GameAccountManageComponent : Entity public sealed class GameAccountManageComponent : Entity
{ {

View File

@@ -1,7 +1,7 @@
using Fantasy.Entitas; using Fantasy.Entitas;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
namespace Fantasy.Gate; namespace NB.Gate;
public sealed class GateJWTComponent : Entity public sealed class GateJWTComponent : Entity
{ {

View File

@@ -1,4 +1,4 @@
namespace Fantasy; namespace NB;
public enum LockType public enum LockType
{ {

View File

@@ -1,7 +0,0 @@
using Fantasy.Entitas;
namespace Fantasy;
public class Fish : Entity
{
}

View File

@@ -0,0 +1,32 @@
namespace Fantasy;
public class ErrorCode
{
public const uint Successful = 0;
/// <summary>
/// 参数有误
/// </summary>
public const uint ErrArgs = 10001;
/// <summary>
/// 服务器有误
/// </summary>
public const uint ErrServer = 10002;
/// <summary>
/// 操作太频繁
/// </summary>
public const uint ErrFrequent = 10003;
/// <summary>
/// 账号已被注册
/// </summary>
public const uint ErrAccountHave = 11001;
/// <summary>
/// 账号或密码有误
/// </summary>
public const uint ErrAccountOrPass = 11002;
}

View File

@@ -5,6 +5,7 @@ using ProtoBuf;
#if FANTASY_NET #if FANTASY_NET
using Fantasy.Network.Roaming; using Fantasy.Network.Roaming;
#endif #endif
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
// ReSharper disable InconsistentNaming // ReSharper disable InconsistentNaming
// ReSharper disable PropertyCanBeMadeInitOnly.Global // ReSharper disable PropertyCanBeMadeInitOnly.Global
@@ -21,6 +22,7 @@ namespace Fantasy.InnerMessage
return Fantasy.Network.OpCode.BenchmarkMessage; return Fantasy.Network.OpCode.BenchmarkMessage;
} }
} }
[ProtoContract] [ProtoContract]
public partial class BenchmarkRequest : AMessage, IRequest public partial class BenchmarkRequest : AMessage, IRequest
{ {
@@ -28,10 +30,9 @@ namespace Fantasy.InnerMessage
{ {
return Fantasy.Network.OpCode.BenchmarkRequest; return Fantasy.Network.OpCode.BenchmarkRequest;
} }
[ProtoIgnore]
public BenchmarkResponse ResponseType { get; set; } [ProtoIgnore] public BenchmarkResponse ResponseType { get; set; }
[ProtoMember(1)] [ProtoMember(1)] public long RpcId { get; set; }
public long RpcId { get; set; }
} }
[ProtoContract] [ProtoContract]
@@ -41,22 +42,22 @@ namespace Fantasy.InnerMessage
{ {
return Fantasy.Network.OpCode.BenchmarkResponse; return Fantasy.Network.OpCode.BenchmarkResponse;
} }
[ProtoMember(1)]
public long RpcId { get; set; } [ProtoMember(1)] public long RpcId { get; set; }
[ProtoMember(2)] [ProtoMember(2)] public uint ErrorCode { get; set; }
public uint ErrorCode { get; set; }
} }
public sealed partial class Response : AMessage, IResponse public sealed partial class Response : AMessage, IResponse
{ {
public uint OpCode() public uint OpCode()
{ {
return Fantasy.Network.OpCode.DefaultResponse; return Fantasy.Network.OpCode.DefaultResponse;
} }
[ProtoMember(1)]
public long RpcId { get; set; } [ProtoMember(1)] public long RpcId { get; set; }
[ProtoMember(2)] [ProtoMember(2)] public uint ErrorCode { get; set; }
public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public sealed partial class RouteResponse : AMessage, IRouteResponse public sealed partial class RouteResponse : AMessage, IRouteResponse
{ {
@@ -64,11 +65,11 @@ namespace Fantasy.InnerMessage
{ {
return Fantasy.Network.OpCode.DefaultRouteResponse; return Fantasy.Network.OpCode.DefaultRouteResponse;
} }
[ProtoMember(1)]
public long RpcId { get; set; } [ProtoMember(1)] public long RpcId { get; set; }
[ProtoMember(2)] [ProtoMember(2)] public uint ErrorCode { get; set; }
public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class PingRequest : AMessage, IRequest public partial class PingRequest : AMessage, IRequest
{ {
@@ -76,10 +77,9 @@ namespace Fantasy.InnerMessage
{ {
return Fantasy.Network.OpCode.PingRequest; return Fantasy.Network.OpCode.PingRequest;
} }
[ProtoIgnore]
public PingResponse ResponseType { get; set; } [ProtoIgnore] public PingResponse ResponseType { get; set; }
[ProtoMember(1)] [ProtoMember(1)] public long RpcId { get; set; }
public long RpcId { get; set; }
} }
[ProtoContract] [ProtoContract]
@@ -89,231 +89,334 @@ namespace Fantasy.InnerMessage
{ {
return Fantasy.Network.OpCode.PingResponse; return Fantasy.Network.OpCode.PingResponse;
} }
[ProtoMember(1)]
public long RpcId { get; set; } [ProtoMember(1)] public long RpcId { get; set; }
[ProtoMember(2)] [ProtoMember(2)] public uint ErrorCode { get; set; }
public uint ErrorCode { get; set; } [ProtoMember(3)] public long Now;
[ProtoMember(3)]
public long Now;
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableAdd_Request : AMessage, IRouteRequest public partial class I_AddressableAdd_Request : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_AddressableAdd_Response ResponseType { get; set; }
public I_AddressableAdd_Response ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.AddressableAddRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.AddressableAddRequest;
public long AddressableId { get; set; } }
[ProtoMember(2)]
public long RouteId { get; set; } public long RouteTypeOpCode()
[ProtoMember(3)] {
public bool IsLock { get; set; } return 1;
}
[ProtoMember(1)] public long AddressableId { get; set; }
[ProtoMember(2)] public long RouteId { get; set; }
[ProtoMember(3)] public bool IsLock { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableAdd_Response : AMessage, IRouteResponse public partial class I_AddressableAdd_Response : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.AddressableAddResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.AddressableAddResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableGet_Request : AMessage, IRouteRequest public partial class I_AddressableGet_Request : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_AddressableGet_Response ResponseType { get; set; }
public I_AddressableGet_Response ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.AddressableGetRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.AddressableGetRequest;
public long AddressableId { get; set; } }
public long RouteTypeOpCode()
{
return 1;
}
[ProtoMember(1)] public long AddressableId { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableGet_Response : AMessage, IRouteResponse public partial class I_AddressableGet_Response : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.AddressableGetResponse; } public uint OpCode()
[ProtoMember(2)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.AddressableGetResponse;
[ProtoMember(1)] }
public long RouteId { get; set; }
[ProtoMember(2)] public uint ErrorCode { get; set; }
[ProtoMember(1)] public long RouteId { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableRemove_Request : AMessage, IRouteRequest public partial class I_AddressableRemove_Request : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_AddressableRemove_Response ResponseType { get; set; }
public I_AddressableRemove_Response ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.AddressableRemoveRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.AddressableRemoveRequest;
public long AddressableId { get; set; } }
public long RouteTypeOpCode()
{
return 1;
}
[ProtoMember(1)] public long AddressableId { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableRemove_Response : AMessage, IRouteResponse public partial class I_AddressableRemove_Response : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.AddressableRemoveResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.AddressableRemoveResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableLock_Request : AMessage, IRouteRequest public partial class I_AddressableLock_Request : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_AddressableLock_Response ResponseType { get; set; }
public I_AddressableLock_Response ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.AddressableLockRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.AddressableLockRequest;
public long AddressableId { get; set; } }
public long RouteTypeOpCode()
{
return 1;
}
[ProtoMember(1)] public long AddressableId { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableLock_Response : AMessage, IRouteResponse public partial class I_AddressableLock_Response : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.AddressableLockResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.AddressableLockResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableUnLock_Request : AMessage, IRouteRequest public partial class I_AddressableUnLock_Request : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_AddressableUnLock_Response ResponseType { get; set; }
public I_AddressableUnLock_Response ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.AddressableUnLockRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.AddressableUnLockRequest;
public long AddressableId { get; set; } }
[ProtoMember(2)]
public long RouteId { get; set; } public long RouteTypeOpCode()
[ProtoMember(3)] {
public string Source { get; set; } return 1;
}
[ProtoMember(1)] public long AddressableId { get; set; }
[ProtoMember(2)] public long RouteId { get; set; }
[ProtoMember(3)] public string Source { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_AddressableUnLock_Response : AMessage, IRouteResponse public partial class I_AddressableUnLock_Response : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.AddressableUnLockResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.AddressableUnLockResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
#if FANTASY_NET #if FANTASY_NET
[ProtoContract] [ProtoContract]
public sealed class I_LinkRoamingRequest : AMessage, IRouteRequest public sealed class I_LinkRoamingRequest : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_LinkRoamingResponse ResponseType { get; set; }
public I_LinkRoamingResponse ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.LinkRoamingRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.LinkRoamingRequest;
public long RoamingId { get; set; } }
[ProtoMember(2)]
public int RoamingType { get; set; } public long RouteTypeOpCode()
[ProtoMember(3)] {
public long ForwardSessionRouteId { get; set; } return 1;
[ProtoMember(4)] }
public long SceneRouteId { get; set; }
[ProtoMember(1)] public long RoamingId { get; set; }
[ProtoMember(2)] public int RoamingType { get; set; }
[ProtoMember(3)] public long ForwardSessionRouteId { get; set; }
[ProtoMember(4)] public long SceneRouteId { get; set; }
} }
[ProtoContract] [ProtoContract]
public sealed class I_LinkRoamingResponse : AMessage, IRouteResponse public sealed class I_LinkRoamingResponse : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.LinkRoamingResponse; } public uint OpCode()
[ProtoMember(1)] {
public long TerminusId { get; set; } return Fantasy.Network.OpCode.LinkRoamingResponse;
[ProtoMember(2)] }
public uint ErrorCode { get; set; }
[ProtoMember(1)] public long TerminusId { get; set; }
[ProtoMember(2)] public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public sealed class I_UnLinkRoamingRequest : AMessage, IRouteRequest public sealed class I_UnLinkRoamingRequest : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_UnLinkRoamingResponse ResponseType { get; set; }
public I_UnLinkRoamingResponse ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.UnLinkRoamingRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.UnLinkRoamingRequest;
public long RoamingId { get; set; } }
[ProtoMember(2)]
public bool DisposeRoaming { get; set; } public long RouteTypeOpCode()
{
return 1;
}
[ProtoMember(1)] public long RoamingId { get; set; }
[ProtoMember(2)] public bool DisposeRoaming { get; set; }
} }
[ProtoContract] [ProtoContract]
public sealed class I_UnLinkRoamingResponse : AMessage, IRouteResponse public sealed class I_UnLinkRoamingResponse : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.UnLinkRoamingResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.UnLinkRoamingResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_LockTerminusIdRequest : AMessage, IRouteRequest public partial class I_LockTerminusIdRequest : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_LockTerminusIdResponse ResponseType { get; set; }
public I_LockTerminusIdResponse ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.LockTerminusIdRequest; } public uint OpCode()
[ProtoMember(1)] {
public long SessionRuntimeId { get; set; } return Fantasy.Network.OpCode.LockTerminusIdRequest;
[ProtoMember(2)] }
public int RoamingType { get; set; }
[ProtoMember(1)] public long SessionRuntimeId { get; set; }
[ProtoMember(2)] public int RoamingType { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_LockTerminusIdResponse : AMessage, IRouteResponse public partial class I_LockTerminusIdResponse : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.LockTerminusIdResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.LockTerminusIdResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
[ProtoContract] [ProtoContract]
public sealed class I_UnLockTerminusIdRequest : AMessage, IRouteRequest public sealed class I_UnLockTerminusIdRequest : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_UnLockTerminusIdResponse ResponseType { get; set; }
public I_UnLockTerminusIdResponse ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.UnLockTerminusIdRequest; } public uint OpCode()
public long RouteTypeOpCode() { return 1; } {
[ProtoMember(1)] return Fantasy.Network.OpCode.UnLockTerminusIdRequest;
public long SessionRuntimeId { get; set; } }
[ProtoMember(2)]
public int RoamingType { get; set; } public long RouteTypeOpCode()
[ProtoMember(3)] {
public long TerminusId { get; set; } return 1;
[ProtoMember(4)] }
public long TargetSceneRouteId { get; set; }
[ProtoMember(1)] public long SessionRuntimeId { get; set; }
[ProtoMember(2)] public int RoamingType { get; set; }
[ProtoMember(3)] public long TerminusId { get; set; }
[ProtoMember(4)] public long TargetSceneRouteId { get; set; }
} }
[ProtoContract] [ProtoContract]
public sealed class I_UnLockTerminusIdResponse : AMessage, IRouteResponse public sealed class I_UnLockTerminusIdResponse : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.UnLockTerminusIdResponse; } public uint OpCode()
[ProtoMember(1)] {
public uint ErrorCode { get; set; } return Fantasy.Network.OpCode.UnLockTerminusIdResponse;
}
[ProtoMember(1)] public uint ErrorCode { get; set; }
} }
/// <summary> /// <summary>
/// 漫游传送终端的请求 /// 漫游传送终端的请求
/// </summary> /// </summary>
public partial class I_TransferTerminusRequest : AMessage, IRouteRequest public partial class I_TransferTerminusRequest : AMessage, IRouteRequest
{ {
[BsonIgnore] [BsonIgnore] public I_TransferTerminusResponse ResponseType { get; set; }
public I_TransferTerminusResponse ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.TransferTerminusRequest; } public uint OpCode()
{
return Fantasy.Network.OpCode.TransferTerminusRequest;
}
public Terminus Terminus { get; set; } public Terminus Terminus { get; set; }
} }
public partial class I_TransferTerminusResponse : AMessage, IRouteResponse public partial class I_TransferTerminusResponse : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.TransferTerminusResponse; } public uint OpCode()
{
return Fantasy.Network.OpCode.TransferTerminusResponse;
}
public uint ErrorCode { get; set; } public uint ErrorCode { get; set; }
} }
/// <summary> /// <summary>
/// 用于服务器之间获取漫游的TerminusId。 /// 用于服务器之间获取漫游的TerminusId。
/// </summary> /// </summary>
[ProtoContract] [ProtoContract]
public partial class I_GetTerminusIdRequest : AMessage, IRouteRequest public partial class I_GetTerminusIdRequest : AMessage, IRouteRequest
{ {
[ProtoIgnore] [ProtoIgnore] public I_GetTerminusIdResponse ResponseType { get; set; }
public I_GetTerminusIdResponse ResponseType { get; set; }
public uint OpCode() { return Fantasy.Network.OpCode.GetTerminusIdRequest; } public uint OpCode()
[ProtoMember(1)] {
public int RoamingType { get; set; } return Fantasy.Network.OpCode.GetTerminusIdRequest;
[ProtoMember(2)] }
public long SessionRuntimeId { get; set; }
[ProtoMember(1)] public int RoamingType { get; set; }
[ProtoMember(2)] public long SessionRuntimeId { get; set; }
} }
[ProtoContract] [ProtoContract]
public partial class I_GetTerminusIdResponse : AMessage, IRouteResponse public partial class I_GetTerminusIdResponse : AMessage, IRouteResponse
{ {
public uint OpCode() { return Fantasy.Network.OpCode.GetTerminusIdResponse; } public uint OpCode()
[ProtoMember(1)] {
public long TerminusId { get; set; } return Fantasy.Network.OpCode.GetTerminusIdResponse;
[ProtoMember(2)] }
public uint ErrorCode { get; set; }
[ProtoMember(1)] public long TerminusId { get; set; }
[ProtoMember(2)] public uint ErrorCode { get; set; }
} }
#endif #endif
} }

View File

@@ -53,7 +53,6 @@ namespace Fantasy.Scheduler
case OpCodeType.OuterPingRequest: case OpCodeType.OuterPingRequest:
{ {
// 注意心跳目前只有外网才才会有、内网之间不需要心跳。 // 注意心跳目前只有外网才才会有、内网之间不需要心跳。
session.LastReceiveTime = TimeHelper.Now; session.LastReceiveTime = TimeHelper.Now;
_pingResponse.Now = session.LastReceiveTime; _pingResponse.Now = session.LastReceiveTime;

View File

@@ -1,4 +1,5 @@
// ReSharper disable RedundantUsingDirective // ReSharper disable RedundantUsingDirective
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@@ -17,6 +18,7 @@ using Fantasy.Serialize;
using Fantasy.Network.Route; using Fantasy.Network.Route;
using Fantasy.Platform.Net; using Fantasy.Platform.Net;
using Fantasy.Network.Roaming; using Fantasy.Network.Roaming;
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member #pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
#endif #endif
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
@@ -36,15 +38,18 @@ namespace Fantasy.Network
{ {
private uint _rpcId; private uint _rpcId;
internal long LastReceiveTime; internal long LastReceiveTime;
/// <summary> /// <summary>
/// 关联的网络连接通道 /// 关联的网络连接通道
/// </summary> /// </summary>
internal INetworkChannel Channel { get; private set; } internal INetworkChannel Channel { get; private set; }
/// <summary> /// <summary>
/// 当前Session的终结点信息 /// 当前Session的终结点信息
/// </summary> /// </summary>
public IPEndPoint RemoteEndPoint { get; private set; } public IPEndPoint RemoteEndPoint { get; private set; }
private ANetworkMessageScheduler NetworkMessageScheduler { get; set;}
private ANetworkMessageScheduler NetworkMessageScheduler { get; set; }
internal readonly Dictionary<long, FTask<IResponse>> RequestCallback = new(); internal readonly Dictionary<long, FTask<IResponse>> RequestCallback = new();
/// <summary> /// <summary>
/// Session的Dispose委托 /// Session的Dispose委托
@@ -54,7 +59,8 @@ namespace Fantasy.Network
internal RouteComponent RouteComponent; internal RouteComponent RouteComponent;
internal SessionRoamingComponent SessionRoamingComponent; internal SessionRoamingComponent SessionRoamingComponent;
internal AddressableRouteComponent AddressableRouteComponent; internal AddressableRouteComponent AddressableRouteComponent;
internal static Session Create(ANetworkMessageScheduler networkMessageScheduler, ANetworkServerChannel channel, NetworkTarget networkTarget) internal static Session Create(ANetworkMessageScheduler networkMessageScheduler, ANetworkServerChannel channel,
NetworkTarget networkTarget)
{ {
var session = Entity.Create<Session>(channel.Scene, false, true); var session = Entity.Create<Session>(channel.Scene, false, true);
session.Channel = channel; session.Channel = channel;
@@ -69,6 +75,7 @@ namespace Fantasy.Network
var timeOut = ProcessDefine.SessionIdleCheckerTimeout; var timeOut = ProcessDefine.SessionIdleCheckerTimeout;
session.AddComponent<SessionIdleCheckerComponent>().Start(interval, timeOut); session.AddComponent<SessionIdleCheckerComponent>().Start(interval, timeOut);
} }
return session; return session;
} }
#endif #endif

View File

@@ -1,11 +1,11 @@
using System.Authentication; using NB.Authentication;
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Entitas; using Fantasy.Entitas;
using Fantasy.Network; using Fantasy.Network;
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
namespace System; namespace NB;
public static class EntityHelper public static class EntityHelper
{ {

View File

@@ -3,7 +3,7 @@ using Fantasy.Async;
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
using Fantasy.Helper; using Fantasy.Helper;
namespace System.Authentication; namespace NB.Authentication;
public sealed class EntityTimeOutComponentDestroySystem : DestroySystem<EntityTimeOutComponent> public sealed class EntityTimeOutComponentDestroySystem : DestroySystem<EntityTimeOutComponent>
{ {

View File

@@ -1,3 +1,4 @@
using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Entitas; using Fantasy.Entitas;
using Fantasy.Event; using Fantasy.Event;
@@ -5,7 +6,7 @@ using Fantasy.Helper;
using Fantasy.Serialize; using Fantasy.Serialize;
using ProtoBuf; using ProtoBuf;
namespace Fantasy; namespace NB;
public sealed class SubSceneTestComponent : Entity public sealed class SubSceneTestComponent : Entity
{ {

View File

@@ -1,11 +1,10 @@
using System.Authentication; using Fantasy;
using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Authentication;
using Fantasy.Event; using Fantasy.Event;
using Fantasy.Gate; using NB.Authentication;
using NB.Gate;
namespace System; namespace NB;
public class OnSceneCreate_Init : AsyncEventSystem<OnCreateScene> public class OnSceneCreate_Init : AsyncEventSystem<OnCreateScene>
{ {

View File

@@ -1,21 +1,46 @@
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Authentication.Jwt;
using Fantasy.Network; using Fantasy.Network;
using Fantasy.Network.Interface; using Fantasy.Network.Interface;
using Fantasy.Platform.Net; using Fantasy.Platform.Net;
using NB.Authentication.Jwt;
namespace Fantasy.Authentication.Handler; namespace NB.Authentication.Handler;
public class C2A_LoginRequestHandler : MessageRPC<C2A_LoginRequest, A2C_LoginResponse> public class C2A_LoginRequestHandler : MessageRPC<C2A_LoginRequest, A2C_LoginResponse>
{ {
protected override async FTask Run(Session session, C2A_LoginRequest request, A2C_LoginResponse response, protected override async FTask Run(Session session, C2A_LoginRequest request, A2C_LoginResponse response,
Action reply) Action reply)
{ {
if (!session.CheckInterval(2000))
{
// 返回这个3代表操作过于频繁。
response.ErrorCode = ErrorCode.ErrFrequent;
return;
}
session.SetTimeout(3000);
var scene = session.Scene; var scene = session.Scene;
var result = await AuthenticationHelper.Login(scene, request.Username, request.Password); var result = await AuthenticationHelper.Login(scene, request.Username, request.Password);
if (result.ErrorCode == 0) if (result.ErrorCode != ErrorCode.Successful && result.AccountId == -1)
{
//开始注册账号
var regErrorCode =
await AuthenticationHelper.Register(session.Scene, request.Username, request.Password, "用户注册");
if (regErrorCode != ErrorCode.Successful)
{
result.ErrorCode = regErrorCode;
}
else
{
Log.Debug($"Register 当前的服务器是:{scene.SceneConfigId}");
//注册完毕,执行登录
result = await AuthenticationHelper.Login(scene, request.Username, request.Password);
}
}
if (result.ErrorCode == ErrorCode.Successful)
{ {
// 通过配置表或其他方式拿到Gate服务器组的信息 // 通过配置表或其他方式拿到Gate服务器组的信息
var gates = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Gate); var gates = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Gate);

View File

@@ -1,25 +0,0 @@
using Fantasy;
using Fantasy.Async;
using Fantasy.Network;
using Fantasy.Network.Interface;
namespace Fantasy.Authentication.Handler;
public sealed class C2A_RegisterRequestHandler : MessageRPC<C2A_RegisterRequest, A2C_RegisterResponse>
{
protected override async FTask Run(Session session, C2A_RegisterRequest request, A2C_RegisterResponse response,
Action reply)
{
if (!session.CheckInterval(2000))
{
// 返回这个3代表操作过于频繁。
response.ErrorCode = 3;
return;
}
session.SetTimeout(3000);
response.ErrorCode =
await AuthenticationHelper.Register(session.Scene, request.Username, request.Password, "用户注册");
Log.Debug($"Register 当前的服务器是:{session.Scene.SceneConfigId}");
}
}

View File

@@ -1,7 +1,7 @@
using Fantasy; using Fantasy;
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
namespace Fantasy.Authentication; namespace NB.Authentication;
public class AccountDestroySystem : DestroySystem<Account> public class AccountDestroySystem : DestroySystem<Account>
{ {

View File

@@ -9,7 +9,7 @@ using Fantasy.Platform.Net;
#pragma warning disable CS8602 // Dereference of a possibly null reference. #pragma warning disable CS8602 // Dereference of a possibly null reference.
#pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type. #pragma warning disable CS8600 // Converting null literal or possible null value to non-nullable type.
namespace Fantasy.Authentication; namespace NB.Authentication;
public sealed class AuthenticationComponentDestroySystem : DestroySystem<AuthenticationComponent> public sealed class AuthenticationComponentDestroySystem : DestroySystem<AuthenticationComponent>
{ {
@@ -40,30 +40,30 @@ internal static class AuthenticationComponentSystem
Log.Info($"鉴权服务器启动成功Position:{self.Position} AuthenticationCount:{self.AuthenticationCount}"); Log.Info($"鉴权服务器启动成功Position:{self.Position} AuthenticationCount:{self.AuthenticationCount}");
} }
internal static async FTask<(uint ErrorCode, long AccountId)> Login(this AuthenticationComponent self, string userName, string password) internal static async FTask<(uint ErrorCode, long AccountId)> Login(this AuthenticationComponent self,
string userName, string password)
{ {
// 1、检查传递的参数是否完整 // 1、检查传递的参数是否完整
if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password)) if (string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password))
{ {
// 这个1代表的是参数不完整。 return (ErrorCode.ErrArgs, 0);
return (1, 0);
} }
// 检查账号是否应该在当前鉴权服务器中处理 // 检查账号是否应该在当前鉴权服务器中处理
var position = HashCodeHelper.MurmurHash3(userName) % self.AuthenticationCount; var position = HashCodeHelper.MurmurHash3(userName) % self.AuthenticationCount;
if (self.Position != position) if (self.Position != position)
{ {
// 这个3代表的是当前账号不应该在这个鉴权服务器处理。 // 这个3代表的是当前账号不应该在这个鉴权服务器处理。
return (3, 0); // return (3, 0);
return (ErrorCode.ErrServer, 0);
} }
var scene = self.Scene; var scene = self.Scene;
var worldDateBase = scene.World.DataBase;//DateBase var worldDateBase = scene.World.DataBase; //DateBase
var usernameHashCode = userName.GetHashCode(); var usernameHashCode = userName.GetHashCode();
using (var @lock = await scene.CoroutineLockComponent.Wait((int)LockType.AuthenticationLoginLock, usernameHashCode)) using (var @lock =
await scene.CoroutineLockComponent.Wait((int)LockType.AuthenticationLoginLock, usernameHashCode))
{ {
// 如果用户频繁发生登录的请求,导致服务器会频繁请求数据库或缓存。 // 如果用户频繁发生登录的请求,导致服务器会频繁请求数据库或缓存。
// 针对这个问题咱们可以利用缓存来解决这个问题。 // 针对这个问题咱们可以利用缓存来解决这个问题。
@@ -90,20 +90,26 @@ internal static class AuthenticationComponentSystem
if (account == null) if (account == null)
{ {
return (2, 0); return (ErrorCode.ErrAccountOrPass, 0);
} }
return (0, account.Id); return (ErrorCode.Successful, account.Id);
} }
uint result = 0; uint result = 0;
accountCacheInfo = Entity.Create<AccountCacheInfo>(scene, true, true); accountCacheInfo = Entity.Create<AccountCacheInfo>(scene, true, true);
account = await worldDateBase.First<Account>(d => d.Username == userName && d.Password == password); account = await worldDateBase.First<Account>(d => d.Username == userName);
if (account == null) if (account == null)
{ {
// 这个2代表的是该用户没有注册或者用户或密码错误 // 没有注册
result = 2; return (ErrorCode.ErrAccountOrPass, -1); //返回-1用于判断是否需要自动注册
}
if (account.Password != password)
{
//密码错误
result = ErrorCode.ErrAccountOrPass;
} }
else else
{ {
@@ -123,7 +129,7 @@ internal static class AuthenticationComponentSystem
return (result, 0); return (result, 0);
} }
return (0, account.Id); return (ErrorCode.Successful, account.Id);
} }
} }
@@ -134,14 +140,15 @@ internal static class AuthenticationComponentSystem
/// <param name="username"></param> /// <param name="username"></param>
/// <param name="password"></param> /// <param name="password"></param>
/// <param name="source"></param> /// <param name="source"></param>
internal static async FTask<uint> Register(this AuthenticationComponent self, string username, string password, string source) internal static async FTask<uint> Register(this AuthenticationComponent self, string username, string password,
string source)
{ {
// 1、检查传递的参数是否完整 // 1、检查传递的参数是否完整
if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password))
{ {
// 这个1代表的是参数不完整。 // 这个1代表的是参数不完整。
return 1; return ErrorCode.ErrArgs;
} }
// 检查账号是否应该在当前鉴权服务器中处理 // 检查账号是否应该在当前鉴权服务器中处理
@@ -149,22 +156,23 @@ internal static class AuthenticationComponentSystem
var position = HashCodeHelper.MurmurHash3(username) % self.AuthenticationCount; var position = HashCodeHelper.MurmurHash3(username) % self.AuthenticationCount;
if (self.Position != position) if (self.Position != position)
{ {
// 这个3代表的是当前账号不应该在这个鉴权服务器处理。 // 这个代表的是当前账号不应该在这个鉴权服务器处理。
return 3; return ErrorCode.ErrServer;
} }
var usernameHashCode = username.GetHashCode(); var usernameHashCode = username.GetHashCode();
var scene = self.Scene; var scene = self.Scene;
// 利用协程锁来解决异步的原子问题 // 利用协程锁来解决异步的原子问题
using (var @lock = await scene.CoroutineLockComponent.Wait((int)LockType.AuthenticationRegisterLock, usernameHashCode)) using (var @lock =
await scene.CoroutineLockComponent.Wait((int)LockType.AuthenticationRegisterLock, usernameHashCode))
{ {
// 利用缓存来减少频繁请求数据库或缓存的压力。 // 利用缓存来减少频繁请求数据库或缓存的压力。
if (self.Accounts.TryGetValue(username, out var account)) if (self.Accounts.TryGetValue(username, out var account))
{ {
// 这个2代表的是该用户已经存在。 // 这个2代表的是该用户已经存在。
return 2; return ErrorCode.ErrAccountHave;
} }
// 2、数据库查询该账号是否存在 // 2、数据库查询该账号是否存在
@@ -173,7 +181,7 @@ internal static class AuthenticationComponentSystem
if (isExist) if (isExist)
{ {
// 这个2代表的是该用户已经存在。 // 这个2代表的是该用户已经存在。
return 2; return ErrorCode.ErrAccountHave;
} }
//3、执行到这里的话表示数据库或缓存没有该账号的注册信息需要咱们创建一个。 //3、执行到这里的话表示数据库或缓存没有该账号的注册信息需要咱们创建一个。
@@ -190,7 +198,7 @@ internal static class AuthenticationComponentSystem
account.AddComponent<AccountTimeOut>().TimeOut(4000); account.AddComponent<AccountTimeOut>().TimeOut(4000);
// 这个0代表的是操作成功 // 这个0代表的是操作成功
Log.Info($"Register source:{source} username:{username} accountId:{accountId}"); Log.Info($"Register source:{source} username:{username} accountId:{accountId}");
return 0; return ErrorCode.Successful;
} }
} }

View File

@@ -1,7 +1,7 @@
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
namespace Fantasy.Authentication; namespace NB.Authentication;
public static class AuthenticationHelper public static class AuthenticationHelper
{ {

View File

@@ -4,7 +4,7 @@ using Fantasy;
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
namespace Fantasy.Authentication.Jwt; namespace NB.Authentication.Jwt;
public sealed class AuthenticationJwtComponentAwakeSystem : AwakeSystem<AuthenticationJwtComponent> public sealed class AuthenticationJwtComponentAwakeSystem : AwakeSystem<AuthenticationJwtComponent>
{ {

View File

@@ -1,6 +1,6 @@
using Fantasy; using Fantasy;
namespace Fantasy.Authentication.Jwt; namespace NB.Authentication.Jwt;
public static class AuthenticationJwtHelper public static class AuthenticationJwtHelper
{ {

View File

@@ -2,7 +2,7 @@ using Fantasy;
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
// ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract // ReSharper disable ConditionIsAlwaysTrueOrFalseAccordingToNullableAPIContract
namespace Fantasy.Authentication; namespace NB.Authentication;
public sealed class AccountCacheInfoTimeOutDestroySystem : DestroySystem<AccountCacheInfoTimeOut> public sealed class AccountCacheInfoTimeOutDestroySystem : DestroySystem<AccountCacheInfoTimeOut>
{ {

View File

@@ -1,7 +1,7 @@
using Fantasy; using Fantasy;
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
namespace Fantasy.Authentication; namespace NB.Authentication;
public sealed class AccountTimeOutDestroySystem : DestroySystem<AccountTimeOut> public sealed class AccountTimeOutDestroySystem : DestroySystem<AccountTimeOut>
{ {

View File

@@ -0,0 +1,6 @@
namespace NB.Game;
public class ItemFactory
{
}

View File

@@ -0,0 +1,6 @@
namespace NB.Game.System;
public class ItemManagerComponentSystem
{
}

View File

@@ -1,10 +1,9 @@
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Gate;
using Fantasy.Network; using Fantasy.Network;
using Fantasy.Network.Interface; using Fantasy.Network.Interface;
namespace System.Gate; namespace NB.Gate;
public sealed class C2G_GetAccountInfoRequestHandler : MessageRPC<C2G_GetAccountInfoRequest, G2C_GetAccountInfoResponse> public sealed class C2G_GetAccountInfoRequestHandler : MessageRPC<C2G_GetAccountInfoRequest, G2C_GetAccountInfoResponse>
{ {

View File

@@ -1,13 +1,12 @@
using System.Gate.System; using NB.Gate.System;
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Gate;
using Fantasy.Network; using Fantasy.Network;
using Fantasy.Network.Interface; using Fantasy.Network.Interface;
#pragma warning disable CS8604 // Possible null reference argument. #pragma warning disable CS8604 // Possible null reference argument.
namespace System.Gate.Handler; namespace NB.Gate.Handler;
public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_LoginResponse> public sealed class C2G_LoginRequestHandler : MessageRPC<C2G_LoginRequest, G2C_LoginResponse>
{ {

View File

@@ -1,10 +1,9 @@
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Entitas; using Fantasy.Entitas;
using Fantasy.Gate;
using Fantasy.Helper; using Fantasy.Helper;
namespace System.Gate; namespace NB.Gate;
public static class GameAccountFactory public static class GameAccountFactory
{ {

View File

@@ -1,7 +1,6 @@
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
using Fantasy.Gate;
namespace System.Gate; namespace NB.Gate;
public sealed class GameAccountFlagComponentDestroySystem : DestroySystem<GameAccountFlagComponent> public sealed class GameAccountFlagComponentDestroySystem : DestroySystem<GameAccountFlagComponent>
{ {

View File

@@ -1,10 +1,9 @@
using System.Gate.System; using NB.Gate.System;
using Fantasy; using Fantasy;
using Fantasy.Async; using Fantasy.Async;
using Fantasy.Gate;
using Fantasy.Network; using Fantasy.Network;
namespace System.Gate; namespace NB.Gate;
public static class GameAccountHelper public static class GameAccountHelper
{ {

View File

@@ -1,7 +1,6 @@
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
using Fantasy.Gate;
namespace System.Gate; namespace NB.Gate;
public sealed class GameAccountDestroySystem : DestroySystem<GameAccount> public sealed class GameAccountDestroySystem : DestroySystem<GameAccount>
{ {

View File

@@ -1,7 +1,6 @@
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
using Fantasy.Gate;
namespace System.Gate.System; namespace NB.Gate.System;
public sealed class GameAccountManageComponentDestroySystem : DestroySystem<GameAccountManageComponent> public sealed class GameAccountManageComponentDestroySystem : DestroySystem<GameAccountManageComponent>
{ {

View File

@@ -1,11 +1,10 @@
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using System.Security.Cryptography; using System.Security.Cryptography;
using Fantasy.Entitas.Interface; using Fantasy.Entitas.Interface;
using Fantasy.Gate;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
#pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type.
namespace System.Gate; namespace NB.Gate;
public sealed class GateJWTComponentAwakeSystem : AwakeSystem<GateJWTComponent> public sealed class GateJWTComponentAwakeSystem : AwakeSystem<GateJWTComponent>
{ {

View File

@@ -1,8 +1,7 @@
using System.IdentityModel.Tokens.Jwt; using System.IdentityModel.Tokens.Jwt;
using Fantasy; using Fantasy;
using Fantasy.Gate;
namespace System.Gate; namespace NB.Gate;
public static class GateJWTHelper public static class GateJWTHelper
{ {

View File

@@ -26,4 +26,4 @@ SceneConfigData.Initialize(sceneConfigText);
// 这里用的是NLog日志系统注册到框架中。 // 这里用的是NLog日志系统注册到框架中。
Log.Register(new Fantasy.NLog("Server")); Log.Register(new Fantasy.NLog("Server"));
await Entry.Start(AssemblyHelper.Assemblies); await Entry.Start(NB.AssemblyHelper.Assemblies);