error to the enter the game

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

    • error to the enter the game

      Good I have the following error that I do not know because it is happening to me because I downloaded the original 2moons 2.0 game and it lets me install it and enter the admin panel, but when I enter to play with the user, it gives me the following error.
      PD: Excuse me for the English is that I use the google translator

      Source Code

      1. Fatal error: Uncaught ErrorException: Undefined offset: 8192 in C:\xampp\htdocs\xnova\includes\GeneralFunctions.php:506 Stack trace: #0 C:\xampp\htdocs\xnova\includes\GeneralFunctions.php(506): errorHandler(8, 'Undefined offse...', 'C:\\xampp\\htdocs...', 506, Array) #1 [internal function]: exceptionHandler(Object(ErrorException)) #2 {main} thrown in C:\xampp\htdocs\xnova\includes\GeneralFunctions.php on line 506
    • this means that the type of error is not defined
      put this in includes\GeneralFunctions.php line 474

      PHP Source Code: includes\GeneralFunctions.php

      1. if(!isset($errorType[$errno])){
      2. $errorType[$errno] = $errno;
      3. }
      this does not solve your problem, but it will give you a correct errormessage so you can find the error.
    • Source Code

      1. Message: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated
      2. File: /includes/pages/game/AbstractGamePage.class.php
      3. Line: 161
      4. URL: http://localhost/xnova/game.php
      5. PHP-Version: 7.3.5
      6. PHP-API: apache2handler
      7. 2Moons Version: 2.0.0
      8. Debug Backtrace:
      9. #0 [internal function]: errorHandler(8192, 'filter_var(): e...', 'C://xampp//htdocs...', 161, Array)
      10. #1 /includes/pages/game/AbstractGamePage.class.php(161): filter_var('http://2moons.d...', 273, 65536)
      11. #2 /includes/pages/game/AbstractGamePage.class.php(175): AbstractGamePage->getNavigationData()
      12. #3 /includes/pages/game/AbstractGamePage.class.php(245): AbstractGamePage->getPageData()
      13. #4 /includes/pages/game/ShowOverviewPage.class.php(307): AbstractGamePage->display('page.overview.d...')
      14. #5 /game.php(57): ShowOverviewPage->show()
      15. #6 {main}
      Display All
    • @mimikri I was checking and in the administration panel when I gave the news I got the following error

      Source Code

      1. Message: count(): Parameter must be an array or an object that implements Countable
      2. File: /includes/pages/adm/ShowNewsPage.php
      3. Line: 68
      4. URL: http://localhost/xnova/admin.php?page=news
      5. PHP-Version: 7.3.5
      6. PHP-API: apache2handler
      7. 2Moons Version: 2.0.git
      8. Debug Backtrace:
      9. #0 /includes/pages/adm/ShowNewsPage.php(68): errorHandler(2, 'count(): Parame...', 'C://xampp//htdocs...', 68, Array)
      10. #1 /admin.php(151): ShowNewsPage()
      11. #2 {main}
      Display All
    • Write news in ACP


      it's cause of your php version
      the command 'count' has been changed
      in php < 7 count gave back 0 if array/object was not defined, now it throws an error

      you have tor replace all occurences of count()

      in this case change:

      Source Code

      1. count($NewsList)
      into

      Source Code

      1. isset($NewsList) ? count($NewsList) : 0
    • !isset($NewsList) ? count($NewsList) : 0)
      this means: if $NewsList is not set -> use $NewsList else use 0
      this can not work

      use this
      'nws_total' => sprintf($LNG['nws_total'], (isset($NewsList) ? count($NewsList) : 0)),
      or this
      'nws_total' => sprintf($LNG['nws_total'], (!isset($NewsList) ? 0 : count($NewsList) )),
      or this
      'nws_total' => sprintf($LNG['nws_total'], is_array($NewsList) ? count($NewsList) : 0),
    • Для PHP-Version: 7.3.5
      Открываем файл GeneralFunctions.php

      Находим этот код

      $errorType = array(
      E_ERROR => 'ERROR',
      E_WARNING => 'WARNING',
      E_PARSE => 'PARSING ERROR',
      E_NOTICE => 'NOTICE',
      E_CORE_ERROR => 'CORE ERROR',
      E_CORE_WARNING => 'CORE WARNING',
      E_COMPILE_ERROR => 'COMPILE ERROR',
      E_COMPILE_WARNING => 'COMPILE WARNING',
      E_USER_ERROR => 'USER ERROR',
      E_USER_WARNING => 'USER WARNING',
      E_USER_NOTICE => 'USER NOTICE',
      E_STRICT => 'STRICT NOTICE',
      E_RECOVERABLE_ERROR => 'RECOVERABLE ERROR'
      );

      дописываем E_DEPRECATED => 'DEPRECATED'

      далее открываем файл AbstractGamePage.class.php

      Находим этот код

      'hasBoard' => filter_var($config->forum_url, FILTER_VALIDATE_URL, FILTER_FLAG_SCHEME_REQUIRED)

      и меняем на это

      'hasBoard' => filter_var($config->forum_url, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED | FILTER_FLAG_QUERY_REQUIRED)