Die GMs können nun zulassen, dass Chars mehrfach hintereinander zu CFs hinzugewiesen werden!

main
hecht 10 years ago
parent 98ff2bae39
commit 0a08e350b8

@ -241,11 +241,11 @@ function displayClanFightOptions($data) {
$colspan = 2;
$desc_array = array('minimale Anzahl an Clanmitgliedern um kämpfen zu können', 'maximale Anzahl an Herausforderungen',
'maximale Anzahl von Offlinecharakteren die angemeldet werden dürfen', 'maximalen Clankämpfe pro Tag', 'Zeit zwischen dem Herausfordern des selben Clans in Stunden', 'Kampfdauer pro Einzelkampf in Davy Back',
'Kampfdauer pro Einzelkampf in Survival', 'Modifikator G für die Clan-Exp Verteilungsformel');
'Kampfdauer pro Einzelkampf in Survival', 'Modifikator G für die Clan-Exp Verteilungsformel', 'Anzahl CFs die ein Char nacheinander haben kann.');
$define_array = array('MIN_MEMBERS', 'MAX_OPEN_REQUESTS', 'MAX_LEADER_ASSIGNED_CHARS', 'CLANFIGHTS_MAX_FIGHTS_PER_24H', 'CLANFIGHTS_RECHALLENGE_DELAY', 'DURATION_DAVY_BACK_FIGHT',
'DURATION_SURVIVAL_FIGHT', 'CLAN_EXP_FAKTOR_G');
'DURATION_SURVIVAL_FIGHT', 'CLAN_EXP_FAKTOR_G', 'MAX_COUNT_PARALLEL_CFS');
$value_array = array(MIN_MEMBERS, MAX_OPEN_REQUESTS, MAX_LEADER_ASSIGNED_CHARS, CLANFIGHTS_MAX_FIGHTS_PER_24H, CLANFIGHTS_RECHALLENGE_DELAY, DURATION_DAVY_BACK_FIGHT, DURATION_SURVIVAL_FIGHT,
CLAN_EXP_FAKTOR_G);
CLAN_EXP_FAKTOR_G, MAX_COUNT_PARALLEL_CFS);
$change = false;
//data überprüfen

@ -25,6 +25,7 @@ defineIfNotDefined('DAVY_BACK_FIGHT', 1);
defineIfNotDefined('SURVIVAL', 2);
defineIfNotDefined('DURATION_DAVY_BACK_FIGHT', 15);
defineIfNotDefined('DURATION_SURVIVAL_FIGHT', 15);
defineIfNotDefined('MAX_COUNT_PARALLEL_CFS', 1);
defineIfNotDefined('ATTACK_SET_DAVY_BACK_FIGHT', 2);
@ -594,14 +595,22 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
}
if($char['status'] != 'Frei') {
if($forced && ($char['status'] == 'Kampf' || $char['status'] == 'Schatz Suche')) { // foreign assignment may also possible if the status is in "fetching" state
if($forced && ($char['status'] == 'Kampf' || $char['status'] == 'Schatz Suche' || $char['status'] == 'Clanfight')) { // foreign assignment may also possible if the status is in "fetching" state
// okay now check if the fetch-time is reached!!
if($char['status'] == 'Schatz Suche') {
$row = mysql_fetch_row(db_query('SELECT Timestampdiff(Second,now(),dauer) as dauer from quests where charid = '.$charid));
} else if($char['status'] == 'Clanfight') {
if(isCharBusyWithClanfighting($charid)) {
$row[0] = '???'; // we do not know when the fight is starting!
} else if(getOngoingEventCount($charid) >= MAX_COUNT_PARALLEL_CFS) {
$row[0] = 'MAX';
} else {
$row[0] = getEventStatusBlocked($char_id);
}
} else {
$row = mysql_fetch_row(db_query('SELECT dauer - ' . time() . ' FROM kampf WHERE db_satz='.$charid ));
}
if($row[0] > 0) {
if(!is_numeric($row[0]) || $row[0] > 0) {
return 'Du kannst den Char \''.$char['name'].'\' nicht an dem Kampf teilnehmen lassen, da er im Moment noch für ' . $row[0] . ' Sekunden mit ' . $char['status']. ' beschäftigt ist!';
}
} else {

@ -149,7 +149,7 @@ function getEventStatus($charid) {
case EVENT_TEST:
return 'Test';
case EVENT_SCHATZ_SUCHE:
return 'Schatzsuche';
return 'Schatz Suche';
case EVENT_TURNIER:
return 'Turnier';
case EVENT_KAMPF:
@ -164,9 +164,15 @@ function getEventStatus($charid) {
return NULL;
}
function getOngoingEventCount($charid) {
$sql = 'SELECT count(*) FROM event_chars e WHERE abgeholt = FALSE AND char_id = ' .$charid;
$row = mysql_fetch_row(mysql_query($sql));
return $row[0];
}
function getEventStatusBlocked($charid) {
$sql = 'SELECT Timestampdiff(Second,now(),MAX(block_end)) FROM event_chars WHERE char_id = ' . $charid;
$sql = 'SELECT Timestampdiff(Second,now(),MAX(block_end)) FROM event_chars WHERE abgeholt = FALSE AND char_id = ' . $charid;
// echo $sql . '<br>';
$row = mysql_fetch_row(mysql_query($sql));
return $row[0];

Loading…
Cancel
Save