From 3a7ff0dddcb57dfb692c6512759d74f69506784d Mon Sep 17 00:00:00 2001
From: Shadow <1140613+Shadowss@users.noreply.github.com>
Date: Tue, 14 Nov 2017 13:15:36 +0200
Subject: [PATCH 1/3] fix vacation mode for market
---
GameEngine/Market.php | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/GameEngine/Market.php b/GameEngine/Market.php
index ed2bc019..5902d54f 100755
--- a/GameEngine/Market.php
+++ b/GameEngine/Market.php
@@ -104,6 +104,11 @@ class Market
header("Location: banned.php");
exit;
}
+ //check if vacation mode:
+ elseif($database->getvacmodexy($id)){
+ $form->addError("error","User is on vacation mode");
+ //break;
+ }
else if($availableWood >= $post['r1'] AND $availableClay >= $post['r2'] AND $availableIron >= $post['r3'] AND $availableCrop >= $post['r4'])
{
$resource = array($wtrans,$ctrans,$itrans,$crtrans);
@@ -370,4 +375,4 @@ class Market
};
$market = new Market;
-?>
\ No newline at end of file
+?>
From fbbe815e3f891602acad89e56d623cb685933373 Mon Sep 17 00:00:00 2001
From: Shadow <1140613+Shadowss@users.noreply.github.com>
Date: Tue, 14 Nov 2017 13:41:30 +0200
Subject: [PATCH 2/3] not fixed , dont receive error for sending resource
---
GameEngine/Market.php | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/GameEngine/Market.php b/GameEngine/Market.php
index 5902d54f..f3fad3ca 100755
--- a/GameEngine/Market.php
+++ b/GameEngine/Market.php
@@ -85,7 +85,7 @@ class Market
private function sendResource($post)
{
- global $database,$village,$session,$generator,$logging;
+ global $database,$village,$session,$generator,$logging,$form;
$wtrans = (isset($post['r1']) && $post['r1'] != "")? $post['r1'] : 0;
$ctrans = (isset($post['r2']) && $post['r2'] != "")? $post['r2'] : 0;
@@ -99,16 +99,15 @@ class Market
$availableClay = $database->getClayAvailable($village->wid);
$availableIron = $database->getIronAvailable($village->wid);
$availableCrop = $database->getCropAvailable($village->wid);
+ //check if vacation mode:
+ if($database->getvacmodexy($id)){
+ $form->addError("error","User is on vacation mode");
+ }
if($session->access == BANNED)
{
header("Location: banned.php");
exit;
}
- //check if vacation mode:
- elseif($database->getvacmodexy($id)){
- $form->addError("error","User is on vacation mode");
- //break;
- }
else if($availableWood >= $post['r1'] AND $availableClay >= $post['r2'] AND $availableIron >= $post['r3'] AND $availableCrop >= $post['r4'])
{
$resource = array($wtrans,$ctrans,$itrans,$crtrans);
From 63eae219d4feb794abb50f5acce7e4e4fe34b626 Mon Sep 17 00:00:00 2001
From: Shadow <1140613+Shadowss@users.noreply.github.com>
Date: Tue, 14 Nov 2017 13:43:27 +0200
Subject: [PATCH 3/3] vacation mode enabled only for username Shadow
---
Templates/Profile/menu.tpl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Templates/Profile/menu.tpl b/Templates/Profile/menu.tpl
index 43401c51..ae119691 100644
--- a/Templates/Profile/menu.tpl
+++ b/Templates/Profile/menu.tpl
@@ -3,7 +3,13 @@
| >Profile
| >Preferences
| >Account
+
| >Vacation
+