[BUG] Closed game error

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

    • [BUG] Closed game error

      While the game is closed, and I'm logged on regular user account (non-admin account) error appears:

      Message: Undefined index: PLANETS
      File: /includes/pages/game/AbstractGamePage.class.php
      Line: 106
      URL: http:/******.pl/game.php
      PHP-Version: 7.2.14
      PHP-API: uwsgi
      2Moons Version: 2.0.git
      Debug Backtrace:
      #0 /includes/pages/game/AbstractGamePage.class.php(106): errorHandler(8, 'Undefined index...', '/includes/pages...', 106, Array)
      #1 /includes/pages/game/AbstractGamePage.class.php(175): AbstractGamePage->getNavigationData()
      #2 /includes/pages/game/AbstractGamePage.class.php(245): AbstractGamePage->getPageData()
      #3 /includes/pages/game/AbstractGamePage.class.php(226): AbstractGamePage->display('error.default.t...')
      #4 /includes/pages/game/ShowErrorPage.class.php(34): AbstractGamePage->printMessage('Gra chwilowo ni...', false, NULL)
      #5 /includes/common.php(155): ShowErrorPage::printError('Gra chwilowo ni...', false)
      #6 /game.php(24): require('/includes/commo...')
      #7 {main}

      any solution?
    • try change

      PHP Source Code: AbstractGamePage.class.php

      1. if(isset($USER['PLANETS'])) {
      2. $USER['PLANETS'] = getPlanets($USER);
      3. }
      to


      PHP Source Code

      1. if(!isset($USER['PLANETS'])) {
      2. $USER['PLANETS'] = getPlanets($USER);
      3. }
    • Kaizoku wrote:

      try change

      PHP Source Code: AbstractGamePage.class.php

      1. if(isset($USER['PLANETS'])) {
      2. $USER['PLANETS'] = getPlanets($USER);
      3. }
      to


      PHP Source Code

      1. if(!isset($USER['PLANETS'])) {
      2. $USER['PLANETS'] = getPlanets($USER);
      3. }
      Now I have something like this

      NOTICE
      Message: Undefined index: used
      File: /cache/templates/pl^007796ca5e8d634b46740c4f9047ed935becb88f.error.default.tpl.php
      Line: 318
      URL: http:/*******.pl/game.php
      PHP-Version: 7.2.14
      PHP-API: uwsgi
      2Moons Version: 2.0.git
      Debug Backtrace:
      #0 /cache/templates/pl^007796ca5e8d634b46740c4f9047ed935becb88f.error.default.tpl.php(318): errorHandler(8, 'Undefined index...', '/cache/template...', 318, Array)
      #1 /includes/libs/Smarty/sysplugins/smarty_template_resource_base.php(128): content_5cab788de38e62_45632161(Object(Smarty_Internal_Template))
      #2 /includes/libs/Smarty/sysplugins/smarty_template_cached.php(136): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template))
      #3 /includes/libs/Smarty/sysplugins/smarty_internal_template.php(179): Smarty_Template_Cached->render(Object(Smarty_Internal_Template), false)
      #4 /includes/libs/Smarty/sysplugins/smarty_internal_templatebase.php(199): Smarty_Internal_Template->render(false, 1)
      #5 /includes/libs/Smarty/sysplugins/smarty_internal_templatebase.php(114): Smarty_Internal_TemplateBase->_execute(Object(Smarty_Internal_Template), NULL, NULL, NULL, 1)
      #6 /includes/classes/class.template.php(137): Smarty_Internal_TemplateBase->display('extends:layout....')
      #7 /includes/pages/game/AbstractGamePage.class.php(261): template->display('extends:layout....')
      #8 /includes/pages/game/AbstractGamePage.class.php(226): AbstractGamePage->display('error.default.t...')
      #9 /includes/pages/game/ShowErrorPage.class.php(34): AbstractGamePage->printMessage('Gra chwilowo ni...', false, NULL)
      #10 /includes/common.php(155): ShowErrorPage::printError('Gra chwilowo ni...', false)
      #11 /game.php(24): require('/includes/commo...')
      #12 {main}
    • Kaizoku wrote:

      or your game is closed? and only admin can login
      Yeah, that's the mode where only admin can login, but regular user should see a message with w reason why game is closed instead of that an error is displayed :/ Every user got a planet
    • in ShowErrorPage.class.php
      change

      PHP Source Code

      1. function __construct()
      2. {
      3. parent::__construct();
      4. $this->initTemplate();
      5. }
      to



      PHP Source Code

      1. function __construct()
      2. {
      3. parent::__construct();
      4. $this->setWindow('popup');
      5. $this->initTemplate();
      6. }
    • Kaizoku wrote:

      in ShowErrorPage.class.php
      change

      PHP Source Code

      1. function __construct()
      2. {
      3. parent::__construct();
      4. $this->initTemplate();
      5. }
      to



      PHP Source Code

      1. function __construct()
      2. {
      3. parent::__construct();
      4. $this->setWindow('popup');
      5. $this->initTemplate();
      6. }
      Fixed! Thanks a lot! :)