获取角色信息相关

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

@@ -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)
{
//退出的是当前的
await account.Save();
self.Remove(accountId);
await PlayerHelper.Disconnect(self.Scene, account.Id);
}
}
}

View File

@@ -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;
}

View File

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