Commit Graph

68 Commits

Author SHA1 Message Date
Catalin Novgorodschi a004f5352b For incremental refactor + some credits 2026-05-12 13:39:10 +03:00
Catalin Novgorodschi 27e9a9a7b5 Full refactor of Battle
Full refactor of Battle
2026-05-08 13:06:53 +03:00
levi a0ef06a35f chore: harden php8 compatibility, optimize installer/croppers, and refresh docs/admin ux 2026-03-14 16:50:27 -03:00
Catalin Novgorodschi c9397246c4 Update Battle.php 2026-02-12 10:33:24 +02:00
Catalin Novgorodschi 260896570e Revert "vulnerability fixed and cleanup and refactor"
This reverts commit 2a44e76414.
2026-02-11 15:22:16 +02:00
Catalin Novgorodschi d3f51506e1 Update Battle.php 2026-02-11 15:17:53 +02:00
Catalin Novgorodschi bb1ac523cc Merge branch 'master' of https://github.com/Shadowss/TravianZ 2026-02-11 15:17:21 +02:00
Catalin Novgorodschi 2a44e76414 vulnerability fixed and cleanup and refactor 2026-02-11 15:11:43 +02:00
AlinV2V 70f911996d Update Battle.php
Fixed hero stacking deff bonus % if multiple heroes are reinforcing same village, now the deff bonus will apply only to the units that came with the hero.
2026-01-24 00:44:54 +02:00
Martin Kalabek 1efe104ed2 Add Natars into combat simulator 2024-10-26 21:01:58 +02:00
iopietro f032523e1c Generale fixes
+Fixed a bug that didn't return reinforcements in counquered oasis, if
it was released by the owner, or from the admin panel
+Changed the catapults and rams formulas (still not completed at 100%),
thanks to Kirilloid!
+Changed the Natars' capital default coordinates
2018-07-28 15:07:52 +02:00
iopietro 628894f478 General fixes
+WWs aren't affected anymore by stronger building artifacts
+Walls damaging/destruction (wall bonus reduction) during a battle, is
now counted
+Added a button for normal acess users, for editing/sticking, etc. their
own topics (instead of directly display the topic "admin menu")
+Fixed some possible warnings
2018-05-21 16:45:54 +02:00
iopietro b91e27381b General fixes
+Fixed a bug that didn't permit to display the bonus of some buildings
at level 0
+The cavalry training percentage bonus, provided by the horsedrinking
trough, is now displayed correctly
2018-05-18 17:23:54 +02:00
iopietro 0322a0ae49 General fixes
+Fixed a bug that permitted to see troops movement with a 0 level rally
point
+Fixed a bug that permitted to send attacks, enforcements, etc. with a 0
level rally point
+Fixed a bug that counted the moral bonus for attacks against WW
villages
+Fixed a bug that didn't permit to finish all buildings/researches, etc.
without a plus account
+Recoded part of Natars timer for being more generic
+Natars/Artifacts spawn, WW villages spawn, WW building plans spawn are
now based on the start date of the server and not on the installation
date
+Better indentation of some code
2018-05-18 15:46:15 +02:00
iopietro bdd3bfd41c Farmlist improvements and fixes
+Troops while adding/editing a raid lists are now inside of a table,
this is a graphic enhancement
+Reduced the X and Y textboxes size while adding/editing a raid list
+Fixed a bug that didn't permit to add a raid list
+Fixed a bug that did permit to insert spies in raid lists
+The farmlists graphic is now more clear, "Add raid" and "Start raid"
are now two general buttons, instead of having two buttons for raid list
+"Select all" checkbox, will select all raid without refreshing the page
(through JS)
+Moved the function "getDistance" to Database.php
+Removed a lot of redundant code from crop_finder.php
+Removed rams, catapults, chiefs and settlers from the raid list,
because the first three can't even loot resources
+Removed trooplist2.tpl because of a more general unique template file
(trooplist.tpl)
+Some minor improvements and bug fixing

IMPORTANT NOTE: if you don't want to reinstal the whole server, you can
simply run this little query (where "s1_" is the prefix of your server):

ALTER TABLE `s1_raidlist` DROP `t7`, DROP `t8`, DROP `t9`, DROP `t10`;
2018-05-16 16:49:25 +02:00
iopietro 656bd4f970 Fixed a spy bug
+Fixed a bug that didn't permit to detect upgraded (in the blachsmith)
spies
+Changed a debug function, from public to public static
2018-05-15 20:55:43 +02:00
iopietro cf74514451 General fixes
+Fixed an exploit that permitted to starts other players' farm lists
+Fixed an exploit that permitted to save our raids to other players'
farm lists
+Fixed an exploit that permitted to edit other players' farm lists
+Fixed a rounding upkeep bug
+Moved the whole startRaid.tpl to a new method in Units.php
+A lot of clean-up
+Improoved indentation
+In the raid list, the "carry" image will now show to the left of an
attack
+Fixed a bug that displayed the wrong loot to returning troops released
by traps
+General minor bug fixing and improovements
-Deleted a lot of redundant code
2018-05-04 22:12:18 +02:00
iopietro 0a9fe1125e Fixed a bug while chiefing and catapulting
+Brewery, big parties and moral bonus are now counted correctly towards
the loyalty reduction
+If you have a brewery you'll now forced to attack random buildings
+Some clean-up
2018-05-01 17:03:41 +02:00
iopietro c599838dc8 Fixed a spy bug
+Attacking spies will now die if they're detected and the enemy has
spies in reinforcement
2018-04-29 12:49:45 +02:00
iopietro 56e280f436 Artifacts fixes part 4
Completely fixed the artifact of the fool and fixed all kind of
artifact:

+Deleted some useless .tpl files and merged into one (Stable)
+The artifact of the fool effect won't be displayed if not active
+Fixed a bug that permitted to have a great and a unique artefacts
active at the same moment
+Big reductions of code in a lot of files
+Created some new methods to support artifacts
+Fixed a bug that prevented the effect of the "Rivals confusion" to work
correctly
+Fixed a bug that prevented "The eagles eyes" artifact to work correctly
for the attacker
+Fixed the artifact of the fool of every kind, now it's calculated with
a new method
+Fixed the cranny capacity when a "Rivals confusion" artifact is active
+Some minor bug fixing , improovements and optimization
2018-04-26 20:37:47 +02:00
iopietro c2f4d43b7e Reports refactor Part 2
+Heroes are now divided by tribes in battle reports
+Added to every report the support to read heroes from the battle report
data

Automation.php:
+Added the hero data, to every battle reports
+Fixed a bug that didn't count own dead defensive troops for general
attacks, top 10 attackers, attackers and hero xp
+Fixed a bug that didn't permit to add the rat enforcement to the
village, from quest number 8

Battle.php:
+Fixed a bug with catapults/rams that permitted to destroy level 1
buildings with only one catapults (even against 1000000 defensive
troops)
+Added a new function, for more readability

+General minor improovementes and bug fixing
2018-04-20 21:23:57 +02:00
iopietro 882215cd2a Reports refactor #1
-Removed 29 files from the "Templates/Notice" folder, there were a lot
of duplicated/very similar kinds of report. Now, there are only 6 kinds
of report (9.tpl isn't counted)
+Changed a lot of codes in some .tpl reports, into a foreach

Automation.php:

+Modified report data, for the refactored report system
+Some clean-up

Battle.php:

+Fixed catapults and rams, they weren't able to destroy completely a building
+Fixed a possible division by 0 error
2018-04-19 20:22:01 +02:00
iopietro 6f895f7d54 Fixed some bugs
+Fixed a "division by zero" error, in Battle.php
+Reworked spied informations, now they're shown only if the building is
at least at level 1. Splitted residence/palace information in two
distinct informations. Now the total crannies capacity is displayed
(even if the capacity is 0) instead of the level of the greatest cranny
+Fixed "getFieldLevelInVillage" function in Database.php
-Removed an useless control in Units.php
2018-04-16 18:39:41 +02:00
iopietro e0c1b6ae5c Fixed some bugs
+Fixed catapults/rams formula
+Added the trapped troops calculation formula, traps are now distributed
through all troops
2018-04-12 21:31:14 +02:00
iopietro 21179d346f Fixed some bugs and errors
+Part 1 of the starvation refactor, attacking troops will now be killed
+Fixed some errors in Units.php, Technology.php, Battle.php and some
16_incomming.tpl
-Removed an unused function in Database.php
+Fixed a bug that could have destroyed a village after taking an
artefact even if it had more than 0 pop
2018-04-09 21:31:50 +02:00
iopietro 9e44c1cd6d Some replacements
+Replaced all $GLOBALS['link'] with $database->dblink
-Removed Templates/links.tpl from build.php (it's already in
Templates/menu.tpl)
2018-04-08 19:55:28 +02:00
iopietro 5bde1fe2dd A little forgetfulness 2018-04-07 23:22:56 +02:00
iopietro 0132af4611 Fixed a lot bugs/security exploits
Profiles can't be hacked anymore, added some security control and
removed those malicious "hidden uid"
Errors now are now shown correctly while editing the profile
The level of the research you're doing in the Blacksmith/Armoury is now
displayed in the research queue
Hugely fixed the battle system, a big thanks to kirilloid for helping me
by providing his formulas :)!
Some general clean-up and bug fixing of little errors
Added some string constants to the language file (en.php)
2018-04-07 22:16:28 +02:00
Pietro 5f9186bd71 Fixed some bugs
In the simulator:
Fixed some error that could have shown during scountings.

All types of attack:
Changed "int" into "float" to gain precision in the attack formula.
Fixed spies formula, it's more precise now.
Fixed the Blacksmith/Armoury calculation formula for spies.
2018-04-06 18:06:08 +02:00
Pietro a1fbf9dcfc Fixed some catapult/ram bugs
Battle.php:
Fixed the blacksmith level formula for catapults and rams.

Automation.php:
+Catapults and rams now works better because of a new formula.

Note: this formula isn't 100% accurate with the real Travian formula, i can't find that formula anywhere, so i created an approximate formula.
2018-04-05 17:05:25 +02:00
Martin Ambrus 7bc582e674 fix: division by zero 2017-11-25 00:17:26 +01:00
Martin Ambrus bc2eaa1380 refactor: s1_abdata & s1_tdata caching implemented
#313
2017-11-20 23:46:45 +01:00
Martin Ambrus fffedc4170 fix: defender troops do not die during attack 2017-11-18 13:11:00 +01:00
Martin Ambrus dd030859cf fix: troops did not return to the village when evasion was set 2017-11-18 11:10:58 +01:00
Martin Ambrus dab768f662 refactor: 1st round of database values caching 2017-11-15 16:01:00 +01:00
Martin Ambrus 3d44226c92 refactor: more caching where possible
This also fixes "Multihunter" being stated as the one attacking
reinforcements in villages during battle (now stores real attacker ID).
2017-11-12 10:36:53 +01:00
Martin Ambrus 603d28f31a fix: MySQL 5.7 compatibility + undefined variables 2017-11-10 14:07:32 +01:00
Martin Ambrus 371c717702 refactor: 3rd round of sendunitsComplete() optimizations 2017-11-09 14:22:15 +01:00
Martin Ambrus 57057384d3 refactor: SELECT * replaced by SELECT fieldname1, fieldname2 ...
So far in a few places.
2017-11-05 09:03:59 +01:00
Martin Ambrus 041726fbd2 fix: undefined indexes 2017-11-01 21:35:24 +01:00
Martin Ambrus ffd3bf373c fix: non-numeric values could be present for empty values 2017-10-24 17:20:32 +02:00
Martin Ambrus a7cd9c8a0c fix: errors with empty post data in combat simulator 2017-10-21 22:57:08 +02:00
Martin Ambrus 057f713528 fix: a LOT of manual typecastings for DB values that should be INTs 2017-10-18 00:33:03 +02:00
Martin Ambrus 9261a4a4b2 Merge branch 'master' of https://github.com/evader1337/TravianZ into evader1337-master
# Conflicts:
#	GameEngine/Database/db_MYSQL.php
#	Templates/Build/avaliable.tpl
#	Templates/Message/inbox.tpl
2017-08-28 14:18:24 +02:00
Martin Ambrus ed0b8031aa fix: spies fixed via armando1980 2017-08-28 13:03:19 +02:00
evader1337 2d26af7c46 Trying to fix this monstrosity #2 2016-09-13 18:54:25 +02:00
uroskn 1afde368d3 GameEngine and install folders have 777 already set by default 2016-07-02 21:39:28 +02:00
Shadow ff5ca62a1e credits 2015-06-22 08:20:34 +03:00
Shadow 2926e6b585 Update Battle.php 2014-04-02 10:48:06 +03:00
Shadow 6c94bb2a8b Merge branch 'master' of https://github.com/Shadowss/TravianZ 2014-02-21 15:29:45 +02:00