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; } var _unit = MapUnitComponent.Instance.Get(request.userId); if (_unit) { response.Message = "对方在线"; reply(); return; } Bag bag = await UnitHelper.Query(unit.DomainZone(),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; } } }