Resource updates are not working properly

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Resource updates are not working properly

      Hi~

      I have modifying it to increase resource production depending on the level of the alliance.
      However, I modified it as shown below, but not many resources are produced.
      Where should I add it?

      I added the code below in class.PlanetRessUpdate.

      Check an alliance member..
      If are not an alliance member, it is 1. If are an alliance member, it is on the level value of the alliance.

      PHP Source Code: class.PlanetRessUpdate.php

      1. $allyprod = 1;
      2. $sql = 'SELECT alliance_production FROM %%ALLIANCE%% WHERE id = :allianceId;';
      3. $allyInfor = $db->selectSingle($sql, array(
      4. ':allianceId' => $this->USER['ally_id']
      5. ));
      6. if($this->USER['ally_id'] != 0){
      7. $allyprod = $allyInfor['alliance_production'];
      8. }
      And add the code below

      PHP Source Code: class.PlanetRessUpdate.php

      1. public function CreateHash() {
      2. global $reslist, $resource;
      3. $Hash = array();
      4. .
      5. .
      6. .
      7. $Hash[] = $allyprod; //added ally_prod
      8. return md5(implode("::", $Hash));
      9. }

      And add the $allyprod code below

      PHP Source Code: class.PlanetRessUpdate.php

      1. //added $allyprod
      2. $this->PLANET['metal_perhour'] = ($temp[901]['plus'] * $allyprod * (1 + $this->USER['factor']['Resource'] + 0.02 * $this->USER[$resource[131]]) * $prodLevel + $temp[901]['minus']) * $this->config->resource_multiplier;
      3. //added $allyprod
      4. $this->PLANET['crystal_perhour'] = ($temp[902]['plus'] * $allyprod * (1 + $this->USER['factor']['Resource'] + 0.02 * $this->USER[$resource[132]]) * $prodLevel + $temp[902]['minus']) * $this->config->resource_multiplier;
      5. //added $allyprod
      6. $this->PLANET['deuterium_perhour'] = ($temp[903]['plus'] * $allyprod * (1 + $this->USER['factor']['Resource'] + 0.02 * $this->USER[$resource[133]]) * $prodLevel + $temp[903]['minus']) * $this->config->resource_multiplier;
      ;( ;(
      --------------------------------------------------------------------------------------

      The post was edited 1 time, last by noonn ().

    • Esto agrégalo en public function ReBuildCache() dentro de foreach($reslist['prod'] as $ProdID)

      Source Code

      1. $allyprod = 1;
      2. $sql = 'SELECT alliance_production FROM %%ALLIANCE%% WHERE id = :allianceId;';
      3. $allyInfor = $db->selectSingle($sql, array(
      4. ':allianceId' => $this->USER['ally_id']
      5. ));
      6. if($this->USER['ally_id'] != 0){
      7. $allyprod = $allyInfor['alliance_production'];
      8. }

      Luego añade en la BD uni1_vars en production901 , production902 y production903

      Source Code

      1. metal_mine
      2. + ((750 * $BuildLevel * pow((1.1), $BuildLevel)) * (0.1 * $BuildLevelFactor) / 100 * $allyprod)
      3. crystal_mine
      4. + ((500 * $BuildLevel * pow((1.1), $BuildLevel)) * (0.1 * $BuildLevelFactor) / 100 * $allyprod)
      5. deuterium_sintetizer
      6. + ((250 * $BuildLevel * pow((1.1), $BuildLevel) * (-0.002 * $BuildTemp + 1.28) * (0.1 * $BuildLevelFactor)) / 100 * $allyprod)
      aquí es donde lo veras reflejado


      Debes borrar cache
      VERY SAD :/ :/ :/ :/
    • yamilrh wrote:

      Esto agrégalo en public function ReBuildCache() dentro de foreach($reslist['prod'] as $ProdID)

      Source Code

      1. $allyprod = 1;
      2. $sql = 'SELECT alliance_production FROM %%ALLIANCE%% WHERE id = :allianceId;';
      3. $allyInfor = $db->selectSingle($sql, array(
      4. ':allianceId' => $this->USER['ally_id']
      5. ));
      6. if($this->USER['ally_id'] != 0){
      7. $allyprod = $allyInfor['alliance_production'];
      8. }
      Luego añade en la BD uni1_vars en production901 , production902 y production903

      Source Code

      1. metal_mine
      2. + ((750 * $BuildLevel * pow((1.1), $BuildLevel)) * (0.1 * $BuildLevelFactor) / 100 * $allyprod)
      3. crystal_mine
      4. + ((500 * $BuildLevel * pow((1.1), $BuildLevel)) * (0.1 * $BuildLevelFactor) / 100 * $allyprod)
      5. deuterium_sintetizer
      6. + ((250 * $BuildLevel * pow((1.1), $BuildLevel) * (-0.002 * $BuildTemp + 1.28) * (0.1 * $BuildLevelFactor)) / 100 * $allyprod)
      aquí es donde lo veras reflejado


      Debes borrar cache




      ================


      Even though I modified it in the same way, it does not work well.
      I don't know what the problem is.
      X/ X/
      --------------------------------------------------------------------------------------