Files
core/hwe/v_processing.php
T
Hide_D 3548d4e939 feat: 턴 선택기를 재 작성 (#211)
- select form에서 유사 dialog 버튼 방식으로 변경
  - 카테고리마다 페이지 이동
- 일반 모드 / 고급 모드 분리
- 일반 모드에서는 턴별 즉시 설정
- 고급 모드에서는 드래그를 포함한 각종 기능 제공
  - 최근 실행 턴
  - 잘라내기, 복사하기, 붙여넣기
  - 반복하기
  - 비우기
  - 지우고 당기기, 뒤로 밀기
  - 보관하기, 보관한 턴 사용하기

Co-authored-by: Hide_D <hided62@gmail.com>
Reviewed-on: https://storage.hided.net/gitea/devsam/core/pulls/211
Co-authored-by: hide_d <hided62@gmail.com>
Co-committed-by: hide_d <hided62@gmail.com>
2022-03-23 20:13:27 +09:00

105 lines
3.1 KiB
PHP

<?php
namespace sammo;
include "lib.php";
include "func.php";
//로그인 검사
$commandType = Util::getReq('command', 'string');
$turnList = array_map('intval', explode('_', Util::getReq('turnList', 'string', '0')));
$isChiefTurn = Util::getReq('is_chief', 'bool', false);
function die_redirect()
{
global $isChiefTurn;
if (!$isChiefTurn) {
header('location:index.php', true, 303);
} else {
header('location:v_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->getAll();
$general = General::createGeneralObjFromDB($session->generalID);
if (!$isChiefTurn) {
$commandObj = buildGeneralCommandClass($commandType, $general, $env);
} else {
if ($general->getVar('officer_level') < 5) {
die_redirect();
}
$commandObj = buildNationCommandClass($commandType, $general, $env, new LastTurn());
}
if ($commandObj->isArgValid()) {
//인자가 필요없는 타입의 경우 processing에서 '전혀' 처리하지 않음!
die_redirect();
}
if (!$commandObj->hasPermissionToReserve()) {
die_redirect();
}
?>
<!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=500" />
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
<?= WebUtil::printJS('d_shared/base_map.js') ?>
<?= WebUtil::printStaticValues([
'staticValues' => [
'serverNick' => DB::prefix(),
'serverID' => UniqueConst::$serverID,
'commandName' => $commandObj->getName(),
'turnList' => $turnList,
'currentCity' => $general->getCityID(),
'currentNation' => $general->getNationID(),
'entryInfo' => [$isChiefTurn?'Nation':'General', $commandType],
'mapName' => GameConst::$mapName,
'unitSet' => GameConst::$unitSet,
],
'commandName' => $commandObj->getName(),
'turnList' => $turnList,
'currentCity' => $general->getCityID(),
'currentNation' => $general->getNationID(),
'entryInfo' => [$isChiefTurn?'Nation':'General', $commandType],
])?>
<?= WebUtil::printStaticValues($commandObj->exportJSVars(), false) ?>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
<?= WebUtil::printDist('vue', ['v_processing'], true) ?>
</head>
<body class="img_back">
<div id="container"></div>
</body>
</html>