fix: quests do not progress

#354
This commit is contained in:
Martin Ambrus
2017-11-20 11:06:54 +01:00
parent b7e9c4edcb
commit 4a7ab1f81a
3 changed files with 102 additions and 102 deletions
+3 -3
View File
@@ -837,8 +837,8 @@ class MYSQLi_DB implements IDbConnection {
// update cached values // update cached values
if ($ret = mysqli_query($this->dblink,$q)) { if ($ret = mysqli_query($this->dblink,$q)) {
foreach ($field as $index => $fieldName) { foreach ($field as $index => $fieldName) {
if (isset(self::$fieldsCache[$ref.$switch][$fieldName])) if (isset(self::$fieldsCache[$ref.($switch ? 0 : 1)][$fieldName]))
self::$fieldsCache[$ref.$switch][$fieldName] = $value[$index]; self::$fieldsCache[$ref.($switch ? 0 : 1)][$fieldName] = $value[$index];
} }
} }
@@ -3622,7 +3622,7 @@ class MYSQLi_DB implements IDbConnection {
$array2 = $this->getVillage(0, 4); $array2 = $this->getVillage(0, 4);
$vill = $array2['wref']; $vill = $array2['wref'];
if(mysqli_num_rows(mysqli_query($this->dblink,$q)) > 0){ if ($array && count($array)){
foreach($array as $village){ foreach($array as $village){
$coor2 = $this->getCoor($village['wref']); $coor2 = $this->getCoor($village['wref']);
$max = 2 * WORLD_MAX + 1; $max = 2 * WORLD_MAX + 1;
+1 -1
View File
@@ -196,7 +196,7 @@ define("Q11_ORDER","Order:</p>Look for the coordinates of ");
define("Q11_ORDER1","and enter them here."); define("Q11_ORDER1","and enter them here.");
define("Q11_RESP","Exactly, there "); define("Q11_RESP","Exactly, there ");
define("Q11_RESP1"," Village! As many resources as you reach this village. Well, almost as much ..."); define("Q11_RESP1"," Village! As many resources as you reach this village. Well, almost as much ...");
define("Q11_BUTN","completar misi&oacute;n"); define("Q11_BUTN","complete task");
define("Q12","Task 12: Cranny"); define("Q12","Task 12: Cranny");
define("Q12_DESC","It's getting time to erect a cranny. The world of <?php echo SERVER_NAME; ?> is dangerous.<br \/><br \/>Many players live by stealing other players' resources. Build a cranny to hide some of your resources from enemies."); define("Q12_DESC","It's getting time to erect a cranny. The world of <?php echo SERVER_NAME; ?> is dangerous.<br \/><br \/>Many players live by stealing other players' resources. Build a cranny to hide some of your resources from enemies.");
+8 -8
View File
@@ -50,7 +50,7 @@ if (isset($qact)){
$qact = $currentQuest; $qact = $currentQuest;
} }
if ($check_quest==$qact) { if ($check_quest===$qact) {
//avoid hacking gold, resources or reward -- added by Ronix //avoid hacking gold, resources or reward -- added by Ronix
}else { }else {
switch($qact) { switch($qact) {
@@ -76,7 +76,7 @@ if (isset($qact)){
break; break;
case '3': case '3':
$database->updateUserField($_SESSION['username'],'quest','3',0); $database->updateUserField($_SESSION['username'],'quest','3',0,false);
$_SESSION['qst']= 3; $_SESSION['qst']= 3;
//Give Reward //Give Reward
if(!$session->plus){ if(!$session->plus){
@@ -124,11 +124,11 @@ if (isset($qact)){
//Give Reward //Give Reward
$gold=$database->getUserField($_SESSION['username'],'gold','username'); $gold=$database->getUserField($_SESSION['username'],'gold','username');
$gold+=20; $gold+=20;
$database->updateUserField($_SESSION['username'],'gold',$gold,0); $database->updateUserField($_SESSION['username'],'gold',$gold,0,false);
break; break;
case '8': case '8':
$database->updateUserField($_SESSION['username'],'quest','8',0); $database->updateUserField($_SESSION['username'],'quest','8',0,false);
$_SESSION['qst']= 8; $_SESSION['qst']= 8;
//Give Reward //Give Reward
$database->modifyResource($session->villages[0],75,80,30,50,1); $database->modifyResource($session->villages[0],75,80,30,50,1);
@@ -485,7 +485,7 @@ if ($vName==$session->userinfo['username']."'s village"){?>
// Compare real player rank with submited rank // Compare real player rank with submited rank
$temp['uid']=$session->userinfo['id']; $temp['uid']=$session->userinfo['id'];
$ranking->procRankReq($temp); $ranking->procRankReq($temp);
$displayarray = $database->getUserArray($temp['uid'],1); $displayarray = $database->getUserArray($temp['uid'],1,false);
$rRes=$ranking->searchRank($displayarray['username'],"username"); $rRes=$ranking->searchRank($displayarray['username'],"username");
if (!isset($rSubmited)) { if (!isset($rSubmited)) {
$rSubmited = null; $rSubmited = null;
@@ -626,7 +626,7 @@ if ($mainbuilding<3){?>
// Compare real player rank with submited rank // Compare real player rank with submited rank
$temp['uid']=$session->userinfo['id']; $temp['uid']=$session->userinfo['id'];
$ranking->procRankReq($temp); $ranking->procRankReq($temp);
$displayarray = $database->getUserArray($temp['uid'],1); $displayarray = $database->getUserArray($temp['uid'],1,false);
$rRes=$ranking->searchRank($displayarray['username'],"username"); $rRes=$ranking->searchRank($displayarray['username'],"username");
if (!isset($rSubmited) || $rRes!=$rSubmited){ ?> if (!isset($rSubmited) || $rRes!=$rSubmited){ ?>
{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q16; ?><\/h1><br \/><i>&rdquo;<?php echo Q16_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q16_ORDER; ?><\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"qst_next('','rank',document.getElementById('qst_val').value)\" type=\"button\" value=\"<?php echo Q_BUTN; ?>\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":"-16","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99} {"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q16; ?><\/h1><br \/><i>&rdquo;<?php echo Q16_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q16_ORDER; ?><\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"qst_next('','rank',document.getElementById('qst_val').value)\" type=\"button\" value=\"<?php echo Q_BUTN; ?>\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":"-16","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
@@ -956,7 +956,7 @@ if ($vName==$session->userinfo['username']."'s village"){?>
// Compare real player rank with submited rank // Compare real player rank with submited rank
$temp['uid']=$session->userinfo['id']; $temp['uid']=$session->userinfo['id'];
$ranking->procRankReq($temp); $ranking->procRankReq($temp);
$displayarray = $database->getUserArray($temp['uid'],1); $displayarray = $database->getUserArray($temp['uid'],1,false);
$rRes=$ranking->searchRank($displayarray['username'],"username"); $rRes=$ranking->searchRank($displayarray['username'],"username");
if (!isset($rSubmited) || $rRes!=$rSubmited){ ?> if (!isset($rSubmited) || $rRes!=$rSubmited){ ?>
{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> Task 4: Other Players<\/h1><br \/><i>&rdquo;In <?php echo SERVER_NAME; ?> you play along with billions of other players. Click 'statistics' in the top menu to look up your rank and enter it here.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\">Order:<\/p>Look for your rank in the statistics and enter it here.<\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"banned.php\" type=\"button\" value=\"complete task\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":-4,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0} {"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> Task 4: Other Players<\/h1><br \/><i>&rdquo;In <?php echo SERVER_NAME; ?> you play along with billions of other players. Click 'statistics' in the top menu to look up your rank and enter it here.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\">Order:<\/p>Look for your rank in the statistics and enter it here.<\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"banned.php\" type=\"button\" value=\"complete task\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":-4,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0}
@@ -1063,7 +1063,7 @@ if ($mainbuilding<3){?>
// Compare real player rank with submited rank // Compare real player rank with submited rank
$temp['uid']=$session->userinfo['id']; $temp['uid']=$session->userinfo['id'];
$ranking->procRankReq($temp); $ranking->procRankReq($temp);
$displayarray = $database->getUserArray($temp['uid'],1); $displayarray = $database->getUserArray($temp['uid'],1,false);
$rRes=$ranking->searchRank($displayarray['username'],"username"); $rRes=$ranking->searchRank($displayarray['username'],"username");
if (!isset($rSubmited) || $rRes!=$rSubmited){ ?> if (!isset($rSubmited) || $rRes!=$rSubmited){ ?>
{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> Task 14: Advanced!<\/h1><br \/><i>&rdquo;Look up your rank in the player statistics again and enjoy your progress.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\">Order:<\/p>Look for your rank in the statistics and enter it here.<\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"banned.php\" type=\"button\" value=\"complete task\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":"-18","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0} {"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> Task 14: Advanced!<\/h1><br \/><i>&rdquo;Look up your rank in the player statistics again and enjoy your progress.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\">Order:<\/p>Look for your rank in the statistics and enter it here.<\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"banned.php\" type=\"button\" value=\"complete task\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":"-18","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0}