|
|
|
@ -43,18 +43,18 @@ if($clan_challange_id == null) {
|
|
|
|
|
function displayChallengeClan($user, $clan_id) {
|
|
|
|
|
if($clan_id == -1 || $clan_id == NULL) {
|
|
|
|
|
displayErrorMessage(NULL,'Es wurde kein Clan ausgewählt!', displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($user['clan'] == $clan_id) {
|
|
|
|
|
displayErrorMessage(NULL,'Man kann sich nicht selbst herausfordern!', displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//TODO: es sollte hier unbedingt ne Auswahl geben wieviel Leute nun kämpfen dürfen :)
|
|
|
|
|
$result = challengeClan($user, $clan_id, 5);
|
|
|
|
|
if ($result != NULL) {
|
|
|
|
|
displayErrorMessage(NULL, $result, displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
echo 'Clan wurde erfolgreich herausgefordert.<br><br>';
|
|
|
|
|
echo '<a href="index.php?as=clan/kampf_info">weiter</a>';
|
|
|
|
@ -64,7 +64,7 @@ function displayChallengeClan($user, $clan_id) {
|
|
|
|
|
function displayChallengeAccepted($user, $clan_id) {
|
|
|
|
|
if(!is_numeric($clan_id)) {
|
|
|
|
|
displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
acceptChallengeRequest($clan_id, $user);
|
|
|
|
|
echo 'Herausforderung wurde angenommen!<br><br>';
|
|
|
|
@ -106,7 +106,7 @@ function denyChallenge($type, $clan_id, $user) {
|
|
|
|
|
displayClanFightMenu($user_ida);
|
|
|
|
|
} else {
|
|
|
|
|
displayErrorMessage(NULL, $success, displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -116,6 +116,7 @@ function displayShowChallenge($clan_challenge_id, $user) {
|
|
|
|
|
|
|
|
|
|
if(!in_array($clan_challenge_id, $open_challenge_ids)) {
|
|
|
|
|
displayClanFightMenu($user);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//initialisieren von wichtigen variablen
|
|
|
|
@ -221,7 +222,7 @@ function displayJoinChallenge($user, $clan_challenge_id, $char_id, $slot) {
|
|
|
|
|
$success = joinChallenge($clan_challenge_id, $user, $char_id, $slot);
|
|
|
|
|
if($success != null) {
|
|
|
|
|
displayErrorMessage(NULL, $success, displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
echo 'Der Charakter wurde erfoglreich angemeldet.<br><br>';
|
|
|
|
|
echo '<a href="index.php?as=clan/kampf_info&action=showchallenge&challenge='.$clan_challenge_id.'">weiter</a>';
|
|
|
|
@ -234,13 +235,13 @@ function displayLeaveChallenge($user, $clan_challenge_id, $char_id) {
|
|
|
|
|
|
|
|
|
|
if(!in_array($clan_challenge_id, $open_challenge_ids)) {
|
|
|
|
|
displayErrorMessage(NULL, 'Wollte da jemand schummeln? ;)', displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$success = leaveChallenge($clan_challenge_id, $user, $char_id);
|
|
|
|
|
if($success != null) {
|
|
|
|
|
displayErrorMessage(NULL, $success, displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
echo 'Der Charakter wurde erfoglreich abgemeldet.<br><br>';
|
|
|
|
|
echo '<a href="index.php?as=clan/kampf_info&action=showchallenge&challenge='.$clan_challenge_id.'">weiter</a>';
|
|
|
|
@ -277,7 +278,7 @@ function cancelThisChallenge($user, $clan_challange_id) {
|
|
|
|
|
$success = cancelChallenge($clan_challange_id, $user);
|
|
|
|
|
if($success != null) {
|
|
|
|
|
displayErrorMessage(NULL, $success, displayHistoryBackLink());
|
|
|
|
|
exit;
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
|
|
|
|
displayClanFightMenu($user);
|
|
|
|
|
}
|
|
|
|
|