获取角色信息相关

This commit is contained in:
2025-08-31 23:48:00 +08:00
parent bd0457d4c5
commit 88d302bbe6
5 changed files with 33 additions and 6 deletions

View File

@@ -47,6 +47,7 @@ message RoleInfo
repeated KeyValueInt64 Currency = 6; //货币信息 repeated KeyValueInt64 Currency = 6; //货币信息
repeated KeyValueInt64 Slots = 7; //插槽使用情况 repeated KeyValueInt64 Slots = 7; //插槽使用情况
repeated SkillInfo Skills = 8; //技能信息 repeated SkillInfo Skills = 8; //技能信息
repeated GearInfo Gears = 9; //钓组信息
int32 MapId = 9; //当前所在地图 int32 MapId = 9; //当前所在地图
} }
@@ -113,4 +114,16 @@ message SkillInfo
int32 ConfigId = 1; //技能配置id int32 ConfigId = 1; //技能配置id
int32 Level = 2; //技能等级 int32 Level = 2; //技能等级
int32 Exp = 3; //技能经验 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;
} }

View File

@@ -0,0 +1,17 @@
using Fantasy;
using Fantasy.Async;
using Fantasy.Network.Interface;
using NB.Map;
namespace NB.Game;
public class C2Game_GetRoleInfoRequestHandler : RouteRPC<Player, C2Game_GetRoleInfoRequest, Game2C_GetRoleInfoResponse>
{
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;
}
}

View File

@@ -115,9 +115,7 @@ public static class PlayerManageComponentSystem
{ {
if (account.SessionRunTimeId == sessionId) if (account.SessionRunTimeId == sessionId)
{ {
//退出的是当前的 await PlayerHelper.Disconnect(self.Scene, account.Id);
await account.Save();
self.Remove(accountId);
} }
} }
} }

View File

@@ -139,8 +139,7 @@ public static class PlayerHelper
} }
#endregion #endregion
#region #region
public static RoleSimpleInfo GetRoleSimpleInfo(this Player self) public static RoleSimpleInfo GetRoleSimpleInfo(this Player self)
@@ -160,6 +159,7 @@ public static class PlayerHelper
{ {
var info = new RoleInfo(); var info = new RoleInfo();
info.BaseInfo = GetRoleBaseInfo(self); info.BaseInfo = GetRoleBaseInfo(self);
info.RoleId = self.RouteId;
return info; return info;
} }

View File

@@ -13,7 +13,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Game\Handler\" />
<Folder Include="Game\Helper\" /> <Folder Include="Game\Helper\" />
<Folder Include="Social\Chat\" /> <Folder Include="Social\Chat\" />
<Folder Include="Social\Club\" /> <Folder Include="Social\Club\" />