From 88d302bbe6aa6ea45bae34efd7d14a2e6c199785 Mon Sep 17 00:00:00 2001 From: BobSong <605277374@qq.com> Date: Sun, 31 Aug 2025 23:48:00 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E8=A7=92=E8=89=B2=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Outer/data/CommonProtoData.proto | 13 +++++++++++++ .../Handler/C2Game_GetRoleInfoRequestHandler.cs | 17 +++++++++++++++++ .../Components/PlayerManageComponentSystem.cs | 4 +--- Hotfix/Game/Player/Helper/PlayerHelper.cs | 4 ++-- Hotfix/Hotfix.csproj | 1 - 5 files changed, 33 insertions(+), 6 deletions(-) create mode 100644 Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs diff --git a/Config/NetworkProtocol/Outer/data/CommonProtoData.proto b/Config/NetworkProtocol/Outer/data/CommonProtoData.proto index bf556b6..560d243 100644 --- a/Config/NetworkProtocol/Outer/data/CommonProtoData.proto +++ b/Config/NetworkProtocol/Outer/data/CommonProtoData.proto @@ -47,6 +47,7 @@ message RoleInfo repeated KeyValueInt64 Currency = 6; //货币信息 repeated KeyValueInt64 Slots = 7; //插槽使用情况 repeated SkillInfo Skills = 8; //技能信息 + repeated GearInfo Gears = 9; //钓组信息 int32 MapId = 9; //当前所在地图 } @@ -113,4 +114,16 @@ message SkillInfo int32 ConfigId = 1; //技能配置id int32 Level = 2; //技能等级 int32 Exp = 3; //技能经验 +} + +///玩家当前使用钓组信息 +message GearInfo +{ + int64 Rod = 1; + int64 Line = 2; + int64 Bobber = 3; + int64 Hook = 4; + int64 Bait = 5; + int64 Weight = 6; + int64 Reel = 7; } \ No newline at end of file diff --git a/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs b/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs new file mode 100644 index 0000000..0ac7054 --- /dev/null +++ b/Hotfix/Game/Handler/C2Game_GetRoleInfoRequestHandler.cs @@ -0,0 +1,17 @@ +using Fantasy; +using Fantasy.Async; +using Fantasy.Network.Interface; +using NB.Map; + +namespace NB.Game; + +public class C2Game_GetRoleInfoRequestHandler : RouteRPC +{ + protected override async FTask Run(Player entity, C2Game_GetRoleInfoRequest request, + Game2C_GetRoleInfoResponse response, Action reply) + { + response.RoomId = 0; + response.RoleInfo = entity.GetRoleInfo(); + await FTask.CompletedTask; + } +} \ No newline at end of file diff --git a/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs b/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs index cb411db..ed6c976 100644 --- a/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs +++ b/Hotfix/Game/Player/Components/PlayerManageComponentSystem.cs @@ -115,9 +115,7 @@ public static class PlayerManageComponentSystem { if (account.SessionRunTimeId == sessionId) { - //退出的是当前的 - await account.Save(); - self.Remove(accountId); + await PlayerHelper.Disconnect(self.Scene, account.Id); } } } diff --git a/Hotfix/Game/Player/Helper/PlayerHelper.cs b/Hotfix/Game/Player/Helper/PlayerHelper.cs index 77cea70..3b597c6 100644 --- a/Hotfix/Game/Player/Helper/PlayerHelper.cs +++ b/Hotfix/Game/Player/Helper/PlayerHelper.cs @@ -139,8 +139,7 @@ public static class PlayerHelper } #endregion - - + #region 结构转换 public static RoleSimpleInfo GetRoleSimpleInfo(this Player self) @@ -160,6 +159,7 @@ public static class PlayerHelper { var info = new RoleInfo(); info.BaseInfo = GetRoleBaseInfo(self); + info.RoleId = self.RouteId; return info; } diff --git a/Hotfix/Hotfix.csproj b/Hotfix/Hotfix.csproj index 8ccc1aa..d51d67f 100644 --- a/Hotfix/Hotfix.csproj +++ b/Hotfix/Hotfix.csproj @@ -13,7 +13,6 @@ -