聊天频道相关
This commit is contained in:
@@ -23,6 +23,7 @@ public class G2Game_EnterRequestHandler : RouteRPC<Scene, G2Game_EnterRequest, G
|
||||
var account = await gameAccountManageComponent.Online(scene, request.AccountId, request.GateRouteId);
|
||||
|
||||
response.RoleRouteId = account.RuntimeId;
|
||||
response.RoleInfo = account.GetRoleSimpleInfo();
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ public static class GameSceneHelper
|
||||
return gameSceneConfigs.First();
|
||||
}
|
||||
|
||||
public static async FTask<long> Online(Scene scene, long accountID, long gateRuntimeId)
|
||||
public static async FTask<(long, RoleSimpleInfo?)> Online(Scene scene, long accountID, long gateRuntimeId)
|
||||
{
|
||||
var gameSceneConfig = GetSceneConfig();
|
||||
var gameRouteId = gameSceneConfig.RouteId;
|
||||
@@ -29,9 +29,9 @@ public static class GameSceneHelper
|
||||
|
||||
if (gameResponse.ErrorCode != 0)
|
||||
{
|
||||
return 0;
|
||||
return (0, null);
|
||||
}
|
||||
|
||||
return gameResponse.RoleRouteId;
|
||||
|
||||
return (gameResponse.RoleRouteId, gameResponse.RoleInfo);
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,8 @@ namespace NB.Game;
|
||||
|
||||
public static class PlayerHelper
|
||||
{
|
||||
#region MyRegion
|
||||
|
||||
public static void InitializeChildEntity(this Player self)
|
||||
{
|
||||
if (self.Basic == null)
|
||||
@@ -141,6 +143,11 @@ public static class PlayerHelper
|
||||
account.SetTimeout(timeOut, account.Disconnect);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 结构转换
|
||||
|
||||
/// <summary>
|
||||
/// 获得GameAccountInfo
|
||||
/// </summary>
|
||||
@@ -158,4 +165,37 @@ public static class PlayerHelper
|
||||
LoginTime = self.Statistics.LoginTime
|
||||
};
|
||||
}
|
||||
|
||||
public static RoleSimpleInfo GetRoleSimpleInfo(this Player self)
|
||||
{
|
||||
return new RoleSimpleInfo()
|
||||
{
|
||||
RoleId = self.Id,
|
||||
NickName = self.Basic.NickName,
|
||||
Head = self.Basic.Head,
|
||||
Country = self.Basic.Country,
|
||||
Level = self.Basic.Level
|
||||
};
|
||||
}
|
||||
|
||||
public static RoleInfo GetRoleInfo(this Player self)
|
||||
{
|
||||
var info = new RoleInfo();
|
||||
info.BaseInfo = GetRoleBaseInfo(self);
|
||||
return info;
|
||||
}
|
||||
|
||||
public static RoleBaseInfo GetRoleBaseInfo(this Player self)
|
||||
{
|
||||
return new RoleBaseInfo()
|
||||
{
|
||||
NickName = self.Basic.NickName,
|
||||
Head = self.Basic.Head,
|
||||
Country = self.Basic.Country,
|
||||
Level = self.Basic.Level,
|
||||
Exp = self.Basic.Exp,
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user