From 89c2c163cb94277192163dec59962e1bd5997973 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 20 Sep 2019 00:35:13 +0900 Subject: [PATCH] =?UTF-8?q?=EC=84=9C=EB=B2=84=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=EC=97=90=20=EC=9E=90=EB=8F=99=ED=96=89=EB=8F=99=20=ED=91=9C?= =?UTF-8?q?=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/j_server_basic_info.php | 35 ++++++++++++++++++++++++++++++++++- hwe/js/install.js | 11 ++++++++--- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/hwe/j_server_basic_info.php b/hwe/j_server_basic_info.php index 0939c241..d717d2d3 100644 --- a/hwe/j_server_basic_info.php +++ b/hwe/j_server_basic_info.php @@ -38,6 +38,21 @@ if(file_exists(__dir__.'/.htaccess')){ $otherTextInfo[] = '랜덤 임관 전용'; } + if($options['autorun_user']['limit_minutes']??false){ + $auto_info = []; + foreach($options['autorun_user']['option'] as $auto_option => $value){ + assert($value); + switch($auto_option){ + case 'internal': $auto_info[] = '내정'; break; + case 'warp': $auto_info[] = '순간이동'; break; + case 'recruit': $auto_info[] = '징훈사'; break; + case 'battle': $auto_info[] = '출병'; break; + } + } + $auto_info = join(',', $auto_info); + $otherTextInfo[] = "자동행동({$auto_info})"; + } + if(!$otherTextInfo){ $otherTextInfo = '표준'; } @@ -64,7 +79,7 @@ if(file_exists(__dir__.'/.htaccess')){ //TODO: 천통시에도 예약 오픈 알림이 필요..? -$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm', 'opentime', 'turntime', 'join_mode', 'fiction']); +$admin = $gameStor->getValues(['isunited', 'npcmode', 'year', 'month', 'scenario', 'scenario_text', 'maxgeneral', 'turnterm', 'opentime', 'turntime', 'join_mode', 'fiction', 'autorun_user']); $admin['maxUserCnt'] = $admin['maxgeneral']; $admin['npcMode'] = $admin['npcmode']; $admin['turnTerm'] = $admin['turnterm']; @@ -94,12 +109,30 @@ if($admin['join_mode'] == 'onlyRandom'){ $otherTextInfo[] = '랜덤 임관 전용'; } + +if($admin['autorun_user']['limit_minutes']??false){ + $auto_info = []; + foreach($admin['autorun_user']['option'] as $auto_option => $value){ + assert($value); + switch($auto_option){ + case 'internal': $auto_info[] = '내정'; break; + case 'warp': $auto_info[] = '순간이동'; break; + case 'recruit': $auto_info[] = '징훈사'; break; + case 'battle': $auto_info[] = '출병'; break; + } + } + $auto_info = join(', ', $auto_info); + $otherTextInfo[] = "자동행동({$auto_info})"; +} + if(!$otherTextInfo){ $otherTextInfo = '표준'; } else{ $otherTextInfo = join(', ', $otherTextInfo); } + + $admin['otherTextInfo'] = $otherTextInfo; $admin['defaultStatTotal'] = GameConst::$defaultStatTotal; $me = []; diff --git a/hwe/js/install.js b/hwe/js/install.js index 80108414..fa759610 100644 --- a/hwe/js/install.js +++ b/hwe/js/install.js @@ -106,16 +106,21 @@ function scenarioPreview(){ function formSetup(){ $.validator.addMethod("autorun_user", function(value,element){ + var parent = $(element).parent('.input-group'); + var checkCnt = parent.find('input:checked').length; if(value <= 0){ + if(checkCnt > 0){ + return false; + } return true; } - var parent = $(element).parent('.input-group'); - if(parent.find('input:checked').length == 0){ + + if(checkCnt == 0){ return false; } return true; - }, "적어도 하나는 선택을 해야합니다."); + }, "유효 시간과 옵션은 동시에 설정해야합니다."); $('#game_form').validate({ rules:{ turnterm:"required",