Changeset 197
- Timestamp:
- 03/31/07 04:19:48 (16 years ago)
- Location:
- dev/common
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/includes/class.config.php
r190 r197 95 95 $db = new DBQuery(); 96 96 $db->execute('select * from kb3_config where cfg_site=\''.KB_SITE."'"); 97 $config = &config::_getCache(); 97 98 while ($row = $db->getRow()) 98 99 { 99 config::put($row['cfg_key'], $row['cfg_value']);100 $config[$row['cfg_key']] = $row['cfg_value']; 100 101 } 101 102 $config_init = true; -
dev/common/kill_related.php
r194 r197 128 128 { 129 129 global $pilots; 130 131 // we need to get all involved pilots, killlists dont supply them 130 132 $qry = new DBQuery(); 131 $sql = "select ind_plt_id, ind_crp_id, ind_all_id, ind_sec_status, 132 i nd_shp_id, ind_wep_id133 $sql = "select ind_plt_id, ind_crp_id, ind_all_id, ind_sec_status, ind_shp_id, ind_wep_id, 134 itm_name, plt_name, crp_name, all_name, shp_name, scl_points, scl_id, shp_externalid 133 135 from kb3_inv_detail 136 left join kb3_items on ind_wep_id=itm_id 137 left join kb3_pilots on ind_plt_id=plt_id 138 left join kb3_corps on ind_crp_id=crp_id 139 left join kb3_alliances on ind_all_id=all_id 140 left join kb3_ships on ind_shp_id=shp_id 141 left join kb3_ship_classes on shp_class=scl_id 134 142 where ind_kll_id = ".$kill->getID()." 135 143 order by ind_order"; … … 138 146 while ($row = $qry->getRow()) 139 147 { 140 $ship = new Ship($row['ind_shp_id']); 141 $shipc = $ship->getClass(); 148 //$ship = new Ship($row['ind_shp_id']); 149 //$shipc = $ship->getClass(); 150 151 // check for npc names (copied from pilot class) 152 $pos = strpos($row['plt_name'], "#"); 153 if ($pos !== false) 154 { 155 $name = explode("#", $row['plt_name']); 156 $item = new Item($name[2]); 157 $row['plt_name'] = $item->getName(); 158 } 142 159 143 160 // dont set pods as ships for pilots we already have 144 161 if (isset($pilots[$side][$row['ind_plt_id']])) 145 162 { 146 if ($ shipc->getID() == 18 || $shipc->getID()== 2)163 if ($row['scl_id'] == 18 || $row['scl_id'] == 2) 147 164 { 148 165 continue; 149 166 } 150 167 } 151 $weapon = new Item($row['ind_wep_id']);152 $pilot = new Pilot($row['ind_plt_id']);153 $corp = new Corporation($row['ind_crp_id']);154 $alliance = new Alliance($row['ind_all_id']);155 168 156 169 // search for ships with the same id … … 159 172 foreach ($pilots[$side][$row['ind_plt_id']] as $id => $_ship) 160 173 { 161 if ($ ship->getID()== $_ship['sid'])174 if ($row['ind_shp_id'] == $_ship['sid']) 162 175 { 163 176 // we already got that pilot in this ship, continue … … 166 179 } 167 180 } 168 $pilots[$side][$row['ind_plt_id']][] = array('name' => $pilot->getName(), 'sid' => $ship->getID(), 169 'spic' => $ship->getImage(32), 'aid' => $row['ind_all_id'], 'ts' => strtotime($kill->getTimeStamp()), 170 'corp' => $corp->getName(), 'alliance' => $alliance->getName(), 'scl' => $shipc->getPoints(), 171 'ship' => $ship->getName(), 'weapon' => $weapon->getName(), 'cid' => $row['ind_crp_id']); 181 182 $shipimage = IMG_URL.'/ships/32_32/'.$row['shp_externalid'].'.png'; 183 $pilots[$side][$row['ind_plt_id']][] = array('name' => $row['plt_name'], 'sid' => $row['ind_shp_id'], 184 'spic' => $shipimage, 'aid' => $row['ind_all_id'], 'ts' => strtotime($kill->getTimeStamp()), 185 'corp' =>$row['crp_name'], 'alliance' => $row['all_name'], 'scl' => $row['scl_points'], 186 'ship' => $row['shp_name'], 'weapon' => $row['itm_name'], 'cid' => $row['ind_crp_id']); 172 187 } 173 188 } … … 188 203 if ($shipc->getID() == 18 || $shipc->getID() == 2) 189 204 { 190 // increase the timestamp of a podkill by 1 so its for sureafter the shipkill205 // increase the timestamp of a podkill by 1 so its after the shipkill 191 206 $ts++; 192 207 global $pods; … … 333 348 foreach ($pilot as $id => $kll) 334 349 { 335 u asort($pilots[$side][$id], 'cmp_ts_func');350 usort($pilots[$side][$id], 'cmp_ts_func'); 336 351 } 337 352 } … … 351 366 if ($kll[$i]['ship'] == 'Capsule') 352 367 { 353 if (isset($kll[$i-1]['sid']) )368 if (isset($kll[$i-1]['sid']) && isset($kll[$i]['destroyed'])) 354 369 { 355 370 $pilots[$side][$id][$i-1]['podded'] = true; 356 371 $pilots[$side][$id][$i-1]['podid'] = $kll[$i]['kll_id']; 357 372 unset($pilots[$side][$id][$i]); 373 } 374 else 375 { 376 // now sort out all pods from pilots who previously flown a real ship 377 $valid_ship = false; 378 foreach ($kll as $ship) 379 { 380 if ($ship['ship'] != 'Capsule') 381 { 382 $valid_ship = true; 383 break; 384 } 385 } 386 if ($valid_ship) 387 { 388 unset($pilots[$side][$id][$i]); 389 } 358 390 } 359 391 }