Exemplo n.º 1
0
 public function __construct($aInvolved, &$cKill, &$cKillboard)
 {
     $this->characterID = $aInvolved->characterID;
     $this->characterName = $aInvolved->characterName;
     $this->corporationID = $aInvolved->corporationID;
     $this->corporationName = $aInvolved->corporationName;
     $this->allianceID = $aInvolved->allianceID;
     $this->allianceName = $aInvolved->allianceName;
     $this->factionID = $aInvolved->factionID;
     $this->factionName = $aInvolved->factionName;
     $this->securityStatus = $aInvolved->securityStatus;
     $this->damageDone = $aInvolved->damageDone;
     $this->finalBlow = $aInvolved->finalBlow;
     $this->weaponTypeID = $aInvolved->weaponTypeID;
     $this->shipTypeID = $aInvolved->shipTypeID;
     $aCorp =& $cKillboard->getCorporation($this->corporationName);
     if (!is_object($aCorp)) {
         $cKillboard->corp[] = $aCorp = new Corporation(SHIP_KILL, $this->corporationID, $this->corporationName, $this->allianceID, $this->allianceName, $cKill);
     } else {
         if (!$cKill->isCorpAlreadyInvolved($this->corporationName)) {
             // Increment killcount
             $aCorp->killCount++;
             // If EVEKILL_SECS_ELAPSED_ASSUME_NEW_BATTLE seconds have elapsed since the last kill by this corp, assume it
             // is a new battle (and adds weight to the fact they are probably resident)
             if (is_null($aCorp->timeEarliestKill) || strtotime($cKill->timestamp) + EVEKILL_SECS_ELAPSED_ASSUME_NEW_BATTLE <= $aCorp->timeEarliestKill) {
                 $aCorp->battle[] =& $cKill;
             }
             // Update kill times
             if (strtotime($cKill->timestamp) < $aCorp->timeEarliestKill || is_null($aCorp->timeEarliestKill)) {
                 $aCorp->timeEarliestKill = strtotime($cKill->timestamp);
             }
             if (strtotime($cKill->timestamp) > $aCorp->timeLatestKill || is_null($aCorp->timeLatestKill)) {
                 $aCorp->timeLatestKill = strtotime($cKill->timestamp);
             }
             // Add kill to this corp's kill database
             $aCorp->addKill($cKill, false);
         }
         // Increment involved parties and ships
         $aCorp->addInvolved();
     }
     // Add the killers ship and weapon to their "use" database
     $aCorp->addShip($this->shipTypeID, SHIP_KILL);
     $aCorp->addWeapon($this->weaponTypeID);
 }