diff --git a/hwe/_admin4_submit.php b/hwe/_admin4_submit.php index 2e33444e..08e5a9bc 100644 --- a/hwe/_admin4_submit.php +++ b/hwe/_admin4_submit.php @@ -63,7 +63,6 @@ switch($btn) { ], 'general_id IN %li AND turn_idx = 0', $genlist); break; case "메세지 전달": - //TODO:새 갠메 시스템으로 변경 $date = TimeUtil::now(); $src = MessageTarget::buildQuick($session->generalID); for($i=0; $i < count($genlist); $i++) { diff --git a/hwe/b_currentCity.php b/hwe/b_currentCity.php index 744dcc25..f8f21e9a 100644 --- a/hwe/b_currentCity.php +++ b/hwe/b_currentCity.php @@ -133,13 +133,6 @@ if($myNation['level'] > 0) { if($rawSpy == ''){ $spyCities = []; } - else if(strpos($rawSpy, '|') !== false || is_numeric($rawSpy)){ - //TODO: 0.8 버전 이후에는 삭제할 것. 이후 버전은 json으로 변경됨. - $spyCities = array_map(function($val){ - $val = intval($val); - return intdiv($val, 10); - }, explode('|', $myNation['spy'])); - } else{ $spyCities = array_keys(Json::decode($rawSpy)); } diff --git a/hwe/b_genList.php b/hwe/b_genList.php index 20e927bc..387ab906 100644 --- a/hwe/b_genList.php +++ b/hwe/b_genList.php @@ -158,15 +158,7 @@ foreach ($generals as &$general) { $general['expLevelText'] = getExpLevel($general['experience']); - if ($general['npc'] >= 2) { - $name = "{$general['name']}"; - } elseif ($general['npc'] == 1) { - $name = "{$general['name']}"; - } else { - $name = $general['name']; - } - //TODO: npc 코드를 일원화 - $general['nameText'] = $name; + $general['nameText'] = getColoredName($general['name'], $general['npc']); $general['modeText'] = formatDefenceTrain($general['defence_train']); $general['crewtypeText'] = GameUnitConst::byId($general['crewtype'])->name??'-'; diff --git a/hwe/processing.php b/hwe/b_processing.php similarity index 56% rename from hwe/processing.php rename to hwe/b_processing.php index b6dace87..814a6a88 100644 --- a/hwe/processing.php +++ b/hwe/b_processing.php @@ -5,41 +5,72 @@ include "lib.php"; include "func.php"; //로그인 검사 -$commandType = Util::getReq('commandtype', 'string'); -$turnList = Util::getReq('turn', 'array_int'); +$commandType = Util::getReq('command', 'string'); +$turnList = array_map('intval', explode('_', Util::getReq('turnList', 'string', '0'))); +$isChiefTurn = Util::getReq('is_chief', 'bool', false); -if(!$turn || $commandtype === null){ - header('location:index.php', true, 303); +function die_redirect(){ + global $isChiefTurn; + if(!$isChiefTurn){ + header('location:index.php', true, 303); + } + else{ + header('location:b_chiefcenter.php', true, 303); + } die(); } +if(!$turnList || !$commandType){ + die_redirect(); +} +if(!is_array($turnList)){ + die_redirect(); +} + $session = Session::requireGameLogin()->setReadOnly(); $db = DB::db(); +if(!$isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableGeneralCommand))){ + die_redirect(); +} + +if($isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableChiefCommand))){ + die_redirect(); +} + $gameStor = KVStorage::getStorage($db, 'game_env')->turnOnCache(); $env = $gameStor->getValues(['init_year','init_month','startyear','year','month','show_img_level','join_mode','maxnation']); $general = General::createGeneralObjFromDB($session->generalID); -$commandObj = buildGeneralCommandClass($commandType, $general, $env); -if($general->getVar('level') < 5 && ($commandObj instanceof Command\NationCommand)){ - header('location:index.php', true, 303); - die(); +if(!$isChiefTurn){ + $commandObj = buildGeneralCommandClass($commandType, $general, $env); } +else{ + if($general->getVar('level') < 5){ + die_redirect(); + } + $commandObj = buildNationCommandClass($commandType, $general, $env, new LastTurn()); +} + if($commandObj->isArgValid()){ //인자가 필요없는 타입의 경우 processing에서 '전혀' 처리하지 않음! - header('location:index.php', true, 303); - die(); + die_redirect(); } -[$jsList, $cssList] = $commandObj->getResourceFiles(); +if(!$commandObj->isReservable()){ + die_redirect(); +} + +$jsList = $commandObj->getJSFiles(); +$cssList = $commandObj->getCSSFiles(); ?>
-