Nun ist die zeit zwischen den herausforderungen einstellbar fuer die GM

main
hecht 10 years ago
parent b77fb42b0c
commit e0d47c309a

@ -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)

Loading…
Cancel
Save