yi12345 / TravianZ

travian t3.6 project (based on travianx v6.0.0)
183 stars 190 forks source link

Update Automation.php #470

Closed uberswe closed 4 years ago

uberswe commented 10 years ago

Fixes the issue of medals not being generated on week 1

Shadowss commented 10 years ago

This update is not good , if i apply that update server give medal every second ... and server stop responding

uberswe commented 10 years ago

I don't see how it could do that and worked fine for a server which has been running for over a month now. Please take a look again.

The main thing I changed is that $givemedal is true on the very first run when $row['lastgavemedal'] == 0 is called. If $givemedal is not true it will update the timestamp for $row['lastgavemedal'] but it will not give out any medals for that first week.

Shadowss commented 10 years ago

I put on my server and give me 24000 medals in 1 day ...

uberswe commented 10 years ago

Then I don't know what to tell you, perhaps it's missing a bracket or something. The code I pushed should only give you medals if lastgavemedal is 0 or if the time is greater than lastgavemedal+MEDALINTERVAL.

I have worked with PHP for over 10 years and was just trying to be helpful by pushing a small change to the project. However I understand that it should not be accepted if it causes issues.

Shadowss commented 10 years ago

I change that modification but on ACTIVE TravianZ version in here : https://github.com/Shadowss/TravianZ maybe you can help me with something cata7007 yahoo messanger or cata7007 skype id