From a73a66ac9140b3c58d093acfa8b5353167520cde Mon Sep 17 00:00:00 2001 From: hecht Date: Thu, 27 Aug 2015 18:57:13 +0000 Subject: [PATCH] re-added the cancel feature of the quests (now with a delay of 30 min) --- ag/abholen.php | 57 ++++++++++++++++++++++++++++++++++++-- ag/include/defines.inc.php | 2 +- ag/include/schatz.inc.php | 5 ++-- ag/schatz3.php | 23 +++++++++------ 4 files changed, 73 insertions(+), 14 deletions(-) diff --git a/ag/abholen.php b/ag/abholen.php index 1969af5..5a98483 100644 --- a/ag/abholen.php +++ b/ag/abholen.php @@ -143,8 +143,9 @@ $zeit_in_sek = getEventStatusBlocked($char_id); #######################Schatz Suche Kampf if($ab == "Schatz Suche") { -$kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$char_id)); +$kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer, Timestampdiff(Second,now(),cancel) as cancel from quests where charid = '.$char_id)); $zeit_in_sek = $kampf_a['dauer']; +$cancel_zeit_in_sek = $kampf_a['cancel']; echo " + diff --git a/ag/include/defines.inc.php b/ag/include/defines.inc.php index b4fab97..0b62469 100644 --- a/ag/include/defines.inc.php +++ b/ag/include/defines.inc.php @@ -87,4 +87,4 @@ function setDefine($key, $value) { } -?> \ No newline at end of file +?> diff --git a/ag/include/schatz.inc.php b/ag/include/schatz.inc.php index 38cca64..7f3f965 100644 --- a/ag/include/schatz.inc.php +++ b/ag/include/schatz.inc.php @@ -110,9 +110,10 @@ function monsterfight_neu($chara_1, $fight_monster, $std, $ort){ $k_hp1[1] = $in_hp_max; // Fuer Heal wichtig!! $k_mp1[1] = $in_mp_max; // Fuer Heal wichtig!! // Hinzufuegen Quest - $sql = 'Insert into quests(charid, dauer, std, ortid, st, sp, ver, gl, aus, hp, mp)' . + $sql = 'Insert into quests(charid, dauer, cancel, std, ortid, st, sp, ver, gl, aus, hp, mp)' . ' values('.$chara_1['id'].', ' . 'TIMESTAMPADD(HOUR, '.$std.', now()), ' . + 'TIMESTAMPADD(MINUTE, 30, now()), ' . $std.', '. $ort.', '. $in_starke.', '. @@ -385,4 +386,4 @@ function getMonsterPowerLevel($monster, $buffer_enabled = true){ } return $monster['starke']+$monster['verteidigung']+$monster['speed']+$monster['ausdauer']+$monster['glueck']+($monster['hp']/10); } -?> \ No newline at end of file +?> diff --git a/ag/schatz3.php b/ag/schatz3.php index 0aade6f..a374219 100644 --- a/ag/schatz3.php +++ b/ag/schatz3.php @@ -55,16 +55,21 @@ if(!checkAbholcode($char_id, $code)){ } if($abort == 'cancel'){ - echo '

Schatz Suche abbrechen ist derzeit nicht moeglich! Wir versuchen es so schnell wie moeglich wieder zu aktivieren.

'; - displayErrorMessage(NULL,'Bitte um Verstaendnis!', displayIndexBackLink()); + $kampf_a = mysql_fetch_array(mysql_query('select Timestampdiff(Second,now(),dauer) as dauer, Timestampdiff(Second,now(),cancel) as cancel from quests where charid = '.$char_id)); + $zeit_in_sek = $kampf_a['dauer']; + $cancel_zeit_in_sek = $kampf_a['cancel']; -# if ($true == 1) { -# interruptSchatzSuche($char_id); -# displayErrorMessage(NULL,'Die Schatzsuche wurde abgebrochen!', displayIndexBackLink()); -# } else { -# echo '

Schatz Suche wirklich abbrechen?

'; -# echo '

Ja | Nein

'; -# } + if ($cancel_zeit_in_sek <= 0) { + if ($true == 1) { + interruptSchatzSuche($char_id); + displayErrorMessage(NULL,'Die Schatzsuche wurde abgebrochen!', displayIndexBackLink()); + } else { + echo '

Schatz Suche wirklich abbrechen?

'; + echo '

Ja | Nein

'; + } + } else { + displayErrorMessage(NULL,'Die Schatzsuche kann noch nicht abgebrochen werden!', displayIndexBackLink()); + } } else{ if(($text = displaySchatzSuche($char)) !== null){ displayErrorMessage(NULL,$text, displayHistoryBackLink());