当前位置: 首页>>代码示例>>PHP>>正文


PHP ResourceUpdate::SavePlanetToDb方法代码示例

本文整理汇总了PHP中ResourceUpdate::SavePlanetToDb方法的典型用法代码示例。如果您正苦于以下问题:PHP ResourceUpdate::SavePlanetToDb方法的具体用法?PHP ResourceUpdate::SavePlanetToDb怎么用?PHP ResourceUpdate::SavePlanetToDb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ResourceUpdate的用法示例。


在下文中一共展示了ResourceUpdate::SavePlanetToDb方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 function show()
 {
     global $USER, $PLANET, $LNG, $LANG, $CONF, $UNI;
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDb();
     $this->tplObj->assign_vars(array());
     $this->display('page.planetjump.default.tpl');
 }
开发者ID:fuding,项目名称:Antaris,代码行数:9,代码来源:class.ShowJumpspecialPage.php

示例2: show

 function show()
 {
     global $LNG, $UNI, $ProdGrid, $resource, $reslist, $CONF, $pricelist, $USER, $PLANET;
     $PlanetRess = new ResourceUpdate();
     $PlanetRess->CalcResource();
     $PlanetRess->SavePlanetToDb();
     if ($USER['urlaubs_modus'] == 1) {
         $basicIncome[901] = 0;
         $basicIncome[902] = 0;
         $basicIncome[903] = 0;
         $basicIncome[911] = 0;
     } else {
         $basicIncome[901] = Config::get($resource[901] . '_basic_income');
         $basicIncome[902] = Config::get($resource[902] . '_basic_income');
         $basicIncome[903] = Config::get($resource[903] . '_basic_income');
         $basicIncome[911] = Config::get($resource[911] . '_basic_income');
     }
     $temp = array(901 => array('plus' => 0, 'minus' => 0), 902 => array('plus' => 0, 'minus' => 0), 903 => array('plus' => 0, 'minus' => 0), 911 => array('plus' => 0, 'minus' => 0));
     $BuildTemp = $PLANET['temp_max'];
     $BuildEnergy = $USER[$resource[113]];
     $ressIDs = array_merge(array(), $reslist['resstype'][1], $reslist['resstype'][2]);
     if ($PLANET['energy_used'] != 0) {
         $prodLevel = min(1, $PLANET['energy'] / abs($PLANET['energy_used']));
     } else {
         $prodLevel = 0;
     }
     foreach ($reslist['prod'] as $ProdID) {
         $BuildLevelFactor = $PLANET[$resource[$ProdID] . '_porcent'];
         $BuildLevel = $PLANET[$resource[$ProdID]];
         $premium_resource = 0;
         $peacefull_resource = 0;
         if ($USER['premium_reward_extraction'] > 0 && $USER['premium_reward_extraction_days'] > TIMESTAMP) {
             $premium_resource = $USER['premium_reward_extraction'];
         }
         $premium_resource = $premium_resource;
         if ($USER['experience_peace_level'] > 0) {
             $peacefull_resource = $USER['experience_peace_level'];
         }
         $peacefull_resource = $peacefull_resource;
         $academy_mines = 0;
         if ($USER['academy_1201'] > 0) {
             $academy_mines = getbonusOneBis(1201, $USER['academy_1201']);
         }
         $academy_mines = $academy_mines;
         $daily_prod_bonus = 0;
         if ($USER['daily_produ'] > TIMESTAMP) {
             $daily_prod_bonus = 30;
         }
         $daily_prod_bonus = $daily_prod_bonus;
         $academy_energy = 0;
         if ($USER['academy_1202'] > 0) {
             $academy_energy = getbonusOneBis(1202, $USER['academy_1202']);
         }
         $academy_energy = $academy_energy;
         $academy_fusion = 0;
         if ($USER['academy_1209'] > 0) {
             $academy_fusion = getbonusOneBis(1209, $USER['academy_1209']);
         }
         $academy_fusion = $academy_fusion;
         $academy_solar = 0;
         if ($USER['academy_1210'] > 0) {
             $academy_solar = getbonusOneBis(1210, $USER['academy_1210']);
         }
         $academy_solar = $academy_solar;
         $combat_collider = 0;
         if ($USER['combat_reward_collider'] > 0) {
             $combat_collider = $USER['combat_reward_collider'];
         }
         $combat_collider = $combat_collider;
         $allyInfo = $GLOBALS['DATABASE']->query("SELECT alliance_prod FROM `uni1_alliance` WHERE id = " . $USER['ally_id'] . ";");
         $allyInfo = $GLOBALS['DATABASE']->fetch_array($allyInfo);
         $alliance_prod = 0;
         if ($allyInfo['alliance_prod'] > 0) {
             $alliance_prod = $allyInfo['alliance_prod'];
         }
         $alliance_prod = $alliance_prod;
         $productionList[$ProdID] = array('production' => array(901 => 0, 902 => 0, 903 => 0, 911 => 0), 'elementLevel' => $PLANET[$resource[$ProdID]], 'prodLevel' => $PLANET[$resource[$ProdID] . '_porcent']);
         foreach ($ressIDs as $ID) {
             if (!isset($ProdGrid[$ProdID]['production'][$ID])) {
                 continue;
             }
             $Production = eval(ResourceUpdate::getProd($ProdGrid[$ProdID]['production'][$ID]));
             if ($ID != 911) {
                 $Production *= $prodLevel * Config::get('resource_multiplier');
             } else {
                 $Production *= Config::get('energySpeed');
             }
             $productionList[$ProdID]['production'][$ID] = $Production;
             if ($Production > 0) {
                 if ($PLANET[$resource[$ID]] == 0) {
                     continue;
                 }
                 $temp[$ID]['plus'] += $Production;
             } else {
                 $temp[$ID]['minus'] += $Production;
             }
         }
     }
     $storage = array(901 => shortly_number($PLANET[$resource[901] . '_max']), 902 => shortly_number($PLANET[$resource[902] . '_max']), 903 => shortly_number($PLANET[$resource[903] . '_max']));
     $basicProduction = array(901 => $basicIncome[901] * Config::get('resource_multiplier'), 902 => $basicIncome[902] * Config::get('resource_multiplier'), 903 => $basicIncome[903] * Config::get('resource_multiplier'), 911 => $basicIncome[911] * Config::get('energySpeed'));
//.........这里部分代码省略.........
开发者ID:Decoder1978,项目名称:Xterium,代码行数:101,代码来源:class.ShowResourcesPage.php


注:本文中的ResourceUpdate::SavePlanetToDb方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。