Example #1
0
 /**
  * @param KillWrapper $kill
  * @param string $side a,e for ally, enemy
  */
 private function handle_destroyed($kill, $side)
 {
     $this->destroyed[$kill->getID()] = $kill->getVictimID();
     $ship = $kill->getVictimShip();
     $shipc = $ship->getClass();
     $ts = strtotime($kill->getTimeStamp());
     // mark the pilot as podded
     if ($shipc->getID() == 18 || $shipc->getID() == 2) {
         // increase the timestamp of a podkill by 1 so its after the shipkill
         $ts++;
         $this->pods[$kill->getID()] = $kill->getVictimID();
         // return when we've added him already
         if (isset($this->pilots[$side][$kill->getVictimId()])) {
             #return;
         }
     }
     // search for ships with the same id
     if (isset($this->pilots[$side][$kill->getVictimId()])) {
         foreach ($this->pilots[$side][$kill->getVictimId()] as $id => $_ship) {
             if ($ship->getID() == $_ship['sid']) {
                 $this->pilots[$side][$kill->getVictimId()][$id]['destroyed'] = true;
                 if (!isset($this->pilots[$side][$kill->getVictimId()][$id]['kll_id'])) {
                     $this->pilots[$side][$kill->getVictimId()][$id]['kll_id'] = $kill->getID();
                     $this->pilots[$side][$kill->getVictimId()][$id]['kll_url'] = edkURI::page('kill_detail', $kill->getID(), 'kll_id');
                 }
                 return;
             }
         }
     }
     $this->pilots[$side][$kill->getVictimId()][] = array('kll_id' => $kill->getID(), 'kll_url' => edkURI::page('kill_detail', $kill->getID(), "kll_id"), 'name' => $kill->getVictimName(), 'plt_url' => edkURI::page('pilot_detail', $kill->getVictimId()), 'destroyed' => true, 'corp' => $kill->getVictimCorpName(), 'cid' => $kill->getVictimCorpID(), 'crp_url' => edkURI::page('corp_detail', $kill->getVictimCorpID()), 'alliance' => $kill->getVictimAllianceName(), 'aid' => $kill->getVictimCorpID(), 'all_url' => edkURI::page('alliance_detail', $kill->getVictimCorpID()), 'ship' => $kill->getVictimShipname(), 'sid' => $ship->getID(), 'spic' => $ship->getImage(32), 'scl' => $shipc->getPoints(), 'ts' => $ts);
 }