refactor: common_ts 분리 후 일괄 로드
This commit is contained in:
+68
-57
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
@@ -12,19 +13,18 @@ $isChiefTurn = Util::getReq('is_chief', 'bool', false);
|
||||
function die_redirect()
|
||||
{
|
||||
global $isChiefTurn;
|
||||
if(!$isChiefTurn){
|
||||
if (!$isChiefTurn) {
|
||||
header('location:index.php', true, 303);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
header('location:b_chiefcenter.php', true, 303);
|
||||
}
|
||||
die();
|
||||
}
|
||||
|
||||
if(!$turnList || !$commandType){
|
||||
if (!$turnList || !$commandType) {
|
||||
die_redirect();
|
||||
}
|
||||
if(!is_array($turnList)){
|
||||
if (!is_array($turnList)) {
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
@@ -32,11 +32,11 @@ $session = Session::requireGameLogin()->setReadOnly();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
if(!$isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableGeneralCommand))){
|
||||
if (!$isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableGeneralCommand))) {
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
if($isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableChiefCommand))){
|
||||
if ($isChiefTurn && !in_array($commandType, Util::array_flatten(GameConst::$availableChiefCommand))) {
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
@@ -44,23 +44,22 @@ $gameStor = KVStorage::getStorage($db, 'game_env')->turnOnCache();
|
||||
$env = $gameStor->getAll();
|
||||
$general = General::createGeneralObjFromDB($session->generalID);
|
||||
|
||||
if(!$isChiefTurn){
|
||||
if (!$isChiefTurn) {
|
||||
$commandObj = buildGeneralCommandClass($commandType, $general, $env);
|
||||
}
|
||||
else{
|
||||
if($general->getVar('officer_level') < 5){
|
||||
} else {
|
||||
if ($general->getVar('officer_level') < 5) {
|
||||
die_redirect();
|
||||
}
|
||||
$commandObj = buildNationCommandClass($commandType, $general, $env, new LastTurn());
|
||||
}
|
||||
|
||||
|
||||
if($commandObj->isArgValid()){
|
||||
if ($commandObj->isArgValid()) {
|
||||
//인자가 필요없는 타입의 경우 processing에서 '전혀' 처리하지 않음!
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
if(!$commandObj->hasPermissionToReserve()){
|
||||
if (!$commandObj->hasPermissionToReserve()) {
|
||||
die_redirect();
|
||||
}
|
||||
|
||||
@@ -70,56 +69,68 @@ $cssList = $commandObj->getCSSFiles();
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?=$commandObj->getName()?></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?=WebUtil::printJS('../d_shared/common_path.js')?>
|
||||
<?=WebUtil::printJS('dist_js/vendors.js')?>
|
||||
<?=WebUtil::printJS('dist_js/common.js')?>
|
||||
<?=WebUtil::printJS('d_shared/base_map.js')?>
|
||||
<?=WebUtil::printJS('dist_js/processing.js')?>
|
||||
<script>
|
||||
window.serverNick = '<?=DB::prefix()?>';
|
||||
window.serverID = '<?=UniqueConst::$serverID?>';
|
||||
window.command = '<?=$commandType?>';
|
||||
window.turnList = [<?=join(', ',$turnList)?>];
|
||||
window.isChiefTurn = <?=$isChiefTurn?'true':'false'?>;
|
||||
var jsPlugins = <?=Json::encode($jsList)?>;
|
||||
</script>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2.min.css')?>
|
||||
<?=WebUtil::printCSS('../e_lib/select2/select2-bootstrap4.css')?>
|
||||
<?=WebUtil::printCSS('../d_shared/common.css')?>
|
||||
<?=WebUtil::printCSS('dist_css/common.css')?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?=WebUtil::printCSS('css/main.css')?>
|
||||
<?=WebUtil::printCSS('css/map.css')?>
|
||||
<?=WebUtil::printCSS('css/processing.css')?>
|
||||
<title><?= $commandObj->getName() ?></title>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/vendors.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/common_ts.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/common.js') ?>
|
||||
<?= WebUtil::printJS('d_shared/base_map.js') ?>
|
||||
<?= WebUtil::printJS('dist_js/processing.js') ?>
|
||||
<script>
|
||||
window.serverNick = '<?= DB::prefix() ?>';
|
||||
window.serverID = '<?= UniqueConst::$serverID ?>';
|
||||
window.command = '<?= $commandType ?>';
|
||||
window.turnList = [<?= join(', ', $turnList) ?>];
|
||||
window.isChiefTurn = <?= $isChiefTurn ? 'true' : 'false' ?>;
|
||||
var jsPlugins = <?= Json::encode($jsList) ?>;
|
||||
</script>
|
||||
<?= WebUtil::printCSS('../e_lib/select2/select2.min.css') ?>
|
||||
<?= WebUtil::printCSS('../e_lib/select2/select2-bootstrap4.css') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<?= WebUtil::printCSS('dist_css/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printCSS('css/main.css') ?>
|
||||
<?= WebUtil::printCSS('css/map.css') ?>
|
||||
<?= WebUtil::printCSS('css/processing.css') ?>
|
||||
|
||||
<?php
|
||||
foreach($cssList as $css){
|
||||
print(WebUtil::printCSS($css));
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
foreach ($cssList as $css) {
|
||||
print(WebUtil::printCSS($css));
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
|
||||
<body class="img_back">
|
||||
<table class="tb_layout bg0" style="width:1000px;margin:auto;">
|
||||
<tr><td class="bg1" style='text-align:center;'><?=$commandObj->getName()?></td></tr>
|
||||
<tr><td>
|
||||
<input type=button value='돌아가기' onclick="history.back();"><br>
|
||||
</td></tr></table>
|
||||
<table class="tb_layout bg0" style="width:1000px;margin:auto;">
|
||||
<tr>
|
||||
<td class="bg1" style='text-align:center;'><?= $commandObj->getName() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type=button value='돌아가기' onclick="history.back();"><br>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<div class="tb_layout bg0" style="width:1000px;margin:auto;padding-bottom:2em;border:solid 1px gray;">
|
||||
<?=$commandObj->getForm()?>
|
||||
</div>
|
||||
<div class="tb_layout bg0" style="width:1000px;margin:auto;padding-bottom:2em;border:solid 1px gray;">
|
||||
<?= $commandObj->getForm() ?>
|
||||
</div>
|
||||
|
||||
<table class="tb_layout bg0" style="width:1000px;margin:auto;">
|
||||
<tr><td>
|
||||
<input type=button value='돌아가기' onclick="history.back();"><br>
|
||||
<?=banner()?>
|
||||
</td></tr></table>
|
||||
<table class="tb_layout bg0" style="width:1000px;margin:auto;">
|
||||
<tr>
|
||||
<td>
|
||||
<input type=button value='돌아가기' onclick="history.back();"><br>
|
||||
<?= banner() ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user