|
|
@ -25,7 +25,7 @@ function generateTournamentResults($name, $additionalExpPerRound, $additionalMon
|
|
|
|
$charids = array();
|
|
|
|
$charids = array();
|
|
|
|
|
|
|
|
|
|
|
|
// First calculate the money and exp the char gets just for doing good at fights ;)
|
|
|
|
// First calculate the money and exp the char gets just for doing good at fights ;)
|
|
|
|
$qry = db_query('select char1, char2, exp1, exp2, geld1, geld2, round from turnier_kampf where art = \''.$name.'\' order by round asc');
|
|
|
|
$qry = silent_query('select char1, char2, exp1, exp2, geld1, geld2, round from turnier_kampf where art = \''.$name.'\' order by round asc');
|
|
|
|
|
|
|
|
|
|
|
|
while($fight = mysqli_fetch_assoc($qry)) {
|
|
|
|
while($fight = mysqli_fetch_assoc($qry)) {
|
|
|
|
if(!isset($charArray[$fight['char1']])) {
|
|
|
|
if(!isset($charArray[$fight['char1']])) {
|
|
|
@ -46,7 +46,7 @@ function generateTournamentResults($name, $additionalExpPerRound, $additionalMon
|
|
|
|
$returnArray = array();
|
|
|
|
$returnArray = array();
|
|
|
|
|
|
|
|
|
|
|
|
// Now calculate the money and exp the char gets just for proceeding in the tournament (in this case ... order the chars right away ;))
|
|
|
|
// Now calculate the money and exp the char gets just for proceeding in the tournament (in this case ... order the chars right away ;))
|
|
|
|
$qry = db_query('Select count(win) as anzahl, win from turnier_kampf where art = \''.$name.'\' group by win order by count(win) desc');
|
|
|
|
$qry = silent_query('Select count(win) as anzahl, win from turnier_kampf where art = \''.$name.'\' group by win order by count(win) desc');
|
|
|
|
$maxRank = -1;
|
|
|
|
$maxRank = -1;
|
|
|
|
while ($participant = mysqli_fetch_assoc($qry)) {
|
|
|
|
while ($participant = mysqli_fetch_assoc($qry)) {
|
|
|
|
$charids[$participant['win']] = 0; // okay we already proceeded this one :)
|
|
|
|
$charids[$participant['win']] = 0; // okay we already proceeded this one :)
|
|
|
@ -63,7 +63,7 @@ function generateTournamentResults($name, $additionalExpPerRound, $additionalMon
|
|
|
|
$char = getChar($participant['win']);
|
|
|
|
$char = getChar($participant['win']);
|
|
|
|
$sql = 'UPDATE user set geld = geld + ' . $charArray[$participant['win']]['money'] . ' WHERE id = ' . $char['besitzer'];
|
|
|
|
$sql = 'UPDATE user set geld = geld + ' . $charArray[$participant['win']]['money'] . ' WHERE id = ' . $char['besitzer'];
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
db_query($sql);
|
|
|
|
silent_query($sql);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach ($charids as $key => $value) {
|
|
|
|
foreach ($charids as $key => $value) {
|
|
|
@ -75,7 +75,7 @@ function generateTournamentResults($name, $additionalExpPerRound, $additionalMon
|
|
|
|
$char = getChar($key);
|
|
|
|
$char = getChar($key);
|
|
|
|
$sql = 'UPDATE user set geld = geld + ' . $charArray[$key]['money'] . ' WHERE id = ' . $char['besitzer'];
|
|
|
|
$sql = 'UPDATE user set geld = geld + ' . $charArray[$key]['money'] . ' WHERE id = ' . $char['besitzer'];
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
db_query($sql);
|
|
|
|
silent_query($sql);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -111,7 +111,7 @@ function distributeShopPoints(array $prices, array $winners, $reason) {
|
|
|
|
$userid = $char['besitzer'];
|
|
|
|
$userid = $char['besitzer'];
|
|
|
|
$sql = 'UPDATE user set pkt = pkt + '.$points.' WHERE id = '. $userid;
|
|
|
|
$sql = 'UPDATE user set pkt = pkt + '.$points.' WHERE id = '. $userid;
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
db_query($sql);
|
|
|
|
silent_query($sql);
|
|
|
|
insertUserTickerMessage($userid, $points .' IP durch den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
|
|
|
|
insertUserTickerMessage($userid, $points .' IP durch den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -127,7 +127,7 @@ function distributeUserPrices(array $prices, array $winners, $reason) {
|
|
|
|
$userid = $char['besitzer'];
|
|
|
|
$userid = $char['besitzer'];
|
|
|
|
$sql = 'UPDATE user set geld = geld + '.$points.' WHERE id = '. $userid;
|
|
|
|
$sql = 'UPDATE user set geld = geld + '.$points.' WHERE id = '. $userid;
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
db_query($sql);
|
|
|
|
silent_query($sql);
|
|
|
|
insertUserTickerMessage($userid, $points .' Preisgeld durch den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
|
|
|
|
insertUserTickerMessage($userid, $points .' Preisgeld durch den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -142,11 +142,11 @@ function distributeClanPrices(array $prices, array $results, $reason) {
|
|
|
|
foreach($results[$i] as $winner) {
|
|
|
|
foreach($results[$i] as $winner) {
|
|
|
|
$char = getChar($winner); // buffered so will not cause in a sql statement all the time!
|
|
|
|
$char = getChar($winner); // buffered so will not cause in a sql statement all the time!
|
|
|
|
$userid = $char['besitzer'];
|
|
|
|
$userid = $char['besitzer'];
|
|
|
|
$data = mysqli_fetch_assoc(db_query('Select clan from user where id = ' .$userid ));
|
|
|
|
$data = mysqli_fetch_assoc(silent_query('Select clan from user where id = ' .$userid ));
|
|
|
|
if(is_numeric($data['clan'])) {
|
|
|
|
if(is_numeric($data['clan'])) {
|
|
|
|
$sql = 'UPDATE clan SET geld = geld + ' . $points . ' WHERE id = ' . $data['clan'];
|
|
|
|
$sql = 'UPDATE clan SET geld = geld + ' . $points . ' WHERE id = ' . $data['clan'];
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
echo $sql . ' <br>';
|
|
|
|
db_query($sql);
|
|
|
|
silent_query($sql);
|
|
|
|
insertClanTickerMessage($row['clan'], 'Das Preisgeld von '.$points.' für den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
|
|
|
|
insertClanTickerMessage($row['clan'], 'Das Preisgeld von '.$points.' für den '.generateRanglistString($i).' Platz im '.$reason.' erhalten!');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|