iopietro / Travianz-Legacy

Join our Discord Server: https://discordapp.com/invite/9fbJKP9 | New repo: https://github.com/iopietro/Travianz
GNU General Public License v3.0
160 stars 95 forks source link

Strange feature of filling the warehouse and granary #396

Closed velhbxtyrj closed 5 years ago

velhbxtyrj commented 6 years ago
  1. expected behaviour: Put a warehouse or granary on the construction site, exit the game, after returning the warehouse or granary must be filled to the maximum taking into account the newly constructed levels or warehouse or granary (depending on what was supplied for construction).
  2. incorrect behaviour: Resources begin to accumulate in a warehouse or granary after we have entered the game after an absence (ie either the warehouse or granary silo were filled with resources to the previous level). The new levels were not considered as built.
  3. the operating system & version: Linux server
  4. PHP version on the server: 7.0
  5. MySQL / MariaDB version on the server: 10.1.24-MariaDB
martinambrus commented 6 years ago

Thanks for this one. I'm actually aware of this behavior and there is no code that would eventually do these kinds of checks in automation at the present state. It's one of the "small" things that most people can live with for now and it would take too much unnecessary energy for me to put into place for this legacy version.

In the refactored version, calculations like this would be handled differently and such dependency errors would not occur.

All that said, if anyone would like to go ahead and fix this one at the present state of things, they are welcome to do so :)

velhbxtyrj commented 6 years ago

Will wait for refactoring :)

martinambrus commented 6 years ago

This will actually only happen if that player is the only player on the server, or nobody will log-in in the meanwhile to trigger the Automation script. With normally populated and active servers, this will not be an issue though, because somebody is bound to trigger Automation which will finish the building for that player and also keep updating their resources on each page load of any other player ;-)

KoriSeng commented 6 years ago

actually i totally forgot how building logs are being handled on this version. you can change the detection of completed buildings to be directly from the log/queue instead that would work i guess.

martinambrus commented 6 years ago

I guess one could update the Automation::buildComplete() method to check what type of building was built and update the resources according to when that building was supposed to get built... but as I said, I'm not really going to rework this logic in this version, so if anyone else is interested, they're welcome to give it a try

AL-Kateb commented 6 years ago

Could not this be achieved easily with a simple cron job?

martinambrus commented 6 years ago

A simple cron job is not so simple for someone who never used Linux before. We're trying to make this as simple as possible for everyone. Also, I don't think this can be done via a "simple" CRON job, since that CRON would have to log in and run a page that would in turn run Automation.php, which I don't think it very simple to start with :P

andreblue commented 5 years ago

Why not simply have a key to pass to the automation page, that would run as if someone were an admin?

iopietro commented 5 years ago

Won't be fixed in the legacy version.