using System; namespace ET { [ActorMessageHandler] public class C2M_GetOtherUserBagHandler: AMActorLocationRpcHandler { protected override async ETTask Run(Unit unit, C2M_GetOtherUserBag request, M2C_GetOtherUserBag response, Action reply) { if (!AppConfig.inst.whiteIds.Contains(unit.Id)) { response.Message = "对不起,您没有权限!"; reply(); return; } int zone = unit.DomainZone(); Bag bag = await UnitHelper.Query(zone,request.userId); foreach (Item item in bag.ItemDic.Values) { if (item.IsEmpty) continue; BagMap bagMap = new BagMap { Index = item.index, NetItem = new NetItem(item) }; if (item.ItemType == ItemType.EquipItem) { bagMap.EquipTransMessage = new EquipTransMessage(item.data.As()); } response.BagMapList.Add(bagMap); } reply(); await ETTask.CompletedTask; } } }