2021-05-01 22:06:12 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Cal;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
[ActorMessageHandler]
|
|
|
|
|
public class C2M_GetStarSoulBagHandler: AMActorLocationRpcHandler<Unit, C2M_GetStarSoulBag, M2C_GetStarSoulBag>
|
|
|
|
|
{
|
|
|
|
|
protected override async ETTask Run(Unit unit, C2M_GetStarSoulBag request, M2C_GetStarSoulBag response, Action reply)
|
|
|
|
|
{
|
|
|
|
|
StarSoulBag bag = unit.GetComponent<StarSoulBag>();
|
|
|
|
|
foreach (var kv in bag.itemDic)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
StarSoulNetItem netItem = new();
|
|
|
|
|
StarSoulItem item = kv.Value;
|
|
|
|
|
netItem.Id = item.Id;
|
|
|
|
|
netItem.level = item.level;
|
|
|
|
|
netItem.exp = item.exp;
|
|
|
|
|
netItem.quality = (int) item.quality;
|
|
|
|
|
netItem.posType = (int) item.posType;
|
|
|
|
|
netItem.typeId = item.typeId;
|
|
|
|
|
netItem.isUsed = item.isUsed;
|
|
|
|
|
netItem.main = item.mainId;
|
2021-05-05 13:36:19 +08:00
|
|
|
|
netItem.isLocked = item.isLocked;
|
2021-05-01 22:06:12 +08:00
|
|
|
|
foreach (int id in item.viceIds)
|
|
|
|
|
{
|
|
|
|
|
netItem.vice.Add(id);
|
|
|
|
|
}foreach (float id in item.viceAdd)
|
|
|
|
|
{
|
|
|
|
|
netItem.viceAdd.Add(id);
|
|
|
|
|
}
|
|
|
|
|
response.itemList.Add(netItem);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
|
Log.Error(e);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-05-05 13:36:19 +08:00
|
|
|
|
response.usedIdMap.AddRange(bag.usedStarSoulDic.Values);
|
|
|
|
|
foreach (StarSoulSuit starSoulSuit in bag.Suits)
|
|
|
|
|
{
|
|
|
|
|
response.suitKVs.Add(new KV_int32_int32()
|
|
|
|
|
{
|
|
|
|
|
key = starSoulSuit.Id,
|
|
|
|
|
value = (int) starSoulSuit.type
|
|
|
|
|
});
|
|
|
|
|
}
|
2021-05-01 22:06:12 +08:00
|
|
|
|
reply();
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|