function getKill() { $this->execQuery(); if ($this->plimit_ && $this->killcounter_ >= $this->plimit_) { // echo $this->plimit_." ".$this->killcounter_; return null; } if ($this->count_ == $this->qry_->recordCount()) { $skip = $this->poffset_ - $this->killpointer_; } else { $skip = 0; } if ($skip > 0) { for ($i = 0; $i < $skip; $i++) { $this->killpointer_++; $row = $this->qry_->getRow(); } } $row = $this->qry_->getRow(); if ($row) { $this->killcounter_++; if ($row['ClassID'] != 2 && $row['ClassID'] != 3 && $row['ClassID'] != 11) { $this->realkillcounter_++; } if ($this->walked == false) { $this->killisk_ += $row['ISK_Loss']; $this->killpoints_ += $row['KillPoints']; } $kill = new KillWrapper($row['ID']); $arr = array('victimexternalid' => (int) $row['Pilot_Ext_ID'], 'victimname' => $row['Name'], 'victimid' => (int) $row['Pilot_ID'], 'victimcorpid' => (int) $row['Corp_ID'], 'victimcorpname' => $row['Corp'], 'victimallianceid' => (int) $row['Ally_ID'], 'victimalliancename' => $row['Ally'], 'victimshipvalue' => $row['ShipValue'], 'fbpilotid' => (int) $row['FB_Pilot_ID'], 'fbpilotexternalid' => (int) $row['FB_Pilot_Ext_ID'], 'fbcorpid' => (int) $row['FB_Corp_ID'], 'fballianceid' => (int) $row['FB_Ally_ID'], 'fbpilotname' => $row['FB_Name'], 'fbcorpname' => $row['FB_Corp'], 'fballiancename' => $row['FB_Ally'], 'victimshipid' => (int) $row['Ship_ID'], 'dmgtaken' => $row['Damage'], 'timestamp' => $row['Time'], 'solarsystemid' => (int) $row['System_ID'], 'solarsystemname' => $row['System'], 'solarsystemsecurity' => $row['SysSec'], 'externalid' => (int) $row['ExtID'], 'killpoints' => (int) $row['KillPoints'], 'iskloss' => (double) $row['ISK_Loss']); $kill->setArray($arr); // Set the involved party count if it is known //if ($this->involved_) $kill->setInvolvedPartyCount((int) $row['Involved']); // Set the comment count if it is known //if ($this->comments_) $kill->setCommentCount((int) $row['Comments']); if (isset($this->_tag)) { $kill->_tag = $this->_tag; } return $kill; } else { $this->walked = true; return null; } }
public function getKill() { $this->execQuery(); if ($this->plimit_ && $this->killcounter_ >= $this->plimit_) { // echo $this->plimit_." ".$this->killcounter_; return null; } if ($this->count_ == $this->qry_->recordCount()) { $skip = $this->poffset_ - $this->killpointer_; } else { $skip = 0; } if ($skip > 0) { for ($i = 0; $i < $skip; $i++) { $this->killpointer_++; $row = $this->qry_->getRow(); } } $row = $this->qry_->getRow(); if ($row) { $this->killcounter_++; if ($row['scl_id'] != 2 && $row['scl_id'] != 3 && $row['scl_id'] != 11) { $this->realkillcounter_++; } if ($this->walked == false) { $this->killisk_ += $row['kll_isk_loss']; $this->killpoints_ += $row['kll_points']; } $kill = new KillWrapper($row['kll_id']); $arr = array('victimexternalid' => (int) $row['plt_externalid'], 'victimname' => $row['plt_name'], 'victimid' => (int) $row['kll_victim_id'], 'victimcorpid' => (int) $row['crp_id'], 'victimcorpname' => $row['crp_name'], 'victimallianceid' => (int) $row['all_id'], 'victimalliancename' => $row['all_name'], 'victimshipvalue' => $row['scl_value'], 'fbpilotid' => (int) $row['fbplt_id'], 'fbpilotexternalid' => (int) $row['fbplt_externalid'], 'fbcorpid' => (int) $row['fbcrp_id'], 'fballianceid' => (int) $row['fball_id'], 'fbpilotname' => $row['fbplt_name'], 'fbcorpname' => $row['fbcrp_name'], 'fballiancename' => $row['fball_name'], 'victimshipid' => (int) $row['shp_id'], 'dmgtaken' => $row['kll_dmgtaken'], 'timestamp' => $row['kll_timestamp'], 'solarsystemid' => (int) $row['sys_id'], 'solarsystemname' => $row['sys_name'], 'solarsystemsecurity' => $row['sys_sec'], 'externalid' => (int) $row['kll_external_id'], 'killpoints' => (int) $row['kll_points'], 'iskloss' => (double) $row['kll_isk_loss']); $kill->setArray($arr); //Set the involved party count if it is known if ($this->involved_) { $kill->setInvolvedPartyCount((int) $row['inv']); } //Set the comment count if it is known if ($this->comments_) { $kill->setCommentCount((int) $row['comments']); } if (isset($this->_tag)) { $kill->_tag = $this->_tag; } return $kill; } else { $this->walked = true; return null; } }
/** * @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); }