[BUG] Cancel Research

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

    • [BUG] Cancel Research

      Cuando cancelo la investigacion en proceso y con mas elementos en cola desde otra colonia y tengo elementos en cola me lanza este error

      When I cancel the investigation in process and with more elements in queue from another colony and I have elements in queue this error throws me

      Когда я отменяю расследование в процессе и с большим количеством элементов в очереди из другой колонии, и у меня есть элементы в очереди, эта ошибка выбрасывает меня

      WARNING
      Message: A non-numeric value encountered
      File: /includes/classes/class.BuildFunctions.php
      Line: 171
      URL: localhost/2moons/game.php?page=research
      PHP-Version: 7.3.8
      PHP-API: apache2handler
      XNProyect Version: 1.0.git
      Debug Backtrace:
      #0 /includes/classes/class.BuildFunctions.php(171): errorHandler(2, 'A non-numeric v...', 'C://xampp//htdocs...', 171, Array)
      #1 /includes/pages/game/ShowResearchPage.class.php(125): BuildFunctions::getBuildingTime(Array, Array, 108, Array, false, 17)
      #2 /includes/pages/game/ShowResearchPage.class.php(343): ShowResearchPage->CancelBuildingFromQueue()
      #3 /game.php(57): ShowResearchPage->show()
      #4 {main}

      Если игрок продолжает обновлять страницу «F5», ошибка остается и передает ресурсы планете, где она исследуется.
      и не отменяет расследование.

      Это доказывает, что игроки используют огромные суммы ресурсов, используя эту ошибку.
      Или оставьте в очереди только один исследовательский элемент.
      Если игрок продолжает обновлять страницу «F5», ошибка остается и передает ресурсы планете, где она исследуется.
      и не отменяет расследование
      В этом сегменте кода (строка 168-173) происходит то, что $ Levels не принимает числовое значение, оно принимает значение «лаборатория»



      If the player keeps updating the "F5" page, the error remains and gives the resources to the planet where it is being investigated.
      and does not cancel the investigation.
      This is proving that players achieve huge sums of resources by exploiting this error.
      Alternatively leave only one research element in the queue.

      In this code segment (Line 168-173) what happens is that $ Levels does not take a numerical value, it takes the value "laboratory"


      En este segmento de codigo (Linea 168 - 173) lo que sucede es que $Levels no toma un valor numerico, toma el valor "laboratory"

      PHP Source Code: class.BuildFunctions.php

      1. foreach($PLANET[$resource[31].'_inter'] as $Levels)
      2. {
      3. if(!isset($requeriments[$Element][31]) || $Levels >= $requeriments[$Element][31])
      4. $Level += $Levels;
      5. }
    • very old bag
      try in ShowResearchPage.class.php
      change

      PHP Source Code

      1. $sql = "SELECT :resource6, :resource31, id FROM %%PLANETS%% WHERE id = :id;";
      2. $CPLANET = $db->selectSingle($sql, array(
      3. ':resource6' => $resource[6],
      4. ':resource31' => $resource[31],
      5. ':id' => $ListIDArray[4]
      6. ));
      to

      PHP Source Code

      1. $sql = "SELECT ".$resource[6].", ".$resource[31].", id FROM %%PLANETS%% WHERE id = :id;";
      2. $CPLANET = $db->selectSingle($sql, array(
      3. ':id' => $ListIDArray[4]
      4. ));
    • It was very simple. It worked.
      But as soon as you notice changes, you only removed the SELECT parameters from the array and put them directly in the query.

      Fue muy sencillo. Funciono.
      Pero apenas note cambios, solo eliminaste los parametros del SELECT del array y los pusiste directamente en la query.
    • Similar case happens with buildings.


      When I cancel an intermediate element of the queue this happens:


      WARNING
      Message: DateTime::setTimestamp() expects parameter 1 to be int, float given

      File: /includes/GeneralFunctions.php

      Line: 143

      URL: localhost/2moons/game.php?page=buildings

      PHP-Version: 7.3.8

      PHP-API: apache2handler

      XNProyect Version: 1.0.git

      Debug Backtrace:
      #0 [internal function]: errorHandler(2, 'DateTime::setTi...', 'C://xampp//htdocs...', 143, Array)

      #1 /includes/GeneralFunctions.php(143): DateTime->setTimestamp(1.2732805782875E+203)

      #2 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 1.2732805782875E+203, 'Europe/Berlin')

      #3 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()

      #4 /game.php(57): ShowBuildingsPage->show()

      #5 {main}


      But if I cancel the queue, one by one, from last to first everything works fine.
    • keep throwing error

      [04-Jan-2020 14:54:17] WARNING: "date() expects parameter 2 to be integer, float given"
      File: /srv/www/www.xnproyect.nat.cu/htdocs/includes/GeneralFunctions.php | Line: 120
      URL: xnproyect.nat.cu/game.php?page=buildings | Version: 2.3.git
      Stack trace:
      #0 [internal function]: errorHandler(2, 'date() expects ...', '/srv/www/www.xn...', 120, Array)
      #1 /includes/GeneralFunctions.php(120): date('w', 2.7716768920774E+227)
      #2 /includes/GeneralFunctions.php(159): locale_date_format('U', 2.7716768920774E+227, Object(Language))
      #3 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 2.7716768920774E+227, 'America/Havana')
      #4 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
      #5 /game.php(58): ShowBuildingsPage->show()
      #6 {main}
    • у вас нет поддержки php 7.8 ... смените версию на 7.2 или 7.1 движок не поддерживает выше .7.2 надо дописывать код
      Делаю качественно в сроки! на любой версии moons, встрою, или напишу любой мод , но дорого! afire-space.com
    • Skylon wrote:

      keep throwing error

      [04-Jan-2020 14:54:17] WARNING: "date() expects parameter 2 to be integer, float given"
      File: /srv/www/www.xnproyect.nat.cu/htdocs/includes/GeneralFunctions.php | Line: 120
      URL: xnproyect.nat.cu/game.php?page=buildings | Version: 2.3.git
      Stack trace:
      #0 [internal function]: errorHandler(2, 'date() expects ...', '/srv/www/www.xn...', 120, Array)
      #1 /includes/GeneralFunctions.php(120): date('w', 2.7716768920774E+227)
      #2 /includes/GeneralFunctions.php(159): locale_date_format('U', 2.7716768920774E+227, Object(Language))
      #3 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 2.7716768920774E+227, 'America/Havana')
      #4 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
      #5 /game.php(58): ShowBuildingsPage->show()
      #6 {main}

      PHP Source Code

      1. return date($format, $time);
      to

      PHP Source Code

      1. return date($format, (int)$time);
    • PHP Source Code: GeneralFunctions.php

      1. if(isset($toTimeZone))
      2. {
      3. $date = new DateTime();
      4. if(method_exists($date, 'setTimestamp'))
      5. { // PHP > 5.3
      6. $date->setTimestamp((int) $time);
      7. } else {
      8. // PHP < 5.3
      9. $tempDate = getdate((int) $time);
      10. $date->setDate($tempDate['year'], $tempDate['mon'], $tempDate['mday']);
      11. $date->setTime($tempDate['hours'], $tempDate['minutes'], $tempDate['seconds']);
      12. }
      13. $time -= $date->getOffset();
      14. try {
      15. $date->setTimezone(new DateTimeZone($toTimeZone));
      16. } catch (Exception $e) {
      17. }
      18. $time += $date->getOffset();
      19. }
      20. $format = locale_date_format($format, $time, $LNG);
      21. return date($format, (int)$time);
      Display All
      Sigue devolviendo el error cuando cancelas una estructura y no te deja ver las edificios

      PHP Source Code

      1. Message: date() expects parameter 2 to be integer, float given
      2. File: /includes/GeneralFunctions.php
      3. Line: 121
      4. URL: https://dominio/game.php?page=buildings
      5. PHP-Version: 7.2.24
      6. PHP-API: fpm-fcgi
      7. 2Moons Version: 2.0.git
      8. Debug Backtrace:
      9. #0 [internal function]: errorHandler(2, 'date() expects ...', 'FILEPATH ...', 121, Array)
      10. #1 /includes/GeneralFunctions.php(121): date('w', 7.2887436334772E+222)
      11. #2 /includes/GeneralFunctions.php(160): locale_date_format('U', 7.2887436334772E+222, Object(Language))
      12. #3 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 7.2887436334772E+222, 'America/Havana')
      13. #4 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
      14. #5 /game.php(57): ShowBuildingsPage->show()
      15. #6 {main}
      Display All
      VERY SAD :/ :/ :/ :/
    • yamilrh wrote:

      PHP Source Code: GeneralFunctions.php

      1. if(isset($toTimeZone))
      2. {
      3. $date = new DateTime();
      4. if(method_exists($date, 'setTimestamp'))
      5. { // PHP > 5.3
      6. $date->setTimestamp((int) $time);
      7. } else {
      8. // PHP < 5.3
      9. $tempDate = getdate((int) $time);
      10. $date->setDate($tempDate['year'], $tempDate['mon'], $tempDate['mday']);
      11. $date->setTime($tempDate['hours'], $tempDate['minutes'], $tempDate['seconds']);
      12. }
      13. $time -= $date->getOffset();
      14. try {
      15. $date->setTimezone(new DateTimeZone($toTimeZone));
      16. } catch (Exception $e) {
      17. }
      18. $time += $date->getOffset();
      19. }
      20. $format = locale_date_format($format, $time, $LNG);
      21. return date($format, (int)$time);
      Display All
      Sigue devolviendo el error cuando cancelas una estructura y no te deja ver las edificios

      PHP Source Code

      1. Message: date() expects parameter 2 to be integer, float given
      2. File: /includes/GeneralFunctions.php
      3. Line: 121
      4. URL: https://dominio/game.php?page=buildings
      5. PHP-Version: 7.2.24
      6. PHP-API: fpm-fcgi
      7. 2Moons Version: 2.0.git
      8. Debug Backtrace:
      9. #0 [internal function]: errorHandler(2, 'date() expects ...', 'FILEPATH ...', 121, Array)
      10. #1 /includes/GeneralFunctions.php(121): date('w', 7.2887436334772E+222)
      11. #2 /includes/GeneralFunctions.php(160): locale_date_format('U', 7.2887436334772E+222, Object(Language))
      12. #3 /includes/pages/game/ShowBuildingsPage.class.php(231): _date('U', 7.2887436334772E+222, 'America/Havana')
      13. #4 /includes/pages/game/ShowBuildingsPage.class.php(271): ShowBuildingsPage->getQueueData()
      14. #5 /game.php(57): ShowBuildingsPage->show()
      15. #6 {main}
      Display All
      in locale_date_format func also add (int) before $time in date func