From 11f7080510211e8b6ca4e04ab6f7a2f229db3a70 Mon Sep 17 00:00:00 2001 From: hecht Date: Sun, 3 Aug 2014 20:13:25 +0000 Subject: [PATCH] =?UTF-8?q?Trac=20#130:=20=C3=84nderungen=20in=20den=20cro?= =?UTF-8?q?njobs=20damit=20diese=20auch=20mit=20den=20neuen=20Rassen=20zur?= =?UTF-8?q?echt=20kommt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cronjob/generic_turnier.php | 16 ++++++++++++---- cronjob/liga1.php | 14 +++++++++----- cronjob/training.php | 2 +- cronjob/wanted.php | 15 ++++++++++----- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/cronjob/generic_turnier.php b/cronjob/generic_turnier.php index fadf4aa..e7423cb 100644 --- a/cronjob/generic_turnier.php +++ b/cronjob/generic_turnier.php @@ -20,6 +20,7 @@ * bei der Schatzsuche gewünscht ^^ ************************************************************************/ + // Put args into get // Neccessary for cronjob execution @@ -40,7 +41,7 @@ if ($argv) { include('db.php'); include('path.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php'); - +include_once(ROOT_PATH.'/include/rassen.inc.php'); $name = $_GET['name']; // Name des Turniers (benötigt) @@ -124,16 +125,23 @@ if($gruppenphase == 1){ mysql_query('DELETE FROM turnier_kampf WHERE art=\''.$name.'\''); +$race_type = getRaceTypeName("NPC"); // Es sollen keine NPC mitmachen :) und nicht die Spezial Wanted NPCs -$auswahl_kriteria = ' rasse != \'NPC\' '; +$auswahl_kriteria = ' type!=\''.$race_type.'\''; $auswahl_kriteria .= ' AND besitzer!=2 '; if($fusion != 1){ - $auswahl_kriteria .= ' AND fusion=\'nein\' '; + $auswahl_kriteria .= ' AND fusions_rasse = \'0\' '; +} + +$races = getSpecialRaceIds(); +$special_race_ids = array(); +foreach($races as $race) { + $special_race_ids[] = '\''.$race['id'].'\''; } if($special != 1){ - $auswahl_kriteria .= ' AND char_type = \'\' '; + $auswahl_kriteria .= ' AND rasse NOT IN('.implode(',',$special_race_ids).') '; } if(is_numeric($minlevel)){ diff --git a/cronjob/liga1.php b/cronjob/liga1.php index 5927803..0178796 100644 --- a/cronjob/liga1.php +++ b/cronjob/liga1.php @@ -5,6 +5,11 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence * */ + +include('db.php'); +include('path.inc.php'); +include_once(ROOT_PATH.'/include/char.inc.php'); + set_time_limit(0); function rand_array($array) { @@ -54,11 +59,10 @@ while(current($test3)!=end($test2)) } -$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 250"); -while($row=mysql_fetch_array($result)) -{ - - $charas[$row['id']]=$row; +$result=mysql_query("SELECT id FROM chars WHERE id IN(".$list.") LIMIT 250"); +while($row=mysql_fetch_array($result)) { + // Nutze getChar um kompatibel mit Aenderungen der Datenstruktur zu bleiben! + $charas[$row['id']]=getChar($row['id']); } diff --git a/cronjob/training.php b/cronjob/training.php index 793b074..e5fe313 100644 --- a/cronjob/training.php +++ b/cronjob/training.php @@ -215,7 +215,7 @@ if (mysql_num_rows($u_qry) != 0) { mysql_query('Delete from ignolist where user in (' . $users . ') or besitzer in (' . $users . ')'); $char = array (); - $c_qry = mysql_query('Select * from chars where besitzer IN (' . $users . ')'); + $c_qry = mysql_query('Select id from chars where besitzer IN (' . $users . ')'); while ($row = mysql_fetch_assoc($c_qry)) { $char[] = $char['id']; } diff --git a/cronjob/wanted.php b/cronjob/wanted.php index 585d430..7f28104 100644 --- a/cronjob/wanted.php +++ b/cronjob/wanted.php @@ -5,6 +5,12 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence * */ + +include('db.php'); +include('path.inc.php'); +include_once(ROOT_PATH.'/include/char.inc.php'); + + set_time_limit(0); function rand_array($array) { @@ -53,11 +59,10 @@ while(current($test3)!=end($test2)) } -$result=mysql_query("SELECT * FROM chars WHERE id IN(".$list.") LIMIT 500"); -while($row=mysql_fetch_array($result)) -{ - - $charas[$row['id']]=$row; +$result=mysql_query("SELECT id FROM chars WHERE id IN(".$list.") LIMIT 500"); +while($row=mysql_fetch_array($result)) { + // Nutze getChar um kompatibel mit Aenderungen der Datenstruktur zu bleiben! + $charas[$row['id']]=getChar($row['id']); } $a8=0;