From 26696dedceab728aa13d2fe892cc170eda4724e2 Mon Sep 17 00:00:00 2001 From: hecht Date: Tue, 17 Jan 2012 20:23:00 +0000 Subject: [PATCH] cleanup plus some changes about presentation --- ag/clan/c_kampf.php | 366 -------------------------- ag/clan/gfx/clan_info.htm | 46 ---- ag/clan/gfx/gfx_config.php | 20 -- ag/clan/kampf/SSJ.php | 56 ---- ag/clan/kampf/atk_wert.php | 29 -- ag/clan/kampf/ausdauer.php | 25 -- ag/clan/kampf/hp.php | 20 -- ag/clan/kampf/hp2.php | 47 ---- ag/clan/kampf/kaioken.php | 48 ---- ag/clan/kampf/kampf_rechnung.php | 115 -------- ag/clan/kampf/mp.php | 30 --- ag/clan/kampf/mpv.php | 26 -- ag/clan/kampf/tausch.php | 100 ------- ag/clan/kampf_info.php | 11 +- ag/gm/include/test_cf.php | 208 +++++++++++++++ ag/include/clan.inc.php | 1 + ag/include/config/ads_example.inc.php | 13 +- ag/include/designfunctions.inc.php | 24 ++ ag/include/usergroup.inc.php | 1 + ag/index.php | 51 +++- ag/info/agchat.php | 6 +- ag/kampf_list.php | 7 + 22 files changed, 308 insertions(+), 942 deletions(-) delete mode 100644 ag/clan/c_kampf.php delete mode 100644 ag/clan/gfx/clan_info.htm delete mode 100644 ag/clan/gfx/gfx_config.php delete mode 100644 ag/clan/kampf/SSJ.php delete mode 100644 ag/clan/kampf/atk_wert.php delete mode 100644 ag/clan/kampf/ausdauer.php delete mode 100644 ag/clan/kampf/hp.php delete mode 100644 ag/clan/kampf/hp2.php delete mode 100644 ag/clan/kampf/kaioken.php delete mode 100644 ag/clan/kampf/kampf_rechnung.php delete mode 100644 ag/clan/kampf/mp.php delete mode 100644 ag/clan/kampf/mpv.php delete mode 100644 ag/clan/kampf/tausch.php create mode 100644 ag/gm/include/test_cf.php diff --git a/ag/clan/c_kampf.php b/ag/clan/c_kampf.php deleted file mode 100644 index 1689760..0000000 --- a/ag/clan/c_kampf.php +++ /dev/null @@ -1,366 +0,0 @@ - - - -'; - echo '

Bitte wähle einen Clan aus

'; - } else { - if (date("d.m.Y") == date("d.m.Y", $_POST['datum']) AND date("G") >= $_POST['zeitpunkt']) { - echo '
'; - echo '

Dieser Zeitpunkt ist bereits verstrichen. Bitte wähle einen Zeitpunkt der noch nicht verstrichen ist.

'; - } else { - $clanid = getClanOfUser($user_ida[id]); - $timestamp= strtotime(date("d.m.Y", $_POST['datum']))+$_POST['zeitpunkt']*3600; - if (termineBereitsBelegt($clanid,$_POST['clan'],$timestamp) == 1) { - echo '
'; - echo '

'.$errmsg.'

'; - echo '

Bitte wähle einen anderen Zeitpunkt!

'; - } else { - erstelleClanKampf($user_ida[id],$_POST['clan'],$timestamp,unserialize(stripslashes($_POST['chars'])),$_POST['numberoffighter'],$_POST['clanfighttyp']); - $clandaten= getClanInformation($_POST['clan']); - echo '

Anfrage, zwecks einen Clankampfes, an Clan "'.$clandaten['clanname'].'" erfolgreich gesendet!

'; - echo 'zurück zur Übersicht'; - } - } - } - } else { - echo '

Bitte führe das Skript zur Herausforderung an einen anderen Clan korrekt aus und versuche nicht es irgendwie zu umgehen!

'; - } - break; - case "del": - if (checkClanfight($_GET['kid']) == 1) { - if (clanfightFromOwnClan($_GET['kid'],$user_ida[id]) == 1) { - deleteClanFight($_GET['kid']); - } else { - echo $errmsg; - } - } else { - echo $errmsg; - } - break; - case "acc": - if (checkClanfight($_GET['kid']) == 1) { - if (clanfightToOwnClan($_GET['kid'],$user_ida[id]) == 1) { - displayClanUser($user_ida[id],getNumberOfFightersByClanfightID($_GET['kid']),'','accept'); - } else { - echo $errmsg; - } - } else { - echo $errmsg; - } - break; - case "acc2": - displayCharsOfClanUser($user_ida[id], $_POST['user'], $_POST['numberoffighter'],'','accept'); - break; - case "acc_fin": - acceptClanfight($_POST['kid'],$_POST['char']); - break; - case "dec": - if (checkClanfight($_GET['kid']) == 1) { - if (clanfightToOwnClan($_GET['kid'],$user_ida[id]) == 1) { - if (isset($_GET['true'])) { - declineClanfight($_GET['kid'],$_GET['true']); - } else { - declineClanfight($_GET['kid']); - } - } else { - echo $errmsg; - } - } else { - echo $errmsg; - } - break; - case "look": - if (checkClanfight($_GET['kid'],$_GET['id']) == 1) { - ?> - zurück zur Übersicht - - - - - '; - } - - $o=0; - $kaempfe_query= mysql_query('SELECT * FROM clan_fights WHERE clanfight_id='.$_GET['kid'].' AND runde='.$y.' ORDER BY id ASC'); - while ($kaempfe_array= mysql_fetch_assoc($kaempfe_query)) { - - if($o == 0) { - $mul = '#018B8B'; - $o++; - } else { - $mul = '#029393'; - $o--; - } - - $char_a= getChar2($kaempfe_array['char1']); - $char_b= getChar2($kaempfe_array['char2']); - if ($kaempfe_array['win'] == $kaempfe_array['char1']) { - $pkt_satz_a++; - } else { - $pkt_satz_b++; - } - - if ($kampf_daten['zeitpunkt']+$x*$duration_of_one_fight <= time()) { - echo ''; - } - $x++; - } - - if ($pkt_satz_a > $pkt_satz_b) { - $pkt_runde_a++; - } elseif ($pkt_satz_b > $pkt_satz_a) { - $pkt_runde_b++; - } - - $pkt_array[$y][pkt_satz_a]= $pkt_satz_a; - $pkt_array[$y][pkt_satz_b]= $pkt_satz_b; - $pkt_array[$y][pkt_runde_a]= $pkt_runde_a; - $pkt_array[$y][pkt_runde_b]= $pkt_runde_b; - - $pkt_satz_a= 0; - $pkt_satz_b= 0; - } - - ?> -
Clankampf
'; - echo '

Runde: '.$y.' '; - echo '

'; - - if (time()-$duration_of_one_fight < $kampf_daten['zeitpunkt']+$x*$duration_of_one_fight) { - echo $char_a['name'].' vs. '.$char_b['name'].'- : -'; - } else { - if ($kaempfe_array['char1'] == $kaempfe_array['win']) { - echo ''.$char_a['name'].' vs. '.$char_b['name'].''.$pkt_satz_a.' : '.$pkt_satz_b; - } else { - echo ''.$char_a['name'].' vs. '.$char_b['name'].''.$pkt_satz_a.' : '.$pkt_satz_b; - } - } - echo '
-

- - - - - '.$y.''; - } - ?> - - - - $pkt_array[$y][pkt_satz_b]) { - echo ''; - } else { - echo ''; - } - } - ?> - - - - $pkt_array[$y][pkt_satz_a]) { - echo ''; - } else { - echo ''; - } - } - ?> - -
Runde:
Punkte :'.$pkt_array[$y][pkt_satz_a].''.$pkt_array[$y][pkt_satz_a].'
Punkte :'.$pkt_array[$y][pkt_satz_b].''.$pkt_array[$y][pkt_satz_b].'
- '.$clan_a[clanname].' '.$pkt_array[count($pkt_array)][pkt_runde_a].' : '.$pkt_array[count($pkt_array)][pkt_runde_b].' '.$clan_b[clanname].'

'; - if ($pkt_array[count($pkt_array)][pkt_runde_a] > $pkt_array[count($pkt_array)][pkt_runde_b]) { - echo '

Gewinner: '.$clan_a[clanname].' - Verlierer: '.$clan_b[clanname].'

'; - } elseif ($pkt_array[count($pkt_array)][pkt_runde_b] > $pkt_array[count($pkt_array)][pkt_runde_a]) { - echo '

Gewinner: '.$clan_b[clanname].' - Verlierer: '.$clan_a[clanname].'

'; - } else { - echo '

Der Clankampf zwischen '.$clan_b[clanname].' und '.$clan_a[clanname].' endet Unentschieden.

'; - } - - if ($kampf_daten['score_set'] == 0) { - if ($pkt_array[count($pkt_array)][pkt_runde_a] > $pkt_array[count($pkt_array)][pkt_runde_b]) { - $clan_a_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1'); - $clan_b_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1'); - } elseif ($pkt_array[count($pkt_array)][pkt_runde_b] > $pkt_array[count($pkt_array)][pkt_runde_a]) { - $clan_a_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1'); - $clan_b_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1'); - } else { - $clan_a_updaten= mysql_query('UPDATE clan SET unentschieden=unentschieden+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1'); - $clan_b_updaten= mysql_query('UPDATE clan SET unentschieden=unentschieden+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1'); - } - $score_set_updaten= mysql_query('UPDATE clan_fight_list SET score_set=1 WHERE id='.$_GET['kid'].' LIMIT 1'); - } - - } - } else { - echo $errmsg; - } - break; - case "create": - displayClanFightType($user_ida[id]); - break; - case "fights": - $clanid= getClanOfUser($user_ida[id]); - echo getActualClanFightInformation($clanid,$user_ida[id]); - break; - case "look_survival": - if (checkClanfight($_GET['kid'],$_GET['id']) == 1) { - ?> - zurück zur Übersicht - - - - - '; - } - $x++; - } - - ?> -
Clankampf
'; - - if (time()-$duration_of_one_fight < $kampf_daten['zeitpunkt']+$x*$duration_of_one_fight) { - echo $char_a['name'].' vs. '.$char_b['name'].'- : -'; - } else { - if ($kaempfe_array['char1'] == $kaempfe_array['win']) { - echo ''.$char_a['name'].' vs. '.$char_b['name'].''.$pkt_satz_a.' : '.$pkt_satz_b; - } else { - echo ''.$char_a['name'].' vs. '.$char_b['name'].''.$pkt_satz_a.' : '.$pkt_satz_b; - } - } - echo '
-

- '.$clan_a[clanname].' '.$pkt_satz_a.' : '.$pkt_satz_b.' '.$clan_b[clanname].'

'; - if ($pkt_satz_a > $pkt_satz_b) { - echo '

Gewinner: '.$clan_a[clanname].' - Verlierer: '.$clan_b[clanname].'

'; - } elseif ($pkt_satz_b > $pkt_satz_a) { - echo '

Gewinner: '.$clan_b[clanname].' - Verlierer: '.$clan_a[clanname].'

'; - } - - if ($kampf_daten['score_set'] == 0) { - if ($pkt_satz_a > $pkt_satz_b) { - $clan_a_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1'); - $clan_b_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1'); - } elseif ($pkt_satz_b > $pkt_satz_a) { - $clan_a_updaten= mysql_query('UPDATE clan SET niederlagen=niederlagen+1 WHERE id='.$kampf_daten['clan'].' LIMIT 1'); - $clan_b_updaten= mysql_query('UPDATE clan SET siege=siege+1 WHERE id='.$kampf_daten['gclan'].' LIMIT 1'); - } - $score_set_updaten= mysql_query('UPDATE clan_fight_list SET score_set=1 WHERE id='.$_GET['kid'].' LIMIT 1'); - } - - } - } else { - echo $errmsg; - } - break; - default: - checkIfChallengeTimedOut($user_ida[id]); - #checkIfClanFightsToExecute($user_ida[id]); - displayClanFights($user_ida[id]); - break; -} - -?> \ No newline at end of file diff --git a/ag/clan/gfx/clan_info.htm b/ag/clan/gfx/clan_info.htm deleted file mode 100644 index cb4f495..0000000 --- a/ag/clan/gfx/clan_info.htm +++ /dev/null @@ -1,46 +0,0 @@ - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

$CLANNAME Info

 Leader: $LEADER
 Co Leader. $COLEADER
 Clanzeichen: $CLANZEICHEN
 Member: $MIN_MEMBER / $MAX_MEMBER
 Level: $LEVEL
 Homepage: $HOMEPAGE
 Info: 
 
-
-
- - \ No newline at end of file diff --git a/ag/clan/gfx/gfx_config.php b/ag/clan/gfx/gfx_config.php deleted file mode 100644 index 39e62b1..0000000 --- a/ag/clan/gfx/gfx_config.php +++ /dev/null @@ -1,20 +0,0 @@ - \ No newline at end of file diff --git a/ag/clan/kampf/SSJ.php b/ag/clan/kampf/SSJ.php deleted file mode 100644 index a3c7b56..0000000 --- a/ag/clan/kampf/SSJ.php +++ /dev/null @@ -1,56 +0,0 @@ - \ No newline at end of file diff --git a/ag/clan/kampf/atk_wert.php b/ag/clan/kampf/atk_wert.php deleted file mode 100644 index 0bb8962..0000000 --- a/ag/clan/kampf/atk_wert.php +++ /dev/null @@ -1,29 +0,0 @@ - $speed_char2) { -if($speed_prz_1*90 >= $speed_char2) { $play1_ausweich=20; } -if($speed_prz_1*80 >= $speed_char2) { $play1_ausweich=41; } -if($speed_prz_1*70 >= $speed_char2) { $play1_ausweich=52; } -if($speed_prz_1*60 >= $speed_char2) { $play1_ausweich=63; } -if($speed_prz_1*50 >= $speed_char2) { $play1_ausweich=80; } -} else { -if($speed_prz_2*90 >= $speed_char1) { $play2_ausweich=20; } -if($speed_prz_2*80 >= $speed_char1) { $play2_ausweich=41; } -if($speed_prz_2*70 >= $speed_char1) { $play2_ausweich=52; } -if($speed_prz_2*60 >= $speed_char1) { $play2_ausweich=63; } -if($speed_prz_2*50 >= $speed_char1) { $play2_ausweich=80; } -} -$zufall_pl1=mt_rand(1,100); -$zufall_pl2=mt_rand(1,100); -?> \ No newline at end of file diff --git a/ag/clan/kampf/ausdauer.php b/ag/clan/kampf/ausdauer.php deleted file mode 100644 index 6e0f19f..0000000 --- a/ag/clan/kampf/ausdauer.php +++ /dev/null @@ -1,25 +0,0 @@ - 0) { - ################### PLAYER 1 - - $k_starke[0] = round($k_starke[0] + (($k_ausdauer[0] / 20)) - ($k_starke[0] / 50)); - $k_speed[0] = round($k_speed[0] + ($k_ausdauer[0] / 10)); - $k_ver[0] = round($k_ver[0] + ($k_ausdauer[0] / 10)); - $k_ausdauer[0] = round($k_ausdauer[0] - ($k_ausdauer[0] / 20)); - - ################### PLAYER 2 - - $k_starke[1] = round($k_starke[1] + (($k_ausdauer[1] / 20)) - ($k_starke[1] / 50)); - $k_speed[1] = round($k_speed[1] + ($k_ausdauer[1] / 10)); - $k_ver[1] = round($k_ver[1] + ($k_ausdauer[1] / 10)); - $k_ausdauer[1] = round($k_ausdauer[1] - ($k_ausdauer[1] / 20)); - -} -?> \ No newline at end of file diff --git a/ag/clan/kampf/hp.php b/ag/clan/kampf/hp.php deleted file mode 100644 index 0d372f2..0000000 --- a/ag/clan/kampf/hp.php +++ /dev/null @@ -1,20 +0,0 @@ - 0) { -$k_hp[0] = $k_hp[0] - $technick1[hp]; -} - -####################KAMPF HP SPIELER 2 - -if($technick2['type'] == normal AND $technick2['hp'] > 0) { -$k_hp[1] = $k_hp[1] - $technick2['hp']; -} -?> \ No newline at end of file diff --git a/ag/clan/kampf/hp2.php b/ag/clan/kampf/hp2.php deleted file mode 100644 index 04d6961..0000000 --- a/ag/clan/kampf/hp2.php +++ /dev/null @@ -1,47 +0,0 @@ -= $speeds_char2) { - if ($technick1['type'] == 'hp') { - $k_mp[0] = $k_mp[0] - $technick1['mp']; - if ($k_mp[0] < 0) { - $k_mp[0] = 0; - } else { - $k_hp[0] = $k_hp[0] + $technick1['hp']; - if ($k_hp1[1] < $k_hp[0]) { - $k_hp[0] = $k_hp1[1]; - } - - $schaden_2 = 'Keinen Schaden'; - $schaden_1 = '+ ' . $technick1['hp'] . ' HP'; - } - $aktion_AV1[$x] = 'nein'; - } -} else { - - ####################KAMPF HP SPIELER 2 - - if ($technick2['type'] == 'hp') { - $k_mp[1] = $k_mp[1] - $technick2['mp']; - if ($k_mp[1] < 0) { - $k_mp[1] = 0; - } else { - $k_hp[1] = $k_hp[1] + $technick2['hp']; - if ($k_hp2[1] < $k_hp[1]) { - $k_hp[1] = $k_hp2[1]; - } - - $schaden_1 = 'Keinen Schaden'; - $schaden_2 = '+ '.$technick2['hp'].' HP'; - } - $aktion_AV2[$x] = 'nein'; - } -} -?> \ No newline at end of file diff --git a/ag/clan/kampf/kaioken.php b/ag/clan/kampf/kaioken.php deleted file mode 100644 index 655b2e8..0000000 --- a/ag/clan/kampf/kaioken.php +++ /dev/null @@ -1,48 +0,0 @@ - \ No newline at end of file diff --git a/ag/clan/kampf/kampf_rechnung.php b/ag/clan/kampf/kampf_rechnung.php deleted file mode 100644 index 3150d16..0000000 --- a/ag/clan/kampf/kampf_rechnung.php +++ /dev/null @@ -1,115 +0,0 @@ - $play2_ausweich) { - if (!$aktion_AV1[$x]) { - $alt_hp = $k_hp[1]; - - $charsa1_def = $k_ver[1] + $technick2['verteidigung']; - $charsa1_4_def = ($k_ver[1] + $technick2['verteidigung']) / 1.1; - - if ($charsa1_def <= 2) { - $charsa1_def = 2; - } - if ($charsa1_4_def < 1) { - $charsa1_4_def = 1; - } - - $charsa1_def = mt_rand($charsa1_4_def, $charsa1_def); - - $charsa1_str = $k_starke[0] * 1.8 + $technick1['starke']; - $charsa1_4_str = ($k_starke[0] * 1.8 + $technick1['starke']) + 1; - - if ($charsa1_str <= 2) { - $charsa1_str = 2; - } - - if ($charsa1_4_str < 1) { - $charsa1_4_str = 1; - } - - $charsa1_str = mt_rand($charsa1_4_str, $charsa1_str); - - $k_hp[1] = round(($k_hp[1] + $charsa1_def - $charsa1_str +mt_rand(1, 20))); - $schaden_1 = $alt_hp - $k_hp[1]; - if ($alt_hp < $k_hp[1]) { - $k_hp[1] = $alt_hp; - $schaden_1 = 0; - } - - } -} else { - $schaden_1 = 'Keinen Schaden'; -} -if ($zufall_pl2 > $play1_ausweich) { - if (!$aktion_AV2[$x]) { - - $alt_hp = $k_hp[0]; - - $charsa2_def = $k_ver[0] + $technick1['verteidigung']; - $charsa2_4_def = ($k_ver[0] + $technick1['verteidigung']) / 1.1; - - if ($charsa2_def <= 2) { - $charsa2_def = 2; - } - if ($charsa2_4_def < 1) { - $charsa2_4_def = 1; - } - - $charsa2_def = mt_rand($charsa2_4_def, $charsa2_def); - $charsa2_str = $k_starke[1] * 1.8 + $technick2['starke']; - $charsa2_4_str = ($k_starke[1] * 1.8 + $technick2['starke']) + 1; - - if ($charsa1_str <= 2) { - $charsa1_str = 2; - } - if ($charsa2_4_str < 1) { - $charsa2_4_str = 1; - } - - $charsa2_str = mt_rand($charsa2_4_str, $charsa2_str); - - $k_hp[0] = round(($k_hp[0] + $charsa2_def - $charsa2_str +mt_rand(1, 20))); - $schaden_2 = $alt_hp - $k_hp[0]; - if ($alt_hp < $k_hp[0]) { - $k_hp[0] = $alt_hp; - $schaden_2 = 0; - } - } -} else { - $schaden_2 = "Keinen Schaden"; -} - -if (!$technick1['name']) { - $technick1['name'] = 'Normaler Kick'; -} -if (!$technick2['name']) { - $technick2['name'] = 'Normaler Kick'; -} - -if ($k_hp[0] < 0) { - $k_hp7[0] = 0; -} else { - $k_hp7[0] = $k_hp[0]; -} -if ($k_mp[0] < 0) { - $k_mp7[0] = 0; -} else { - $k_mp7[0] = $k_mp[0]; -} -if ($k_hp[1] < 0) { - $k_hp7[1] = 0; -} else { - $k_hp7[1] = $k_hp[1]; -} -if ($k_mp[1] < 0) { - $k_mp7[1] = 0; -} else { - $k_mp7[1] = $k_mp[1]; -} -?> \ No newline at end of file diff --git a/ag/clan/kampf/mp.php b/ag/clan/kampf/mp.php deleted file mode 100644 index a748389..0000000 --- a/ag/clan/kampf/mp.php +++ /dev/null @@ -1,30 +0,0 @@ - 0) { - $k_mp[0] = $k_mp[0] - $technick1['mp']; - - if ($k_mp[0] < 0) { - $k_hp[0] = $k_hp[0] + ($k_mp[0] * 10); - $k_mp[0] = 0; - } -} -####################KAMPF MP SPIELER 2 - -if ($technick2['type'] == 'normal' AND $technick2['mp'] > 0) { - $k_mp[1] = $k_mp[1] - $technick2['mp']; - - if ($k_mp[1] < 0) { - $k_hp[1] = $k_hp[1] + ($k_mp[1] * 10); - $k_mp[1] = 0; - } -} -?> \ No newline at end of file diff --git a/ag/clan/kampf/mpv.php b/ag/clan/kampf/mpv.php deleted file mode 100644 index 517d3af..0000000 --- a/ag/clan/kampf/mpv.php +++ /dev/null @@ -1,26 +0,0 @@ - \ No newline at end of file diff --git a/ag/clan/kampf/tausch.php b/ag/clan/kampf/tausch.php deleted file mode 100644 index 3133014..0000000 --- a/ag/clan/kampf/tausch.php +++ /dev/null @@ -1,100 +0,0 @@ -= $technick1['mp']) { - if ($haloo1 > mt_rand(1, 100)) { - - $k_starke_alt[0] = $k_starke[0]; - $k_speed_alt[0] = $k_speed[0]; - $k_ver_alt[0] = $k_ver[0]; - $k_ausdauer_alt[0] = $k_ausdauer[0]; - $k_glueck_alt[0] = $k_glueck[0]; - $k_hp_alt[0] = $k_hp[0]; - - $k_starke_alt[1] = $k_starke[1]; - $k_speed_alt[1] = $k_speed[1]; - $k_ver_alt[1] = $k_ver[1]; - $k_ausdauer_alt[1] = $k_ausdauer[1]; - $k_glueck_alt[1] = $k_glueck[1]; - $k_hp_alt[1] = $k_hp[1]; - - $k_starke[0] = $k_starke_alt[1]; - $k_speed[0] = $k_speed_alt[1]; - $k_ver[0] = $k_ver_alt[1]; - $k_ausdauer[0] = $k_ausdauer_alt[1]; - $k_glueck[0] = $k_glueck_alt[1]; - $k_hp[0] = $k_hp_alt[1]; - - $k_starke[1] = $k_starke_alt[0]; - $k_speed[1] = $k_speed_alt[0]; - $k_ver[1] = $k_ver_alt[0]; - $k_ausdauer[1] = $k_ausdauer_alt[0]; - $k_glueck[1] = $k_glueck_alt[0]; - $k_hp[1] = $k_hp_alt[0]; - - } else { - $k_mp[0] = $k_mp[0] - $technick1['mp']; - $schaden_2 = 'Keinen Schaden'; - $schaden_1 = 'Körpertausch'; - } - } else { - $k_mp[0] = $k_mp[0] - $technick1['mp']; - $schaden_2 = 'Keinen Schaden'; - $schaden_1 = 'Körpertausch fehlgeschlagen'; - } - $aktion_AV1[$x] = 'nein'; -} - -################### Spieler 2 -if ($technick2['type'] == 'tausch') { - if ($k_mp[1] >= $technick2['mp']) { - if ($haloo1 > mt_rand(1, 100)) { - - $k_starke_alt[0] = $k_starke[0]; - $k_speed_alt[0] = $k_speed[0]; - $k_ver_alt[0] = $k_ver[0]; - $k_ausdauer_alt[0] = $k_ausdauer[0]; - $k_glueck_alt[0] = $k_glueck[0]; - $k_hp_alt[0] = $k_hp[0]; - - $k_starke_alt[1] = $k_starke[1]; - $k_speed_alt[1] = $k_speed[1]; - $k_ver_alt[1] = $k_ver[1]; - $k_ausdauer_alt[1] = $k_ausdauer[1]; - $k_glueck_alt[1] = $k_glueck[1]; - $k_hp_alt[1] = $k_hp[1]; - - $k_starke[0] = $k_starke_alt[1]; - $k_speed[0] = $k_speed_alt[1]; - $k_ver[0] = $k_ver_alt[1]; - $k_ausdauer[0] = $k_ausdauer_alt[1]; - $k_glueck[0] = $k_glueck_alt[1]; - $k_hp[0] = $k_hp_alt[1]; - - $k_starke[1] = $k_starke_alt[0]; - $k_speed[1] = $k_speed_alt[0]; - $k_ver[1] = $k_ver_alt[0]; - $k_ausdauer[1] = $k_ausdauer_alt[0]; - $k_glueck[1] = $k_glueck_alt[0]; - $k_hp[1] = $k_hp_alt[0]; - - } else { - $k_mp[1] = $k_mp[1] - $technick2['mp']; - $schaden_1 = 'Keinen Schaden'; - $schaden_2 = 'Körpertausch'; - } - } else { - $k_mp[1] = $k_mp[1] - $technick2['mp']; - $schaden_1 = 'Keinen Schaden'; - $schaden_2 = 'Körpertausch fehlgeschlagen'; - } - $aktion_AV2[$x] = 'nein'; -} \ No newline at end of file diff --git a/ag/clan/kampf_info.php b/ag/clan/kampf_info.php index 2d184c1..1b2f6b5 100644 --- a/ag/clan/kampf_info.php +++ b/ag/clan/kampf_info.php @@ -9,6 +9,7 @@ include_once(ROOT_PATH.'/include/defines.inc.php'); include_once(ROOT_PATH.'/include/clan.inc.php'); include_once(ROOT_PATH.'/include/fehlerausgabe.inc.php'); +include_once(ROOT_PATH.'/include/designfunctions.inc.php'); include_once(ROOT_PATH.'/include/parse.inc.php'); include_once(ROOT_PATH.'/include/char.inc.php'); include_once(ROOT_PATH.'/include/user.inc.php'); @@ -165,8 +166,8 @@ function displayShowChallenge($clan_challenge_id, $user) { if($user_clan_chars[$i] != null) { $char = getChar($user_clan_chars[$i]); $char_owner = getOwnerOfChar($char['id']); - echo ''.$char['name'].' '; - echo '('.$char_owner['nickname'].')'; + echo ''.generateCharLinkByID($char['id']); + echo '('.generateUserLinkByID($char_owner['id'], FALSE).')'; if(isUserOwnerOf($user['id'], $char['id'])) { echo 'abmelden'; } @@ -494,13 +495,15 @@ function displayClanFightMenu($user) { } else { $max = $count; } - + for ($i = 0; $i < $max; $i++) { $participating_clan_ids = getParticipatingClanIDs($old_challenge_ids[$i]); + $old_challenge = getChallenge($old_challenge_ids[$i]); foreach ($participating_clan_ids as $pci) if($pci != $user_clan['id']) { $challenged_clan = getClan($pci); - echo ' '.$challenged_clan['clanname'].''; + echo ' '.$challenged_clan['clanname'].''; + echo '' .formatTimestamp($old_challenge['date'] ).''; echo ''.anzeigen.''; } } diff --git a/ag/gm/include/test_cf.php b/ag/gm/include/test_cf.php new file mode 100644 index 0000000..d43da51 --- /dev/null +++ b/ag/gm/include/test_cf.php @@ -0,0 +1,208 @@ +'; + + 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'], $amount); +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!!
'; + } + +} +} + +} + + +?> diff --git a/ag/include/clan.inc.php b/ag/include/clan.inc.php index ac994cb..0fe1073 100644 --- a/ag/include/clan.inc.php +++ b/ag/include/clan.inc.php @@ -244,6 +244,7 @@ function joinClan($user, $clanid, $check_invitation = true){ mysql_query('UPDATE clan SET leader = NULL WHERE leader = ' .$user['id'] . ' and id != ' .$clanid); mysql_query('UPDATE clan SET co_leader = NULL WHERE co_leader = ' .$user['id'] . ' and id != ' .$clanid); mysql_query('DELETE FROM clan_challenge_whitelist WHERE clan_id = ' .$clanid . ' AND user_id = ' .$user['id']); + mysql_query('DELETE FROM clan_challenge_participants where char_id IN (SELECT id from chars where besitzer = '.$user['id'].') and clan_challenge_id IN (SELECT clan_challenge_id from clan_challenges WHERE calculated = 0)'); if($check_invitation) { displayErrorMessage('Aufgenommen','Du wurdest erfolgreich in den Clan aufgenommen!','weiter'); diff --git a/ag/include/config/ads_example.inc.php b/ag/include/config/ads_example.inc.php index 967fbcd..ac56100 100644 --- a/ag/include/config/ads_example.inc.php +++ b/ag/include/config/ads_example.inc.php @@ -6,7 +6,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public Licence * */ - + // Liefert den HTML-Code für einen horizontalen Werbebanner // @returns String des HTML-Codes function getHorizontalAdvertisement(){ @@ -32,5 +32,14 @@ function getBoxAdvertisement(){ function getLayerAdvertisement(){ return ''; } - + + +function getFlattrHeadCode() { + return ''; +} + +function getFlattrBodyCode() { + return ''; +} + ?> \ No newline at end of file diff --git a/ag/include/designfunctions.inc.php b/ag/include/designfunctions.inc.php index 73a2542..8da4985 100644 --- a/ag/include/designfunctions.inc.php +++ b/ag/include/designfunctions.inc.php @@ -9,11 +9,14 @@ include_once(ROOT_PATH.'/include/defines.inc.php'); include_once(ROOT_PATH.'/include/usergroup.inc.php'); include_once(ROOT_PATH.'/include/config/settings.inc.php'); +include_once(ROOT_PATH.'/include/char.inc.php'); +include_once(ROOT_PATH.'/include/sqlwrapper.inc.php'); defineIfNotDefined('GROUP_COLOR_SUPPORTER', 'gold'); defineIfNotDefined('GROUP_COLOR_GAMEMASTER', 'lime'); defineIfNotDefined('GROUP_COLOR_DEVELOPER', 'orange'); defineIfNotDefined('GROUP_COLOR_CREATIVE', 'red'); +defineIfNotDefined('GROUP_COLOR_MODERATOR', 'green'); // Diese Funktion muss in ein Darstellungspackage hinein und muss noch verlegt werden, Gestaltung in css-Datei @@ -48,6 +51,8 @@ function generateUserNameByID($userid, $showClanTags = TRUE){ $color = 'style="color:'.GROUP_COLOR_DEVELOPER.'"'; } else if(isUserInGroup($groups, DESIGNER)){ $color = 'style="color:'.GROUP_COLOR_CREATIVE.'"'; + } else if(isUserInGroup($groups, MODERATOR)){ + $color = 'style="color:'.GROUP_COLOR_MODERATOR.'"'; } else { $color = 'style="color:'.GROUP_COLOR_SUPPORTER.'"'; } @@ -108,6 +113,25 @@ function displayIndexBackLink(){ return 'zurück'; } +function generateCharLinkByID($charid, $showAvatar = FALSE, $showClanTags = FALSE) { + $char = getChar($charid); + $clan_pre = null; + $clan_su = null; + $suffix = null; + if($showClanTags) { + $qry = db_query('select clan.clanz_pre, clan.clanz_suff from user left join clan on user.clan = clan.id where user.id = '.$userid); + $row = mysql_fetch_assoc($qry); + $clan_pre = $row['clanz_pre']; + $clan_su = $row['clanz_suff']; + } + + if($showAvatar) { + $suffix = '
'; + } + + return ''.$clan_pre . ' ' . $char['name'] . ' ' . $clan_su . $suffix .''; +} + function displayCharLink($charid, $charname, $img = NULL, $clanpre = NULL, $clansu = NULL){ if($clanpre !== NULL && $clansu !== NULL){ $charname = $clanpre.' '.$charname.' '.$clansu; diff --git a/ag/include/usergroup.inc.php b/ag/include/usergroup.inc.php index 949a241..61c5efe 100644 --- a/ag/include/usergroup.inc.php +++ b/ag/include/usergroup.inc.php @@ -19,6 +19,7 @@ defineIfNotDefined('WERBUNG_AN', 5); defineIfNotDefined('INAKTIV_LOESCHSCHUTZ', 6); defineIfNotDefined('AKTIV_LOESCHSCHUTZ', 7); defineIfNotDefined('AKTIV_CHAT', 8); +defineIfNotDefined('MODERATOREN', 9); function getUserGroups($user) { $qry = null; diff --git a/ag/index.php b/ag/index.php index 0cfb879..811d476 100644 --- a/ag/index.php +++ b/ag/index.php @@ -37,6 +37,13 @@ $agb = $_REQUEST['agb']; + + + + @@ -364,10 +371,46 @@ if($as != "irc" AND $as != "login" AND $as != "anmeldung" AND $as != "info/logs" - -
+ + + + + + + + + +
Support
+ + + + + + + +
+
+ + + + + + + + + +
+ Chat
  + + + + + + + +
+
+ + + + +
diff --git a/ag/info/agchat.php b/ag/info/agchat.php index 8fe3c63..63b23b0 100644 --- a/ag/info/agchat.php +++ b/ag/info/agchat.php @@ -1,4 +1,4 @@ - -

-

+
Hier klicken zum mitreden!! -

diff --git a/ag/kampf_list.php b/ag/kampf_list.php index 343b596..d595280 100644 --- a/ag/kampf_list.php +++ b/ag/kampf_list.php @@ -379,6 +379,13 @@ function displayAutoFights($user, $portal, $pagenum){
Falls kein Kampf gefunden wird: + Autofight ohne Namensbegrenzung
+ Kampf erstellen +