Calculation of extracted resources

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

    • Calculation of extracted resources

      Hello everybody.

      I have a small idea, but to implement it I faced a problem.

      I need to implement the calculation of extracted resources (only by mines with all other bonuses) (do not take into account: found in an expedition, brought by the fleet from other players or from another planet, obtained from the demolition of a building and the like).

      For example: A player has built a level 25 metal mine, and I need to calculate how many resources he has mined per day in real time, taking into account that he can be attacked and destroyed by solar satellites, and without them he will not have enough energy and thus the mining of resources will decrease.
    • includes/classes/class.PlanetRessUpdate.php

      this is the file there the given ressources are calculated. you might make 3 new columns in the uni1_planets table with
      allmet allcrys all deut
      all unsigned double

      and then find the function
      ExecCalc()
      in there you add your values to the $this->PLANET array()

      you might want to post your
      includes/classes/class.PlanetRessUpdate.php
      if more detailed help is needed


      this would reflect the real production, but it does not take into account the ressources stolen, this has to be subtracted on an other file/action
    • Thanks for the help, everything works as it should.

      I looked at the ExecCalc() function before but wasn't sure. And after your answer and a fresh look, I understood everything))))

      To save to the DB, it was necessary to add the fields that I created in uni1_planets to the SavePlanetToDB function