From 5270b1ca306a82eab9070845396659547639e591 Mon Sep 17 00:00:00 2001
From: iopietro
Date: Tue, 17 Apr 2018 22:54:07 +0200
Subject: [PATCH] Fixed bugs in trade routes
+Trade routes can't be hacked anymore
+Fixed a bug that permitted to choose any village when adding a trade
route
+Fixed a bug that permitted to choose a time greater than 23 and less
than 0
+Fixed a bug that permitted to choose a number of repetitions greater
than 3 and less than 1
+Fixed a bug that permitted to edit other players trade route
+Fixed a bug that permitted to create a trading route with the same
village you were in
+Fixed some minor bugs
+Reworked the post/get request system, it's buch better now
---
GameEngine/Lang/en.php | 8 +-
Templates/Build/17_4.tpl | 20 ++--
Templates/Build/17_create.tpl | 4 +-
Templates/Build/17_edit.tpl | 6 +-
build.php | 193 ++++++++++++++++------------------
5 files changed, 107 insertions(+), 124 deletions(-)
diff --git a/GameEngine/Lang/en.php b/GameEngine/Lang/en.php
index ca4722d9..fa404081 100755
--- a/GameEngine/Lang/en.php
+++ b/GameEngine/Lang/en.php
@@ -891,10 +891,10 @@ define("EXTEND","Extend");
define("EDIT","Edit");
define("EXTEND_TRADE_ROUTES","Extend the trade route by 7 days for");
define("CREATE_TRADE_ROUTES","Create new trade route");
-define("DELIVERIES","deliveries");
-define("START_TIME_TRADE","start time");
+define("DELIVERIES","Deliveries");
+define("START_TIME_TRADE","Start time");
define("CREATE_TRADE_ROUTE","Create trade route");
-define("TARGET_VILLAGE","target village");
+define("TARGET_VILLAGE","Target village");
define("EDIT_TRADE_ROUTES","Edit trade route");
define("TRADE_ROUTES_DESC","Trade route allows you to set up routes for your merchant that he will walk every day at a certain hour.
Standard this holds on for 7 days, but you can extend it with 7 days for the cost of");
define("NPC_TRADE_DESC","With the NPC merchant you can distribute the resources in your warehouse as you desire.
The first line shows the current stock. In the second line you can choose another distribution. The third line shows the difference between the old and new stock.");
@@ -1114,7 +1114,7 @@ define("BUILDING_BEING_DEMOLISHED","Building presently being demolished");
define("COSTS_UPGRADING_LEVEL","Costs for upgrading to level");
define("WORKERS_ALREADY_WORK","The workers are already at work.");
define("CONSTRUCTING_MASTER_BUILDER","Constructing with master builder ");
-define("COSTS","costs");
+define("COSTS","Costs");
define("GOLD","Gold");
define("WORKERS_ALREADY_WORK_WAITING","The workers are already at work. (waiting loop)");
define("ENOUGH_FOOD_EXPAND_CROPLAND","Not enough food. Expand cropland.");
diff --git a/Templates/Build/17_4.tpl b/Templates/Build/17_4.tpl
index 36ffec5c..7dabaf9e 100644
--- a/Templates/Build/17_4.tpl
+++ b/Templates/Build/17_4.tpl
@@ -7,23 +7,19 @@
gold > 1){
$routeaccess = 1;
include("17_create.tpl");
-}else if($_GET['action'] == 'editRoute' && isset($_GET['routeid']) && $_GET['routeid'] != ""){
-$traderoute = $database->getTradeRouteUid($_GET['routeid']);
-if($traderoute == $session->uid){
+}else if($_POST['action'] == 'editRoute' && isset($_POST['routeid']) && !empty($_POST['routeid']) && $database->getTradeRouteUid($_POST['routeid']) == $session->uid){
include("17_edit.tpl");
-}
}else{
?>
2.
-
+
*
2
+
:
- 2
+ 2
|
|
: |
- 7
+ 7
|
diff --git a/Templates/Build/17_edit.tpl b/Templates/Build/17_edit.tpl
index f9d0dc37..f6d4ef40 100644
--- a/Templates/Build/17_edit.tpl
+++ b/Templates/Build/17_edit.tpl
@@ -1,8 +1,8 @@
-getTradeRoute2($_GET['routeid']); ?>
+getTradeRoute2($_POST['routeid']); ?>