Travianz-Legacy
Travianz-Legacy copied to clipboard
Tasks for TravianZ Version 8.3.5
Hello guys,
That tasks remain to fix from version after release 8.3.4
-
[ ] Automation (start of the refactoring process)
- [x] Separate the whole Automation class from the UI and user classes. This will hugely decrease the load time of all pages (all without using Cron Jobs).
- [ ] Divide the Automation class in 4/5 subclasses and the "SendUnitsComplete" method in some submethods (seeing a method with 2k of codes hurts my eyes).
- [ ] Remove all (fu**ing) global variables by creating a serious OOP structure.
- [x] Create a class called "Artifacts" and move the aritfacts-related functions/constants/etc. in it.
- [x] Optimize the whole Natars creation process (Natars account/Artifacts/WW villages/WW building plans creation)
-
[ ] Rally Point
- [ ] Rally point dots #185
-
[ ] Profile bugs
- [ ] "Preferences" arent' coded yet. #247
- [ ] Prerequisites for entering in the vacation mode aren't coded yet.
- [ ] Make it possible to assign rights for sitters. #338 I KNOW THIS FUNCTION EXIST ALSO IN T3.6 http://travian.wikia.com/wiki/Sitters
- [x] On village name , you must leave players to put special chars like : 00. KILLUϺINA†I (i mean : , . †)
-
[ ] Admin panel
- [x] Rally point is not displayed in the village overview of the admin panel (A little confusion. In the old villages of the Rally point is displayed. In the newly created Rally point is not displayed.)
- [x] Add the ability not only to give a certain user a "plus" and "bonus" to the resources for the account, but also that it would be possible to delete it only in one user.
- [x] "Read reports" is incomplete. #517
- [x] "Read IGM" isn't coded yet. #285
- [ ] Alliance Admin Section is incomplete. #284
- [x] Cannot delete medals from player interface
- [x] Wall not see on player interface (village interface)
- [x] WW level isn't showed on the village interface.
- [x] WW level cannot be edited on the village interface.
- [x] A legend must be added on village interface
- [x] Search IGMs/Reports - not coded
- [x] Ban/UnBan Players not working properly (must verified)
- [ ] Server Resetting not work properly (must to be fixed) for restart the server without reinstall all game server.
- [x] On MAP section must to be added artifacts option (already added legend and artifact check) - must to be coded
- [x] Server Maintenence Not Work (URGENT FIX) For situation like today (a new page should be displayed instead of banning every player)
- [ ] Automatic Pushing Protection for resource / Automatic Conquering Protection
System / Automatic Enforced Game Rules
The following things are automatically enforced by the system. Therefore it is no longer possible that you get banned for sending too many resources or friendly conquering / attacking another village: the system will simply not allow you to do this. Automatic Pushing Protection
To get rid of the complete pushing (= excessive resource transfers) section in the rules we developed the below described automatic pushing protection system.
The limitations to the amount of resources a player may send to another one are now hard coded. Therefore it is no longer possible that you get banned for sending too many resources: the system will simply not allow you to do this.
The limitations are complicated and connected to the relationship between the accounts in question.
The different connection types are:
Type 1 Players were not sitters and have not used the same computer or the same network (IP) recently.
Type 2 Players have been sitters recently or have used the same network (IP).
Type 3 Players are currently sitters or used the same PC recently.
Additionally 6 transfer categories exist:
Resource transfers to a bigger player
Resource transfers to a smaller player
Resource transfers to a bigger player to feed own reinforcements
Resource transfers to a smaller player to feed own reinforcements
Raiding a bigger player
Raiding a smaller player
Hourly production
All limitations are based in the hourly production. The resources produced in an hour are calculated by summing up the production of lumber, clay, iron and crop (all crop produced minus the inhabitants of your account) for the complete account. Furthermore one hour of the last week's average net raiding (raiding income - resources lost by being raided) is added to give the hourly production for the account.
Possible combinations of resources:
If the resource transfers are limited to crop (e.g. feeding of reinforcements or supplying artefact villages) resource transfers which include other resources than crop may not be possible. Therefore you have to take care about the combination of resources you try to send away.
Sending resources in advance:
In some cases it is allowed to send resources for some days in advance. For example if you are allowed to send 7 days in advance, you could send the sum of the hourly production from Monday till Sunday all at once.
Rules for connection type 1
can send 2 production hours to bigger player (7 days in advance) but nothing if your account is smaller than 50 population
can send 3 production hours to smaller player (7 days in advance) but nothing if your account is smaller than 50 population
can send 150% crop consumed by your troops reinforcing the other player (100% for 24h in advance)
can send 300% crop consumed by your troops reinforcing the other player (100% for 24h in advance)
can raid bigger player unlimited (when in the same alliance §2 in this section applies)
can raid smaller player unlimited (when in the same alliance §1 in this section applies)
Rules for connection type 2
can send 1 production hours to bigger player (3 days in advance) but nothing if your account is smaller than 50 population
can send 2 production hours to smaller player (3 days in advance) but nothing if your account is smaller than 50 population
can send 125% crop consumed by your troops reinforcing the other player (100% for 12h in advance)
can send 150% crop consumed by your troops reinforcing the other player (100% for 12h in advance)
can raid bigger player unlimited (when in the same alliance §2 in this section applies)
raiding a smaller player is limited by §1 in this section
Rules for connection type 3
cannot send anything to bigger player, bigger player needs to send first
can send 2 hours production to smaller player (1 days in advance) but nothing if your account is smaller than 50 population
can send 100% crop consumed by your troops reinforcing the other player (100% for 6h in advance if the transfers are only crop)
can send 100% crop consumed by your troops reinforcing the other player (100% for 12h in advance if the transfers are only crop)
can raid bigger limited by §2 in this section
can raid smaller limited by §1 in this section
cannot raid villages that have been sent resources in the last 6h by a player you have connection type 3 with
Exceptions
Wonder of the World villages can be supplied unlimited.
Wonder of the World villages can be attacked and reinforced unlimited.
Artefact villages can be supplied with CROP unlimited.
Marketplace trades: If the trade balance (without raid and supply) is within 20% a trade is always possible.
Automatic Conquering Protection
The conquering limitations are also hard coded.
These limitations are not that complicated but also connected to the relationship between the accounts in question.
The different connection types are:
Type 1 Players were not sitters and have not used the same computer or the same network (IP) recently.
Type 2 Players have been sitters recently or have used the same network (IP).
Type 3 Players are currently sitters or used the same PC recently.
Rules for connection type 1
can conquer village when both players have not been in the same or an allied alliance within the last 2 days AND both players are not currently in alliances that have NAP with each others
Rules for connection type 2
can conquer village when there has been NO active sitter connection within the last 14 days AND both players have not been in the same or an allied alliance within the last 2 days AND both players are not currently in alliances that have NAP with each others
Rules for connection type 3
can NOT conquer village of each other
Exceptions
Wonder of the World villages can always be conquered as long as they are not the last village of the defender.
Artefact villages can always be conquered as long as they are not the last village or the capital of the defender.
-
[ ] General bugs
- [ ] During the enabled "Server Maintenance" turn off the hunger of troops.
- [ ] You shouldn't be able to finish researches/demolitions, etc. with gold in WW Villages
- [ ] The "Finish all constructions immedately" image shouldn't be displayed in WW Villages/with Residence/Palace only in the building queue
- [ ] Graphical statistics does not work (Not coded) #334.
- [ ] The "preview" button does not work #254.
- [x] Admin village incorrect creation #448.
- [ ] If you start a costruction with the master builder (and don't have enough resources), you can complete every building you'll add to the building queue in 0 seconds.
- [x] WWs can be built even if the WW Building plan(s) aren't active.
- [ ] You can queue a level 11 or greater resource field and then change the capital, to have level 11 or greater resources field in non-capital village.
- [x] Sometimes population isn't counted when a building is finished.
- [x] Troops in WW villages are too low.
- [x] You can't change the tag or the name of an alliance individually.
- [x] Population upkeep should be halved in WW Villages.
- [x] Oasis with 0 as a X or Y coordinate, cannot be attacked.
- [x] Scounting reports should be excluded from the raidlist.
- [x] Our hero isn't showed when spying a village (is showed when attacking it).
- [x] Oasis can't be raided through the raid list if ADMIN_ALLOW_INCOMIN_RAIDS is set to false.
- [x] When no troops return, "None of your soldiers returned" shoud be showed on the defender's report.
- [x] Some report icons are wrong, if all of the attacker's troops are killed/trapped during the battle.
- [x] Horse drinking trough train bonus is incorrect (should be 1% for level, for a maximum of 20%)
- [x] Change the issue code of medals #381
-
[x] Alliance bugs
- [x] You shouldn't be able to invite other players which already have an alliance.
- [x] Your permissions should be deleted when exiting from an alliance (or being kicked).
- [x] You can post on closed threads.
- [x] You can create threads on closed forums.
- [x] Other members shouldn't be able to edit alliance owner's permissions
-
[ ] Forum bugs
- [x] If there are unread messages on the forum this should be indicated by the corresponding icons
-
[ ] Gold Club bugs
- [ ] Raid List Statistics
- [ ] Search for 9 and 15 croppers including oases (already exists but without possibility to select oases)
- [x] evasion not work (The value of the number of troop withdrawals is not preserved. The value 0 is always set.)
- [ ] Evasion does not work properly (evasion is only set if we create a raidlist). Evasion and raidlist must work independently.
-
[ ] Raid List bugs
- [ ] Disable the button after sending a raidlist
-
[ ] Oasis
- [ ] every oasis should have a different production, based on their base bonus.
-
[x] Troops
- [x] Scouts of every tribe don't consume crop when returning from a scounting attack.
- [x] Scouts that are returning from a scouting attack, aren't displayed in the "Troops" section in dorf3.php.
-
[ ] Natars
- [ ] The removal of the lock from artifacts, villages of Natar, building scrolls in the 3 version of the game occurs the day after their appearance in the game. In the 4th version of the game, artifacts and building scrolls appear unlocked.
- [x] Add to the admin panel a section in which a list of all the artifacts will be displayed, which you can eventually add to the server.
- [x] Add to the admin panel a section in which you can add WW villages.
-
[x] WW village
- [x] Buildings that should be in the WW village: All Woodcutter of the 5th level All Clay Pit of the 5th level All Iron Mine of the 5th level All Cropland of the 6th level Main Building of the 10th level Marketplace of the 1th level Warehouse of the 20th level Warehouse of the 10th level Granary of the 20th level Granary of the 10th level
-
[ ] Artefact
- [x] The village with the artifact has a population of 163. It has the following buildings: 18 Cranny of the 10th level - 90 people Residence of the 10th level - 10 population Treasury of the 20th level - 62 people Rally Point of the 1th level - 1 people.
- [ ] Troops on a unique artifact is 1.5 times stronger than on a large one, and on a small one it is 0.65 times smaller. (Ie 1.5 = unique, 1 = larger, 0.65 = small)
- [x] After the artifact is captured, the Natarian village is always deleted.
- [ ] Natarian artifact villages are NOT uniformly distributed on the server. Unique artifacts are located densely around the center of the map. Large artifacts are located farther from center and less dense. Finally, small artifacts are farthest and sparsely distributed among the people of Travian. (There are some map and numerical values for this. If need it, I can give it.)
- [x] You can not destroy the artifact by destroying the village. In this case, the village will remain on the map with a population of 0. To eliminate the artifact from the game, you need to delete the account where it is located. Return the artifact to the game can only the administration at its discretion.
- [x] When you chief a Natars' village, no levels should be removed from resources field/building
- [x] You can remove the WW by removing it while building it at level 1 in the building queue (this is an old bug I've reintrouduced after the "removeBuilding" method rework).
@Shadowss update new files on a test server to start testing
All files has been updated today. All query are already executed in database. So is up to date.
I removed "The forum alliance is completely hackable" because I forgot to tick it in the previous post. Also I removed every bugs you posted here from the previous post (to not have duplicates).
Great ! I think first task is the hardest... I look forward for complete this 👍
Me too, it'll be the first one I'll complete, I already prepared the Automation class for the separation process.
Still there is one problem related to the alliance. When a player automatically drops out of the alliance (perhaps this is due to some rights of access to the management of the alliance), upon re-acceptance, it automatically receives the previously assigned access rights to the management. In the admin panel in the Alliance: Alliance Positions section, it is listed as a member of the alliance, although it is not.
Perhaps when exit the alliance, also lose the rights to manage the alliance? This is due to the innovation in the alliance, when the embassy is destroyed, the player automatically withdraws from the alliance.
You're right, if an alliance member is kicked or leave the alliance, his permissions (related to that alliance) should also be removed.
In the latest commit (f41666cabc07315372b0d6c8d0ee00cd257f4cee) I've separated Automation.php from the UI and users classes (Village.php, Building.php, etc.), it's only a test, I wanna know if everything works fine.
Try it by playing normally, every one second the Automation.php file will be called through a recursive JS function.
Let me know the results of your test and tell me if you'll notice a faster pages reload time.
Server updated !
Oh my GOD !
Calculated in 93 ms Calculated in 49 ms Calculated in 66 ms Calculated in 102 ms - Main building Calculated in 28 ms - training troops
@iopietro but every player online will now call the same page every 1 second. the automation should be handled by a cron. wich restart every minute. and runs for only 60 seconds.
@TerraSkye : on original Travian , automation is not run by cronjobs ! @iopietro : i receive this message on the game
@shadowss, was it before or after the new automation? What did they mean with "catapults" are glitching the whole game?
@TerraSkye, I said many times that's only a test, I've better solutions to handle the whole automation.
Also, you can't refresh the whole automation every 60 seconds. Every attack/construction finished will have a delay of about 60 seconds.
At me in general time of an attack after the expiration has gone to a minus.
@iopietro : that`s the whole message. Let me ask him.
I receive a screen. And an answer : of course, just a sec, and my troops are not returning back anymore somehow.
- https://imgur.com/a/W3YEUcs
- https://imgur.com/a/y4EjqGo
I update the server in this morning at 7:51:41 o'clock Romanian HOUR
He attack at 08:20:03 today, so yes , it`s on new automation
Do you have some recent errors in your error log file?
If the time goes to a minus value, is because there's an error somewhere because the method "sendUnitsComplete" doesn't get executed.
It could happens even because you've JS disabled on your browser and you're the only one online.
The server is 1 hour above my actual time zone. Is the server time equal to the Romanian time zone?
@iopietro im really impressed by the speed of reloading... very amazing :+1:
Yep, the loading speed of pages is really good now, but I've to resolve some bug that caused by the new automation system.
EDITED. POST TOO LONG
Ok, I'll fix it as soon as I can.
Fixed in: fca22ac98b86cbe4610575e60303399fe9c8bd18. Troops are still doubling (attacks will be performed 2 times in a row sometimes) and this is good, it's a good opportunity to finally fix the doubling troops bug.
@Shadowss, you can update your server.
@iopietro : Server updated.
Double troops bug dissapear when i change database to InnoDB and from NULL to NOT NULL
There are back again ??
Yep, it never disappeared, it's because 2 (or more) users can execute the method "sendUnitsComplete" at the same time. To fix this bug, we need a bettere "lock" system.
I changed all in database from unsigned to signed. But you know better than me 💃
IonCube explain me this :
As you can see, unsigned has minimum value of ZERO (NULL, 0) and if it goes below 0 it will go to max value 4294967295 - OVERFLOWED_VALUE , this is why you have many troops. Looking at PHP doc's (PHP: Integers - Manual), Unsigned integer is NOT supported but can be parsed.
function parse_unsigned_int($string) { $x = (float)$string; if ($x > (float)2147483647) $x -= (float)"4294967296"; return (int)$x; }
So best option would be just checking for values that go below 0 => make them to NULL and change unsigned to signed data type. This is the main reason why no one is developing Travian, only few private developers understand this. Someone will make a patch for the SQL that could fix everything.
Yes, but that was another bug, generated by overflowing an unsigned integer (by trying to bring it to -1, but it's not possible for an unsigned integer, so it will be assigned to the maximum integer 32 value = 4294967295).
The doubling troops bug is a different bug, caused by calling the method "sendUnitsComplete" at the same time by two or more users. This shouldn't be possible with our actual lock system, but it presents some fallacy, so we need to use a better lock system.
The "lock" term is used in multithreading applications, you have to use a lock when you don't want that two or more threads access to the same instructions at the same time. In our case, we have to prevent two or more different users to access to the same method, at the same time.
I removed the timer, because with this code, it caused too much load to the server. Automation.php will be now called only once for page refresh.
Fixed in 8605996533f5aa7b7e0c7ecf4fc6633859f7ffad. @Shadowss update your server :).
With the rework of the "lock" system I should have resolved a lot of problem related to "two or more users trying to access to the same method".
Update done.
Someone on game send me bugs :))))
https://imgur.com/a/EKb6h8n
@iopietro : time bug remain active in building
@iopietro @Shadowss
units searched desapered and cant search again in academy...
looking for more ;) btw : amazing job @iopietro and all of us helping :+1: this was gona stay the best version at this rate :1st_place_medal:
EDIT. POST TOO LONG