fix: now assigning chars is possible again, no logging of sql-statements if the sql-statement was executed correctly!

main
hecht 13 years ago
parent af197941ae
commit 0822d24b46

@ -467,7 +467,6 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
return 'Konnte den Char nicht hinzufügen. Da du schon einen Char angemeldet hast!'; return 'Konnte den Char nicht hinzufügen. Da du schon einen Char angemeldet hast!';
} }
if($forced && isForceForCharAcknowledged($char['id'])) { if($forced && isForceForCharAcknowledged($char['id'])) {
} }
@ -485,8 +484,11 @@ function joinChallenge($clan_challenge_id, array $user, $charid, $slot ) {
semaphoreDown($ressource2); semaphoreDown($ressource2);
return 'Du kannst den Char nicht zuweisen, da die maximale Anzahl der Zuweisungen schon erreicht ist!'; return 'Du kannst den Char nicht zuweisen, da die maximale Anzahl der Zuweisungen schon erreicht ist!';
} }
$sql = 'INSERT INTO clan_challenge_participants(clan_challenge_id, clan_id, char_id, slot, forced) values('.$clan_challenge_id.', '.$user['clan'].', '.$charid.', '.$slot.', ' .($forced?'TRUE':'FALSE') .')';
mysql_query('INSERT INTO clan_challenge_participants(clan_challenge_id, clan_id, char_id, slot, forced) values('.$clan_challenge_id.', '.$user['clan'].', '.$charid.', '.$slot.', ' .$forced .')'); $res = mysql_query($sql);
if(!$res) {
echo $sql .'<br>';
}
if(mysql_affected_rows() == 0) { if(mysql_affected_rows() == 0) {
if(!$forced) { if(!$forced) {
// maybe the leader has already assigned the char and we now give the official okay for that! // maybe the leader has already assigned the char and we now give the official okay for that!

@ -113,18 +113,19 @@ function persistFight($event_id, array $combinedArray, $startTimestamp, $endTime
$sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)'; $sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)';
$sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_1['id'].',\''. $chara_1['hp'].'\', \''. $chara_1['mp'].'\', '. $chara_1['starke'].', '. $chara_1['speed'].', '. $chara_1['verteidigung'].', '. $chara_1['glueck'].', '. $chara_1['ausdauer'].', '. ($roundsArray[$round]['atk_char1']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char1'].'\'' ).', '. ($roundsArray[$round]['dmg_char1']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char1'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')'; $sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_1['id'].',\''. $chara_1['hp'].'\', \''. $chara_1['mp'].'\', '. $chara_1['starke'].', '. $chara_1['speed'].', '. $chara_1['verteidigung'].', '. $chara_1['glueck'].', '. $chara_1['ausdauer'].', '. ($roundsArray[$round]['atk_char1']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char1'].'\'' ).', '. ($roundsArray[$round]['dmg_char1']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char1'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
echo $sql .'<br>';
mysql_query($sql); $res = mysql_query($sql);
if(!$res)
echo $sql .'<br>';
// now persist char2 // now persist char2
$chara_2 = $roundsArray[$round]['char2_array']; $chara_2 = $roundsArray[$round]['char2_array'];
$sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)'; $sql = 'INSERT INTO event_fight_rounds(event_id, event_fight_id, round, event_char_id, hp, mp, strength, speed, defense, luck, stamina, attack, damage, visible)';
$sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_2['id'].',\''. $chara_2['hp'].'\', \''. $chara_2['mp'].'\', '. $chara_2['starke'].', '. $chara_2['speed'].', '. $chara_2['verteidigung'].', '. $chara_2['glueck'].', '. $chara_2['ausdauer'].', '. ($roundsArray[$round]['atk_char2']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char2'].'\'' ).', '. ($roundsArray[$round]['dmg_char2']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char2'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')'; $sql .= ' values('.$event_id.','.$event_fight_id.','.$round.',' .$chara_2['id'].',\''. $chara_2['hp'].'\', \''. $chara_2['mp'].'\', '. $chara_2['starke'].', '. $chara_2['speed'].', '. $chara_2['verteidigung'].', '. $chara_2['glueck'].', '. $chara_2['ausdauer'].', '. ($roundsArray[$round]['atk_char2']===NULL?'NULL': '\''.$roundsArray[$round]['atk_char2'].'\'' ).', '. ($roundsArray[$round]['dmg_char2']===NULL?'NULL': '\''.$roundsArray[$round]['dmg_char2'].'\'' ).', \''.date("Y-m-d H:i:s",$endTimestamp).'\')';
$res = mysql_query($sql);
if(!$res)
echo $sql .'<br>'; echo $sql .'<br>';
mysql_query($sql);
} }
// Okay now do we have any additional data left? // Okay now do we have any additional data left?

Loading…
Cancel
Save