Undefined offset: 502

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

  • Undefined offset: 502

    Ich brauche nochmal eure hilfe .....
    wie vermeide ich den o.g. Fehler ?

    [29-Sep-2017 15:19:09] NOTICE: "Undefined offset: 502"
    File: /var/www/virtual/***********/htdocs/includes/libs/Smarty/sysplugins/smarty_internal_templatebase.php(252) : eval()'d code | Line: 498
    URL: http://***********/game.php?page=raport&mode=battlehall&raport=905712b9614996feed6ddcfca1198774 | Version: V 1.0
    Stack trace:
    #0 /includes/libs/Smarty/sysplugins/smarty_internal_templatebase.php(252) : eval()'d code(498): errorHandler(8, 'Undefined offse...', '/var/www/virtua...', 498, Array)
    #1 /includes/libs/Smarty/sysplugins/smarty_internal_templatebase.php(252): eval()
    #2 /includes/libs/Smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('extends:layout....', NULL, NULL, NULL, true)
    #3 /includes/classes/class.template.php(142): Smarty_Internal_TemplateBase->display('extends:layout....')
    #4 /includes/pages/game/class.AbstractPage.php(1121): template->display('extends:layout....')
    #5 /includes/pages/game/class.ShowRaportPage.php(130): AbstractPage->display('shared.mission....')
    #6 /game.php(40): ShowRaportPage->battlehall()
    #7 {main}


    ************* <- = meine URL

    den Fehler bekomme ich wenn ich von der BattleHall den KB aufrufen möchte

    meine class.ShowRaportPage.php sieht so aus

    PHP Source Code

    1. <?php
    2. class ShowRaportPage extends AbstractPage
    3. {
    4. public static $requireModule = 0;
    5. protected $disableEcoSystem = true;
    6. function __construct()
    7. {
    8. parent::__construct();
    9. }
    10. private function BCWrapperPreRev2321($CombatRaport)
    11. {
    12. if(isset($CombatRaport['moon']['desfail']))
    13. {
    14. $CombatRaport['moon'] = array(
    15. 'moonName' => $CombatRaport['moon']['name'],
    16. 'moonChance' => $CombatRaport['moon']['chance'],
    17. 'moonDestroySuccess' => !$CombatRaport['moon']['desfail'],
    18. 'fleetDestroyChance' => $CombatRaport['moon']['chance2'],
    19. 'fleetDestroySuccess' => !$CombatRaport['moon']['fleetfail']
    20. );
    21. }
    22. elseif(isset($CombatRaport['moon'][0]))
    23. {
    24. $CombatRaport['moon'] = array(
    25. 'moonName' => $CombatRaport['moon'][1],
    26. 'moonChance' => $CombatRaport['moon'][0],
    27. 'moonDestroySuccess' => !$CombatRaport['moon'][2],
    28. 'fleetDestroyChance' => $CombatRaport['moon'][3],
    29. 'fleetDestroySuccess' => !$CombatRaport['moon'][4]
    30. );
    31. }
    32. if(isset($CombatRaport['simu']))
    33. {
    34. $CombatRaport['additionalInfo'] = $CombatRaport['simu'];
    35. }
    36. if(isset($CombatRaport['debris'][0]))
    37. {
    38. $CombatRaport['debris'] = array(
    39. 901 => $CombatRaport['debris'][0],
    40. 902 => $CombatRaport['debris'][1]
    41. );
    42. }
    43. if (!empty($CombatRaport['steal']['metal']))
    44. {
    45. $CombatRaport['steal'] = array(
    46. 901 => $CombatRaport['steal']['metal'],
    47. 902 => $CombatRaport['steal']['crystal'],
    48. 903 => $CombatRaport['steal']['deuterium']
    49. );
    50. }
    51. return $CombatRaport;
    52. }
    53. function battlehall()
    54. {
    55. global $LNG, $USER;
    56. $LNG->includeData(array('FLEET'));
    57. $this->setWindow('popup');
    58. $RID = HTTP::_GP('raport', '');
    59. $Raport = $GLOBALS['DATABASE']->getFirstRow("SELECT
    60. raport, time,
    61. (
    62. SELECT
    63. GROUP_CONCAT(username SEPARATOR ' • ') as attacker
    64. FROM ".USERS."
    65. WHERE id IN (SELECT uid FROM ".TOPKB_USERS." WHERE ".TOPKB_USERS.".rid = ".RW.".rid AND role = 1)
    66. ) as attacker,
    67. (
    68. SELECT
    69. GROUP_CONCAT(username SEPARATOR ' • ') as defender
    70. FROM ".USERS."
    71. WHERE id IN (SELECT uid FROM ".TOPKB_USERS." WHERE ".TOPKB_USERS.".rid = ".RW.".rid AND role = 2)
    72. ) as defender
    73. FROM ".RW."
    74. WHERE rid = '".$GLOBALS['DATABASE']->escape($RID)."';");
    75. $Info = array($Raport["attacker"], $Raport["defender"]);
    76. if(!isset($Raport)) {
    77. $this->printMessage($LNG['sys_raport_not_found']);
    78. }
    79. $CombatRaport = unserialize($Raport['raport']);
    80. $CombatRaport['time'] = _date($LNG['php_tdformat'], $CombatRaport['time'], $USER['timezone']);
    81. $CombatRaport = $this->BCWrapperPreRev2321($CombatRaport);
    82. $this->tplObj->assign_vars(array(
    83. 'Raport' => $CombatRaport,
    84. 'Info' => $Info,
    85. 'pageTitle' => $LNG['lm_topkb']
    86. ));
    87. $this->display('shared.mission.raportbis.tpl');
    88. }
    89. function show()
    90. {
    91. global $LNG, $USER;
    92. $LNG->includeData(array('FLEET'));
    93. $this->setWindow('popup');
    94. $RID = HTTP::_GP('raport', '');
    95. $raportData = $GLOBALS['DATABASE']->getFirstRow("SELECT raport,attacker,defender FROM ".RW." WHERE rid = '".$GLOBALS['DATABASE']->escape($RID)."';");
    96. if(empty($raportData)) {
    97. $this->printMessage($LNG['sys_raport_not_found']);
    98. }
    99. // empty is BC for pre r2484
    100. $isAttacker = empty($raportData['attacker']) || in_array($USER['id'], explode(",", $raportData['attacker']));
    101. $isDefender = empty($raportData['defender']) || in_array($USER['id'], explode(",", $raportData['defender']));
    102. if(empty($raportData) || (!$isAttacker && !$isDefender && !$USER['authlevel'] == 3)) {
    103. $this->printMessage($LNG['sys_raport_not_found']);
    104. }
    105. $CombatRaport = unserialize($raportData['raport']);
    106. if($isAttacker && !$isDefender && $CombatRaport['result'] == 'r' && count($CombatRaport['rounds']) <= 2) {
    107. $this->printMessage($LNG['sys_raport_lost_contact']);
    108. }
    109. $CombatRaport['time'] = _date($LNG['php_tdformat'], $CombatRaport['time'], (isset($USER['timezone']) ? $USER['timezone'] : Config::get('timezone')));
    110. $CombatRaport = $this->BCWrapperPreRev2321($CombatRaport);
    111. $this->tplObj->assign_vars(array(
    112. 'Raport' => $CombatRaport,
    113. 'pageTitle' => $LNG['sys_mess_attack_report']
    114. ));
    115. $this->display('shared.mission.raport.tpl');
    116. }
    117. }
    Display All



    suche hier im Forum hat mich dazu auch nicht weiter gebracht. Wenn es um 502 geht ist der Typ als Missile in der DB drinne und auch im LNG Tech
  • That happen when u decide to remove fleets or defense from database. Best think is to keep in database but only calls ids u need in your game :)