예제 #1
0
function validKill(&$kill)
{
    // Show all pod kills
    $victimShipID = $kill['victim']['shipType']['id'];
    if ($victimShipID == 670 || $victimShipID == 33328) {
        return true;
    }
    $npcOnly = true;
    foreach ($kill['attackers'] as $attacker) {
        if (isset($attacker['shipType']['id'])) {
            $attackerGroupID = Info::getGroupID($attacker['shipType']['id']);
            if ($attackerGroupID == 365) {
                return true;
            }
            // A tower is involved
            if ($attackerGroupID == 99) {
                return true;
            }
            // A sentry gun is involved
        }
        if (isset($attacker['shipType']['id']) && $attacker['shipType']['id'] == 34495) {
            return true;
        }
        // A drifter is involved
        // Don't process the kill if it's NPC only
        if (isset($attacker['corporation']['id']) && $attacker['corporation']['id'] == 1000125) {
            return true;
        }
        $npcOnly &= @$attacker['character']['id'] == 0 && (@$attacker['corporation']['id'] < 1999999 && @$attacker['corporation']['id'] != 1000125);
    }
    return !$npcOnly;
}
예제 #2
0
 public function execute($parameters, $db)
 {
     // Fix unknown group ID's
     $result = $db->query("select distinct killID from zz_participants where groupID != vGroupID and isVictim = 1 limit 1", array(), 0);
     foreach ($result as $row) {
         $killID = $row["killID"];
         $shipTypeID = $db->queryField("select shipTypeID from zz_participants where killID = {$killID} and isVictim = 1", "shipTypeID");
         if ($shipTypeID == 0) {
             continue;
         }
         $groupID = Info::getGroupID($shipTypeID);
         echo "Updating {$killID} to {$groupID}\n";
         $db->execute("update zz_participants set vGroupID = {$groupID} where killID = {$killID}");
     }
     CLI::out(sizeof($result) . " done!", true);
 }
예제 #3
0
 public static function eftarray($md5, $items, $victimID = 0)
 {
     $Cache = Cache::get($md5 . 'eftarray');
     if ($Cache) {
         return $Cache;
     }
     // EFT / Fitting Wheel
     $eftarray['high'] = array();
     // high
     $eftarray['mid'] = array();
     // mid
     $eftarray['low'] = array();
     // low
     $eftarray['rig'] = array();
     // rig
     $eftarray['drone'] = array();
     // drone
     $eftarray['sub'] = array();
     // sub
     $eftammo['high'] = array();
     // high ammo
     $eftammo['mid'] = array();
     // mid ammo
     foreach ($items as $itm) {
         if (!isset($itm['inContainer'])) {
             $itm['inContainer'] = 0;
         }
         if ($victimID >= 2100000000 && $victimID <= 2999999999.0) {
             $itm['flagName'] = Info::getGroupName(Info::getGroupID($itm['typeID']));
         } elseif (!isset($itm['flagName'])) {
             $itm['flagName'] = Info::getFlagName($itm['flag']);
         }
         if ($itm['flagName'] == 'Infantry Modules') {
             $itm['flagName'] = 'Mid Slots';
         }
         if ($itm['flagName'] == 'Infantry Weapons') {
             $itm['flagName'] = 'High Slots';
         }
         if ($itm['flagName'] == 'Infantry Equipment') {
             $itm['flagName'] = 'Low Slots';
         }
         if ($itm['flag'] == 89) {
             $slot = Db::queryField('select coalesce(valueInt, valueFloat) slot from ccp_dgmTypeAttributes where typeID = :typeID and attributeID = 331', 'slot', array(':typeID' => $itm['typeID']));
             if ($slot <= 5 && $slot >= 1) {
                 $itm['flagName'] = 'High Slots';
                 $itm['flag'] = 27 + ($slot - 1);
             } elseif ($slot > 5 && $slot <= 10) {
                 $itm['flagName'] = 'Low Slots';
                 $itm['flag'] = 11 + ($slot - 6);
             }
             $itm['fittable'] = 1;
         }
         if (!isset($itm['flag']) || $itm['flag'] == 0) {
             if ($itm['flagName'] == 'High Slots') {
                 $itm['flag'] = 27;
             }
             if ($itm['flagName'] == 'Mid Slots') {
                 $itm['flag'] = 19;
             }
             if ($itm['flagName'] == 'Low Slots') {
                 $itm['flag'] = 11;
             }
         }
         $key = $itm['typeName'] . '|' . $itm['flagName'];
         if (isset($itm['flagName'])) {
             if ($itm['fittable'] && $itm['inContainer'] == 0) {
                 // not ammo or whatever
                 $repeats = @$itm['quantityDropped'] + @$itm['quantityDestroyed'];
                 $i = 0;
                 while ($i < $repeats) {
                     if ($itm['flagName'] == 'High Slots') {
                         high:
                         if (isset($eftarray['high'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto high;
                         }
                         $eftarray['high'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'Mid Slots') {
                         mid:
                         if (isset($eftarray['mid'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto mid;
                         }
                         $eftarray['mid'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'Low Slots') {
                         low:
                         if (isset($eftarray['low'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto low;
                         }
                         $eftarray['low'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'Rigs') {
                         rigs:
                         if (isset($eftarray['rig'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto rigs;
                         }
                         $eftarray['rig'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'SubSystems') {
                         subs:
                         if (isset($eftarray['sub'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto subs;
                         }
                         $eftarray['sub'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     ++$i;
                 }
             } else {
                 if ($itm['flagName'] == 'Drone Bay') {
                     $eftarray['drone'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'qty' => @$itm['quantityDropped'] + @$itm['quantityDestroyed']);
                 }
             }
         }
     }
     // Ammo shit
     foreach ($items as $itm) {
         if (!isset($itm['inContainer'])) {
             $itm['inContainer'] = 0;
         }
         if ($itm['inContainer'] == 0 && !$itm['fittable'] && isset($itm['flagName'])) {
             // possibly ammo
             if ($itm['flagName'] == 'High Slots') {
                 // high slot ammo
                 $eftarray['high'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'charge' => true);
             }
             if ($itm['flagName'] == 'Mid Slots') {
                 // mid slot ammo
                 $eftarray['mid'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'charge' => true);
             }
             if ($itm['flagName'] == 'Low Slots') {
                 // mid slot ammo
                 $eftarray['low'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'charge' => true);
             }
         }
     }
     foreach ($eftarray as $key => $value) {
         if (sizeof($value)) {
             asort($value);
             $eftarray[$key] = $value;
         } else {
             unset($eftarray[$key]);
         }
     }
     Cache::set($md5 . 'eftarray', $eftarray);
     return $eftarray;
 }
 private static function stats($db)
 {
     Log::irc("|g|Stats calculation started - checking for unknown groupID's");
     // Fix unknown group ID's
     $result = $db->query("select distinct shipTypeID from zz_participants where groupID = 0 and shipTypeID != 0");
     foreach ($result as $row) {
         $shipTypeID = $row["shipTypeID"];
         $groupID = Info::getGroupID($shipTypeID);
         if ($groupID == 0) {
             continue;
         }
         Log::log("Updating {$shipTypeID} to group {$groupID}");
         $db->execute("update zz_participants set groupID = {$groupID} where groupID = 0 and shipTypeID = {$shipTypeID}");
     }
     $db->execute("set session wait_timeout = 6000");
     if (!Util::isMaintenanceMode()) {
         $db->execute("replace into zz_storage values ('MaintenanceReason', 'Full stats calculation in progress')");
         $db->execute("replace into zz_storage values ('maintenance', 'true')");
         Log::log("Maintenance mode engaged");
         Log::irc("|r|Engaging maintenance mode for full stat calculations...");
         sleep(60);
         // Wait for processes to finish and cleanup
     }
     $db->execute("truncate zz_stats");
     try {
         self::recalc('faction', 'factionID', true, $db);
         self::recalc('alli', 'allianceID', true, $db);
         self::recalc('corp', 'corporationID', true, $db);
         self::recalc('pilot', 'characterID', true, $db);
         self::recalc('group', 'groupID', true, $db);
         self::recalc('ship', 'shipTypeID', true, $db);
         self::recalc('system', 'solarSystemID', false, $db);
         self::recalc('region', 'regionID', false, $db);
     } catch (Exception $e) {
         print_r($e);
     }
     $db->execute("delete from zz_storage where locker = 'maintenance'");
     Log::irc("|g|Stat recalculations have completed, leaving Maintenance mode and now reverting to business as usual...");
 }
예제 #5
0
function createInvolved($data)
{
    global $mdb;
    $dataArray = array('character', 'corporation', 'alliance', 'faction', 'shipType');
    $array = array();
    foreach ($dataArray as $index) {
        if (isset($data[$index]['id']) && $data[$index]['id'] != 0) {
            $array["{$index}ID"] = (int) $data[$index]['id'];
        }
    }
    if (isset($array['shipTypeID']) && Info::getGroupID($array['shipTypeID']) == -1) {
        $mdb->getCollection('information')->update(['type' => 'group'], ['$set' => ['lastCrestUpdate' => new MongoDate(1)]]);
        Util::out('Bailing on processing a kill, unable to find groupID for ' . $array['shipTypeID']);
        exit;
    }
    if (isset($array['shipTypeID'])) {
        $array['groupID'] = (int) Info::getGroupID($array['shipTypeID']);
    }
    if (isset($data['finalBlow']) && $data['finalBlow'] == true) {
        $array['finalBlow'] = true;
    }
    return $array;
}
 private static function stats($db)
 {
     CLI::out("|g|Stats calculation started");
     $db->execute("set session wait_timeout = 600");
     // Fix unknown group ID's
     echo "Updating groups...\n";
     $result = $db->query("select distinct shipTypeID from zz_participants where groupID = 0 and shipTypeID != 0");
     foreach ($result as $row) {
         $shipTypeID = $row["shipTypeID"];
         $groupID = Info::getGroupID($shipTypeID);
         if ($groupID == null) {
             $groupID = 0;
         }
         if ($groupID == 0) {
             continue;
         }
         echo "Updating {$shipTypeID} to {$groupID}\n";
         $db->execute("update zz_participants set groupID = {$groupID} where groupID = 0 and shipTypeID = {$shipTypeID}");
     }
     echo "Finished updating groups...\n";
     $db->execute("create table if not exists zz_stats_recent like zz_stats");
     $db->execute("truncate zz_stats_recent");
     try {
         self::recalc('faction', 'factionID', true, $db);
         self::recalc('alli', 'allianceID', true, $db);
         self::recalc('corp', 'corporationID', true, $db);
         self::recalc('pilot', 'characterID', true, $db);
         self::recalc('group', 'groupID', true, $db);
         self::recalc('ship', 'shipTypeID', true, $db);
         self::recalc('system', 'solarSystemID', false, $db);
         self::recalc('region', 'regionID', false, $db);
     } catch (Exception $e) {
         print_r($e);
     }
 }
예제 #7
0
 private static function processAttacker(&$kill, &$killID, &$attacker, $victimShipTypeID, $totalCost)
 {
     $victimGroupID = Info::getGroupID($victimShipTypeID);
     $attackerGroupID = Info::getGroupID($attacker["shipTypeID"]);
     $regionID = Info::getRegionIDFromSystemID($kill["solarSystemID"]);
     $dttm = (string) $kill["killTime"];
     Db::execute("\n\t\t\t\tinsert into zz_participants_temporary\n\t\t\t\t(killID, solarSystemID, regionID, isVictim, characterID, corporationID, allianceID, total_price, vGroupID,\n\t\t\t\t factionID, damage, finalBlow, weaponTypeID, shipTypeID, groupID, dttm)\n\t\t\t\tvalues\n\t\t\t\t(:killID, :solarSystemID, :regionID, 0, :characterID, :corporationID, :allianceID, :total, :vGroupID,\n\t\t\t\t :factionID, :damageDone, :finalBlow, :weaponTypeID, :shipTypeID, :groupID, :dttm)", array(":killID" => $killID, ":solarSystemID" => $kill["solarSystemID"], ":regionID" => $regionID, ":characterID" => $attacker["characterID"], ":corporationID" => $attacker["corporationID"], ":allianceID" => $attacker["allianceID"], ":factionID" => $attacker["factionID"], ":damageDone" => $attacker["damageDone"], ":finalBlow" => $attacker["finalBlow"], ":weaponTypeID" => $attacker["weaponTypeID"], ":shipTypeID" => $attacker["shipTypeID"], ":groupID" => $attackerGroupID, ":dttm" => $dttm, ":total" => $totalCost, ":vGroupID" => $victimGroupID));
     Info::addChar($attacker["characterID"], $attacker["characterName"]);
     Info::addCorp($attacker["corporationID"], $attacker["corporationName"]);
     Info::addAlli($attacker["allianceID"], $attacker["allianceName"]);
 }
예제 #8
0
function validKill(&$kill)
{
    // Show all pod kills
    $victimShipID = $kill['victim']['shipType']['id'];
    if ($victimShipID == 670 || $victimShipID == 33328) {
        return true;
    }
    foreach ($kill['attackers'] as $attacker) {
        if (@$attacker['character']['id'] > 0) {
            return true;
        }
        if (@$attacker['corporation']['id'] > 1999999) {
            return true;
        }
        if (@$attacker['alliance']['id'] > 0) {
            return true;
        }
        $attackerGroupID = Info::getGroupID(@$attacker['shipType']['id']);
        if ($attackerGroupID == 365 || $attackerGroupID == 99) {
            return true;
        }
        // Tower or Sentry gun
        if (@$attacker['shipType']['id'] == 34495) {
            return true;
        }
        // Drifters
        if (@$attacker['corporation']['id'] == 1000125) {
            return true;
        }
        // Drifters
    }
    return false;
}
예제 #9
0
function eftarray($md5, $items, $victimID = 0)
{
    $Cache = Cache::get($md5 . "eftarray");
    if ($Cache) {
        return $Cache;
    }
    // EFT / Fitting Wheel
    $eftarray["high"] = array();
    // high
    $eftarray["mid"] = array();
    // mid
    $eftarray["low"] = array();
    // low
    $eftarray["rig"] = array();
    // rig
    $eftarray["drone"] = array();
    // drone
    $eftarray["sub"] = array();
    // sub
    $eftammo["high"] = array();
    // high ammo
    $eftammo["mid"] = array();
    // mid ammo
    foreach ($items as $itm) {
        if ($victimID >= 2100000000 && $victimID <= 2999999999) {
            $itm["flagName"] = Info::getGroupName(Info::getGroupID($itm["typeID"]));
        } else {
            if (!isset($itm["flagName"])) {
                $itm["flagName"] = Info::getFlagName($itm["flag"]);
            }
        }
        if ($itm["flagName"] == "Infantry Modules") {
            $itm["flagName"] = "Mid Slots";
        }
        if ($itm["flagName"] == "Infantry Weapons") {
            $itm["flagName"] = "High Slots";
        }
        if ($itm["flagName"] == "Infantry Equipment") {
            $itm["flagName"] = "Low Slots";
        }
        if (!isset($itm["flag"]) || $itm["flag"] == 0) {
            if ($itm["flagName"] == "High Slots") {
                $itm["flag"] = 27;
            }
            if ($itm["flagName"] == "Mid Slots") {
                $itm["flag"] = 19;
            }
            if ($itm["flagName"] == "Low Slots") {
                $itm["flag"] = 11;
            }
        }
        $key = $itm["typeName"] . "|" . $itm["flagName"];
        if (isset($itm["flagName"])) {
            if ($itm["fittable"] && $itm["inContainer"] == 0) {
                $repeats = $itm["qtyDropped"] + $itm["qtyDestroyed"];
                $i = 0;
                while ($i < $repeats) {
                    if ($itm["flagName"] == "High Slots") {
                        high:
                        if (isset($eftarray["high"][$itm["flag"]])) {
                            $itm["flag"] = $itm["flag"] + 1;
                            goto high;
                        }
                        $eftarray["high"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"]);
                    }
                    if ($itm["flagName"] == "Mid Slots") {
                        mid:
                        if (isset($eftarray["mid"][$itm["flag"]])) {
                            $itm["flag"] = $itm["flag"] + 1;
                            goto mid;
                        }
                        $eftarray["mid"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"]);
                    }
                    if ($itm["flagName"] == "Low Slots") {
                        low:
                        if (isset($eftarray["low"][$itm["flag"]])) {
                            $itm["flag"] = $itm["flag"] + 1;
                            goto low;
                        }
                        $eftarray["low"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"]);
                    }
                    if ($itm["flagName"] == "Rigs") {
                        rigs:
                        if (isset($eftarray["rig"][$itm["flag"]])) {
                            $itm["flag"] = $itm["flag"] + 1;
                            goto rigs;
                        }
                        $eftarray["rig"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"]);
                    }
                    if ($itm["flagName"] == "SubSystems") {
                        subs:
                        if (isset($eftarray["sub"][$itm["flag"]])) {
                            $itm["flag"] = $itm["flag"] + 1;
                            goto subs;
                        }
                        $eftarray["sub"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"]);
                    }
                    $i++;
                }
            } else {
                if ($itm["flagName"] == "Drone Bay") {
                    $eftarray["drone"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"], "qty" => $itm["qtyDropped"] + $itm["qtyDestroyed"]);
                }
            }
        }
    }
    // Ammo shit
    foreach ($items as $itm) {
        if ($itm["inContainer"] == 0 && !$itm["fittable"] && isset($itm["flagName"])) {
            if ($itm["flagName"] == "High Slots") {
                // high slot ammo
                $eftarray["high"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"], "charge" => true);
            }
            if ($itm["flagName"] == "Mid Slots") {
                // mid slot ammo
                $eftarray["mid"][$itm["flag"]][] = array("typeName" => $itm["typeName"], "typeID" => $itm["typeID"], "charge" => true);
            }
        }
    }
    foreach ($eftarray as $key => $value) {
        if (sizeof($value)) {
            asort($value);
            $eftarray[$key] = $value;
        } else {
            unset($eftarray[$key]);
        }
    }
    Cache::set($md5 . "eftarray", $eftarray);
    return $eftarray;
}
예제 #10
0
    exit;
}
$statClasses = ['ships', 'isk', 'points'];
$statTypes = ['Destroyed', 'Lost'];
$ninetyDayKillID = $mdb->findField("oneWeek", "killID", [], ['killID' => 1]);
$statistics = $mdb->getCollection("statistics");
Util::out("weekly time ranks - first iteration");
$types = [];
$iter = $statistics->find();
while ($row = $iter->next()) {
    $type = $row['type'];
    $id = $row['id'];
    if ($type == 'corporationID' && $id <= 1999999) {
        continue;
    }
    if ($type == 'shipTypeID' && Info::getGroupID($id) == 29) {
        continue;
    }
    $killID = getLatestKillID($type, $id, $ninetyDayKillID);
    if ($killID < $ninetyDayKillID) {
        continue;
    }
    $types[$type] = true;
    $key = "tq:ranks:weekly:{$type}:{$today}";
    $weeklyKills = getWeekly($row['type'], $row['id'], false, $ninetyDayKillID);
    if ($weeklyKills['killIDCount'] == 0) {
        continue;
    }
    $weeklyLosses = getWeekly($row['type'], $row['id'], true, $ninetyDayKillID);
    $multi = $redis->multi();
    zAdd($multi, "{$key}:shipsDestroyed", $weeklyKills['killIDCount'], $id);
예제 #11
0
 public static function eftarray($md5, $items, $victimID = 0)
 {
     global $mdb;
     // EFT / Fitting Wheel
     $eftarray['high'] = array();
     // high
     $eftarray['mid'] = array();
     // mid
     $eftarray['low'] = array();
     // low
     $eftarray['rig'] = array();
     // rig
     $eftarray['drone'] = array();
     // drone
     $eftarray['sub'] = array();
     // sub
     $eftammo['high'] = array();
     // high ammo
     $eftammo['mid'] = array();
     // mid ammo
     foreach ($items as $itm) {
         if (!isset($itm['inContainer'])) {
             $itm['inContainer'] = 0;
         }
         if ($victimID >= 2100000000 && $victimID <= 2999999999) {
             $itm['flagName'] = Info::getInfoField('groupID', Info::getGroupID($itm['typeID']), 'name');
         } elseif (!isset($itm['flagName'])) {
             $itm['flagName'] = Info::getFlagName($itm['flag']);
         }
         if ($itm['flagName'] == 'Infantry Modules') {
             $itm['flagName'] = 'Mid Slots';
         }
         if ($itm['flagName'] == 'Infantry Weapons') {
             $itm['flagName'] = 'High Slots';
         }
         if ($itm['flagName'] == 'Infantry Equipment') {
             $itm['flagName'] = 'Low Slots';
         }
         if ($itm['flag'] == 89) {
             $slot = $mdb->findField("information", "implantSlot", ['type' => 'typeID', 'id' => (int) $itm['typeID']]);
             if ($slot <= 5 && $slot >= 1) {
                 $itm['flagName'] = 'High Slots';
                 $itm['flag'] = 27 + ($slot - 1);
             } elseif ($slot > 5 && $slot <= 10) {
                 $itm['flagName'] = 'Low Slots';
                 $itm['flag'] = 11 + ($slot - 6);
             }
             $itm['fittable'] = 1;
         }
         if (!isset($itm['flag']) || $itm['flag'] == 0) {
             if ($itm['flagName'] == 'High Slots') {
                 $itm['flag'] = 27;
             }
             if ($itm['flagName'] == 'Mid Slots') {
                 $itm['flag'] = 19;
             }
             if ($itm['flagName'] == 'Low Slots') {
                 $itm['flag'] = 11;
             }
         }
         $key = $itm['typeName'] . '|' . $itm['flagName'];
         if (isset($itm['flagName'])) {
             if ($itm['flagName'] == 'SubSystems' || $itm['fittable'] && $itm['inContainer'] == 0) {
                 // not ammo or whatever
                 $repeats = @$itm['quantityDropped'] + @$itm['quantityDestroyed'];
                 $i = 0;
                 while ($i < $repeats) {
                     if ($itm['flagName'] == 'High Slots') {
                         high:
                         if (isset($eftarray['high'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto high;
                         }
                         $eftarray['high'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'Mid Slots') {
                         mid:
                         if (isset($eftarray['mid'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto mid;
                         }
                         $eftarray['mid'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'Low Slots') {
                         low:
                         if (isset($eftarray['low'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto low;
                         }
                         $eftarray['low'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'Rigs') {
                         rigs:
                         if (isset($eftarray['rig'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto rigs;
                         }
                         $eftarray['rig'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     if ($itm['flagName'] == 'SubSystems') {
                         subs:
                         if (isset($eftarray['sub'][$itm['flag']])) {
                             $itm['flag'] = $itm['flag'] + 1;
                             goto subs;
                         }
                         $eftarray['sub'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID']);
                     }
                     ++$i;
                 }
             } else {
                 if ($itm['flagName'] == 'Drone Bay') {
                     $eftarray['drone'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'qty' => @$itm['quantityDropped'] + @$itm['quantityDestroyed']);
                 }
             }
         }
     }
     // Ammo shit
     foreach ($items as $itm) {
         if (!isset($itm['inContainer'])) {
             $itm['inContainer'] = 0;
         }
         if ($itm['inContainer'] == 0 && !$itm['fittable'] && isset($itm['flagName'])) {
             // possibly ammo
             if ($itm['flagName'] == 'High Slots') {
                 // high slot ammo
                 $eftarray['high'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'charge' => true);
             }
             if ($itm['flagName'] == 'Mid Slots') {
                 // mid slot ammo
                 $eftarray['mid'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'charge' => true);
             }
             if ($itm['flagName'] == 'Low Slots') {
                 // mid slot ammo
                 $eftarray['low'][$itm['flag']][] = array('typeName' => $itm['typeName'], 'typeID' => $itm['typeID'], 'charge' => true);
             }
         }
     }
     foreach ($eftarray as $key => $value) {
         if (sizeof($value)) {
             asort($value);
             $eftarray[$key] = $value;
         } else {
             unset($eftarray[$key]);
         }
     }
     return $eftarray;
 }
예제 #12
0
파일: Price.php 프로젝트: a-tal/zKillboard
 protected static function getFixedPrice($typeID)
 {
     // Some typeID's have hardcoded prices
     switch ($typeID) {
         case 2834:
             // Utu
         // Utu
         case 3516:
             // Malice
         // Malice
         case 11375:
             // Freki
             return 80000000000;
             // 80b
         // 80b
         case 3518:
             // Vangel
         // Vangel
         case 3514:
             // Revenant
         // Revenant
         case 32788:
             // Cambion
         // Cambion
         case 32790:
             // Etana
         // Etana
         case 32209:
             // Mimir
         // Mimir
         case 33673:
             // Whiptail
             return 100000000000;
             // 100b
         // 100b
         case 33397:
             // Chremoas
         // Chremoas
         case 35779:
             // Imp
             return 120000000000;
             // 120b
         // 120b
         case 2836:
             // Adrestia
         // Adrestia
         case 33675:
             // Chameleon
         // Chameleon
         case 35781:
             // Fiend
             return 150000000000;
             // 150b
         // 150b
         case 9860:
             // Polaris
         // Polaris
         case 11019:
             // Cockroach
             return 1000000000000;
             // 1 trillion, rare dev ships
             // Rare cruisers
         // 1 trillion, rare dev ships
         // Rare cruisers
         case 11940:
             // Gold Magnate
         // Gold Magnate
         case 11942:
             // Silver Magnate
         // Silver Magnate
         case 635:
             // Opux Luxury Yacht
         // Opux Luxury Yacht
         case 11011:
             // Guardian-Vexor
         // Guardian-Vexor
         case 25560:
             // Opux Dragoon Yacht
             return 500000000000;
             // 500b
             // Rare battleships
         // 500b
         // Rare battleships
         case 13202:
             // Megathron Federate Issue
         // Megathron Federate Issue
         case 26840:
             // Raven State Issue
         // Raven State Issue
         case 11936:
             // Apocalypse Imperial Issue
         // Apocalypse Imperial Issue
         case 11938:
             // Armageddon Imperial Issue
         // Armageddon Imperial Issue
         case 26842:
             // Tempest Tribal Issue
             return 750000000000;
             // 750b
     }
     // Some groupIDs have hardcoded prices
     $groupID = Info::getGroupID($typeID);
     switch ($groupID) {
         case 30:
             // Titans
             return 100000000000;
             // 100b
         // 100b
         case 659:
             // Supercarriers
             return 20000000000;
             // 20b
         // 20b
         case 29:
             // Capsules
             return 10000;
             // 10k
     }
     return null;
 }