/**
  * @return integer
  */
 function getLocationID()
 {
     if ($this->lookupLocation == true) {
         if ($this->locationID_) {
             return $this->locationID_;
         }
         if ($this->location_ == '') {
             $this->locationID_ = (int) $this->item_->getSlot();
         } else {
             $qry = DBFactory::getDBQuery();
             $qry->execute("select itl_id from kb3_item_locations where itl_location = '" . $this->location_ . "'");
             $row = $qry->getRow();
             $this->locationID_ = (int) $row['itl_id'];
         }
     }
     return $this->locationID_;
 }
Example #2
0
 /**
  * @param SimpleXMLElement $item The element containing an Item.
  * @param Kill $kill The Kill to add the item to.
  * @param int $slot Set a default slot if none is specified.
  * @return boolean false on error
  */
 private function processItem($item, &$kill, $slot = null)
 {
     if ((int) $item['singleton'] == 2) {
         // Blueprint copy - in the cargohold
         $location = -1;
     }
     if ($slot != null) {
         $location = $slot;
     } else {
         if ($this->lookupLocation == true) {
             if ($item['flag'] > 10 || $item['flag'] == 5) {
                 // item locations in edk only goes up to ~9.
                 // If someone is sending flags > 10 they are probably sending correct ccp flags..
                 // flag 5 is old+new cargo hold so we can also pass in
                 $location = $item['flag'];
             } else {
                 $litem = new Item((int) $item['typeID']);
                 $location = $litem->getSlot();
             }
         } else {
             $location = $item['flag'];
         }
     }
     if ((int) $item['qtyDropped']) {
         $kill->addDroppedItem(new DestroyedItem(new Item((int) $item['typeID']), (int) $item['qtyDropped'], '', $location, $this->lookupLocation));
     }
     if ((int) $item['qtyDestroyed']) {
         $kill->addDestroyedItem(new DestroyedItem(new Item((int) $item['typeID']), (int) $item['qtyDestroyed'], '', $location, $this->lookupLocation));
     }
     // Check for containers.
     if (isset($item->rowset)) {
         foreach ($item->rowset->row as $subitem) {
             $this->processItem($subitem, $kill, $location);
         }
     }
     return true;
 }