의심 가는 취약점 구역 차단
This commit is contained in:
+11
-7
@@ -12,28 +12,32 @@ $connect=$db->get();
|
|||||||
increaseRefresh("내정보", 1);
|
increaseRefresh("내정보", 1);
|
||||||
|
|
||||||
$query = "select myset from general where owner='{$session->userID}'";
|
$query = "select myset from general where owner='{$session->userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
if($me['myset'] > 0) {
|
if ($me['myset'] > 0) {
|
||||||
$submit = 'submit';
|
$submit = 'submit';
|
||||||
} else {
|
} else {
|
||||||
$submit = 'hidden';
|
$submit = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "설정저장" && $me['myset'] > 0) {
|
if ($btn == "설정저장" && $me['myset'] > 0) {
|
||||||
if($me['myset'] > 1) {
|
if ($me['myset'] > 1) {
|
||||||
$submit = 'submit';
|
$submit = 'submit';
|
||||||
} else {
|
} else {
|
||||||
$submit = 'hidden';
|
$submit = 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "update general set myset=myset-1,map='$map',mode='$mode',tnmt='$tnmt' where owner='{$session->userID}'";
|
$db->update('general', [
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'myset'=>$db->sqleval('myset-1'),
|
||||||
|
'map'=>$map,
|
||||||
|
'mode'=>$mode,
|
||||||
|
'tnmt'=>$tnmt
|
||||||
|
], 'owner=%i', $session->userID);
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "select no,map,mode,tnmt,myset from general where owner='{$session->userID}'";
|
$query = "select no,map,mode,tnmt,myset from general where owner='{$session->userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
+99
-64
@@ -12,19 +12,19 @@ $connect=$db->get();
|
|||||||
increaseRefresh("입찰", 1);
|
increaseRefresh("입찰", 1);
|
||||||
|
|
||||||
$query = "select turnterm from game limit 1";
|
$query = "select turnterm from game limit 1";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$admin = MYDB_fetch_array($result);
|
$admin = MYDB_fetch_array($result);
|
||||||
|
|
||||||
$query = "select no,name,gold,rice,special from general where owner='{$session->userID}'";
|
$query = "select no,name,gold,rice,special from general where owner='{$session->userID}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$me = MYDB_fetch_array($result);
|
$me = MYDB_fetch_array($result);
|
||||||
|
|
||||||
$query = "select no from auction where no1='{$me['no']}'";
|
$query = "select no from auction where no1='{$me['no']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$tradeCount = MYDB_num_rows($result);
|
$tradeCount = MYDB_num_rows($result);
|
||||||
|
|
||||||
$query = "select no from auction where no2='{$me['no']}'";
|
$query = "select no from auction where no2='{$me['no']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$bidCount = MYDB_num_rows($result);
|
$bidCount = MYDB_num_rows($result);
|
||||||
|
|
||||||
$btCount = $tradeCount + $bidCount;
|
$btCount = $tradeCount + $bidCount;
|
||||||
@@ -35,10 +35,12 @@ $amount = round($amount / 10) * 10;
|
|||||||
$cost = round($cost / 10) * 10;
|
$cost = round($cost / 10) * 10;
|
||||||
$topv = round($topv / 10) * 10;
|
$topv = round($topv / 10) * 10;
|
||||||
$value = round($value / 10) * 10;
|
$value = round($value / 10) * 10;
|
||||||
if($term > 24) $term = 24;
|
if ($term > 24) {
|
||||||
|
$term = 24;
|
||||||
|
}
|
||||||
|
|
||||||
$valid = 1;
|
$valid = 1;
|
||||||
if($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
|
if ($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['special'] == 30 && $btCount < 3)) {
|
||||||
} else {
|
} else {
|
||||||
$msg = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>더이상 등록할 수 없습니다.</span>";
|
||||||
@@ -46,36 +48,36 @@ if($session->userGrade >= 5 || ($me['special'] != 30 && $btCount < 1) || ($me['s
|
|||||||
$btn = "hidden";
|
$btn = "hidden";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($btn == "판매") {
|
if ($btn == "판매") {
|
||||||
if($stuff != 0) {
|
if ($stuff != 0) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($term < 0 || $term > 24) {
|
if ($term < 0 || $term > 24) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>종료기한은 1 ~ 24 턴 이어야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>종료기한은 1 ~ 24 턴 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($amount < 100 || $amount > 10000) {
|
if ($amount < 100 || $amount > 10000) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>거래량은 100 ~ 10000 이어야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>거래량은 100 ~ 10000 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($cost > $amount * 2 || $cost * 2 < $amount) {
|
if ($cost > $amount * 2 || $cost * 2 < $amount) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>시작판매가는 50% ~ 200% 이어야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>시작판매가는 50% ~ 200% 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($topv < $amount*1.1 || $topv > $amount * 2) {
|
if ($topv < $amount*1.1 || $topv > $amount * 2) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 110% ~ 200% 이어야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 110% ~ 200% 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($topv < $cost*1.1) {
|
if ($topv < $cost*1.1) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>즉시판매가는 시작판매가의 110% 이상이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($amount > $me['rice'] - 1000) {
|
if ($amount > $me['rice'] - 1000) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>기본 군량 1000은 거래할 수 없습니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>기본 군량 1000은 거래할 수 없습니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($valid == 1) {
|
if ($valid == 1) {
|
||||||
$msg = "ㆍ<span class='ev_success'>등록 성공.</span>";
|
$msg = "ㆍ<span class='ev_success'>등록 성공.</span>";
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||||
$db->insert('auction', [
|
$db->insert('auction', [
|
||||||
@@ -90,132 +92,165 @@ if($btn == "판매") {
|
|||||||
'expire'=>$date
|
'expire'=>$date
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
} elseif($btn == "구매시도") {
|
} elseif ($btn == "구매시도") {
|
||||||
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$auction = MYDB_fetch_array($result);
|
$auction = MYDB_fetch_array($result);
|
||||||
|
|
||||||
if($value == $auction['topv']) {
|
if ($value == $auction['topv']) {
|
||||||
$valid = 2;
|
$valid = 2;
|
||||||
}
|
}
|
||||||
if(!$auction) {
|
if (!$auction) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>종료된 거래입니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>종료된 거래입니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
if($stuff != 0) {
|
if($stuff != 0) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if($auction['no2'] > 0 && $value <= $auction['value']) {
|
if ($auction['no2'] > 0 && $value <= $auction['value']) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>현재판매가보다 높게 입찰해야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>현재판매가보다 높게 입찰해야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($value < $auction['value']) {
|
if ($value < $auction['value']) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>현재판매가보다 높게 입찰해야 합니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>현재판매가보다 높게 입찰해야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($value > $auction['topv']) {
|
if ($value > $auction['topv']) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>즉시판매가보다 높을 수 없습니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>즉시판매가보다 높을 수 없습니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($value > $me['gold'] - 1000) {
|
if ($value > $me['gold'] - 1000) {
|
||||||
$msg = "ㆍ<span class='ev_warning'>기본 자금 1000은 거래할 수 없습니다.</span>";
|
$msg = "ㆍ<span class='ev_warning'>기본 자금 1000은 거래할 수 없습니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($valid == 1) {
|
if ($valid == 1) {
|
||||||
$msg = "ㆍ<span class='ev_success'>입찰 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
$msg = "ㆍ<span class='ev_success'>입찰 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
||||||
if($auction['expire'] > $date) $date = $auction['expire'];
|
if ($auction['expire'] > $date) {
|
||||||
$query = "update auction set value='$value',no2='{$me['no']}',name2='{$me['name']}',expire='$date' where no='$sel'";
|
$date = $auction['expire'];
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
}
|
||||||
} elseif($valid == 2) {
|
|
||||||
|
$db->update('auction', [
|
||||||
|
'value'=>$value,
|
||||||
|
'no2'=>$me['no'],
|
||||||
|
'name2'=>$me['name'],
|
||||||
|
'expire'=>$date,
|
||||||
|
], 'no=%i', $sel);
|
||||||
|
} elseif ($valid == 2) {
|
||||||
$msg = "ㆍ<span class='ev_success'>즉시판매 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
$msg = "ㆍ<span class='ev_success'>즉시판매 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
||||||
$query = "update auction set value='$value',no2='{$me['no']}',name2='{$me['name']}',expire='$date' where no='$sel'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$db->update('auction', [
|
||||||
|
'value'=>$value,
|
||||||
|
'no2'=>$me['no'],
|
||||||
|
'name2'=>$me['name'],
|
||||||
|
'expire'=>$date,
|
||||||
|
], 'no=%i', $sel);
|
||||||
}
|
}
|
||||||
} elseif($btn == "구매") {
|
} elseif ($btn == "구매") {
|
||||||
if($stuff != 0) {
|
if ($stuff != 0) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($term < 0 || $term > 24) {
|
if ($term < 0 || $term > 24) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>종료기한은 1 ~ 24 턴 이어야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>종료기한은 1 ~ 24 턴 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($amount < 100 || $amount > 10000) {
|
if ($amount < 100 || $amount > 10000) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>거래량은 100 ~ 10000 이어야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>거래량은 100 ~ 10000 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($cost > $amount * 2 || $cost * 2 < $amount) {
|
if ($cost > $amount * 2 || $cost * 2 < $amount) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>시작구매가는 50% ~ 200% 이어야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>시작구매가는 50% ~ 200% 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($topv < $amount * 0.5 || $topv > $amount * 0.9) {
|
if ($topv < $amount * 0.5 || $topv > $amount * 0.9) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가는 50% ~ 90% 이어야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가는 50% ~ 90% 이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($topv > $cost * 0.9) {
|
if ($topv > $cost * 0.9) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가는 시작구매가의 90% 이하이어야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($cost > $me['gold'] - 1000) {
|
if ($cost > $me['gold'] - 1000) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>기본 자금 1000은 거래할 수 없습니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>기본 자금 1000은 거래할 수 없습니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($valid == 1) {
|
if ($valid == 1) {
|
||||||
$msg2 = "ㆍ<span class='ev_success'>등록 성공.</span>";
|
$msg2 = "ㆍ<span class='ev_success'>등록 성공.</span>";
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit * $term);
|
||||||
$query = "insert into auction (type, no1, name1, stuff, amount, cost, value, topv, expire) values (1, '{$me['no']}', '{$me['name']}', '$stuff', '$amount', '$cost', '$cost', '$topv', '$date')";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$db->insert('auction', [
|
||||||
|
'type'=>1,
|
||||||
|
'no1'=>$me['no'],
|
||||||
|
'name1'=>$me['name'],
|
||||||
|
'stuff'=>$stuff,
|
||||||
|
'amount'=>$amount,
|
||||||
|
'cost'=>$cost,
|
||||||
|
'value'=>$cost,
|
||||||
|
'topv'=>$topv,
|
||||||
|
'expire'=>$date
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
} elseif($btn == "판매시도") {
|
} elseif ($btn == "판매시도") {
|
||||||
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
$query = "select no2,value,topv,expire,amount from auction where no='$sel'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect), "");
|
||||||
$auction = MYDB_fetch_array($result);
|
$auction = MYDB_fetch_array($result);
|
||||||
|
|
||||||
if($value == $auction['topv']) {
|
if ($value == $auction['topv']) {
|
||||||
$valid = 2;
|
$valid = 2;
|
||||||
}
|
}
|
||||||
if(!$auction) {
|
if (!$auction) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>종료된 거래입니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>종료된 거래입니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($stuff != 0) {
|
if ($stuff != 0) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>현재 쌀만 거래 가능합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($auction['no2'] > 0 && $value >= $auction['value']) {
|
if ($auction['no2'] > 0 && $value >= $auction['value']) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>현재구매가보다 낮게 입찰해야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>현재구매가보다 낮게 입찰해야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($value > $auction['value']) {
|
if ($value > $auction['value']) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>현재구매가보다 낮게 입찰해야 합니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>현재구매가보다 낮게 입찰해야 합니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($value < $auction['topv']) {
|
if ($value < $auction['topv']) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가보다 낮을 수 없습니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>즉시구매가보다 낮을 수 없습니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($value > $me['rice'] - 1000) {
|
if ($value > $me['rice'] - 1000) {
|
||||||
$msg2 = "ㆍ<span class='ev_warning'>기본 군량 1000은 거래할 수 없습니다.</span>";
|
$msg2 = "ㆍ<span class='ev_warning'>기본 군량 1000은 거래할 수 없습니다.</span>";
|
||||||
$valid = 0;
|
$valid = 0;
|
||||||
}
|
}
|
||||||
if($valid == 1) {
|
if ($valid == 1) {
|
||||||
$msg2 = "ㆍ<span class='ev_success'>입찰 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
$msg2 = "ㆍ<span class='ev_success'>입찰 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
||||||
if($auction['expire'] > $date) $date = $auction['expire'];
|
if ($auction['expire'] > $date) {
|
||||||
$query = "update auction set value='$value',no2='{$me['no']}',name2='{$me['name']}',expire='$date' where no='$sel'";
|
$date = $auction['expire'];
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
}
|
||||||
} elseif($valid == 2) {
|
|
||||||
|
$db->update('auction', [
|
||||||
|
'value'=>$value,
|
||||||
|
'no2'=>$me['no'],
|
||||||
|
'name2'=>$me['name'],
|
||||||
|
'expire'=>$date,
|
||||||
|
], 'no=%i', $sel);
|
||||||
|
} elseif ($valid == 2) {
|
||||||
$msg2 = "ㆍ<span class='ev_success'>즉시구매 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
$msg2 = "ㆍ<span class='ev_success'>즉시구매 성공.</span> 거래완료는 빨라도 현재로부터 1턴 뒤입니다.";
|
||||||
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
$date = date("Y-m-d H:i:s", strtotime(date("Y-m-d H:i:s")) + $unit);
|
||||||
$query = "update auction set value='$value',no2='{$me['no']}',name2='{$me['name']}',expire='$date' where no='$sel'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$db->update('auction', [
|
||||||
|
'value'=>$value,
|
||||||
|
'no2'=>$me['no'],
|
||||||
|
'name2'=>$me['name'],
|
||||||
|
'expire'=>$date,
|
||||||
|
], 'no=%i', $sel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Submit("b_auction.php", $msg, $msg2);
|
Submit("b_auction.php", $msg, $msg2);
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@ $me = MYDB_fetch_array($result);
|
|||||||
|
|
||||||
for($i=0; $i < 16; $i++) {
|
for($i=0; $i < 16; $i++) {
|
||||||
if(${"btn{$i}"} == "베팅!") {
|
if(${"btn{$i}"} == "베팅!") {
|
||||||
$gold = ${"gold{$i}"};
|
$gold = Util::toInt(${"gold{$i}"});
|
||||||
$mebet = $me["bet{$i}"];
|
$mebet = $me["bet{$i}"];
|
||||||
if($gold >= 10 && $gold <= 1000) {
|
if($gold >= 10 && $gold <= 1000) {
|
||||||
if($gold + 500 <= $me['gold'] && $gold + $mebet <= 1000 && $gold + $me['bet'] <= 1000) {
|
if($gold + 500 <= $me['gold'] && $gold + $mebet <= 1000 && $gold + $me['bet'] <= 1000) {
|
||||||
|
|||||||
@@ -3,6 +3,10 @@ namespace sammo;
|
|||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
|
$title = Util::array_get($_POST['title']);
|
||||||
|
$msg = Util::array_get($_POST['msg']);
|
||||||
|
$num = Util::toInt(Util::array_get($_POST['num']));
|
||||||
// $title, $msg, $num
|
// $title, $msg, $num
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
|
|||||||
@@ -33,16 +33,19 @@ if($btn == "국가방침") {
|
|||||||
$query = "update nation set scoutmsg='$scoutmsg' where nation='{$me['nation']}'";
|
$query = "update nation set scoutmsg='$scoutmsg' where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
} elseif($btn == "세율") {
|
} elseif($btn == "세율") {
|
||||||
|
$rate = (int)$rate;
|
||||||
if($rate < 5) { $rate = 5; }
|
if($rate < 5) { $rate = 5; }
|
||||||
if($rate > 30) { $rate = 30; }
|
if($rate > 30) { $rate = 30; }
|
||||||
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
|
$query = "update nation set rate='$rate' where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
} elseif($btn == "지급율") {
|
} elseif($btn == "지급율") {
|
||||||
|
$bill = (int)$bill;
|
||||||
if($bill < 20) { $bill = 20; }
|
if($bill < 20) { $bill = 20; }
|
||||||
if($bill > 200) { $bill = 200; }
|
if($bill > 200) { $bill = 200; }
|
||||||
$query = "update nation set bill='$bill' where nation='{$me['nation']}'";
|
$query = "update nation set bill='$bill' where nation='{$me['nation']}'";
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
} elseif($btn == "기밀권한") {
|
} elseif($btn == "기밀권한") {
|
||||||
|
$secretlimit = (int)$secretlimit;
|
||||||
if($secretlimit < 1) { $secretlimit = 1; }
|
if($secretlimit < 1) { $secretlimit = 1; }
|
||||||
if($secretlimit > 99) { $secretlimit = 99; }
|
if($secretlimit > 99) { $secretlimit = 99; }
|
||||||
$query = "update nation set secretlimit='$secretlimit' where nation='{$me['nation']}'";
|
$query = "update nation set secretlimit='$secretlimit' where nation='{$me['nation']}'";
|
||||||
|
|||||||
+8
-9
@@ -34,18 +34,17 @@ if($command == 46) {
|
|||||||
if($name == "") { $name = "무명"; }
|
if($name == "") { $name = "무명"; }
|
||||||
$name = StringUtil::SubStrForWidth($name, 0, 12);
|
$name = StringUtil::SubStrForWidth($name, 0, 12);
|
||||||
|
|
||||||
$query = "update general set makenation='{$name}' where owner='{$session->userID}'";
|
$db->update('general', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'makenation'=>$name
|
||||||
|
], 'owner=%i', $session->userID);
|
||||||
|
|
||||||
$count = sizeof($turn);
|
$count = sizeof($turn);
|
||||||
$str = "con=con";
|
$query = ['con'=>$db->eval('con')];
|
||||||
for($i=0; $i < $count; $i++) {
|
foreach($turn as $turnIdx){
|
||||||
$str .= ",turn{$turn[$i]}='{$comStr}'";
|
$query['turn'.$turnIdx] = $comStr;
|
||||||
}
|
}
|
||||||
$query = "update general set {$str} where owner='{$session->userID}'";
|
$db->upate('general', $query, 'owner=%i', $session->userID);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
header('Location:index.php');
|
||||||
//echo "<script>location.replace('index.php');</script>";
|
|
||||||
echo 'index.php';//TODO:debug all and replace
|
|
||||||
//통합제의
|
//통합제의
|
||||||
} elseif($command == 53) {
|
} elseif($command == 53) {
|
||||||
$query = "select nation,level from general where owner='{$session->userID}'";
|
$query = "select nation,level from general where owner='{$session->userID}'";
|
||||||
|
|||||||
+26
-1
@@ -5,6 +5,11 @@ include "lib.php";
|
|||||||
include "func.php";
|
include "func.php";
|
||||||
// $btn, $level, $genlist, $outlist
|
// $btn, $level, $genlist, $outlist
|
||||||
|
|
||||||
|
$btn = Util::array_get($_POST['btn']);
|
||||||
|
$level = Util::toInt(Util::array_get($_POST['level']));
|
||||||
|
$genlist = Util::toInt(Util::array_get($_POST['genlist']));
|
||||||
|
$outlist = Util::toInt(Util::array_get($_POST['outlist']));
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
@@ -24,6 +29,13 @@ $query = "select no from general where nation='{$me['nation']}' and level=12";
|
|||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$ruler = MYDB_fetch_array($result);
|
$ruler = MYDB_fetch_array($result);
|
||||||
|
|
||||||
|
//수뇌가 아니면 아무것도 할 수 없음
|
||||||
|
if($meLevel < 5){
|
||||||
|
echo 'b_myBossInfo.php';//TODO:debug all and replace
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($btn == "임명") {
|
if($btn == "임명") {
|
||||||
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
$query = "select no,nation,level,leader,power,intel from general where no='$genlist'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -48,6 +60,12 @@ if($btn == "임명") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//나와 대상 장수는 국가가 같아야 함
|
||||||
|
if($me['nation'] != $general['nation']){
|
||||||
|
echo 'b_myBossInfo.php';//TODO:debug all and replace
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
if($btn == "추방") {
|
if($btn == "추방") {
|
||||||
$query = "select name,l{$meLevel}set,chemi from nation where nation='{$me['nation']}'";
|
$query = "select name,l{$meLevel}set,chemi from nation where nation='{$me['nation']}'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
@@ -220,10 +238,16 @@ if($btn == "추방") {
|
|||||||
case 2: $lv = 3; break;
|
case 2: $lv = 3; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "select gen{$lv} from city where city='$citylist'";
|
$query = "select gen{$lv} from city where nation='{$me['nation']}' and city='$citylist'";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$city = MYDB_fetch_array($result);
|
$city = MYDB_fetch_array($result);
|
||||||
|
if(!$city){
|
||||||
|
//echo "<script>location.replace('b_myBossInfo.php');</script>";
|
||||||
|
echo 'b_myBossInfo.php';//TODO:debug all and replace
|
||||||
|
die();
|
||||||
|
}
|
||||||
$oldlist = $city["gen{$lv}"];
|
$oldlist = $city["gen{$lv}"];
|
||||||
|
|
||||||
if($oldlist != 0) {
|
if($oldlist != 0) {
|
||||||
//기존 장수 일반으로
|
//기존 장수 일반으로
|
||||||
$query = "update general set level=1 where no='$oldlist'";
|
$query = "update general set level=1 where no='$oldlist'";
|
||||||
@@ -239,6 +263,7 @@ if($btn == "추방") {
|
|||||||
case 3: if($general['intel'] >= GameConst::$goodgenintel) { $valid = 1; } break;
|
case 3: if($general['intel'] >= GameConst::$goodgenintel) { $valid = 1; } break;
|
||||||
default: $valid = 1; break;
|
default: $valid = 1; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($valid == 1) {
|
if($valid == 1) {
|
||||||
// 신임 장수의 원래 자리 해제
|
// 신임 장수의 원래 자리 해제
|
||||||
$query = "update city set gen1=0 where gen1='$genlist'";
|
$query = "update city set gen1=0 where gen1='$genlist'";
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ namespace sammo;
|
|||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
// $title, $msg, $num
|
// $title, $msg, $num
|
||||||
|
$title = Util::array_get($_POST['title']);
|
||||||
|
$msg = Util::array_get($_POST['msg']);
|
||||||
|
$num = Util::toInt(Util::array_get($_POST['num']));
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ include "lib.php";
|
|||||||
include "func.php";
|
include "func.php";
|
||||||
// $btn, $msg
|
// $btn, $msg
|
||||||
|
|
||||||
|
$gen = Util::toInt(Util::array_get($_POST['gen']));
|
||||||
|
$sel = Util::toInt(Util::array_get($_POST['sel']));
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
@@ -29,13 +32,15 @@ case 3: $tp = "intel"; $tp2 = "설전"; $tp3 = "intel"; break;
|
|||||||
if($me['tournament'] == 1 && $session->userGrade < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
|
if($me['tournament'] == 1 && $session->userGrade < 5) { echo "<script>location.replace('b_tournament.php');</script>"; exit(); }
|
||||||
|
|
||||||
if($btn == "자동개최설정" && $session->userGrade >= 5) {
|
if($btn == "자동개최설정" && $session->userGrade >= 5) {
|
||||||
$query = "update game set tnmt_trig={$trig}";
|
$db->update('game', ['tnmt_trig'=>$trig], true);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
} elseif($btn == "개최" && $session->userGrade >= 5) {
|
} elseif($btn == "개최" && $session->userGrade >= 5) {
|
||||||
startTournament($auto, $type);
|
startTournament($auto, $type);
|
||||||
} elseif($btn == "중단" && $session->userGrade >= 5) {
|
} elseif($btn == "중단" && $session->userGrade >= 5) {
|
||||||
$query = "update game set tnmt_auto=0, tournament=0, phase=0";
|
$db->update('game', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'tnmt_auto'=>0,
|
||||||
|
'tournament'=>0,
|
||||||
|
'phase'=>0
|
||||||
|
], true);
|
||||||
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $session->userGrade >= 5) || $btn == "참가") {
|
} elseif((($btn == "투입" || $btn == "무명투입" || $btn == "쪼렙투입" || $btn == "일반투입" || $btn == "굇수투입" || $btn == "랜덤투입") && $session->userGrade >= 5) || $btn == "참가") {
|
||||||
if($btn == "투입") {
|
if($btn == "투입") {
|
||||||
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
|
$query = "select no,name,npc,leader,power,intel,explevel,gold,horse,weap,book from general where no='$gen'";
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ namespace sammo;
|
|||||||
|
|
||||||
include "lib.php";
|
include "lib.php";
|
||||||
include "func.php";
|
include "func.php";
|
||||||
|
|
||||||
|
$sel = Util::toInt(Util::array_get($_POST['sel']));
|
||||||
|
|
||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ include "func.php";
|
|||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
|
//FIXME: 망했음. CriticalFailure. 재 구현.
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ include "func.php";
|
|||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
|
//FIXME: 망했음. CriticalFailure. 재 구현.
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ include "func.php";
|
|||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
|
//FIXME: 망했음. CriticalFailure. 재 구현.
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ $session = Session::requireGameLogin()->setReadOnly();
|
|||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
//FIXME: 망했음. CriticalFailure. 재 구현.
|
||||||
|
|
||||||
$query = "select year,month from game limit 1";
|
$query = "select year,month from game limit 1";
|
||||||
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
$result = MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
||||||
$admin = MYDB_fetch_array($result);
|
$admin = MYDB_fetch_array($result);
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ include "func.php";
|
|||||||
|
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
|
//FIXME: 망했음. CriticalFailure. 재 구현.
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ include "func.php";
|
|||||||
//로그인 검사
|
//로그인 검사
|
||||||
$session = Session::requireGameLogin()->setReadOnly();
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
|
||||||
|
//FIXME: 망했음. CriticalFailure. 재 구현.
|
||||||
|
|
||||||
$db = DB::db();
|
$db = DB::db();
|
||||||
$connect=$db->get();
|
$connect=$db->get();
|
||||||
|
|
||||||
|
|||||||
+5
-9
@@ -34,15 +34,11 @@ $session->setReadOnly();
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($me['newmsg'] == 1 && $me['newvote'] == 1) {
|
if($me['newmsg'] == 1 || $me['newvote'] == 1) {
|
||||||
$query = "update general set newmsg=0,newvote=0 where owner='{$session->userID}'";
|
$db->update('general', [
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
'newmsg'=>0,
|
||||||
} elseif($me['newmsg'] == 1) {
|
'newvote'=>0
|
||||||
$query = "update general set newmsg=0 where owner='{$session->userID}'";
|
], 'owner=%i', $session->userID);
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
} elseif($me['newvote'] == 1) {
|
|
||||||
$query = "update general set newvote=0 where owner='{$session->userID}'";
|
|
||||||
MYDB_query($query, $connect) or Error(__LINE__.MYDB_error($connect),"");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$query = "select develcost,online,conlimit,tournament,tnmt_type,turnterm,scenario,scenario_text,extended_general,fiction,npcmode,vote from game limit 1";
|
$query = "select develcost,online,conlimit,tournament,tnmt_type,turnterm,scenario,scenario_text,extended_general,fiction,npcmode,vote from game limit 1";
|
||||||
|
|||||||
Reference in New Issue
Block a user