$items = $mail['victim']['items']; $i = array(); $destroyedValue = 0; $droppedValue = 0; $totalValue = processItems($mail['victim']['items'], $date); $totalValue += Price::getItemPrice($mail['victim']['shipType']['id'], $date, true); $zkb = array(); if (isset($mail['war']['id']) && $mail['war']['id'] != 0) { $kill['warID'] = (int) $mail['war']['id']; } if (isset($kill['locationID'])) { $zkb['locationID'] = $kill['locationID']; } $zkb['hash'] = $crestmail['hash']; $zkb['totalValue'] = (double) $totalValue; $zkb['points'] = (int) Points::getKillPoints($kill, $zkb['totalValue']); $kill['zkb'] = $zkb; $exists = $killmails->count(['killID' => $killID]); if ($exists == 0) { $killmails->save($kill); } $oneWeekExists = $mdb->exists('oneWeek', ['killID' => $killID]); if (!$oneWeekExists) { $mdb->getCollection('oneWeek')->save($kill); } $queueInfo->push($killID); $redis->incr("zkb:totalKills"); ++$counter; } } if ($debug && $counter > 0) {