From a799afdbd9dbf3a9d4f204fc8032e09ee2b392b8 Mon Sep 17 00:00:00 2001 From: phaze1G Date: Thu, 14 Jun 2018 00:52:44 +0200 Subject: [PATCH 1/9] Small fix to calcualted/servertime (#548) * Calcuated & server time * Update plus1.php * Update rules.php * Update menu.tpl * Update maintenance.php * Update version.php * Update dorf3.php * Update karte.php * Update berichte.php * Update dorf2.php * Update plus.php * Update warsim.php * Update support.php * Update statistiken.php * Update nachrichten.php * Update spieler.php * Update crop_finder.php * Update winner.php * Update a2b2.php --- Templates/menu.tpl | 10 +++++----- a2b2.php | 6 ++++-- berichte.php | 6 +++--- crop_finder.php | 12 +++--------- dorf2.php | 4 ++-- dorf3.php | 4 ++-- karte.php | 6 +++--- logout.php | 6 +++--- maintenance.php | 7 +++++-- nachrichten.php | 6 +++--- plus.php | 6 +++--- plus1.php | 6 +++--- rules.php | 6 +++--- spieler.php | 4 ++-- statistiken.php | 6 +++--- support.php | 4 ++-- version.php | 4 ++-- warsim.php | 4 ++-- winner.php | 7 +++++-- 19 files changed, 58 insertions(+), 56 deletions(-) diff --git a/Templates/menu.tpl b/Templates/menu.tpl index 3b01b773..29ca87bf 100644 --- a/Templates/menu.tpl +++ b/Templates/menu.tpl @@ -121,11 +121,11 @@ div.c1 {text-align: center}
- Calculated in pageLoadTimeEnd()-$start_timer)*1000); - ?> ms -
- Server time: + pageLoadTimeEnd()-$start_timer)*1000); +?> ms + +
diff --git a/a2b2.php b/a2b2.php index e2547f3f..66033233 100644 --- a/a2b2.php +++ b/a2b2.php @@ -359,9 +359,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms + pageLoadTimeEnd()-$start_timer)*1000); +?> ms -
Server time: +
diff --git a/berichte.php b/berichte.php index f0ec9520..add05dbf 100644 --- a/berichte.php +++ b/berichte.php @@ -136,15 +136,15 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/crop_finder.php b/crop_finder.php index ead411d2..7b4b6780 100644 --- a/crop_finder.php +++ b/crop_finder.php @@ -226,17 +226,11 @@ include("Templates/news.tpl");
-Calculated in pageLoadTimeEnd() - $start_timer) * 1000); - + pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/dorf2.php b/dorf2.php index 8e69b574..656a422f 100644 --- a/dorf2.php +++ b/dorf2.php @@ -93,11 +93,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/dorf3.php b/dorf3.php index c69d734e..58db23a2 100644 --- a/dorf3.php +++ b/dorf3.php @@ -112,11 +112,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/karte.php b/karte.php index e2ad874b..72252678 100644 --- a/karte.php +++ b/karte.php @@ -109,14 +109,14 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/logout.php b/logout.php index cc9511ac..b6a6d6ac 100644 --- a/logout.php +++ b/logout.php @@ -83,14 +83,14 @@ include("Templates/footer.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/maintenance.php b/maintenance.php index 86205c79..341062d4 100644 --- a/maintenance.php +++ b/maintenance.php @@ -108,8 +108,11 @@ if($_SESSION['ok'] == 2){
- Calculated in pageLoadTimeEnd()-$start_timer)*1000);?> ms -
Server time: + pageLoadTimeEnd()-$start_timer)*1000); +?> ms + +
diff --git a/nachrichten.php b/nachrichten.php index af0d76f3..74271174 100644 --- a/nachrichten.php +++ b/nachrichten.php @@ -172,14 +172,14 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/plus.php b/plus.php index 003dae03..eb19f837 100644 --- a/plus.php +++ b/plus.php @@ -170,15 +170,15 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/plus1.php b/plus1.php index 066a5450..be628d7d 100644 --- a/plus1.php +++ b/plus1.php @@ -97,15 +97,15 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/rules.php b/rules.php index 10796f38..7bddde5e 100644 --- a/rules.php +++ b/rules.php @@ -87,14 +87,14 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
- \ No newline at end of file + diff --git a/spieler.php b/spieler.php index 3532bc08..1f5b0f10 100644 --- a/spieler.php +++ b/spieler.php @@ -180,11 +180,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/statistiken.php b/statistiken.php index 0f0b1285..d6a4cf5e 100644 --- a/statistiken.php +++ b/statistiken.php @@ -190,11 +190,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$__start)*1000); + pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/support.php b/support.php index 719bf1a9..00655677 100644 --- a/support.php +++ b/support.php @@ -160,11 +160,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/version.php b/version.php index 427a5f3e..91ffbce9 100644 --- a/version.php +++ b/version.php @@ -127,11 +127,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/warsim.php b/warsim.php index 9d2a586e..4e3282a9 100644 --- a/warsim.php +++ b/warsim.php @@ -184,11 +184,11 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms -
Server time: +
diff --git a/winner.php b/winner.php index 44f5bbeb..bddb0184 100644 --- a/winner.php +++ b/winner.php @@ -243,8 +243,11 @@ if(isset($_GET['newdid'])) {
- Calculated in pageLoadTimeEnd()-$start_timer)*1000);?> ms -
Server time: + pageLoadTimeEnd()-$start_timer)*1000); +?> ms + +
From 9efbe9ffd9ae087e2225bb8579434a020e1a744b Mon Sep 17 00:00:00 2001 From: iopietro Date: Fri, 15 Jun 2018 02:31:37 +0200 Subject: [PATCH 2/9] General fixes +Fixed a bug that didn't permit to create users' villages in small maps, from the admin panel --- GameEngine/Admin/Mods/addUsers.php | 2 +- GameEngine/Database.php | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/GameEngine/Admin/Mods/addUsers.php b/GameEngine/Admin/Mods/addUsers.php index b5124ad7..32382fd3 100755 --- a/GameEngine/Admin/Mods/addUsers.php +++ b/GameEngine/Admin/Mods/addUsers.php @@ -135,7 +135,7 @@ WHERE id = ".(int) $uid) or die(mysqli_error($database->dblink)); } $database->updateUserField($uid,"act","",1); - $wid = $database->generateBase($kid,0,false); + $wid = $database->generateBase($kid); $database->setFieldTaken($wid); //calculate random generate value and level building diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 0c6f8e8a..7e5fca93 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -1288,17 +1288,17 @@ class MYSQLi_DB implements IDbConnection { } switch($sector){ - case 1: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x- y+ - break; - case 2: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x+ y+ - break; - case 3: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x- y- - break; - default: - $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x+ y- + case 1: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x- y+ + break; + case 2: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x+ y+ + break; + case 3: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x- y- + break; + default: + $q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x+ y- } $result = mysqli_query($this->dblink,$q); From 8861a578e4513b24bf4469bdf9b25c47a746f459 Mon Sep 17 00:00:00 2001 From: iopietro Date: Sun, 17 Jun 2018 01:48:40 +0200 Subject: [PATCH 3/9] 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.) --- GameEngine/Automation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index c7ba7a7c..82ebcd9d 100755 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -3889,7 +3889,7 @@ class Automation { $starv = $getVillage['starv']; if ($crop < $villageUpkeep){ //Add starvation data - $database->setVillageFields($wref, ['starv', 'starvupdate'], [$villageUpkeep, time()]); + $database->setVillageFields($wref, ['starv'], [$villageUpkeep]); } } } From 7fde3e5ec2f489957e28a14000d74617db4207a3 Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Sun, 17 Jun 2018 14:01:53 +0300 Subject: [PATCH 4/9] Fix the display of long words in the profile Now the long words in the player's description are not hidden but are transferred to a new line --- Templates/Profile/overview.tpl | 2 +- gpack/travian_default/lang/en/compact.css | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Templates/Profile/overview.tpl b/Templates/Profile/overview.tpl index 7b533045..7e5deca9 100644 --- a/Templates/Profile/overview.tpl +++ b/Templates/Profile/overview.tpl @@ -146,7 +146,7 @@ if($displayarray['vac_mode'] == 1) echo ", Effect ' . $effect . ' '; echo '' . $database->getVillageField($artefact['vref'], "name") . ''; - echo '' . date("d/m/Y H:i", $artefact['conquered']) . ''; + echo '' . date("d.m.Y H:i", $artefact['conquered']) . ''; } } From 1a9f71e23da6ed18944d9fcbd5b8dfb9443fdbd4 Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Sun, 17 Jun 2018 18:40:13 +0300 Subject: [PATCH 7/9] General fixes +Activation correction plus (it was not displayed correctly) +Added a transfer to a new line of long words in the admin panel (for the description of the player's profile and the alliance) --- Admin/Templates/alliance.tpl | 8 ++++---- Templates/Plus/3.tpl | 2 +- img/admin/admin.css | 13 ++++++++++++- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Admin/Templates/alliance.tpl b/Admin/Templates/alliance.tpl index 211049a3..0c08f733 100644 --- a/Admin/Templates/alliance.tpl +++ b/Admin/Templates/alliance.tpl @@ -151,9 +151,9 @@ if($_GET['aid']) -
+
-
+
@@ -163,9 +163,9 @@ if($_GET['aid']) -
+
-
+
diff --git a/Templates/Plus/3.tpl b/Templates/Plus/3.tpl index 348eb151..e080d736 100644 --- a/Templates/Plus/3.tpl +++ b/Templates/Plus/3.tpl @@ -71,6 +71,7 @@ else $holdmr = intval($holdtotmin - (($holdhr * 60) + ($holdtotday * 1440))); echo " " . ($holdmr) . " mins
"; } +} ?> = 86400) { echo 'too little gold'; } } -} ?> diff --git a/img/admin/admin.css b/img/admin/admin.css index 5ed7631c..c53cb573 100644 --- a/img/admin/admin.css +++ b/img/admin/admin.css @@ -527,7 +527,7 @@ table#profile thead th, table#profile tfoot th {background-image:url(../un/a/c2. table#profile thead td, table#profile tfoot td {background-color:#F3F3F3; text-align:center; width:50%;} table#profile tbody th, table#profile tbody td {text-align:left;} table#profile td.details {width:50%; height:156px; padding:0px; vertical-align:top; border-bottom:none;} -table#profile td.details table {border-collapse:collapse; line-height:16px; margin-top:0px; width:100%;} +table#profile td.details table {border-collapse:collapse; line-height:16px; margin-top:0px; width:100%; height:100%} table#profile td.details table th {width:50%; border-left:none; border-top:none; background:none;} table#profile td.details table td {border-right:none; border-left:none; border-top:none; text-align:left;} table#profile td.desc1, table#profile td.desc2 {width:50%; padding:0px 7px; vertical-align:middle;} @@ -572,6 +572,17 @@ input#btn_forward {width:97px; background-image: url(b/forward.gif);} input#btn_demolish {width:97px; background-image: url(b/demolish.gif);} input#btn_search {width:97px; background-image: url(b/search.gif);} +.desc1div { + width: 235px; + word-wrap: break-word; + overflow-wrap: break-word; +} +.desc2div { + width: 234px; + word-wrap: break-word; + overflow-wrap: break-word; +} + /* Start tooltips for the admin panel settings */ .tooltip { position: relative; From ce83e0fde53260a7797ca05af0726335a5dafafb Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Mon, 18 Jun 2018 13:38:06 +0300 Subject: [PATCH 8/9] Little forgetfulness --- Admin/Templates/playerinfo.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Admin/Templates/playerinfo.tpl b/Admin/Templates/playerinfo.tpl index 370b0afd..103d6705 100644 --- a/Admin/Templates/playerinfo.tpl +++ b/Admin/Templates/playerinfo.tpl @@ -261,9 +261,9 @@ - +
- +
From 4eadb214c0cf7e1f12492f57515979118c595884 Mon Sep 17 00:00:00 2001 From: Vladyslav Date: Mon, 18 Jun 2018 14:41:32 +0300 Subject: [PATCH 9/9] Changing sections of the alliance description The alliance description sections in the admin panel are swapped (as it looks in the overview of the alliance in the game) --- Admin/Templates/alliance.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Admin/Templates/alliance.tpl b/Admin/Templates/alliance.tpl index 0c08f733..8d211d51 100644 --- a/Admin/Templates/alliance.tpl +++ b/Admin/Templates/alliance.tpl @@ -91,7 +91,7 @@ if($_GET['aid']) $player = mysqli_fetch_assoc(mysqli_query($GLOBALS["link"], "SELECT * FROM ".TB_PREFIX."users WHERE id = ".(int) $row['uid']."")); if($row['opt1'] == 1) { $position1 = "Assign To Position"; } else { $position1 = "No Assigning Positions"; } if($row['opt2'] == 1) { $position2 = "Kick Players"; } else { $position2 = "No Kicking Players"; } - if($row['opt3'] == 1) { $position3 = "Change Alliance Description"; } else { $position3 = "No Changing Description"; } + if($row['opt3'] == 1) { $position3 = "Change Description"; } else { $position3 = "No Changing Description"; } if($row['opt4'] == 1) { $position4 = "Invite Players"; } else { $position4 = "No Invitations"; } if($row['opt5'] == 1) { $position5 = "Manage Forums"; } else { $position5 = "No Forum Management"; } if($row['opt6'] == 1) { $position6 = "Alliance Diplomacy"; } else { $position6 = "No Diplomacy"; } @@ -152,7 +152,7 @@ if($_GET['aid'])
- +
@@ -164,7 +164,7 @@ if($_GET['aid'])
- +