Exemplo n.º 1
0
        public Player GetKnownTradeObj(ObjectGuid itemGuid)
        {
            if (KnownTradeObjs.Count() == 0)
            {
                return(null);
            }

            PruneKnownTradeObjs();

            foreach (var knownTradeObj in KnownTradeObjs)
            {
                if (knownTradeObj.Value.Contains(itemGuid))
                {
                    var playerGuid = knownTradeObj.Key;
                    var player     = ObjMaint.GetKnownObject(playerGuid.Full)?.WeenieObj?.WorldObject as Player;
                    if (player != null && player.Location != null && Location.DistanceTo(player.Location) <= LocalBroadcastRange)
                    {
                        return(player);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }
            return(null);
        }
Exemplo n.º 2
0
 public void PruneKnownTradeObjs()
 {
     foreach (var playerGuid in KnownTradeObjs.Keys.ToList())
     {
         if (ObjMaint.GetKnownObject(playerGuid.Full) == null)
         {
             KnownTradeObjs.Remove(playerGuid);
         }
     }
 }