修复插槽清理后的bug
This commit is contained in:
@@ -13,7 +13,7 @@ public class C2Game_GetItemsRequestHandler : AddressRPC<Player, C2Game_GetItemsR
|
||||
var itemContainer = entity.GetComponent<PlayerItemContainerComponent>();
|
||||
response.Items = itemContainer.GetItemInfos();
|
||||
response.Rigs = itemContainer.GetRigInfos();
|
||||
response.Slots = itemContainer.Slots;
|
||||
response.Slots = itemContainer.GetSlots();
|
||||
await FTask.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
@@ -161,5 +162,10 @@ public static class PlayerItemContainerComponentSystem
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static List<long> GetSlots(this PlayerItemContainerComponent self)
|
||||
{
|
||||
return self.Slots.ToList();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public static class PlayerManageComponentSystem
|
||||
{
|
||||
Log.Debug("检测到当前账号已经在缓存中了");
|
||||
// 如果有延迟下线的计划任务,那就先取消一下。
|
||||
account.CancelTimeout();
|
||||
// account.CancelTimeout();
|
||||
// 如果在Gate的缓存中已经存在了该账号那只能以下几种可能:
|
||||
// 1、同一客户端发送了重复登录的请求数据。
|
||||
// 2、客户端经历的断线然后又重新连接到这个服务器上了(断线重连)。
|
||||
|
||||
@@ -92,12 +92,12 @@ public static class PlayerHelper
|
||||
return;
|
||||
}
|
||||
|
||||
// 如果不存在定时任务的组件,那就添加并设置定时任务
|
||||
if (account.IsTimeOutComponent())
|
||||
{
|
||||
// 如果已经存在了,那就表示当然已经有一个延时断开的任务了,那就不需要重复添加了
|
||||
return;
|
||||
}
|
||||
// // 如果不存在定时任务的组件,那就添加并设置定时任务
|
||||
// if (account.IsTimeOutComponent())
|
||||
// {
|
||||
// // 如果已经存在了,那就表示当然已经有一个延时断开的任务了,那就不需要重复添加了
|
||||
// return;
|
||||
// }
|
||||
|
||||
// 立即下线处理
|
||||
if (timeOut <= 0)
|
||||
@@ -108,7 +108,7 @@ public static class PlayerHelper
|
||||
}
|
||||
|
||||
// 设置延迟下线
|
||||
account.SetTimeout(timeOut, account.Disconnect);
|
||||
// account.SetTimeout(timeOut, account.Disconnect);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user