聊天频道相关
This commit is contained in:
@@ -13,21 +13,29 @@ public static class ChatUnitManageComponentSystem
|
||||
/// </summary>
|
||||
/// <param name="self"></param>
|
||||
/// <param name="scene"></param>
|
||||
/// <param name="accountId"></param>
|
||||
/// <param name="roleSimpleInfo"></param>
|
||||
/// <param name="gateRouteId"></param>
|
||||
public static async FTask<ChatUnit> Online(this ChatUnitManageComponent self, Scene scene, long accountId,
|
||||
public static async FTask<ChatUnit?> Online(this ChatUnitManageComponent self, Scene scene, RoleSimpleInfo roleSimpleInfo,
|
||||
long gateRouteId)
|
||||
{
|
||||
var accountId = roleSimpleInfo.RoleId;
|
||||
if (!self.TryGet(accountId, out var account))
|
||||
{
|
||||
account = ChatUnitFactory.Create(scene, accountId);
|
||||
self.Add(account);
|
||||
}
|
||||
|
||||
account.GateRouteId = gateRouteId;
|
||||
|
||||
if (account != null)
|
||||
{
|
||||
account.GateRouteId = gateRouteId;
|
||||
account.RoleId = accountId;
|
||||
account.Head = roleSimpleInfo.Head;
|
||||
account.Level = roleSimpleInfo.Level;
|
||||
account.NickName = roleSimpleInfo.NickName;
|
||||
account.Country = roleSimpleInfo.Country;
|
||||
}
|
||||
|
||||
await FTask.CompletedTask;
|
||||
|
||||
return account;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user