Example #1
0
 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;
     }
 }
 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;
     }
 }