本文整理汇总了PHP中Info::getInfoField方法的典型用法代码示例。如果您正苦于以下问题:PHP Info::getInfoField方法的具体用法?PHP Info::getInfoField怎么用?PHP Info::getInfoField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Info
的用法示例。
在下文中一共展示了Info::getInfoField方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getWarInfo
public static function getWarInfo($warID)
{
global $mdb;
$warInfo = array();
if ($warID == null) {
return $warInfo;
}
$warInfo = $mdb->findDoc('information', ['type' => 'warID', 'id' => $warID]);
if (!isset($warInfo['aggressor'])) {
return [];
}
$warInfo['warID'] = $warID;
$agr = $warInfo['aggressor']['id'];
$agrIsAlliance = self::isAlliance($agr);
$agrName = $agrIsAlliance ? Info::getInfoField('allianceID', $agr, 'name') : Info::getInfoField('corporationID', $agr, 'name');
$warInfo['agrName'] = $agrName;
$warInfo['agrLink'] = ($agrIsAlliance ? '/alliance/' : '/corporation/') . "{$agr}/";
$dfd = $warInfo['defender']['id'];
$dfdIsAlliance = self::isAlliance($dfd);
$dfdName = $dfdIsAlliance ? Info::getInfoField('allianceID', $dfd, 'name') : Info::getInfoField('corporationID', $dfd, 'name');
$warInfo['dfdName'] = $dfdName;
$warInfo['dfdLink'] = ($dfdIsAlliance ? '/alliance/' : '/corporation/') . "{$dfd}/";
$warInfo['dscr'] = "{$agrName} vs {$dfdName}";
return $warInfo;
}
示例2: getInvolved
private static function getInvolved(&$kills, $team)
{
$involved = array();
foreach ($kills as $kill) {
$kill = self::$killstorage[$kill['victim']['killID']];
$attackers = $kill['involved'];
array_shift($attackers);
if (is_array($attackers)) {
foreach ($attackers as $entry) {
$add = false;
if (in_array(@$entry['allianceID'], $team)) {
$add = true;
}
if (in_array(@$entry['corporationID'], $team)) {
$add = true;
}
if ($add) {
$key = @$entry['characterID'] . ':' . @$entry['corporationID'] . ':' . @$entry['allianceID'] . ':' . @$entry['shipTypeID'];
$entry['shipName'] = Info::getInfoField('typeID', @$entry['shipTypeID'], 'name');
if (!in_array($key, $involved)) {
$involved[$key] = $entry;
}
}
}
}
}
return $involved;
}
示例3: saveFitting
public static function saveFitting($killID)
{
global $mdb;
$killmail = $mdb->findDoc('rawmails', ['killID' => (int) $killID]);
$victim = $killmail['victim'];
header('Content-Type: application/json');
$export = [];
$export['name'] = @$victim['character']['name'] . "'s " . $victim['shipType']['name'];
$export['description'] = "Imported from https://zkillboard.com/kill/{$killID}/";
$export['ship'] = ['id' => $victim['shipType']['id']];
$export['ship']['name'] = Info::getInfoField('typeID', $victim['shipType']['id'], 'name');
$export['ship']['href'] = "https://public-crest.eveonline.com/types/" . $victim['shipType']['id'] . "/";
$items = $victim['items'];
$export['items'] = [];
foreach ($items as $item) {
$flag = $item['flag'];
if (!self::isFit($flag)) {
continue;
}
$nextItem = [];
$nextItem['flag'] = $flag;
$nextItem['quantity'] = @$item['quantityDropped'] + @$item['quantityDestroyed'];
$nextItem['type']['id'] = $item['itemType']['id'];
$nextItem['type']['name'] = Info::getInfoField('typeID', $item['itemType']['id'], 'name');
$nextItem['type']['href'] = "https://public-crest.eveonline.com/types/" . $item['itemType']['id'] . "/";
$export['items'][] = $nextItem;
}
if (sizeof($export['items']) == 0) {
return ['message' => 'Cannot save this fit, no hardware.'];
}
$decode = CrestSSO::crestGet("https://crest-tq.eveonline.com/decode/");
if (isset($decode['message'])) {
return $decode;
}
$character = CrestSSO::crestGet($decode['character']['href']);
$result = CrestSSO::crestPost($character['fittings']['href'], $export);
if ($result['httpCode'] == 201) {
return ['message' => "Fit successfully saved to your character's fittings."];
}
return $result;
}
示例4: getGroupID
/**
* [getGroupID description].
*
* @param int $id
*
* @return int
*/
public static function getGroupID($id)
{
return Info::getInfoField('typeID', $id, 'groupID');
}
示例5: addItems
public static function addItems(&$itemArray, $items, $killTime, $inContainer = 0, $parentFlag = 0)
{
if ($items == null) {
return;
}
if (is_array($items)) {
foreach ($items as $item) {
$typeID = $item['itemType']['id'];
$item['typeID'] = $typeID;
$item['price'] = Price::getItemPrice($typeID, $killTime);
$item['inContainer'] = $inContainer;
if ($inContainer) {
$item['flag'] = $parentFlag;
}
if ($inContainer && strpos(Info::getInfoField('typeID', $typeID, 'name'), 'Blueprint')) {
$item['singleton'] = 2;
}
unset($item['_stringValue']);
$itemArray[] = $item;
$subItems = isset($item['items']) ? $item['items'] : null;
unset($item['items']);
if ($subItems != null) {
self::addItems($itemArray, $subItems, $killTime, 1, $item['flag']);
}
}
}
}
示例6: strtolower
case 'warID':
continue;
case 'corporationID':
$flag = @$entity['ticker'];
break;
case 'allianceID':
$flag = @$entity['ticker'];
break;
case 'typeID':
if ($mdb->exists('killmails', ['involved.shipTypeID' => $id])) {
$flag = strtolower($name);
}
if (@$entity['published'] != true && $flag == '') {
continue;
}
$isShip = $flag != '';
break;
case 'solarSystemID':
$regionID = Info::getInfoField('solarSystemID', $id, 'regionID');
$regionName = Info::getInfoField('regionID', $regionID, 'name');
$name = "{$name} ({$regionName})";
break;
}
if (!$isShip) {
$redis->zAdd("search:{$type}", 0, strtolower($name) . "{$id}");
}
if (strlen($flag) > 0) {
$redis->zAdd("search:{$type}:flag", 0, strtolower("{$flag}{$id}"));
}
}
$redis->setex($key, 3600, true);
示例7: eftarray
public static function eftarray($md5, $items, $victimID = 0)
{
// 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 = 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['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:
//.........这里部分代码省略.........