Commit Graph

320 Commits

Author SHA1 Message Date
iopietro c574a71b3a General fixes
+Fixed a bug that didn't delete artifacts when a player deleted his
account
+Added "(artifact)" if a village has an artifact in the village overview
+Added the artifact section in the multihunter panel (return to natars
doesn't work yet)

NOTE: To play this version of the game, you have to run this query first
(where "s1_" is the prefix of your server):

ALTER TABLE `s1_artefacts` ADD `del` TINYINT(1) NULL DEFAULT '0' AFTER
`lastupdate`;
ALTER TABLE `testtravian`.`s1_artefacts` ADD INDEX
`active-owner-conquered-del` (`active`, `owner`, `conquered`, `del`);
2018-06-21 14:43:47 +02:00
iopietro 8861a578e4 General fixes
+Fixed a bug that didn't update the starvation correctly, when
starvation data was updated (for example: troops in training, attacks
completed, etc.)
2018-06-17 01:48:40 +02:00
iopietro d96259afd8 General fixes
+You can no longer build WW if your and your alliance building plans
aren't active yet
+You can no longer remove the WW from the village if you remove it from
the building queue
+Spies from every tribe will now consume crop correctly, when returning
from a scouting attacks
+Spies from every tribe will now be displayed correctly, in the "Troops"
tab of dorf3.php, when returning from a scouting attack
+Building levels will now not be downgraded by 1 level, when conquering
a Natars' village
+Natars' villages with an artifact inside, will now be deleted if the
artifact is conquered (even if the pop isn't 0)
2018-06-09 03:03:01 +02:00
iopietro a8d6b9c357 General fixes
+Fixed a bug that didn't permit to change the name or the Tag of the
alliance individually
+Fixed a bug that didn't count the population growth sometimes
+Fixed a bug that didn't halve the population consumption in WW villages
2018-06-08 19:15:39 +02:00
iopietro b717c0cdf4 General fixes
+Fixed a bug that didn't permit to show to the defender "None of your
soldiers returned." under certain circumnstances
+Fixed a bug that showed a wrong report icon if the defender had 0
defences and all attacker's units were trapped/killed during the battle
+Fixed a bug that counted a wrong percentage bonus for the horse
drinking trough
2018-06-01 16:24:36 +02:00
iopietro b12f4d4497 General fixes
+Fixed a bug that didn't permit to see a defender hero in a spy report
+Fixed a bug that only permitted to revive the last hero on the hero
list
2018-05-31 15:23:48 +02:00
iopietro 11c3d44168 general fixes
+Fixed a bug that didn't permit to counquer an artifact in certain
circumstances with the new automation system
2018-05-25 17:45:05 +02:00
iopietro 8605996533 Fixed some Automation bug
+Fixed the (in)famous "doubling troops bug", this has been the oldest
bug I can remember, it lasted 7 years!!!
+Reworked the whole lock system, it's more maintanable and easy to read
now
+Removed some useless class fields, reworked some methods that depended
on them
2018-05-24 01:28:56 +02:00
iopietro fca22ac98b General fixes
+Fixed a bug that didn't permit to attack with catapults with the new
automation system
+Fixed a warning that could have been displayed in certain cases
2018-05-23 17:36:16 +02:00
iopietro f41666cabc New automation
+Separated Automation.php from the UI and users classes

NOTE: This is only a test, it'll not absolutely be as it is in this commit in the final version.
2018-05-22 23:37:28 +02:00
iopietro edeee02333 Some clean-up 2018-05-22 22:43:01 +02:00
iopietro f0b9f32826 General fixes
+Moved "isWinner()" method from Automation.php to Session.php, it's now
triggered when activating plus function or entering in
plus1.php/build.php
+General clean-up and better indentation
+The tournament square bonus is now displayed correctly
2018-05-22 00:33:09 +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
Vladyslav a956abee13 Change the date display
The date display was changed from 'm/d/Y' to 'd.m.Y'
2018-05-19 20:52:33 +03: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 6909ba4e58 Fixed a medals bug
+First medals will now be given on the next Sunday (at 12 PM) from the
start of the server
2018-05-16 18:44:06 +02:00
iopietro 95cc6180a9 Fixed a catapult bug
+Fixed a bug that didn't recount building time for in waiting loop
buildings
+Fixed a bug that didn't remove a building from the waiting loop, if the
previous was destroyed by catapults
2018-05-15 20:20:38 +02:00
iopietro f92e4d3bb8 General fixes
+Increased the number of "Slight artifact of the fool" from 5 to 10
2018-05-13 22:55:38 +02:00
iopietro 26431b6cea General fixes
+Fixed a bug that didn't halved the catapults force when two buildings
were selected
2018-05-13 16:10:49 +02:00
iopietro bdd896573c General fixes
+Added WW building plans to the "Small artifacts" section of the
treasury
+Fixed a bug that permitted to maintain a building in queue when
destroyed by catapults
+Fixed a bug that didn't count the catapult destruction of a building in
building queue
2018-05-13 15:50:45 +02:00
iopietro 43cbd60f78 General fixes
+Added an image in: Natars/Artifacts spawn message, WW villages spawn
message and WW building plans spawn message
+Fixed a wrong time calculation when removing a building from the
construction queue, if there was present a master builder order
2018-05-13 00:21:07 +02:00
Shadow 77f919e718 FIX 2 2018-05-11 11:31:35 +03:00
Shadow db7ce71dfd WW village message 2018-05-11 11:26:50 +03:00
iopietro 950fc61f8a General fixes
+A method in Building.php is now static
+Fixed timers in the market
+Fixed a bug that did take in account a wrong tournament square when
calculating the returning time of the troops
2018-05-10 20:50:29 +02:00
iopietro 90221cf19f Natars automation system
+Natars will now spawn automatically, you can set how many day should
pass before the spawn of Natars (and artifacts), WW Villages and WW
building plans (Note: WW villages and WW building plans won't spawn
until the creation of the natar account)
+Added 3 timers under the left menu which indicate the spawn of
Natars/Artifacts, WW villages and WW building plans
+Added an option in the installation, to set the resource production of
oasis
+Fixed a bug that didn't permit to add multiple Units, Abtech and tech
rows with one query
+Added a new information to the Artifact of the fool, the next effect
reroll will now be displayed in his informations (in the treasury)
+Fixed a bug that dind't permit the correct timers flow in Dorf3.php
(Warehouse tab), they'll now flow correctly
+Timers and resources percentage of villages with a negative production
of crop will now be marked in red (in the Warehouse tab, Dorf3.php) and
will now be displayed in how much time the granary will be emptied
+Fixed a possible bug that prevented to add raids to farm lists
+Fixed a bug that didn't permit to create WW Villages from the
Multihunter control panel
+Reworked all timers, there will be only one timer field now (in
Session.php)
+Minor bug fixing and optimization

NOTE: To play this version of the game, you need to reinstall the server
OR you can simply add these lines of code into your "config.php" file:

// ***** Natars Spawn Time
define("NATARS_SPAWN_TIME",260);
define("NATARS_WW_SPAWN_TIME",260);
define("NATARS_WW_BUILDING_PLAN_SPAWN_TIME",260);

// ***** Oasis production
define("OASIS_WOOD_MULTIPLIER",40);
define("OASIS_CLAY_MULTIPLIER",40);
define("OASIS_IRON_MULTIPLIER",40);
define("OASIS_CROP_MULTIPLIER",40);
define("OASIS_WOOD_PRODUCTION",OASIS_WOOD_MULTIPLIER*SPEED);
define("OASIS_CLAY_PRODUCTION",OASIS_CLAY_MULTIPLIER*SPEED);
define("OASIS_IRON_PRODUCTION",OASIS_IRON_MULTIPLIER*SPEED);
define("OASIS_CROP_PRODUCTION",OASIS_CROP_MULTIPLIER*SPEED);

P.S: from the next version, the possibility to add manual WWs, WW
building plans and to create the natar account will be REMOVED.
2018-05-10 17:45:27 +02:00
iopietro ec63b04587 General fixes
+Fixed an exploit that permit to maintain the crop level constant if the
page was refreshed every second, with a negative production
2018-05-06 15:20:58 +02:00
iopietro bd033334c4 General fixes
+Fixed a little mistake in the starvation it works properly now
+A reinforced hero is now reassigned if his main village is conquered
+Population will now recount after a conquering
2018-05-06 15:02:38 +02:00
iopietro 89bebaee1f General fixes
+Fixed a bug that didn't permit to destroy the capital if the player had
more than 1 village. The capital is now destroyable (if the player has
more than 1 village)
+Fixed a bug that updated the hero wref wrongly when reinforcing their
own villages
+Fixed a bug that didn't kill the hero if his village was destroyed
while he was sent to another village as a reinforcement
+Better indentation
+General improovements
2018-05-06 00:00:27 +02:00
iopietro f7e05c9802 Optimizations
-Removed the "sort_type" 6 from the movement table, looted resources
will now be saved in the "sort_type" 4 returing attack.
This reduces a lot the spam in the tables "send" and "movement" of the
database
-Removed some useless methods in Database.php and Message.php
+Optimized report loading, own report will be loaded only once (and not
twice at random) and allied reports aren't loaded anymore
+Minor improovements and better indentation
2018-05-05 17:54:34 +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 49bc3c5073 General fixes
+Fixed a bug in the farm list that permitted to attack the same village
troops were sent
+Fixed a bug that permitted to delete others raid lists
+Fixed a bug that permitted to view broken reports
+Fixed a bug that permitted to insert 0 troops in the raid list
+Fixed the broken graphic of the raid/farm list
+Fixed a bug that didn't permit to send more than 2 raids at a time (in
the raid list)
+General improovements and bug fixing
+Some clean-up
2018-05-03 23:07:11 +02:00
iopietro e751a0c01f Fixed some bugs
+Returning troops time will now flow correctly in the rally point
+Resources won't be set to 0 anymore if overflow (this could have
happened in high speed servers)
+Fixed a distorted view of the right part  of the page, while reading a
mass message
2018-05-03 14:35:19 +02:00
iopietro 9e2d2b6842 Fixed trap bugs
+Traps are now repaired (built) in the trapper building, instead of
instantly given after a successful normal attack or a dismiss/releasing
from the rally point
+1/4 of trapped troops are now lost after a successful normal attack
+Traps are now released when troops die from starvation
+If you'll dismiss your trapped troops from the rally point, the gaul
player will be able to only repair 1/3 of the total used traps
+Created a new method to delete some redundant and duplicated code
starvation related
+The effect of WW building plans will be displayed correctly, when
they're active
+Troops related artifacts are now counted when building traps
+Some minor improovements and bug fixing
+Some clean-up
2018-05-02 21:17:20 +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 2fc3e7b7da Fixed trap bugs
+Released troops will now return to their respective villages correctly,
(allied or own villages)
+Fixed "Released X of own troops" and "Released X of friendly troops"
texts, they'll now match the correct amount of own/friendly released
troops.
+Fixed a bug that didn't permit to release troops in the first attack or
if in the attacked village there were prisoners from more than one
village
+Corrected a wrong stolen resources calculation
+Minor improovements and bug fixing
2018-05-01 00:09:58 +02:00
iopietro 0fac64b23a Fixed a bug while conquering
+Expansion slots are now cleared/assigned correctly (following the
official Travian rules)
+Some minor improovements and bug fixing
-Removed redundant code
2018-04-30 13:53:52 +02:00
iopietro 6443d2d490 Fixed a bug while destroying a village
+If a village is destroyed, all oasis of it, will return to the Nature
+If a village is destroyed all trade routes from and to it, will be
deleted
2018-04-29 21:29:14 +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 a40accc101 Distance calculation optimization and bug fixing
-Removed a lot of redundant code and put into a function
+Fixed a bug that permitted to found a new village in already founded
village
+Fixed a bug that permitted to found in an oasis
+Fixed a bug that permitted to hack the time you need to found a new
village
+Fixed a bug that permitted to found a new village to an inexistent one
2018-04-29 00:49:24 +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 8e731dd7d0 Artifacts fixes part 3
+Fixed the artifact of the fool, it will now work and reduce/increase
troops speed
+Optimized some templates file and deleted some useless files
+Added a method to Database.php which permits to calculate things
related to artifacts (it's not general yet, it only works for troops
speed)
-Removed artifact of the fool "Account" type, because it shouldn't exist
2018-04-25 22:58:18 +02:00
iopietro 0011d2abcb Artifacts fixes part 2
+Artifacts are now activated after a certain amount of time (based on
the official Travian Rules and the server speed) and not immediately
after the conquer
+Artifacts are now activated based on official Travian Rules, you can
only have 1 unique/account active artifacts

Changes in 27_show.tpl:
+Added the text "Can't be activated" to not-activable artifacts

Changes in Automation.php:
+Added a new method which activate activable artifacts

Changes in Database.php:
+Added some methods to support the new artifacts activation system
2018-04-25 15:13:24 +02:00
iopietro 26cb03cdb6 Artifacts fixing part 1
+Added a new table in the database, called "artefacts_chrono" which
stores the chronology of all artifacts
+Added the support for the artifacts chronology in 27_show.tpl
+Added the support for interacting with the artifacts chronology table in Database.php
+Cleaned the code in 27_show.tpl
+Some minor improovements and bug fixing
2018-04-23 20:34:28 +02:00
iopietro ec6a26acf3 Fixed a bug in the market
+ x3 orders and trade routes won't disappear anymore if the player has
less resources than required, the merchants will take all of his
resources instead
+Fixed a bug in the market that didn't permit to send x3 merchants
2018-04-21 21:56:33 +02:00
iopietro 05504afcf4 Fixed a bug while training troops
+Troop trainings with 0 troops are now deleted immediately after adding
the trained troops (and not after another foreach)
+Fixed a bug that could have caused the training of one negative troops
2018-04-21 21:04:16 +02:00
iopietro 13e21d66e1 Fixed a bug while finishing a construction
+Buildings cannot be incremented anymore by two levels instead of one
2018-04-21 20:34:43 +02:00
iopietro daa7f0fdf4 Fixed a bug in oasis
+Oasis now produce resources correctly
2018-04-21 19:41:44 +02:00
iopietro 996f011666 Fixed some report bugs
+Added the report type 23, which indicates a defence during festive days
+Festive reports in the alliance no longer duplicates
+Festive reports in the village view no longer duplicates
+Fixed a bug that didn't permit to read an allied report

General:
-Removed the possibility to view an inexistent village
+Some minor improovements
2018-04-21 17:28:20 +02:00
iopietro f7f164ea2b General fixes
+Fixed some errors in Automation.php
+Some clean up in the alliance templates directory
2018-04-21 13:30:18 +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