서버 정보에 자동행동 표기

This commit is contained in:
2019-09-20 00:35:13 +09:00
parent 8826061266
commit 89c2c163cb
2 changed files with 42 additions and 4 deletions
+34 -1
View File
@@ -38,6 +38,21 @@ if(file_exists(__dir__.'/.htaccess')){
$otherTextInfo[] = '랜덤 임관 전용'; $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){ if(!$otherTextInfo){
$otherTextInfo = '표준'; $otherTextInfo = '표준';
} }
@@ -64,7 +79,7 @@ if(file_exists(__dir__.'/.htaccess')){
//TODO: 천통시에도 예약 오픈 알림이 필요..? //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['maxUserCnt'] = $admin['maxgeneral'];
$admin['npcMode'] = $admin['npcmode']; $admin['npcMode'] = $admin['npcmode'];
$admin['turnTerm'] = $admin['turnterm']; $admin['turnTerm'] = $admin['turnterm'];
@@ -94,12 +109,30 @@ if($admin['join_mode'] == 'onlyRandom'){
$otherTextInfo[] = '랜덤 임관 전용'; $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){ if(!$otherTextInfo){
$otherTextInfo = '표준'; $otherTextInfo = '표준';
} }
else{ else{
$otherTextInfo = join(', ', $otherTextInfo); $otherTextInfo = join(', ', $otherTextInfo);
} }
$admin['otherTextInfo'] = $otherTextInfo; $admin['otherTextInfo'] = $otherTextInfo;
$admin['defaultStatTotal'] = GameConst::$defaultStatTotal; $admin['defaultStatTotal'] = GameConst::$defaultStatTotal;
$me = []; $me = [];
+8 -3
View File
@@ -106,16 +106,21 @@ function scenarioPreview(){
function formSetup(){ function formSetup(){
$.validator.addMethod("autorun_user", function(value,element){ $.validator.addMethod("autorun_user", function(value,element){
var parent = $(element).parent('.input-group');
var checkCnt = parent.find('input:checked').length;
if(value <= 0){ if(value <= 0){
if(checkCnt > 0){
return false;
}
return true; return true;
} }
var parent = $(element).parent('.input-group');
if(parent.find('input:checked').length == 0){ if(checkCnt == 0){
return false; return false;
} }
return true; return true;
}, "적어도 하나는 선택을 해야합니다."); }, "유효 시간과 옵션은 동시에 설정해야합니다.");
$('#game_form').validate({ $('#game_form').validate({
rules:{ rules:{
turnterm:"required", turnterm:"required",