From 82202c50893064e1f5784151fee4a94bcda3e0b4 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Mon, 30 Oct 2017 09:31:56 +0100 Subject: [PATCH] fix: Calculated In time sometimes invalid due to $start variable reuse --- Templates/menu.tpl | 2 +- a2b.php | 2 +- a2b2.php | 4 ++-- allianz.php | 2 +- banned.php | 4 ++-- berichte.php | 4 ++-- create_account.php | 4 ++-- dorf1.php | 4 ++-- dorf2.php | 4 ++-- dorf3.php | 4 ++-- karte.php | 4 ++-- logout.php | 4 ++-- nachrichten.php | 4 ++-- packages.php | 4 ++-- plus.php | 4 ++-- plus1.php | 4 ++-- rules.php | 4 ++-- spieler.php | 4 ++-- support.php | 4 ++-- version.php | 4 ++-- warsim.php | 4 ++-- winner.php | 4 ++-- 22 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Templates/menu.tpl b/Templates/menu.tpl index 78d56af8..303fafbf 100644 --- a/Templates/menu.tpl +++ b/Templates/menu.tpl @@ -117,7 +117,7 @@ div.c1 {text-align: center}
Calculated in pageLoadTimeEnd()-$start)*1000); + echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/a2b.php b/a2b.php index 8bcec895..029006c5 100644 --- a/a2b.php +++ b/a2b.php @@ -14,7 +14,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; if(isset($_GET['w'])) { diff --git a/a2b2.php b/a2b2.php index caa19e09..3618b7f6 100644 --- a/a2b2.php +++ b/a2b2.php @@ -16,7 +16,7 @@ include("GameEngine/Village.php"); AccessLogger::logRequest(); $amount = $_SESSION['amount']; -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -362,7 +362,7 @@ include("Templates/res.tpl");
-Calculated in pageLoadTimeEnd()-$start)*1000); ?> ms +Calculated in pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time:
diff --git a/allianz.php b/allianz.php index 6ff74035..9165a8aa 100644 --- a/allianz.php +++ b/allianz.php @@ -7,7 +7,7 @@ include ("GameEngine/Village.php"); include ("GameEngine/Chat.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); $alliance->procAlliance($_GET); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; diff --git a/banned.php b/banned.php index b16af3ba..ea6c60bf 100644 --- a/banned.php +++ b/banned.php @@ -14,7 +14,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if($session->access == BANNED){ ?> @@ -83,7 +83,7 @@ include("Templates/res.tpl")
pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
diff --git a/berichte.php b/berichte.php index d96ecc8a..560688df 100644 --- a/berichte.php +++ b/berichte.php @@ -15,7 +15,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); $message->noticeType($_GET); $message->procNotice($_POST); if(isset($_GET['newdid'])) { @@ -154,7 +154,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/create_account.php b/create_account.php index e1f04472..fb9ca886 100644 --- a/create_account.php +++ b/create_account.php @@ -45,7 +45,7 @@ AccessLogger::logRequest(); die("Access Denied: You are not Admin!"); }else{ -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); ?> @@ -555,7 +555,7 @@ include("Templates/res.tpl")
pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
diff --git a/dorf1.php b/dorf1.php index 2bc5bbcf..cb0521d8 100644 --- a/dorf1.php +++ b/dorf1.php @@ -14,7 +14,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['ok'])){ $database->updateUserField($session->uid,'ok','0','1'); $_SESSION['ok'] = '0'; } @@ -106,7 +106,7 @@ include("Templates/res.tpl");
pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
diff --git a/dorf2.php b/dorf2.php index 4e1d3425..a444c6ef 100644 --- a/dorf2.php +++ b/dorf2.php @@ -14,7 +14,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; $database->query("UPDATE ".TB_PREFIX."users SET village_select=".$database->escape((int) $_GET['newdid'])." WHERE id=".$session->uid); @@ -94,7 +94,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/dorf3.php b/dorf3.php index c37f105b..900a7692 100644 --- a/dorf3.php +++ b/dorf3.php @@ -16,7 +16,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; $database->query("UPDATE ".TB_PREFIX."users SET village_select=".$database->escape((int) $_GET['newdid'])." WHERE id=".$session->uid); @@ -113,7 +113,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/karte.php b/karte.php index 8c732225..e0957e38 100644 --- a/karte.php +++ b/karte.php @@ -16,7 +16,7 @@ if(isset($_GET['z']) && !is_numeric($_GET['z'])) die('Hacking Attempt'); include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; if(isset($_GET['d']) && isset($_GET['c'])){ @@ -111,7 +111,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/logout.php b/logout.php index 3e8dab5b..2c6c35b3 100644 --- a/logout.php +++ b/logout.php @@ -16,7 +16,7 @@ use App\Utils\AccessLogger; include("GameEngine/Account.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); ?> @@ -83,7 +83,7 @@ include("Templates/footer.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/nachrichten.php b/nachrichten.php index a74b9a56..4c442dc8 100644 --- a/nachrichten.php +++ b/nachrichten.php @@ -16,7 +16,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); $message->procMessage($_POST); if(isset($_GET['t']) && $_GET['t'] == 1){ $automation->isWinner(); @@ -169,7 +169,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/packages.php b/packages.php index 4f3dd5db..144be1b7 100644 --- a/packages.php +++ b/packages.php @@ -14,7 +14,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); $id = $_GET['id']; if($session->access != BANNED){ ?> @@ -101,7 +101,7 @@ include("Templates/res.tpl")
pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
diff --git a/plus.php b/plus.php index b0fbc6be..4f7d8e78 100644 --- a/plus.php +++ b/plus.php @@ -16,7 +16,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -174,7 +174,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/plus1.php b/plus1.php index 291ada13..8975e26a 100644 --- a/plus1.php +++ b/plus1.php @@ -5,7 +5,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -97,7 +97,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/rules.php b/rules.php index dca15735..157062ea 100644 --- a/rules.php +++ b/rules.php @@ -16,7 +16,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -88,7 +88,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/spieler.php b/spieler.php index 0ce69f1e..7d6aa5c3 100644 --- a/spieler.php +++ b/spieler.php @@ -15,7 +15,7 @@ ob_start(); include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); $profile->procProfile($_POST); $profile->procSpecial($_GET); if(isset($_GET['newdid'])) { @@ -186,7 +186,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/support.php b/support.php index f9ba4c77..038c74e5 100644 --- a/support.php +++ b/support.php @@ -15,7 +15,7 @@ include("GameEngine/Village.php"); AccessLogger::logRequest(); $amount = $_SESSION['amount']; -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -164,7 +164,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/version.php b/version.php index feaa7f3f..44577479 100644 --- a/version.php +++ b/version.php @@ -17,7 +17,7 @@ include("GameEngine/Village.php"); AccessLogger::logRequest(); $amount = $_SESSION['amount']; -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -125,7 +125,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/warsim.php b/warsim.php index b9c3c239..fe3485f1 100644 --- a/warsim.php +++ b/warsim.php @@ -16,7 +16,7 @@ use App\Utils\AccessLogger; include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); $battle->procSim($_POST); ?> @@ -192,7 +192,7 @@ include("Templates/res.tpl");
Calculated in pageLoadTimeEnd()-$start)*1000); +echo round(($generator->pageLoadTimeEnd()-$start_timer)*1000); ?> ms
Server time: diff --git a/winner.php b/winner.php index 76fda738..f769bcdb 100644 --- a/winner.php +++ b/winner.php @@ -31,7 +31,7 @@ if (!function_exists('mysqli_result')) { include("GameEngine/Village.php"); AccessLogger::logRequest(); -$start = $generator->pageLoadTimeStart(); +$start_timer = $generator->pageLoadTimeStart(); if(isset($_GET['newdid'])) { $_SESSION['wid'] = $_GET['newdid']; header("Location: ".$_SERVER['PHP_SELF']); @@ -256,7 +256,7 @@ $q = "
- Calculated in pageLoadTimeEnd()-$start)*1000);?> ms + Calculated in pageLoadTimeEnd()-$start_timer)*1000);?> ms
Server time: