Stat problem

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

    • Stat problem

      Hi,
      I have problem with stat. Stat wrong update point.
      I have 2moons 1.7.3
      I search fix on github but I need your help.
      My class.statbuilder.php
      Error on tech and on buildings
      Help me fix this :)

      Source Code

      1. private function GetTechnoPoints($USER)
      2. {
      3. global $resource, $reslist, $pricelist;
      4. $TechCounts = 0;
      5. $TechPoints = 0;
      6. foreach($reslist['tech'] as $Techno)
      7. {
      8. if($USER[$resource[$Techno]] == 0) continue;
      9. $Units = $pricelist[$Techno]['cost'][901] + $pricelist[$Techno]['cost'][902] + $pricelist[$Techno]['cost'][903];
      10. for($Level = 1; $Level < $USER[$resource[$Techno]]; $Level++)
      11. {
      12. $TechPoints += $Units * pow($pricelist[$Techno]['factor'], $Level);
      13. }
      14. $TechCounts += $USER[$resource[$Techno]];
      15. $this->setRecords($USER['id'], $Techno, $USER[$resource[$Techno]]);
      16. }
      17. return array('count' => $TechCounts, 'points' => ($TechPoints / Config::get('stat_settings')));
      18. }
      19. private function GetBuildPoints($PLANET)
      20. {
      21. global $resource, $reslist, $pricelist;
      22. $BuildCounts = 0;
      23. $BuildPoints = 0;
      24. foreach($reslist['build'] as $Build)
      25. {
      26. if($PLANET[$resource[$Build]] == 0) continue;
      27. $Units = $pricelist[$Build]['cost'][901] + $pricelist[$Build]['cost'][902] + $pricelist[$Build]['cost'][903];
      28. for($Level = 1; $Level <= $PLANET[$resource[$Build]]; $Level++)
      29. {
      30. $BuildPoints += $Units * pow($pricelist[$Build]['factor'], $Level);
      31. }
      32. $BuildCounts += $PLANET[$resource[$Build]];
      33. $this->setRecords($PLANET['id_owner'], $Build, $PLANET[$resource[$Build]]);
      34. }
      35. return array('count' => $BuildCounts, 'points' => ($BuildPoints / Config::get('stat_settings')));
      36. }
      Display All
    • Why don't you post the complete error log in the first thread, you will receive answers much faster, as no one will respnd you nw, we dont know about what u are talking

      Regards
    • I dont have nothing in error.log
      Problem: in config i set the 1000 resources give 1 point. But really 1000 resources give more points. I think $level in code is the problem.
    • oh you have it about that bug, check on gihub, i already fixed that bug, only listen to my replies and not others as they are simply fake if you want it resolved

      github.com/jkroepke/2Moons/pull/246
      github.com/jkroepke/2Moons/pull/245

      github.com/jkroepke/2Moons/pull/240
      github.com/jkroepke/2Moons/issues/241

      Read, inform and fix :)