From 75aebd82c502827e79d4b7ed48c986523f70c7d6 Mon Sep 17 00:00:00 2001 From: hecht Date: Sun, 4 Dec 2011 14:33:06 +0000 Subject: [PATCH] remove test scripts --- ag/test.php | 208 ---------------------------------------------------- 1 file changed, 208 deletions(-) delete mode 100644 ag/test.php diff --git a/ag/test.php b/ag/test.php deleted file mode 100644 index 5862cb3..0000000 --- a/ag/test.php +++ /dev/null @@ -1,208 +0,0 @@ -'; - - mysql_query('UPDATE user SET clan = null'); // clean all clans - mysql_query('UPDATE clan SET leader = null, co_leader = null'); - $sql = 'SELECT id FROM clan ORDER BY ID ASC'; - $qry = mysql_query($sql); - while( $row = mysql_fetch_assoc($qry)) { - $sql = 'UPDATE user SET clan = ' .$row['id'] . ' WHERE clan is null AND 0 < (SELECT COUNT(*) FROM chars WHERE besitzer = user.id) LIMIT 5'; - //echo $sql . '
'; - mysql_query($sql); - - if(mysql_affected_rows() == 0) { - break; - } - - } - - $qry = mysql_query('SELECT clan, min(id) as id FROM user WHERE clan is not null GROUP BY clan'); - while($row = mysql_fetch_assoc($qry)) { - $sql = 'UPDATE clan SET leader = '.$row['id'].' WHERE id = '.$row['clan']; - //echo $sql . '
'; - mysql_query($sql); - } - -} - - -mysql_query('DELETE FROM clan_challenge_requests'); -mysql_query('DELETE FROM clan_challenges'); -mysql_query('DELETE FROM events'); -mysql_query('DELETE FROM clan_locked'); - - - - -$ids = getClanFightCapableClanIds(); -if(count($ids) < 2) { - echo "zu wenig Clans die Clanfights machen können " . count($ids); - die(); -} - -for($i=0;$i'; -$leaderClan1 = getUser($clan1['leader']); -$leaderClan2 = getUser($clan2['leader']); - -$result = challengeClan($leaderClan1, $clan2['id'], 1); -if($result !== NULL) { - echo $result.'
'; -} - -if(getOpenChallengeRequestCount($clan1['id']) != 1) { - echo 'Fehler: Es sollte mindestens ein Fight offen sein!!
'; -} - -if(getOpenChallengeRequestCount($clan2['id']) != 1) { - echo 'Fehler: Es sollte mindestens ein Fight offen sein!!
'; -} - -if(count(getOpenChallengeRequests($clan1['id'])) != 1) { - echo 'Fehler: Es sollte mindestens ein Fight offen sein!!
'; -} - -if(count(getOpenChallengeRequests($clan2['id'])) != 1) { - echo 'Fehler: Es sollte mindestens ein Fight offen sein!!
'; -} - -$challengeArray = getOpenChallengeRequests($clan2['id']); - -if($acceptTestCase) { - - $result = acceptChallengeRequest($challengeArray[0]['clan_requester'], $leaderClan2); - - if($result !== NULL) { - echo $result.'
'; - } - - if(getOpenChallengeRequestCount($clan1['id']) > 0) { - echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!
'; - } - - if(getOpenChallengeRequestCount($clan2['id']) > 0) { - echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!
'; - } - - if(count(getOpenChallengeRequests($clan1['id'])) > 0) { - echo 'Fehler in getOpenChallengeRequests ('.$clan1['id'].'): Es sollte kein Fight-Request offen sein!!
'; - } - - if(count(getOpenChallengeRequests($clan2['id'])) > 0) { - echo 'Fehler in getOpenChallengeRequests ('.$clan2['id'].'): Es sollte kein Fight-Request offen sein!!
'; - } - - - if(count(getOpenChallengeIDs($clan1['id'])) != 1) { - echo 'Fehler: Es sollte mindestens ein Fight offen sein!!
'; - } - - if(count(getOpenChallengeIDs($clan2['id'])) != 1) { - echo 'Fehler: Es sollte mindestens ein Fight offen sein!!
'; - } - - $challengeIDsArray = getOpenChallengeIDs($clan1['id']); - $clan_challenge_id = $challengeIDsArray[0]; - if(count(getParticipatingClanIDs($clan_challenge_id)) != 2) { - echo 'Fehler in getParticipatingClanIDs: Es sollten 2 Clans teilnehmen!
'; - } - - // Okay now let the chars participate - - $chars1 = getCharsOfUser($leaderClan1['id']); - $chars2 = getCharsOfUser($leaderClan2['id']); - - $found = -1; - - for($i=0;$i'; - } - - - $result = joinChallenge($clan_challenge_id, $leaderClan1, $chars1[$found]['id'], 1); - if($result !== NULL) { - echo $result .'
'; - } - - $found = -1; - - for($i=0;$i'; - } - - $result = joinChallenge($clan_challenge_id, $leaderClan2, $chars2[$found]['id'], 1); - if($result !== NULL) { - echo $result .'
'; - } - - - -} else { - $result = denyChallengeRequest($challengeArray[0]['clan_requester'], $leaderClan2); - - if($result !== NULL) { - echo $result .'
'; - } - - if(getOpenChallengeRequestCount($clan1['id']) > 0) { - echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!
'; - } - - if(getOpenChallengeRequestCount($clan2['id']) > 0) { - echo 'Fehler in getOpenChallengeRequestCount: Es sollte kein Fight-Request offen sein!!
'; - } - - if(count(getOpenChallengeRequests($clan1['id'])) > 0) { - echo 'Fehler in getOpenChallengeRequests ('.$clan1['id'].'): Es sollte kein Fight-Request offen sein!!
'; - } - - if(count(getOpenChallengeRequests($clan2['id'])) > 0) { - echo 'Fehler in getOpenChallengeRequests ('.$clan2['id'].'): Es sollte kein Fight-Request offen sein!!
'; - } - -} -} - - -?>