230 Commits

Author SHA1 Message Date
iopietro 3a14da51e0 Alliance forum fixes part 5
+Confederation and shared forums are now visible to the confederation
alliances or selected alliances/users
+Sticked topics are now displayed first
+Fixed a bug that permitted to add confederated alliances/users to
shared forums
+Minor bug fixing
2018-05-20 21:45:14 +02:00
iopietro 34c8000e44 Alliance forum fixes part 4
+Public forums can now be created by MH only
+Public forums can only be edited by MH only (every MH)
+Fixed BBCode in forum posts
+Removed 8 unused columns from the database
+Removed about 150 lines of unused code in forum.tpl
+Minor improvements and bug fixing
2018-05-20 16:50:26 +02:00
Vladyslav b752e4c4f4 Merge branch 'master' of https://github.com/Shadowss/TravianZ 2018-05-20 01:14:01 +03:00
iopietro 4f98e14c29 Alliance forum fixes part 2
+Added the "Forum" link to the game menu (above Game Rules), player
without an alliance, will be able to access to public forums only
+All players can now open public forums (even without an alliance), post
to them, edit and delete them
+Added the possility to add alliances and players to the "Who can view
this forum" list, the graphic was present but there wasn't the database
and code support (conditions aren't coded yet)
+General fixes

NOTE: To play this version without reinstalling the server, you have to
run this simple query:

ALTER TABLE s1_forum_cat ADD (`display_to_alliances` text,
`display_to_users` text)
2018-05-19 22:04:51 +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 5ecf035cb3 Alliance fixes part 2
+Public forums are now displayed for every player on the server
+Fixed some security bugs that permitted to create thread and posts to
private forums
+Fixed some general bugs
2018-05-19 00:01:50 +02:00
iopietro e5d823cda0 Alliance forum fixes part 1
Fixed the majority of security issues:

+Fixed a bug that permitted to edit, delete and create a forum in any
alliance, without any permissions
+Fixed a bug that permitted to edit, create and delete any kind of
thread, with any kind of permission
+Fixed a bug that permitted to edit, modify and delete every kind of
post, without any kind of permission
+Fixed a bug that din't permit to create posts and threads
+Fixed a bug that permitted to create forum and threads with empty
name/topic
+Fixed a bug that permitted to move a thread to an invalid forum
+Fixed a bug that permitted to create an invalid type of forum
+Fixed a bug that didn't permit to move forums, to the top and the
bottom of their forum type (in reality, it wasn't even coded)
+Added a sorting column for supporting the "move to top/bottom"
functionality
+Minor improvements and bug fixing/code indentation/removal of redundant
code

NOTE: For playing this version, you HAVE to add a new column to the table "s1_forum_cat", you can simply do that by running this query (where "s1_" is the prefix of your server): ALTER TABLE s1_forum_cat ADD `sorting` int(11) NOT NULL AFTER `id`
2018-05-18 00:28:48 +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 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 b58b762b12 General Fixes
+Completely reworked the "removeBuilding" function, it's now more
generic (for future uses)
+Fixed a bug that bugged the master builder time when a building was
removed from the construction queue
+Fixed a bug that bugged building times when a building was removed from
the queue, with a master builder order queued
+Fixed a bug that didn't permit to save the server settings from the
+MH/Admin panel
+Fixed a bug that did save the WW spawn time in the WW building plan
spawn time and vice versa
+General improovements and bug fixing
2018-05-14 23:14:10 +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
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 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 2530dcac6d Fixed a bug in Palace/Residence
+Fixed a bug (or fixed a fix?) that didn't permit to train chief and
settlers in the same village
+Fixed a bug that didn't count trapped chiefs and trapped settlers
+Fixed a bug that did count chiefs and settlers of other players as used
slots, if they were attacking/reinforcing you
-Removed an unused portion of code
2018-04-29 16:57:27 +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 6394707e53 Fixed a little mistake 2018-04-26 12:19:39 +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 daa7f0fdf4 Fixed a bug in oasis
+Oasis now produce resources correctly
2018-04-21 19:41:44 +02:00
iopietro e9def19bd9 Fixed an exploit in the market
+Fixed an exploit that permitted to gain an infinite amount of resources
2018-04-21 17:53:59 +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 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 06fc62752a Fixed bugs in trade routes
+Trade routes are now editable without errors or redirects
+Trade routes are now filtered by village and not by account
2018-04-18 14:38:15 +02:00
iopietro bf091c2a0c Fixed a bug while reinforcing
+If you've already reinforced the target village, you'll troops will now
be merged with the present troops
2018-04-17 18:52:48 +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
Pietro Fallanca 274d89bfa1 Fixed a lot of bugs/security issues in the alliance
+You can no longer kick people of other alliances
+You can no longer change the forum link with no permissions
+You can no longer make more than 3 total confederation and 3 total NAP
+You can no longer send a diplomacy pact to an alliance with already one
pact or one pending pact
+You can no longer handle diplomacy without permissions
+Fixed security bugs related to invites (sending, deleting etc.)
+You can no longer access to any alliance submenus without permissions
(kick menu, diplomacy menu, etc.)
+Errors are now shown correctly and better handling of them
+New forum link and alliance description are shown correctly after
editing them
+You can no longer access to other alliances informations without being
in it (attack reports, news, etc)
+Corrected some alliance news
+Added some language constants to en.php
+Fixed and changed some database.php functions alliance related
2018-04-15 16:11:43 +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 29faeca811 Starvation Refactor
Refactor part 3 of the starvation function

+Troops will now die equally, according to the crop consumption of the
village

Database.php:
+Modified two functions to work with unit arrays as a parameters
2018-04-12 12:53:24 +02:00
iopietro 8b3a387cd5 Starvation refactor
Refactor part 2 of the "Starvation" function:
+Trapped troops in other villages will die of starvation
+Returning troops will die of starvaton

Database.php:
+Added "modifyPrisoners" function
2018-04-11 00:16:39 +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 72fd81b69b Fixed an artefact bug
+Fixed a bug that prevented the destruction of a village, if it had 0
population with no artefacts inside
+Some clean-up
2018-04-08 22:55:33 +02:00
iopietro a8b474bc01 Fixed an artefact bug
+Fixed a bug that prevented the conquer of an artefact between two
villages of the same owner
2018-04-08 21:49:13 +02:00
iopietro d236a21d38 Fixed some bugs
+Level upgrades in Blacksmith and Armoury are now shown correctly
+Corrected a typo
+Upgrades in the Blacksmith and the Armoury should be ordered correctly
2018-04-07 23:15:23 +02:00
Pietro 9869abe5ba Fixed two population bugs
Automation.php:
Fixed the attacker population and defender population before a battle, now the account population will be considered instead of the single village population.
Fixed the attacker population and defender population while chiefing a village, now the account population will be considered instead of the single village population.

Database:
Added a function to get the total population of the account.
2018-04-05 21:09:16 +02:00
Pietro aec41019e9 Fixed a bug in the troops training
If the speed of the server is very high and the single troop training time is 0, you can now train troops instantly.
2018-04-05 03:03:49 +02:00
Pietro 3738fd44cc Fixed some bugs and some clean up
Units.php:
Fixed a bug which allows to select invalid buildings or not-hittable building (such as Cranny, Walls, Stonemason's lodge and Trapper) with catapults.
Fixed a bug which allows to select a secondary target with less than 20 catapults.

Removed some unused functions from Automation.php and Database.php.
2018-04-05 00:02:12 +02:00
Pietro a749d74dfb Fixed an hero bug
The experience was distributed incorrectly if the defender(s)/attacker had more than 1 hero
2018-04-03 01:44:27 +02:00
Pietro 09ec695997 Fixed some building bugs
Fixed a bug that allowed to build resource fields in the village (the previous fix was still hackable)
Fixed a bug that allowed to build everything with the master builder (even the WW)
Fixed a bug that allowed to build over the twentieth level with the master builder
Fixed a bug that allowed to build level 0 building with the master builder by removing them from the construction queue
2018-04-02 18:55:10 +02:00