diff --git a/Entity/Model/DB/UserInfo.cs b/Entity/Model/DB/UserInfo.cs new file mode 100644 index 0000000..9a02c91 --- /dev/null +++ b/Entity/Model/DB/UserInfo.cs @@ -0,0 +1,16 @@ +using Fantasy.Entitas; + +namespace Fantasy; + +public class UserInfo : Entity +{ + /// + /// 昵称 + /// + public string NickName { get; set; } + + /// + /// 余额 + /// + public long Money { get; set; } +} \ No newline at end of file diff --git a/Entity/Model/Game/Player.cs b/Entity/Model/Game/Player.cs new file mode 100644 index 0000000..37a0e82 --- /dev/null +++ b/Entity/Model/Game/Player.cs @@ -0,0 +1,11 @@ +using Fantasy.Entitas; + +namespace Fantasy; + +/// +/// 玩家信息 +/// +public class Player : Entity +{ + +} \ No newline at end of file diff --git a/Entity/Model/User.cs b/Entity/Model/User.cs new file mode 100644 index 0000000..43f1865 --- /dev/null +++ b/Entity/Model/User.cs @@ -0,0 +1,11 @@ +using Fantasy.Entitas; + +namespace Fantasy.Model; + +public sealed class User : Entity +{ + public string NickName { get; set; } + public string Head { get; set; } + public string Country { get; set; } + +} \ No newline at end of file diff --git a/Hotfix/HTTPHandler/UsersController.cs b/Hotfix/HTTPHandler/UsersController.cs index 32c466d..b0f79c2 100644 --- a/Hotfix/HTTPHandler/UsersController.cs +++ b/Hotfix/HTTPHandler/UsersController.cs @@ -25,7 +25,7 @@ public class UsersController : ControllerBase } [HttpPost("register")] - public IActionResult RegisterUser([FromBody] User user) + public IActionResult RegisterUser([FromBody] HttpUser user) { return Ok("User registered successfully"); } @@ -38,7 +38,7 @@ public class UsersController : ControllerBase } } -public class User +public class HttpUser { public int Id { get; set; } public string Name { get; set; } diff --git a/Hotfix/Hotfix.csproj b/Hotfix/Hotfix.csproj index ab38d6c..f45c1b8 100644 --- a/Hotfix/Hotfix.csproj +++ b/Hotfix/Hotfix.csproj @@ -13,7 +13,6 @@ - diff --git a/Hotfix/Outer/Addresable/C2G_CreateAddressableRequestHandler.cs b/Hotfix/Outer/Addresable/C2G_CreateAddressableRequestHandler.cs index dcaace0..6424749 100644 --- a/Hotfix/Outer/Addresable/C2G_CreateAddressableRequestHandler.cs +++ b/Hotfix/Outer/Addresable/C2G_CreateAddressableRequestHandler.cs @@ -7,9 +7,11 @@ using Fantasy.Platform.Net; namespace Fantasy; -public sealed class C2G_CreateAddressableRequestHandler : MessageRPC +public sealed class + C2G_CreateAddressableRequestHandler : MessageRPC { - protected override async FTask Run(Session session, C2G_CreateAddressableRequest request, G2C_CreateAddressableResponse response, Action reply) + protected override async FTask Run(Session session, C2G_CreateAddressableRequest request, + G2C_CreateAddressableResponse response, Action reply) { var scene = session.Scene; // 1、首先要通过SceneConfig配置文件拿到进行注册Addressable协议的服务器 @@ -18,9 +20,11 @@ public sealed class C2G_CreateAddressableRequestHandler : MessageRPC(); // 4、拿到MapScene返回的AddressableId赋值给addressableRouteComponent.AddressableId。 diff --git a/Main/Program.cs b/Main/Program.cs index 7a7d537..eb3c405 100644 --- a/Main/Program.cs +++ b/Main/Program.cs @@ -1,10 +1,17 @@ using Fantasy; -using Fantasy.Assembly; using Fantasy.ConfigTable; -using Fantasy.DataBase; using Fantasy.Helper; using Fantasy.IdFactory; using Fantasy.Platform.Net; + +//Scene 255 +//gate 20个以内 +//游戏服 1个 +//Addressable管理中心 一个 +//游戏服 50个内 +//聊天服 1个1 + + // 设置配置表的路径 ConfigTableHelper.Initialize("../../../Config/Binary"); // 设置ID生成规则 @@ -21,14 +28,10 @@ MachineConfigData.Initialize(machineConfigText); ProcessConfigData.Initialize(processConfigText); WorldConfigData.Initialize(worldConfigText); SceneConfigData.Initialize(sceneConfigText); + // 注册日志模块到框架 // 开发者可以自己注册日志系统到框架,只要实现Fantasy.ILog接口就可以。 // 这里用的是NLog日志系统注册到框架中。 -Fantasy.Log.Register(new Fantasy.NLog("Server")); -// 初始化框架,添加程序集到框架中 -await Fantasy.Platform.Net.Entry.Initialize(Fantasy.AssemblyHelper.Assemblies); -// 启动Fantasy.Net -await Fantasy.Platform.Net.Entry.Start(); -// 也可以使用下面的Start方法来初始化并且启动Fantasy.Net -// 使用下面这个方法就不用使用上面的两个方法了。 -// await Fantasy.Platform.Net.Entry.Start(Fantasy.AssemblyHelper.Assemblies); +Log.Register(new Fantasy.NLog("Server")); + +await Entry.Start(AssemblyHelper.Assemblies);