토너먼트 중복 참가 방지. 자동 참가시 돈을 받지 않음

This commit is contained in:
2018-08-08 01:54:57 +09:00
parent 1b3380c2ca
commit 975bdd5897
2 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -38,9 +38,13 @@ case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
}
if($btn == '참가') {
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='{$me['no']}'";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$general = MYDB_fetch_array($result);
if($db->queryFirstField('SELECT `no` FROM tournament WHERE `no`=%i', $me['no'])){
header('location:b_tournament.php');
exit(1);
}
$general = $db->queryFirstRow('SELECT no,name,npc,leader,power,intel,explevel,gold,horse,weap,book FROM general WHERE `no`=%i', $me['no']);
//{$admin['develcost']}원 참가비
if($general['gold'] < $admin['develcost']) {
+2 -2
View File
@@ -298,7 +298,7 @@ function fillLowGenAll() {
}
//자동신청하고, 돈 있고, 아직 참가 안한 장수
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' and gold>='{$develcost}' order by rand() limit 0,64";
$query = "select no,npc,name,leader,power,intel,explevel from general where tnmt='1' and tournament='0' order by rand() limit 0,64";
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$genCount = MYDB_num_rows($result);
@@ -313,7 +313,7 @@ function fillLowGenAll() {
if($genCount > 0) {
$genCount--;
$gen = MYDB_fetch_array($result);
$query = "update general set gold=gold-'{$develcost}',tournament='1' where no='{$gen['no']}'";
$query = "update general set tournament='1' where no='{$gen['no']}'";
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
$query = "insert into tournament (no, npc, name, ldr, pwr, itl, lvl, grp, grp_no) values ('{$gen['no']}', '{$gen['npc']}', '{$gen['name']}', '{$gen['leader']}', '{$gen['power']}', '{$gen['intel']}', '{$gen['explevel']}', '$i', '$grpCount[$i]')";