From e0d47c309a5c2e8c0e6caf2a81bc5243265a3d88 Mon Sep 17 00:00:00 2001 From: hecht Date: Sat, 23 Aug 2014 19:42:00 +0000 Subject: [PATCH] Nun ist die zeit zwischen den herausforderungen einstellbar fuer die GM --- ag/include/clan_fights.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ag/include/clan_fights.inc.php b/ag/include/clan_fights.inc.php index 1598fde..f3d9a07 100644 --- a/ag/include/clan_fights.inc.php +++ b/ag/include/clan_fights.inc.php @@ -20,6 +20,7 @@ defineIfNotDefined('MIN_MEMBERS', 5); defineIfNotDefined('MAX_OPEN_REQUESTS', 3); defineIfNotDefined('MAX_LEADER_ASSIGNED_CHARS', 1); defineIfNotDefined('CLANFIGHTS_MAX_FIGHTS_PER_24H', 6); +defineIfNotDefined('CLANFIGHTS_RECHALLENGE_DELAY', 23); // in hours defineIfNotDefined('DAVY_BACK_FIGHT', 1); defineIfNotDefined('SURVIVAL', 2); defineIfNotDefined('DURATION_DAVY_BACK_FIGHT', 15); @@ -108,14 +109,14 @@ function challengeClan(array $user, $clanid, $anzahl = 5, $type = DAVY_BACK_FIGH // check if both clans have already been challengeing each other since 24h? - $sql = 'SELECT count(*) as anzahl FROM clan_challenge_requests WHERE clan_requester IN ('.$user['clan'].', '.$clanid.') AND clan_challenged IN ('.$user['clan'].', '.$clanid.') AND challenged_time > TIMESTAMPADD(day, -1, now())'; + $sql = 'SELECT count(*) as anzahl FROM clan_challenge_requests WHERE clan_requester IN ('.$user['clan'].', '.$clanid.') AND clan_challenged IN ('.$user['clan'].', '.$clanid.') AND challenged_time > TIMESTAMPADD(hour, -'.CLANFIGHTS_RECHALLENGE_DELAY.', now())'; $qry = mysql_query($sql); $row = mysql_fetch_assoc($qry); if($row['anzahl'] > 0) { semaphoreDown($ressource_clan1); // free the previously reserved semaphore! semaphoreDown($ressource_clan2); // free the previously reserved semaphore! - return 'Konnte den anderen Clan nicht herausfordern, da dieser Clan schoneinmal in den letzten 24 Stunden herausgefordert wurde!'; + return 'Konnte den anderen Clan nicht herausfordern, da dieser Clan schoneinmal in den letzten '.CLANFIGHTS_RECHALLENGE_DELAY.' Stunden herausgefordert wurde!'; } // it should not be possible to challenge a clan that already has an open match that is not yet calculated! ( not completely possible in sql)