내 설정 페이지 동작 방식 일단 수정

This commit is contained in:
2020-06-01 02:17:20 +09:00
parent 3d1ced386f
commit e56a550cff
11 changed files with 210 additions and 102 deletions
+12 -86
View File
@@ -4,30 +4,9 @@ namespace sammo;
include "lib.php";
include "func.php";
$btn = Util::getPost('btn');
$defence_train = Util::getPost('defence_train', 'int', 80);
$tnmt = Util::getPost('tnmt', 'int', 1);
//$detachNPC = Util::getPost('detachNPC', 'bool');
$detachNPC = false;
$showDieImmediatelyBtn = false;
$availableDieImmediately = false;
if ($defence_train <= 40) {
$defence_train = 40;
}
if($defence_train <= 90){
$defence_train = Util::round($defence_train, -1);
}
else{
$defence_train = 999;
}
if($tnmt < 0 || $tnmt > 1){
$tnmt = 1;
}
//로그인 검사
$session = Session::requireGameLogin()->setReadOnly();
$userID = Session::getUserID();
@@ -42,56 +21,17 @@ $me = General::createGeneralObjFromDB($generalID);
$myset = $me->getVar('myset');
if ($myset > 0) {
$submit = 'submit';
$submit = 'button';
} else {
$submit = 'hidden';
}
if (($btn == "설정저장" || $detachNPC) && $myset > 0) {
if ($myset > 1) {
$submit = 'submit';
} else {
$submit = 'hidden';
}
if($defence_train != $me->getVar('defence_train')){
if($defence_train == 999){
$me->increaseVar('myset', -1);
$me->setVar('defence_train', $defence_train);
$me->increaseVar('train', -3);
$me->increaseVar('atmos', -3);
}
else{
$me->increaseVar('myset', -1);
$me->setVar('defence_train', $defence_train);
}
$myset -= 1;
}
if($me->getVar('tnmt') != $tnmt){
$me->setVar('tnmt', $tnmt);
}
if($me->getNPCType() == 1 && $detachNPC){
$turnterm = $gameStor->turnterm;
if($turnterm < 10){
$targetKillTurn = 30 / $turnterm;
}
else{
$targetKillTurn = 60 / $turnterm;
}
$me->setVar('killturn', $targetKillTurn);
}
}
$me->applyDB($db);
$targetTime = addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2);
if($gameStor->turntime <= $gameStor->opentime){
//서버 가오픈시 할 수 있는 행동
if($me->getNPCType() == 0){
$showDieImmediatelyBtn = true;
if(addTurn($me->getVar('lastrefresh'), $gameStor->turnterm, 2) <= TimeUtil::now()){
if($targetTime <= TimeUtil::now()){
$availableDieImmediately = true;
}
}
@@ -105,6 +45,9 @@ if($gameStor->turntime <= $gameStor->opentime){
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=1024" />
<title><?=UniqueConst::$serverName?>: 내정보</title>
<script>
var availableDieImmediately = <?=$availableDieImmediately?'true':'false'?>;
</script>
<?=WebUtil::printJS('../e_lib/jquery-3.3.1.min.js')?>
<?=WebUtil::printJS('../e_lib/bootstrap.bundle.min.js')?>
<?=WebUtil::printJS('js/common.js')?>
@@ -112,21 +55,6 @@ if($gameStor->turntime <= $gameStor->opentime){
<?=WebUtil::printCSS('../e_lib/bootstrap.min.css')?>
<?=WebUtil::printCSS('../d_shared/common.css')?>
<?=WebUtil::printCSS('css/common.css')?>
<script>
var availableDieImmediately = <?=$availableDieImmediately?'true':'false'?>;
jQuery(function($){
$('#die_immediately').click(function(){
if(!availableDieImmediately){
alert('삭제를 위해서는 생성 후 2턴 가량의 시간이 필요합니다.');
location.reload();
return false;
}
return confirm('정말로 삭제하시겠습니까?');
});
});
</script>
</head>
<body>
@@ -140,13 +68,12 @@ $('#die_immediately').click(function(){
<?php generalInfo2($me); ?>
</td>
<td width=50% valign=top style="padding-left:4ch;">
<form name=form1 action=b_myPage.php method=post>
토너먼트 【
<input type=radio name=tnmt value=0 <?=$me->getVar('tnmt')==0?"checked":""; ?>>수동참여
<input type=radio name=tnmt value=1 <?=$me->getVar('tnmt')==1?"checked":""; ?>>자동참여
<input type=radio class='tnmt' name=tnmt value=0 <?=$me->getVar('tnmt')==0?"checked":""; ?>>수동참여
<input type=radio class='tnmt' name=tnmt value=1 <?=$me->getVar('tnmt')==1?"checked":""; ?>>자동참여
】<br>
∞<font color=orange>개막직전 남는자리가 있을경우 랜덤하게 참여합니다.</font><br><br>
수비 【<select name='defence_train'>
수비 【<select id='defence_train' name='defence_train'>
<option value=90 <?=$me->getVar('defence_train')==90?"selected":""; ?>>☆(훈사90)</option>
<option value=80 <?=$me->getVar('defence_train')==80?"selected":""; ?>>◎(훈사80)</option>
<option value=60 <?=$me->getVar('defence_train')==60?"selected":""; ?>>○(훈사60)</option>
@@ -154,18 +81,17 @@ $('#die_immediately').click(function(){
<option value=999 <?=$me->getVar('defence_train')==999?"selected":""; ?>>×[훈련, 사기 -3]</option>
</select>
】<br><br>
<input type=<?=$submit?> name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
<input type=<?=$submit?> id='set_my_setting' name=btn style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px; value=설정저장><br>
∞<font color=orange>설정저장은 이달중 <?=$myset?>회 남았습니다.</font><br><br>
</form>
<?php if(!($gameStor->autorun_user['limit_minutes']??false)): ?>
휴 가 신 청<br>
<a href="c_vacation.php"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button></a><br><br>
<button type="button" id='vacation' style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>휴가 신청</button><br><br>
<?php endif; ?>
<!--빙의 해제용 삭턴 조절<br>
<a href="b_myPage.php?detachNPC=1"><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>빙의 해체 요청</button></a>-->
<?php if($showDieImmediatelyBtn): ?>
가오픈 기간 내 장수 삭제<br>
가오픈 기간 내 장수 삭제 (<?=substr($targetTime, 0, 19)?> 부터)<br>
<a href="c_die_immediately.php" id='die_immediately'><button type="button" style=background-color:<?=GameConst::$basecolor2?>;color:white;width:160px;height:30px;font-size:13px;>장수 삭제</button></a><br><br>
<?php endif; ?>