Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7b75f4e01b | ||
|
|
a9fc69e70f | ||
|
|
a06c574327 | ||
|
|
420ae2f45b | ||
|
|
850073a096 | ||
|
|
e40aa88253 | ||
|
|
ff92b0149a | ||
|
|
e6049a17a2 | ||
|
|
9bc1bc13f2 | ||
|
|
b9cda08a4e | ||
|
|
4e2193fe6f | ||
|
|
155af45378 | ||
|
|
66d6bbc772 | ||
|
|
066a6d4e6a | ||
|
|
94f5834b61 | ||
|
|
947286bd09 | ||
|
|
a0dee353b5 | ||
|
|
308b1f2348 | ||
|
|
897780cf1c | ||
|
|
0f8a8011be | ||
|
|
7ebfd960b1 | ||
|
|
7b3d64996d | ||
|
|
e578a2f310 | ||
|
|
eecb4f699b | ||
|
|
9f4f7a759e | ||
|
|
11a98eb184 | ||
|
|
ed0bc5e19f | ||
|
|
020a2d2668 | ||
|
|
27cdd3ee4b | ||
|
|
43a95979e1 | ||
|
|
800106f9cb | ||
|
|
e5c50e48d3 | ||
|
|
08e43bed71 | ||
|
|
6773b8cddb | ||
|
|
23c030fd00 | ||
|
|
d5e67bb16d | ||
|
|
188e3a0fa6 | ||
|
|
b31ee022af | ||
|
|
87e063e03e | ||
|
|
48fe26e4b1 | ||
|
|
88fcc64537 | ||
|
|
d9beabbbbc | ||
|
|
3da0a7d950 | ||
|
|
50b1db75f0 | ||
|
|
94bb96d208 | ||
|
|
93490276fd | ||
|
|
73a7bf5a61 | ||
|
|
8a1f8f8e2c | ||
|
|
39c88c11c4 | ||
|
|
c2e956a639 | ||
|
|
368f31d1fa | ||
|
|
d3390dc490 | ||
|
|
eb36b6a52f | ||
|
|
be882000ad | ||
|
|
266c1c6a5b |
@@ -45,7 +45,6 @@ return [
|
||||
'hwe/api.php',
|
||||
'hwe/a_traffic.php',
|
||||
'hwe/battle_simulator.php',
|
||||
'hwe/b_battleCenter.php',
|
||||
'hwe/b_betting.php',
|
||||
'hwe/v_chiefCenter.php',
|
||||
'hwe/b_currentCity.php',
|
||||
@@ -58,7 +57,6 @@ return [
|
||||
'hwe/b_myPage.php',
|
||||
'hwe/v_processing.php',
|
||||
'hwe/b_tournament.php',
|
||||
'hwe/b_troop.php',
|
||||
'hwe/c_tournament.php',
|
||||
'hwe/func_auction.php',
|
||||
'hwe/func_command.php',
|
||||
|
||||
@@ -34,6 +34,7 @@ $templates = new \League\Plates\Engine(__DIR__ . '/templates');
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'bestGeneral']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ increaseRefresh("왕조일람", 1);
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', 'common') ?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -28,6 +28,7 @@ $serverID = $emperior['server_id'] ?? ($emperior['serverID'] ?? null);
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?= UniqueConst::$serverName ?>: 왕조일람</title>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', 'common', true) ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ if ($gameStor->isunited) {
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', 'common') ?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -49,6 +49,7 @@ if ($scenarioIdx && key_exists($scenarioIdx, $scenarioList[$seasonIdx] ?? [])) {
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'hallOfFame']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ if ($con >= 2) {
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'extKingdoms']) ?>
|
||||
<?= WebUtil::printStaticValues($gameStor->getValues(['killturn', 'autorun_user', 'turnterm'])) ?>
|
||||
</head>
|
||||
|
||||
@@ -30,6 +30,7 @@ $sel[$type] = "selected";
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -83,6 +83,7 @@ if ($admin['maxonline'] < $curonline) {
|
||||
}
|
||||
</style>
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -1,208 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
|
||||
$v = new Validator($_POST + $_GET);
|
||||
$v->rule('required', 'gen')
|
||||
->rule('integer', 'gen');
|
||||
|
||||
$btn = Util::getReq('btn');
|
||||
$gen = Util::getReq('gen', 'int', 0);
|
||||
$reqQueryType = Util::getReq('query_type', 'string', null);
|
||||
|
||||
// $queryTypeText, $reqArgType(0=>None, 1=>AdditionalColumn, 2=>rankVal, 3=>aux), $comp
|
||||
$queryMap = [
|
||||
'turntime' => ['최근턴', 0, function ($lhs, $rhs) {
|
||||
return - ($lhs['turntime'] <=> $rhs['turntime']);
|
||||
}],
|
||||
'recent_war' => ['최근전투', 1, function ($lhs, $rhs) {
|
||||
return - ($lhs['recent_war'] <=> $rhs['recent_war']);
|
||||
}],
|
||||
'name' => ['장수명', 0, function ($lhs, $rhs) {
|
||||
if ($lhs['npc'] !== $rhs['npc']) {
|
||||
return $lhs['npc'] <=> $rhs['npc'];
|
||||
}
|
||||
return $lhs['name'] <=> $rhs['name'];
|
||||
}],
|
||||
'warnum' => ['전투수', 2, function ($lhs, $rhs) {
|
||||
return - ($lhs['warnum'] <=> $rhs['warnum']);
|
||||
}]
|
||||
];
|
||||
|
||||
if ($reqQueryType === null || !key_exists($reqQueryType, $queryMap)) {
|
||||
$reqQueryType = Util::array_first_key($queryMap);
|
||||
}
|
||||
|
||||
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
|
||||
increaseRefresh("감찰부", 2);
|
||||
//전투 추진을 위해 갱신
|
||||
TurnExecutionHelper::executeAllCommand();
|
||||
$gameStor->resetCache();
|
||||
|
||||
$testGeneralNationID = $db->queryFirstField('SELECT nation FROM general WHERE no = %i', $gen);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no,nation,officer_level,con,turntime,belong,permission,penalty from general where owner=%i', $userID);
|
||||
$nationID = $me['nation'];
|
||||
|
||||
$con = checkLimit($me['con']);
|
||||
if ($con >= 2) {
|
||||
printLimitMsg($me['turntime']);
|
||||
exit();
|
||||
}
|
||||
|
||||
$permission = checkSecretPermission($me);
|
||||
if ($permission < 0) {
|
||||
echo '국가에 소속되어있지 않습니다.';
|
||||
die();
|
||||
} else if ($permission < 1) {
|
||||
echo "권한이 부족합니다. 수뇌부가 아니거나 사관년도가 부족합니다.";
|
||||
die();
|
||||
}
|
||||
|
||||
//잘못된 접근
|
||||
if ($testGeneralNationID != $nationID) {
|
||||
$gen = 0;
|
||||
}
|
||||
|
||||
if ($btn == '정렬') {
|
||||
$gen = 0;
|
||||
}
|
||||
|
||||
|
||||
[$queryTypeText, $reqArgType, $comp] = $queryMap[$reqQueryType];
|
||||
if ($reqArgType === 0) {
|
||||
$generalBasicList = $db->query('SELECT no, name, npc, turntime, officer_level FROM general WHERE nation = %i', $nationID);
|
||||
} else if ($reqArgType === 1) {
|
||||
$generalBasicList = $db->query('SELECT no, name, npc, turntime, officer_level, %b FROM general WHERE nation = %i', $reqQueryType, $nationID);
|
||||
} else if ($reqArgType === 2) {
|
||||
$generalBasicList = $db->query(
|
||||
'SELECT no, name, npc, turntime, officer_level, value as %b
|
||||
FROM general LEFT JOIN rank_data
|
||||
ON general.no = rank_data.general_id
|
||||
WHERE rank_data.type = %s AND general.nation = %i',
|
||||
$reqQueryType,
|
||||
$reqQueryType,
|
||||
$nationID
|
||||
);
|
||||
} else if ($reqArgType === 3) {
|
||||
$generalBasicList = array_map(function ($arr) {
|
||||
$arr['aux'] = Json::decode($arr['aux']);
|
||||
return $arr;
|
||||
}, $db->query('SELECT no, name, npc, turntime, officer_level, aux FROM general WHERE nation = %i', $nationID));
|
||||
} else {
|
||||
throw new \sammo\MustNotBeReachedException();
|
||||
}
|
||||
|
||||
|
||||
usort($generalBasicList, $comp);
|
||||
|
||||
if (!$gen) {
|
||||
$gen = $generalBasicList[0]['no'];
|
||||
}
|
||||
$showGeneral = General::createGeneralObjFromDB($gen);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title><?= UniqueConst::$serverName ?>: 감찰부</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::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('ts', ['common', 'battleCenter']) ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="container" class="bg0">
|
||||
<div class="row gx-0">
|
||||
<div class="col">감 찰 부<br><?= closeButton() ?></div>
|
||||
</div>
|
||||
<div class="row gx-0">
|
||||
<div class="col-12" style="border-left: solid 1px gray; border-right:solid 1px gray;">
|
||||
<form name=form1 method=get>
|
||||
정렬순서 :
|
||||
<select name='query_type' size=1>
|
||||
<?php foreach ($queryMap as $queryType => [$queryTypeText,]) : ?>
|
||||
<option <?= $queryType == $reqQueryType ? 'selected' : '' ?> value='<?= $queryType ?>'><?= $queryTypeText ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=submit name=btn value='정렬'>
|
||||
대상장수 :
|
||||
<select name=gen size=1>
|
||||
<?php foreach ($generalBasicList as $general) : ?>
|
||||
<option <?= $gen == $general['no'] ? 'selected' : '' ?> value='<?= $general['no'] ?>'><?= $general['officer_level'] > 4 ? "*{$general['name']}*" : $general['name'] ?> (<?= substr($general['turntime'], 14, 5) ?>)</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<input type=submit name=btn value='조회'>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col col-12 col-md-6">
|
||||
<div class="row mx-0">
|
||||
<div class="col bg1 header-cell" style="color:skyblue">장수 정보</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col"><?php generalInfo($showGeneral); ?><?php generalInfo2($showGeneral); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col col-12 col-md-6">
|
||||
<div class="row mx-0">
|
||||
<div class="col bg1 header-cell">장수 열전</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col"><?= formatHistoryToHTML(getGeneralHistoryLogAll($gen)) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col col-12 col-md-6">
|
||||
<div class="row mx-0">
|
||||
<div class="col bg1 header-cell">전투 기록</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col"><?= formatHistoryToHTML(getBattleDetailLogRecent($gen, 24)) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col col-12 col-md-6">
|
||||
<div class="row mx-0">
|
||||
<div class="col bg1 header-cell">전투 결과</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col"><?= formatHistoryToHTML(getBattleResultRecent($gen, 24)) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php if ($showGeneral->getNPCType() > 1 || $permission >= 2) : ?>
|
||||
<div class="col col-12 col-md-6">
|
||||
<div class="row mx-0">
|
||||
<div class="col bg1 header-cell">개인 기록</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col"><?= formatHistoryToHTML(getGeneralActionLogRecent($gen, 24)) ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="row gx-0">
|
||||
<div class="col "><?= closeButton() ?></div>
|
||||
</div>
|
||||
<div class="row bg0 gx-0">
|
||||
<div class="col bg0"><?= banner() ?></div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -119,6 +119,7 @@ if ($str3) {
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'betting']) ?>
|
||||
<?= WebUtil::printStaticValues([
|
||||
'staticValues'=>[
|
||||
|
||||
@@ -55,6 +55,7 @@ $templates = new \League\Plates\Engine('templates');
|
||||
font-size: x-small;
|
||||
}
|
||||
</style>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'currentCity']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ $templates = new \League\Plates\Engine('templates');
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -54,6 +54,7 @@ if ($meLevel >= 5) {
|
||||
var chiefStatMin = <?= GameConst::$chiefStatMin ?>;
|
||||
var myLevel = <?= $meLevel ?>;
|
||||
</script>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'bossInfo']) ?>
|
||||
|
||||
<?php
|
||||
|
||||
@@ -39,6 +39,7 @@ $sel = [$type => "selected"];
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'extExpandCity']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@ if ($gameStor->isunited) {
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ if ($nationID == 0) {
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -70,6 +70,7 @@ $use_auto_nation_turn = $me->getAuxVar('use_auto_nation_turn') ?? 1;
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['myPage']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -110,6 +110,7 @@ $globalBetTotal = array_sum($globalBet);
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?= UniqueConst::$serverName ?>: 토너먼트</title>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', 'common', true) ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
</head>
|
||||
|
||||
-251
@@ -1,251 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace sammo;
|
||||
|
||||
include "lib.php";
|
||||
include "func.php";
|
||||
//로그인 검사
|
||||
$session = Session::requireGameLogin()->setReadOnly();
|
||||
$userID = Session::getUserID();
|
||||
|
||||
$db = DB::db();
|
||||
|
||||
increaseRefresh("부대편성", 1);
|
||||
|
||||
$me = $db->queryFirstRow('SELECT no,nation,troop,`officer_level`,permission,penalty FROM general WHERE owner=%i', $userID);
|
||||
$permission = checkSecretPermission($me, false);
|
||||
|
||||
$troops = [];
|
||||
foreach ($db->query('SELECT troop_leader,name FROM troop WHERE nation = %i', $me['nation']) as $rawTroop) {
|
||||
$troops[$rawTroop['troop_leader']] = [
|
||||
'name' => $rawTroop['name'],
|
||||
'users' => []
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($db->query(
|
||||
'SELECT no,name,turntime,troop,city FROM general WHERE troop!=0 AND nation = %i ORDER BY turntime ASC',
|
||||
$me['nation']
|
||||
) as $general) {
|
||||
if (!key_exists($general['troop'], $troops)) {
|
||||
trigger_error("올바르지 않은 부대 소속 {$general['no']}, {$general['name']} : {$general['troop']}");
|
||||
continue;
|
||||
}
|
||||
|
||||
$general['cityText'] = CityConst::byID($general['city'])->name;
|
||||
|
||||
$troops[$general['troop']]['users'][] = $general;
|
||||
}
|
||||
|
||||
if ($troops) {
|
||||
$troopLeaders = $db->query(
|
||||
'SELECT no,name,picture,imgsvr,turntime,city,troop FROM general WHERE no IN %li',
|
||||
array_keys($troops)
|
||||
);
|
||||
$generalTurnList = [];
|
||||
|
||||
foreach ($db->queryAllLists(
|
||||
'SELECT general_id, turn_idx, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id ASC, turn_idx ASC',
|
||||
array_column($troopLeaders, 'no')
|
||||
) as [$generalID, $turnIdx, $brief]) {
|
||||
if (!key_exists($generalID, $generalTurnList)) {
|
||||
$generalTurnList[$generalID] = [];
|
||||
}
|
||||
$generalTurnList[$generalID][$turnIdx] = $brief;
|
||||
}
|
||||
|
||||
foreach ($troopLeaders as $troopLeader) {
|
||||
$imageTemp = GetImageURL($troopLeader['imgsvr']);
|
||||
|
||||
$troopLeader['pictureFullPath'] = "$imageTemp/{$troopLeader['picture']}";
|
||||
$troopLeader['cityText'] = CityConst::byID($troopLeader['city'])->name;
|
||||
|
||||
$turnText = [];
|
||||
foreach ($generalTurnList[$troopLeader['no']] as $rawTurnIdx => $brief) {
|
||||
if ($brief != '집합') {
|
||||
$brief = '~';
|
||||
}
|
||||
$turnIdx = $rawTurnIdx + 1;
|
||||
$turnText[] = "{$turnIdx} : {$brief}";
|
||||
}
|
||||
$troopLeader['turnText'] = join('<br>', $turnText);
|
||||
$troops[$troopLeader['troop']]['leader'] = $troopLeader;
|
||||
}
|
||||
}
|
||||
|
||||
uasort($troops, function ($lhs, $rhs) {
|
||||
return $lhs['leader']['turntime'] <=> $rhs['leader']['turntime'];
|
||||
})
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=1024" />
|
||||
<title><?= UniqueConst::$serverName ?>: 부대편성</title>
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printCSS('../d_shared/common.css') ?>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css" />
|
||||
<?= WebUtil::printDist('ts', ['common', 'troop'], true) ?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div style="width:1000px;margin:auto;">
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td>부 대 편 성<br><?= backButton() ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="troop_list" class='tb_layout bg0'>
|
||||
<thead>
|
||||
<tr>
|
||||
<td width=64 class='bg1 center'>선 택</td>
|
||||
<td width=130 class='bg1 center'>부 대 정 보</td>
|
||||
<td width=100 class='bg1 center'>부 대 장</td>
|
||||
<td width=576 class='bg1 center' style=table-layout:fixed;word-break:break-all;>장 수</td>
|
||||
<td width=130 class='bg1 center' style=table-layout:fixed;word-break:break-all;>부대장행동</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan='5'>
|
||||
<?php if (!$troops) : ?>
|
||||
<?php elseif ($me['troop'] == 0) : ?>
|
||||
<input type=button id='btnJoinTroop' value='부 대 가 입'>
|
||||
<?php else : ?>
|
||||
<input type=button id="btnLeaveTroop" value='부 대 탈 퇴'>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
<?php
|
||||
foreach ($troops as $troopNo => $troop) {
|
||||
$troopLeader = $troop['leader'];
|
||||
$genlistText = [];
|
||||
$cityText = $troopLeader['cityText'];
|
||||
$cityID = $troopLeader['city'];
|
||||
$leaderID = $troopLeader['no'];
|
||||
|
||||
foreach ($troop['users'] as $troopUser) {
|
||||
$spanClass = 'troopUser';
|
||||
if ($troopUser['city'] !== $cityID) {
|
||||
$spanClass .= ' diffCity';
|
||||
}
|
||||
if ($troopUser['no'] == $leaderID) {
|
||||
$spanClass .= ' leader';
|
||||
}
|
||||
$genlistText[] = "<span class='$spanClass' data-general-id='{$troopUser['no']}'
|
||||
><span class='generalName'>{$troopUser['name']}</span><span class='cityText'>【{$troopUser['cityText']}】</span
|
||||
></span>";
|
||||
}
|
||||
|
||||
$genlistText = sprintf('%s (%d명)', join(', ', $genlistText), count($genlistText)); ?>
|
||||
|
||||
<?php if ($me['troop'] == 0) : ?>
|
||||
<tr>
|
||||
<td align=center rowspan=2><input type='radio' class='troopId' name='troop' value='<?= $troopNo ?>'></td>
|
||||
<td align=center><?= $troop['name'] ?><br>【 <?= $cityText ?> 】</td>
|
||||
<td height=64 class='generalIcon' style='background:no-repeat center url("<?= $troopLeader['pictureFullPath'] ?>");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=62><?= $genlistText ?></td>
|
||||
<td rowspan=2><?= $troopLeader['turnText'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<font size=2>【턴】 <?= substr($troopLeader['turntime'], 14, 5) ?></font>
|
||||
</td>
|
||||
<td align=center>
|
||||
<font size=1><?= $troopLeader['name'] ?></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=5>
|
||||
|
||||
<?php else : ?>
|
||||
<tr>
|
||||
<td align=center rowspan=2> </td>
|
||||
<td align=center><?= $troop['name'] ?><br>【 <?= $cityText ?> 】</td>
|
||||
<td height=64 class='generalIcon' style='background:no-repeat center url("<?= $troopLeader['pictureFullPath'] ?>");background-size:64px;'> </td>
|
||||
<td rowspan=2 width=62><?= $genlistText ?></td>
|
||||
<td rowspan=2>
|
||||
<?php if ($me['no'] == $troopLeader['no']) : ?>
|
||||
<select id='genNo' name=gen size=3 style=color:white;background-color:black;font-size:14px;width:128px;>";
|
||||
<?php foreach ($troop['users'] as $troopUser) : ?>
|
||||
<?php if ($troopUser['no'] == $me['no']) {
|
||||
continue;
|
||||
} ?>
|
||||
<option value='<?= $troopUser['no'] ?>'><?= $troopUser['name'] ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select><br>
|
||||
<input type=button id='btnKickTroop' value='부 대 추 방' style=width:130px;height:25px;>
|
||||
<?php else : ?>
|
||||
<?= $troopLeader['turnText'] ?>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align=center>
|
||||
<font size=2>【턴】 <?= substr($troopLeader['turntime'], 14, 5) ?></font>
|
||||
</td>
|
||||
<td align=center>
|
||||
<font size=1><?= $troopLeader['name'] ?></font>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan=5></td>
|
||||
</tr>
|
||||
<?php endif;
|
||||
} //foreach ($troops as $troopNo=>$troop) {
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<br>
|
||||
<div class="row">
|
||||
<?php if($me['troop'] == 0): ?>
|
||||
<div class="col-6"><?php /*TODO: 모바일 */ ?>
|
||||
<div class="row gx-0 bg0">
|
||||
<div class="bg1 col d-grid"><span class="align-self-center center">부대명</span></div>
|
||||
<div class="col d-grid"><input type=text style=color:white;background-color:black; size=18 maxlength=18 id='newTroopName'></div>
|
||||
<div class="col d-grid"><button type='button' id="btnCreateTroop" class='btn btn-sm btn-secondary'>부대 창설</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if($troops && ($me['troop'] == $me['no'] || $permission == 4)): ?>
|
||||
<div class="col-6">
|
||||
<div class="row gx-0 bg0">
|
||||
<div class="bg1 col d-grid"><span class="align-self-center center">부대명</span></div>
|
||||
<div class="col d-grid"><select class="form-select" id="changeNameTroopID">
|
||||
<?php if($permission != 4): ?>
|
||||
<option value="<?=$me['troop']?>"><?=$troops[$me['troop']]['name']?></option>
|
||||
<?php else: ?>
|
||||
<?php foreach ($troops as $troopNo => $troop): ?>
|
||||
<option value="<?=$troopNo?>"><?=$troop['name']?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col d-grid"><input type=text style=color:white;background-color:black; size=18 maxlength=18 id='changeTroopName'></div>
|
||||
<div class="col d-grid"><button type='button' id="btnChangeTroopName" class='btn btn-sm btn-secondary'>이름 변경</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<table width=1000 class='tb_layout bg0'>
|
||||
<tr>
|
||||
<td><?= backButton() ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?= banner() ?> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -54,6 +54,7 @@ if ($nationID) {
|
||||
var city = <?= Json::encode($city) ?>;
|
||||
var nation = <?= Json::encode($nation) ?>;
|
||||
</script>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'battle_simulator']) ?>
|
||||
</head>
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ function registerAuction(RandUtil $rng)
|
||||
[AuctionType::BuyRice->value, AuctionType::SellRice->value],
|
||||
));
|
||||
|
||||
$neutralbuyRiceCnt = $neutralAuctionCnt[AuctionType::BuyRice->value];
|
||||
$neutralbuyRiceCnt = $neutralAuctionCnt[AuctionType::BuyRice->value] ?? 0;
|
||||
|
||||
// 판매건 등록
|
||||
if ($rng->nextBool(1 / ($neutralbuyRiceCnt + 5))) {
|
||||
@@ -38,7 +38,7 @@ function registerAuction(RandUtil $rng)
|
||||
AuctionBuyRice::openResourceAuction($dummyGeneral, $amount, $term, $cost, $topv);
|
||||
}
|
||||
|
||||
$neutralSellRiceCnt = $neutralAuctionCnt[AuctionType::SellRice->value];
|
||||
$neutralSellRiceCnt = $neutralAuctionCnt[AuctionType::SellRice->value] ?? 0;
|
||||
// 구매건 등록
|
||||
if ($rng->nextBool(1 / ($neutralSellRiceCnt + 5))) {
|
||||
//평균 쌀의 5% ~ 25%
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
namespace sammo;
|
||||
|
||||
use sammo\DTO\AuctionInfo;
|
||||
use sammo\Enums\AuctionType;
|
||||
use sammo\Enums\InheritanceKey;
|
||||
use sammo\Enums\RankColumn;
|
||||
|
||||
@@ -1053,6 +1055,16 @@ function checkEmperior()
|
||||
$nationLogger = new ActionLogger(0, $nationID, $admin['year'], $admin['month']);
|
||||
$nationLogger->pushNationalHistoryLog("<D><b>{$nationName}</b></>{$josaYi} 전토를 통일");
|
||||
|
||||
/** @var int[] */
|
||||
$auctionList = $db->queryFirstColumn(
|
||||
'SELECT `id` FROM `ng_auction` WHERE `type` = %s AND `finished` = 0 ORDER BY `close_date` ASC',
|
||||
AuctionType::UniqueItem->value
|
||||
);
|
||||
foreach($auctionList as $auctionID){
|
||||
$auction = new AuctionUniqueItem($auctionID, new DummyGeneral(true));
|
||||
$auction->closeAuction(true);
|
||||
}
|
||||
|
||||
$inheritPointManager = InheritancePointManager::getInstance();
|
||||
$allUserGenerals = General::createGeneralObjListFromDB($db->queryFirstColumn('SELECT `no` FROM general WHERE npc < 2'));
|
||||
foreach ($allUserGenerals as $genObj) {
|
||||
|
||||
@@ -254,6 +254,7 @@ function pushGeneralHistoryLog(int $generalID, ?array $history, $year=null, $mon
|
||||
|
||||
}
|
||||
|
||||
/** @deprecated */
|
||||
function getGeneralHistoryLogAll(int $generalID):array {
|
||||
$db = DB::db();
|
||||
|
||||
@@ -263,6 +264,15 @@ function getGeneralHistoryLogAll(int $generalID):array {
|
||||
);
|
||||
}
|
||||
|
||||
function getGeneralHistoryLogWithLogID(int $generalID):array {
|
||||
$db = DB::db();
|
||||
|
||||
return Util::convertPairArrayToDict($db->queryAllLists(
|
||||
'SELECT `id`, `text` from general_record WHERE general_id = %i AND log_type = "history" order by id desc',
|
||||
$generalID
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
function pushNationHistoryLog(int $nationID, ?array $history, ?int $year=null, ?int $month=null) {
|
||||
if(!$history){
|
||||
|
||||
@@ -37,7 +37,7 @@ class BidUniqueAuction extends \sammo\BaseAPI
|
||||
{
|
||||
$auctionID = $this->args['auctionID'];
|
||||
$amount = $this->args['amount'];
|
||||
$tryExtendCloseDate = $this->arg['extendCloseDate'] ?? false;
|
||||
$tryExtendCloseDate = $this->args['extendCloseDate'] ?? false;
|
||||
|
||||
$generalID = $session->generalID;
|
||||
$general = General::createGeneralObjFromDB($generalID);
|
||||
|
||||
@@ -18,12 +18,12 @@ class GetGeneralLog extends GetNationGeneralLog
|
||||
$v = new Validator($this->args);
|
||||
$v
|
||||
->rule('required', [
|
||||
'type',
|
||||
'reqType',
|
||||
])
|
||||
->rule('int', [
|
||||
'reqTo',
|
||||
])
|
||||
->rule('in', 'type', [
|
||||
->rule('in', 'reqType', [
|
||||
self::GENERAL_HISTORY,
|
||||
self::GENERAL_ACTION,
|
||||
self::BATTLE_RESULT,
|
||||
|
||||
@@ -67,6 +67,10 @@ class BuyHiddenBuff extends \sammo\BaseAPI
|
||||
$reqAmount = GameConst::$inheritBuffPoints[$level] - GameConst::$inheritBuffPoints[$prevLevel];
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($gameStor->isunited){
|
||||
return '이미 천하가 통일되었습니다.';
|
||||
}
|
||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||
$previousPoint = ($inheritStor->getValue('previous') ?? [0,0])[0];
|
||||
if ($previousPoint < $reqAmount) {
|
||||
|
||||
@@ -40,6 +40,10 @@ class BuyRandomUnique extends \sammo\BaseAPI
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($gameStor->isunited){
|
||||
return '이미 천하가 통일되었습니다.';
|
||||
}
|
||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||
$previousPoint = ($inheritStor->getValue('previous')??[0, 0])[0];
|
||||
$reqAmount = GameConst::$inheritItemRandomPoint;
|
||||
|
||||
@@ -51,6 +51,11 @@ class ResetSpecialWar extends \sammo\BaseAPI
|
||||
$reqPoint = GameConst::$inheritResetAttrPointBase[$nextLevel];
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($gameStor->isunited){
|
||||
return '이미 천하가 통일되었습니다.';
|
||||
}
|
||||
|
||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||
if ($previousPoint < $reqPoint) {
|
||||
|
||||
@@ -50,6 +50,10 @@ class ResetTurnTime extends \sammo\BaseAPI
|
||||
$reqPoint = GameConst::$inheritResetAttrPointBase[$nextLevel];
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($gameStor->isunited){
|
||||
return '이미 천하가 통일되었습니다.';
|
||||
}
|
||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||
if ($previousPoint < $reqPoint) {
|
||||
|
||||
@@ -65,6 +65,10 @@ class SetNextSpecialWar extends \sammo\BaseAPI
|
||||
$reqAmount = GameConst::$inheritSpecificSpecialPoint;
|
||||
|
||||
$db = DB::db();
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
if($gameStor->isunited){
|
||||
return '이미 천하가 통일되었습니다.';
|
||||
}
|
||||
$inheritStor = KVStorage::getStorage($db, "inheritance_{$userID}");
|
||||
$previousPoint = ($inheritStor->getValue('previous') ?? [0, 0])[0];
|
||||
if ($previousPoint < $reqAmount) {
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace sammo\API\Nation;
|
||||
|
||||
use ArrayObject;
|
||||
use sammo\DB;
|
||||
use sammo\General;
|
||||
use sammo\Session;
|
||||
@@ -44,9 +45,12 @@ class GeneralList extends \sammo\BaseAPI
|
||||
'belong' => 0,
|
||||
'connect' => 0,
|
||||
|
||||
'troop' => 0,
|
||||
'city' => 0,
|
||||
|
||||
'con' => 1,
|
||||
'specage' => 1,
|
||||
'specage2' => 1,
|
||||
'specage' => 0,
|
||||
'specage2' => 0,
|
||||
'leadership_exp' => 1,
|
||||
'strength_exp' => 1,
|
||||
'intel_exp' => 1,
|
||||
@@ -56,14 +60,12 @@ class GeneralList extends \sammo\BaseAPI
|
||||
'dex4' => 1,
|
||||
'dex5' => 1,
|
||||
|
||||
'city' => 1,
|
||||
'experience' => 1,
|
||||
'dedication' => 1,
|
||||
|
||||
'officer_level' => 1,
|
||||
'officer_city' => 1,
|
||||
'defence_train' => 1,
|
||||
'troop' => 1,
|
||||
'crewtype' => 1,
|
||||
'crew' => 1,
|
||||
'train' => 1,
|
||||
@@ -125,7 +127,7 @@ class GeneralList extends \sammo\BaseAPI
|
||||
if ($level >= 5) {
|
||||
return $level;
|
||||
}
|
||||
if ($this->permission > 1) {
|
||||
if ($this->permission >= 1) {
|
||||
return $level;
|
||||
}
|
||||
return 1;
|
||||
@@ -157,35 +159,59 @@ class GeneralList extends \sammo\BaseAPI
|
||||
|
||||
$rawGeneralList = Util::convertArrayToDict($db->query('SELECT %l from general WHERE nation = %i ORDER BY turntime ASC', Util::formatListOfBackticks($queryColumns), $nationID), 'no');
|
||||
|
||||
/** @var ArrayObject[] */
|
||||
$troops = [];
|
||||
foreach ($db->queryAllLists('SELECT troop_leader,name FROM troop WHERE nation = %i', $nationID) as [$troopLeaderID, $troopName]) {
|
||||
if (!key_exists($troopLeaderID, $rawGeneralList)) {
|
||||
continue;
|
||||
}
|
||||
$troopTurnTime = $rawGeneralList[$troopLeaderID]['turntime'];
|
||||
$troops[$troopLeaderID] = new ArrayObject([
|
||||
'id' => $troopLeaderID,
|
||||
'name' => $troopName,
|
||||
'turntime' => $troopTurnTime,
|
||||
'reservedCommand' => [],
|
||||
]);
|
||||
}
|
||||
|
||||
$reservedCommand = [];
|
||||
if ($this->permission >= 1) {
|
||||
$nonNPCGeneralIDList = [];
|
||||
foreach ($rawGeneralList as $rawGeneral) {
|
||||
if ($rawGeneral['npc'] < 2) {
|
||||
$nonNPCGeneralIDList[] = $rawGeneral['no'];
|
||||
if ($this->permission >= 1 || count($troops)) {
|
||||
$reservedCommandTargetGeneralIDList = [];
|
||||
|
||||
if($this->permission >= 1){
|
||||
foreach ($rawGeneralList as $rawGeneral) {
|
||||
if ($rawGeneral['npc'] < 2) {
|
||||
$reservedCommandTargetGeneralIDList[$rawGeneral['no']] = $rawGeneral['no'];
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach($troops as $troop){
|
||||
$reservedCommandTargetGeneralIDList[$troop['id']] = $troop['id'];
|
||||
}
|
||||
|
||||
|
||||
$rawTurnList = $db->query(
|
||||
'SELECT general_id, turn_idx, action, arg, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id asc, turn_idx asc',
|
||||
$nonNPCGeneralIDList
|
||||
);
|
||||
|
||||
foreach ($rawTurnList as $rawTurn) {
|
||||
[
|
||||
'general_id' => $generalID,
|
||||
'action' => $action,
|
||||
'arg' => $arg,
|
||||
'brief' => $brief,
|
||||
] = $rawTurn;
|
||||
if (!key_exists($generalID, $reservedCommand)) {
|
||||
$reservedCommand[$generalID] = [];
|
||||
if($reservedCommandTargetGeneralIDList){
|
||||
$rawTurnList = $db->query(
|
||||
'SELECT general_id, turn_idx, action, arg, brief FROM general_turn WHERE general_id IN %li AND turn_idx < 5 ORDER BY general_id asc, turn_idx asc',
|
||||
array_values($reservedCommandTargetGeneralIDList)
|
||||
);
|
||||
|
||||
foreach ($rawTurnList as $rawTurn) {
|
||||
[
|
||||
'general_id' => $generalID,
|
||||
'action' => $action,
|
||||
'arg' => $arg,
|
||||
'brief' => $brief,
|
||||
] = $rawTurn;
|
||||
if (!key_exists($generalID, $reservedCommand)) {
|
||||
$reservedCommand[$generalID] = [];
|
||||
}
|
||||
$reservedCommand[$generalID][] = [
|
||||
'action' => $action,
|
||||
'arg' => $arg,
|
||||
'brief' => $brief
|
||||
];
|
||||
}
|
||||
$reservedCommand[$generalID][] = [
|
||||
'action' => $action,
|
||||
'arg' => $arg,
|
||||
'brief' => $brief
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,6 +277,17 @@ class GeneralList extends \sammo\BaseAPI
|
||||
$resultColumns[$column] = $column;
|
||||
}
|
||||
|
||||
foreach ($troops as $troop){
|
||||
$troopLeaderID = $troop['id'];
|
||||
$troop['reservedCommand'] = array_map(function($turnObj){
|
||||
$brief = $turnObj['brief'];
|
||||
if($brief == '집합'){
|
||||
return $brief;
|
||||
}
|
||||
return '-';
|
||||
}, $specialViewFilter['reservedCommand']($rawGeneralList[$troopLeaderID]));
|
||||
}
|
||||
|
||||
$generalList = [];
|
||||
foreach ($rawGeneralList as $rawGeneral) {
|
||||
//General 생성?
|
||||
@@ -271,20 +308,14 @@ class GeneralList extends \sammo\BaseAPI
|
||||
$generalList[] = $item;
|
||||
}
|
||||
|
||||
if ($this->permission >= 1) {
|
||||
$troops = $db->queryAllLists('SELECT troop_leader,name FROM troop WHERE nation = %i', $nationID);
|
||||
} else {
|
||||
$troops = null;
|
||||
}
|
||||
|
||||
|
||||
$result = [
|
||||
'result' => true,
|
||||
'permission' => $this->permission,
|
||||
'column' => array_keys($resultColumns),
|
||||
'list' => $generalList,
|
||||
'troops' => $troops,
|
||||
'troops' => array_values($troops),
|
||||
'env' => $env,
|
||||
'myGeneralID' => $session->generalID,
|
||||
];
|
||||
|
||||
return $result;
|
||||
|
||||
@@ -9,11 +9,12 @@ use sammo\Validator;
|
||||
use function sammo\checkLimit;
|
||||
use function sammo\checkSecretPermission;
|
||||
use function sammo\getBattleDetailLogMore;
|
||||
use function sammo\getBattleDetailLogRecent;
|
||||
use function sammo\getBattleResultMore;
|
||||
use function sammo\getBattleResultRecent;
|
||||
use function sammo\getGeneralActionLogMore;
|
||||
use function sammo\getGeneralActionLogRecent;
|
||||
use function sammo\getGeneralHistoryLogAll;
|
||||
use function sammo\getGeneralHistoryLogWithLogID;
|
||||
|
||||
class GetGeneralLog extends \sammo\BaseAPI
|
||||
{
|
||||
@@ -28,13 +29,13 @@ class GetGeneralLog extends \sammo\BaseAPI
|
||||
$v
|
||||
->rule('required', [
|
||||
'generalID',
|
||||
'type',
|
||||
'reqType',
|
||||
])
|
||||
->rule('integer', [
|
||||
'generalID',
|
||||
'reqTo',
|
||||
])
|
||||
->rule('in', 'type', [
|
||||
->rule('in', 'reqType', [
|
||||
self::GENERAL_HISTORY,
|
||||
self::GENERAL_ACTION,
|
||||
self::BATTLE_RESULT,
|
||||
@@ -76,7 +77,7 @@ class GetGeneralLog extends \sammo\BaseAPI
|
||||
return '같은 나라의 장수가 아닙니다.';
|
||||
}
|
||||
|
||||
$reqType = $this->args['type'];
|
||||
$reqType = $this->args['reqType'];
|
||||
if (
|
||||
$reqType === self::GENERAL_ACTION &&
|
||||
$testGeneralNPCType < 2 &&
|
||||
@@ -103,7 +104,7 @@ class GetGeneralLog extends \sammo\BaseAPI
|
||||
$userID = $session->userID;
|
||||
|
||||
$targetGeneralID = $this->getTargetGeneralID($session);
|
||||
$reqType = $this->args['type'];
|
||||
$reqType = $this->args['reqType'];
|
||||
$reqTo = $this->args['reqTo'] ?? null;
|
||||
|
||||
$db = DB::db();
|
||||
@@ -124,7 +125,7 @@ class GetGeneralLog extends \sammo\BaseAPI
|
||||
'result' => true,
|
||||
'reqType' => $reqType,
|
||||
'generalID' => $targetGeneralID,
|
||||
'log' => getGeneralHistoryLogAll($targetGeneralID)
|
||||
'log' => getGeneralHistoryLogWithLogID($targetGeneralID)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -156,7 +157,7 @@ class GetGeneralLog extends \sammo\BaseAPI
|
||||
'reqType' => $reqType,
|
||||
'generalID' => $targetGeneralID,
|
||||
'log' => $reqTo === null
|
||||
? getBattleResultRecent($targetGeneralID, 30)
|
||||
? getBattleDetailLogRecent($targetGeneralID, 30)
|
||||
: getBattleDetailLogMore($targetGeneralID, $reqTo, 30)
|
||||
];
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Nation;
|
||||
|
||||
use sammo\DB;
|
||||
use sammo\GameConst;
|
||||
use sammo\General;
|
||||
use sammo\KVStorage;
|
||||
use sammo\LastTurn;
|
||||
use sammo\Session;
|
||||
use sammo\Util;
|
||||
use sammo\Validator;
|
||||
|
||||
use function sammo\buildNationCommandClass;
|
||||
use function sammo\checkLimit;
|
||||
use function sammo\checkSecretPermission;
|
||||
use function sammo\getBattleDetailLogMore;
|
||||
use function sammo\getBattleResultMore;
|
||||
use function sammo\getBattleResultRecent;
|
||||
use function sammo\getGeneralActionLogMore;
|
||||
use function sammo\getGeneralActionLogRecent;
|
||||
use function sammo\getGeneralHistoryLogAll;
|
||||
use function sammo\getNationStaticInfo;
|
||||
|
||||
class GetNationInfo extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
$v = new Validator($this->args);
|
||||
$v->rule('boolean', 'full');
|
||||
|
||||
if (!$v->validate()) {
|
||||
return $v->errorStr();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?\DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$userID = $session->userID;
|
||||
|
||||
$db = DB::db();
|
||||
$nationID = $db->queryFirstField('SELECT nation FROM general WHERE `owner` = %i', $userID);
|
||||
|
||||
if (!$nationID) {
|
||||
return [
|
||||
'result' => true,
|
||||
'nation' => getNationStaticInfo(0)
|
||||
];
|
||||
}
|
||||
|
||||
$isFull = $this->args['full'] ?? false;
|
||||
|
||||
if(!$isFull){
|
||||
$nation = getNationStaticInfo($nationID);
|
||||
return [
|
||||
'result' => true,
|
||||
'nation' => $nation,
|
||||
];
|
||||
}
|
||||
|
||||
$generalObj = General::createGeneralObjFromDB($session->generalID, null, 1);
|
||||
|
||||
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||
$gameEnv = $gameStor->getValues(['year', 'month', 'startyear']);
|
||||
|
||||
$nation = $db->queryFirstRow(
|
||||
'SELECT nation, `name`, color, capital, gennum, gold, rice, bill, rate, secretlimit, chief_set, scout, war, strategic_cmd_limit, surlimit, tech, `power`, `level`, `type` FROM nation WHERE id = %i',
|
||||
$nationID
|
||||
);
|
||||
$nationStor = \sammo\KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||
$nationStor->cacheAll();
|
||||
|
||||
|
||||
//전략 정보를 매번 읽어와야하나?
|
||||
$impossibleStrategicCommandLists = [];
|
||||
$strategicCommandLists = GameConst::$availableChiefCommand['전략'];
|
||||
$yearMonth = Util::joinYearMonth($gameEnv['year'], $gameEnv['month']);
|
||||
foreach ($strategicCommandLists as $command) {
|
||||
$cmd = buildNationCommandClass($command, $generalObj, $gameEnv, new LastTurn());
|
||||
$nextAvailableTurn = $cmd->getNextAvailableTurn();
|
||||
if ($nextAvailableTurn > $yearMonth) {
|
||||
$impossibleStrategicCommandLists[] = [$cmd->getName(), $nextAvailableTurn - $yearMonth];
|
||||
}
|
||||
}
|
||||
|
||||
$troopName = [];
|
||||
foreach ($db->queryAllLists('SELECT troop_leader, name FROM troop WHERE nation=%i', $nationID) as [$troopID, $tName]) {
|
||||
$troopName[$troopID] = $tName;
|
||||
}
|
||||
|
||||
return [
|
||||
'result' => true,
|
||||
'nation' => $nation,
|
||||
'impossibleStrategicCommandLists' => $impossibleStrategicCommandLists,
|
||||
'troops' => $troopName,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,7 @@ use sammo\Validator;
|
||||
|
||||
use function sammo\checkSecretPermission;
|
||||
|
||||
/** @deprecated */
|
||||
class SetTroopName extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
|
||||
@@ -63,9 +63,9 @@ class GetReservedCommand extends \sammo\BaseAPI
|
||||
|
||||
$nationTurnList = [];
|
||||
foreach ($db->queryAllLists(
|
||||
'SELECT officer_level, turn_idx, action, arg, brief FROM nation_turn WHERE nation_id = %i ORDER BY officer_level DESC, turn_idx ASC',
|
||||
$me['nation']
|
||||
) as [$officer_level, $turn_idx, $action, $arg, $brief]) {
|
||||
'SELECT officer_level, turn_idx, action, arg, brief FROM nation_turn WHERE nation_id = %i ORDER BY officer_level DESC, turn_idx ASC',
|
||||
$me['nation']
|
||||
) as [$officer_level, $turn_idx, $action, $arg, $brief]) {
|
||||
if (!key_exists($officer_level, $nationTurnList)) {
|
||||
$nationTurnList[$officer_level] = [];
|
||||
}
|
||||
@@ -76,6 +76,14 @@ class GetReservedCommand extends \sammo\BaseAPI
|
||||
];
|
||||
}
|
||||
|
||||
$troopList = [];
|
||||
foreach ($db->queryAllLists(
|
||||
'SELECT troop_leader, `name` FROM troop WHERE `nation` = %i',
|
||||
$nationID
|
||||
) as [$troopID, $troopName]) {
|
||||
$troopList[$troopID] = $troopName;
|
||||
}
|
||||
|
||||
|
||||
$nationChiefList = [];
|
||||
foreach ($nationTurnList as $officer_level => $turnBrief) {
|
||||
@@ -111,7 +119,8 @@ class GetReservedCommand extends \sammo\BaseAPI
|
||||
'turnTerm' => $turnTerm,
|
||||
'date' => TimeUtil::now(true),
|
||||
'chiefList' => $nationChiefList,
|
||||
'isChief'=>($me['officer_level'] > 4),
|
||||
'troopList' => $troopList,
|
||||
'isChief' => ($me['officer_level'] > 4),
|
||||
'autorun_limit' => $generalObj->getAuxVar('autorun_limit'),
|
||||
'officerLevel' => $me['officer_level'],
|
||||
'commandList' => getChiefCommandTable($generalObj),
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Troop;
|
||||
|
||||
use sammo\Session;
|
||||
use DateTimeInterface;
|
||||
use sammo\DB;
|
||||
|
||||
class ExitTroop extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$generalID = $session->generalID;
|
||||
$db = DB::db();
|
||||
|
||||
$troopID = $db->queryFirstField('SELECT troop FROM general WHERE no = %i', $generalID);
|
||||
if($troopID == 0){
|
||||
return '부대에 소속되어 있지 않습니다.';
|
||||
}
|
||||
|
||||
if($generalID != $troopID){
|
||||
$db->update('general', [
|
||||
'troop' => 0,
|
||||
], '`no` = %i', $generalID);
|
||||
return null;
|
||||
}
|
||||
|
||||
//부대장이다.
|
||||
$db->update('general', [
|
||||
'troop' => 0,
|
||||
], '`troop` = %i', $troopID);
|
||||
$db->delete('troop', 'troop_leader = %i', $troopID);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Troop;
|
||||
|
||||
use sammo\Session;
|
||||
use DateTimeInterface;
|
||||
use sammo\DB;
|
||||
use sammo\StringUtil;
|
||||
use sammo\Validator;
|
||||
|
||||
class JoinTroop extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
$v = new Validator($this->args);
|
||||
$v->rule('required', [
|
||||
'troopID',
|
||||
])
|
||||
->rule('integer', 'troopID');
|
||||
|
||||
if (!$v->validate()) {
|
||||
return $v->errorStr();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$userID = $session->userID;
|
||||
$troopID = $this->args['troopID'];
|
||||
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`troop`,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
||||
if ($me['troop'] != 0) {
|
||||
return '이미 부대에 소속되어 있습니다.';
|
||||
}
|
||||
$nationID = $me['nation'];
|
||||
if ($nationID == 0) {
|
||||
return '국가에 소속되어 있지 않습니다.';
|
||||
}
|
||||
|
||||
$troopExists = $db->queryFirstField('SELECT `troop_leader` FROM `troop` WHERE `troop_leader` = %i AND `nation` = %i', $troopID, $nationID);
|
||||
if (!$troopExists) {
|
||||
return '부대가 올바르지 않습니다.';
|
||||
}
|
||||
$generalID = $me['no'];
|
||||
|
||||
$db->update('general', [
|
||||
'troop' => $troopID,
|
||||
], '`no` = %i AND `troop` = %i', $generalID, 0);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Troop;
|
||||
|
||||
use sammo\Session;
|
||||
use DateTimeInterface;
|
||||
use sammo\DB;
|
||||
use sammo\Validator;
|
||||
|
||||
class KickFromTroop extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
$v = new Validator($this->args);
|
||||
$v->rule('required', [
|
||||
'troopID',
|
||||
'generalID',
|
||||
])
|
||||
->rule('integer', 'troopID')
|
||||
->rule('integer', 'generalID');
|
||||
|
||||
if (!$v->validate()) {
|
||||
return $v->errorStr();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$generalID = $this->args['generalID'];
|
||||
$db = DB::db();
|
||||
|
||||
$troopID = $db->queryFirstField('SELECT troop FROM general WHERE no = %i', $generalID);
|
||||
if($troopID == 0){
|
||||
return '부대에 소속되어 있지 않습니다.';
|
||||
}
|
||||
|
||||
if($troopID != $this->args['troopID']){
|
||||
return '다른 부대에 소속되어 있습니다.';
|
||||
}
|
||||
|
||||
if($troopID == $generalID){
|
||||
return '부대장을 추방할 수 없습니다.';
|
||||
}
|
||||
|
||||
$db->update('general', [
|
||||
'troop' => 0,
|
||||
], '`no` = %i AND `troop` = %i', $generalID, $troopID);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Troop;
|
||||
|
||||
use sammo\Session;
|
||||
use DateTimeInterface;
|
||||
use sammo\DB;
|
||||
use sammo\StringUtil;
|
||||
use sammo\Validator;
|
||||
|
||||
class NewTroop extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
$v = new Validator($this->args);
|
||||
$v->rule('required', [
|
||||
'troopName',
|
||||
])
|
||||
->rule('stringWidthBetween', 'troopName', 1, 18);
|
||||
|
||||
if (!$v->validate()) {
|
||||
return $v->errorStr();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$userID = $session->userID;
|
||||
$troopName = StringUtil::neutralize($this->args['troopName']);
|
||||
if(!$troopName){
|
||||
return '부대 이름이 없습니다.';
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`troop`,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
||||
if($me['troop'] != 0){
|
||||
return '이미 부대에 소속되어 있습니다.';
|
||||
}
|
||||
$nationID = $me['nation'];
|
||||
if($nationID == 0){
|
||||
return '국가에 소속되어 있지 않습니다.';
|
||||
}
|
||||
|
||||
$generalID = $me['no'];
|
||||
|
||||
$db->insert('troop', [
|
||||
'name'=>$troopName,
|
||||
'troop_leader'=>$generalID,
|
||||
'nation'=>$nationID,
|
||||
]);
|
||||
|
||||
if($db->affectedRows() == 0){
|
||||
return '부대가 생성되지 않았습니다. 버그일 수 있습니다.';
|
||||
}
|
||||
|
||||
$db->update('general', [
|
||||
'troop'=>$generalID
|
||||
], '`no` = %i', $generalID);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Troop;
|
||||
|
||||
use sammo\Session;
|
||||
use DateTimeInterface;
|
||||
use sammo\DB;
|
||||
use sammo\StringUtil;
|
||||
use sammo\Validator;
|
||||
|
||||
use function sammo\checkSecretPermission;
|
||||
|
||||
class SetTroopName extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
$v = new Validator($this->args);
|
||||
$v->rule('required', [
|
||||
'troopID',
|
||||
'troopName',
|
||||
])
|
||||
->rule('stringWidthBetween', 'troopName', 1, 18)
|
||||
->rule('integer', 'troopID');
|
||||
|
||||
if (!$v->validate()) {
|
||||
return $v->errorStr();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$userID = $session->userID;
|
||||
$db = DB::db();
|
||||
$me = $db->queryFirstRow('SELECT `no`,nation,`officer_level`,permission,penalty FROM general WHERE `owner`=%i', $userID);
|
||||
$permission = checkSecretPermission($me, false);
|
||||
$troopID = $this->args['troopID'];
|
||||
|
||||
$generalID = $me['no'];
|
||||
if($generalID != $troopID && $permission < 4){
|
||||
return "권한이 부족합니다.";
|
||||
}
|
||||
|
||||
$troopName = StringUtil::neutralize($this->args['troopName']);
|
||||
if(!$troopName){
|
||||
return '부대 이름이 없습니다.';
|
||||
}
|
||||
|
||||
$nationID = $me['nation'];
|
||||
$db->update('troop', [
|
||||
'name'=>$troopName
|
||||
], 'troop_leader=%i AND `nation`=%i',$troopID, $nationID);
|
||||
|
||||
if($db->affectedRows() == 0){
|
||||
return '부대가 없습니다.';
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ class che_내정_납금박산로 extends \sammo\BaseItem{
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null): float{
|
||||
if(in_array($turnType, ['상업', '농업', '기술', '성벽', '수비', '치안', '민심', '인구'])){
|
||||
if($varType == 'success') return $value + 0.15;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class che_조달_주판 extends \sammo\BaseItem{
|
||||
protected $cost = 200;
|
||||
protected $consumable = false;
|
||||
|
||||
public function onCalcStrategic(string $turnType, string $varType, $value){
|
||||
public function onCalcDomestic(string $turnType, string $varType, float $value, $aux=null): float{
|
||||
if($turnType === '조달'){
|
||||
if($varType == 'success') return $value + 0.2;
|
||||
if($varType == 'score') return $value * 2;
|
||||
|
||||
@@ -53,12 +53,19 @@ class AuctionUniqueItem extends Auction
|
||||
}
|
||||
|
||||
$availableCnt = 0;
|
||||
foreach(GameConst::$allItems as $itemType => $itemList){
|
||||
$availableCnt += $itemList[$itemKey] ?? 0;
|
||||
foreach (GameConst::$allItems as $itemType => $itemList) {
|
||||
if (!key_exists($itemKey, $itemList)) {
|
||||
continue;
|
||||
}
|
||||
$ownItem = $general->getItem($itemType);
|
||||
if ($ownItem !== null && !$ownItem->isBuyable()) {
|
||||
return '이미 가진 아이템이 있습니다.';
|
||||
}
|
||||
$availableCnt += $itemList[$itemKey];
|
||||
$availableCnt -= $db->queryFirstField('SELECT count(*) FROM `general` WHERE %b = %s', $itemType, $itemKey);
|
||||
}
|
||||
|
||||
if($availableCnt <= 0){
|
||||
if ($availableCnt <= 0) {
|
||||
return '그 유니크를 더 얻을 수 없습니다.';
|
||||
}
|
||||
|
||||
@@ -129,7 +136,7 @@ class AuctionUniqueItem extends Auction
|
||||
public function bid(int $amount, bool $tryExtendCloseDate): ?string
|
||||
{
|
||||
|
||||
if($this->info->finished){
|
||||
if ($this->info->finished) {
|
||||
return '경매가 종료되었습니다.';
|
||||
}
|
||||
|
||||
@@ -146,7 +153,7 @@ class AuctionUniqueItem extends Auction
|
||||
}
|
||||
|
||||
$db = DB::db();
|
||||
if($auctionIDList){
|
||||
if ($auctionIDList) {
|
||||
$rawHighestBids = Util::convertArrayToDict($db->query(
|
||||
'SELECT bid.* FROM `ng_auction_bid` bid INNER JOIN (
|
||||
SELECT `auction_id`, MAX(`amount`) as `max_amount`
|
||||
@@ -158,8 +165,7 @@ class AuctionUniqueItem extends Auction
|
||||
ON bid.`auction_id` = max_bid.`auction_id` AND bid.`amount` = max_bid.`max_amount`',
|
||||
$auctionIDList,
|
||||
) ?? [], 'auction_id');
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
$rawHighestBids = [];
|
||||
}
|
||||
|
||||
@@ -177,7 +183,14 @@ class AuctionUniqueItem extends Auction
|
||||
|
||||
$bidItemTypes = new Set();
|
||||
foreach (GameConst::$allItems as $itemType => $itemList) {
|
||||
if (($itemList[$itemCode] ?? 0) <= 0) {
|
||||
if (!key_exists($itemCode, $itemList)) {
|
||||
continue;
|
||||
}
|
||||
$ownItem = $this->general->getItem($itemType);
|
||||
if ($ownItem !== null && !$ownItem->isBuyable()) {
|
||||
return '이미 가진 아이템이 있습니다.';
|
||||
}
|
||||
if ($itemList[$itemCode] <= 0) {
|
||||
continue;
|
||||
}
|
||||
$bidItemTypes->add($itemType);
|
||||
@@ -212,6 +225,11 @@ class AuctionUniqueItem extends Auction
|
||||
return $this->_bid($amount, $tryExtendCloseDate);
|
||||
}
|
||||
|
||||
protected function setHostAsNeutral(){
|
||||
$this->info->hostGeneralID = 0;
|
||||
$this->info->detail->hostName = '(상인)';
|
||||
}
|
||||
|
||||
protected function finishAuction(AuctionBidItem $highestBid, General $bidder): ?string
|
||||
{
|
||||
$itemKey = $this->info->target;
|
||||
@@ -250,6 +268,9 @@ class AuctionUniqueItem extends Auction
|
||||
max(static::MIN_EXTENSION_MINUTES_BY_EXTENSION_QUERY, $turnTerm * static::COEFF_EXTENSION_MINUTES_LIMIT_UNIQUE_CNT) * 60
|
||||
));
|
||||
|
||||
if($bidder->getID() != $this->info->hostGeneralID){
|
||||
$this->setHostAsNeutral();
|
||||
}
|
||||
$this->extendCloseDate($extendedCloseDate, true);
|
||||
$this->extendLatestBidCloseDate(null);
|
||||
$this->applyDB();
|
||||
@@ -295,8 +316,12 @@ class AuctionUniqueItem extends Auction
|
||||
max(static::MIN_EXTENSION_MINUTES_LIMIT_BY_BID, $turnTerm * static::COEFF_EXTENSION_MINUTES_LIMIT_BY_BID) * 60
|
||||
));
|
||||
|
||||
if($bidder->getID() != $this->info->hostGeneralID){
|
||||
$this->setHostAsNeutral();
|
||||
}
|
||||
$this->extendCloseDate($extendedCloseDate, true);
|
||||
$this->extendLatestBidCloseDate(null);
|
||||
$this->applyDB();
|
||||
}
|
||||
return join(' ', $reasons);
|
||||
}
|
||||
|
||||
@@ -146,6 +146,8 @@ class AutorunNationPolicy {
|
||||
public $safeRecruitCityPopulationRatio = 0.5;
|
||||
public $properWarTrainAtmos = 90;
|
||||
|
||||
public $cureThreshold = 10;
|
||||
|
||||
///이쪽의 값이 실제 초기화 값임
|
||||
public static $defaultPolicy = [
|
||||
'reqNationGold'=>10000,
|
||||
@@ -173,6 +175,8 @@ class AutorunNationPolicy {
|
||||
'minNPCRecruitCityPopulation'=>50000,
|
||||
'safeRecruitCityPopulationRatio'=>0.5,
|
||||
'properWarTrainAtmos'=>90,
|
||||
|
||||
'cureThreshold'=>10,
|
||||
];
|
||||
|
||||
function __construct(General $general, $aiOptions, ?array $nationPolicy, ?array $serverPolicy, array $nation, array $env)
|
||||
|
||||
@@ -152,6 +152,8 @@ class che_강행 extends Command\GeneralCommand
|
||||
|
||||
[$reqGold, $reqRice] = $this->getCost();
|
||||
$general->increaseVarWithLimit('gold', -$reqGold, 0);
|
||||
$general->increaseVarWithLimit('train', -5, 20);
|
||||
$general->increaseVarWithLimit('atmos', -5, 20);
|
||||
$general->addExperience($exp);
|
||||
$general->increaseVar('leadership_exp', 1);
|
||||
$this->setResultTurn(new LastTurn(static::getName(), $this->arg));
|
||||
|
||||
@@ -91,7 +91,7 @@ class che_집합 extends Command\GeneralCommand{
|
||||
}
|
||||
foreach($generalList as $targetGeneralID){
|
||||
$targetLogger = new ActionLogger($targetGeneralID, $general->getNationID(), $env['year'], $env['month']);
|
||||
$targetLogger->pushGeneralActionLog("{$troopName}의 부대원들은 <G><b>{$cityName}</b></>{$josaRo} 집합되었습니다.", ActionLogger::PLAIN);
|
||||
$targetLogger->pushGeneralActionLog("{$troopName} 부대원들은 <G><b>{$cityName}</b></>{$josaRo} 집합되었습니다.", ActionLogger::PLAIN);
|
||||
$targetLogger->flush();
|
||||
}
|
||||
|
||||
|
||||
@@ -65,8 +65,17 @@ class che_해산 extends Command\GeneralCommand{
|
||||
$env = $this->env;
|
||||
|
||||
$general = $this->generalObj;
|
||||
$logger = $general->getLogger();
|
||||
$date = $general->getTurnTime($general::TURNTIME_HM);
|
||||
|
||||
$initYearMonth = Util::joinYearMonth($env['init_year'], $env['init_month']);
|
||||
$yearMonth = Util::joinYearMonth($env['year'], $env['month']);
|
||||
if($yearMonth <= $initYearMonth){
|
||||
$logger->pushGeneralActionLog("다음 턴부터 해산할 수 있습니다. <1>$date</>");
|
||||
$this->alternative = new che_인재탐색($general, $this->env, null);
|
||||
return false;
|
||||
}
|
||||
|
||||
$generalName = $general->getName();
|
||||
$josaYi = JosaUtil::pick($generalName, '이');
|
||||
|
||||
@@ -87,7 +96,7 @@ class che_해산 extends Command\GeneralCommand{
|
||||
|
||||
refreshNationStaticInfo();
|
||||
|
||||
$logger = $general->getLogger();
|
||||
|
||||
$logger->pushGeneralActionLog("세력을 해산했습니다. <1>$date</>");
|
||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYi} 세력을 해산했습니다.");
|
||||
$logger->pushGeneralHistoryLog("<D><b>{$nationName}</b></>{$josaUl} 해산");
|
||||
|
||||
@@ -111,6 +111,7 @@ class che_물자원조 extends Command\NationCommand
|
||||
ConstraintHelper::OccupiedCity(),
|
||||
ConstraintHelper::BeChief(),
|
||||
ConstraintHelper::SuppliedCity(),
|
||||
ConstraintHelper::DifferentDestNation(),
|
||||
ConstraintHelper::ReqNationGold(GameConst::$basegold + (($goldAmount > 0) ? 1 : 0)),
|
||||
ConstraintHelper::ReqNationRice(GameConst::$baserice + (($riceAmount > 0) ? 1 : 0)),
|
||||
ConstraintHelper::ReqNationValue('surlimit', '외교제한', '==', 0, '외교제한중입니다.'),
|
||||
|
||||
@@ -165,7 +165,7 @@ class che_불가침파기수락 extends Command\NationCommand
|
||||
$logger->pushGeneralHistoryLog("<D><b>{$destNationName}</b></>{$josaWa}의 불가침 파기 수락");
|
||||
|
||||
$logger->pushGlobalActionLog("<Y>{$generalName}</>{$josaYiGeneral} <D><b>{$destNationName}</b></>{$josaWa}의 불가침 조약을 <M>파기</> 하였습니다.");
|
||||
$logger->pushGlobalHistoryLog("<Y><b>【종전】</b></><D><b>{$nationName}</b></>{$josaYiNation} <D><b>{$destNationName}</b></>{$josaWa}의 불가침 조약을 <M>파기</> 하였습니다.");
|
||||
$logger->pushGlobalHistoryLog("<Y><b>【파기】</b></><D><b>{$nationName}</b></>{$josaYiNation} <D><b>{$destNationName}</b></>{$josaWa}의 불가침 조약을 <M>파기</> 하였습니다.");
|
||||
|
||||
|
||||
$josaWa = JosaUtil::pick($nationName, '와');
|
||||
|
||||
@@ -329,7 +329,7 @@ class GameUnitConstBase{
|
||||
],
|
||||
[
|
||||
1502, self::T_SIEGE, '벽력거',
|
||||
200, 100, 6, 10, 0, 18, 5,
|
||||
200, 100, 6, 5, 0, 20, 5,
|
||||
3000, ['업'], null, 0,
|
||||
[self::T_FOOTMAN=>1.25, self::T_ARCHER=>1.25, self::T_CAVALRY=>1.25, self::T_WIZARD=>1.25, self::T_CASTLE=>1.8, 1106=>1.112],
|
||||
[self::T_FOOTMAN=>0.833, self::T_ARCHER=>0.833, self::T_CAVALRY=>0.833, self::T_WIZARD=>0.833, 1106=>0.909],
|
||||
@@ -338,7 +338,7 @@ class GameUnitConstBase{
|
||||
],
|
||||
[
|
||||
1503, self::T_SIEGE, '목우',
|
||||
50, 200, 5, 0, 0, 18, 5,
|
||||
50, 200, 5, 0, 0, 15, 5,
|
||||
3000, ['성도'], null, 0,
|
||||
[self::T_FOOTMAN=>0.8, self::T_ARCHER=>0.8, self::T_CAVALRY=>0.8, self::T_WIZARD=>0.8],
|
||||
[self::T_FOOTMAN=>1.2, self::T_ARCHER=>1.2, self::T_CAVALRY=>1.2, self::T_WIZARD=>1.2],
|
||||
|
||||
+11
-7
@@ -205,9 +205,15 @@ class GeneralAI
|
||||
$nationID
|
||||
);
|
||||
|
||||
if (!$warTarget && $yearMonth <= Util::joinYearMonth($env['startyear'] + 2, 5)) {
|
||||
$this->dipState = self::d평화;
|
||||
$this->attackable = false;
|
||||
if ($yearMonth <= Util::joinYearMonth($env['startyear'] + 2, 5)) {
|
||||
if(!$warTarget){
|
||||
$this->dipState = self::d평화;
|
||||
$this->attackable = false;
|
||||
}
|
||||
else{
|
||||
$this->dipState = self::d선포;
|
||||
$this->attackable = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -237,8 +243,6 @@ class GeneralAI
|
||||
|
||||
$this->warTargetNation = $warTargetNation;
|
||||
|
||||
|
||||
|
||||
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||
$minWarTerm = $db->queryFirstField('SELECT min(term) FROM diplomacy WHERE me = %i AND state=1', $nationID);
|
||||
if ($minWarTerm === null) {
|
||||
@@ -2570,7 +2574,7 @@ class GeneralAI
|
||||
$gold = $general->getVar('gold');
|
||||
$gold -= $this->fullLeadership * 3;
|
||||
$rice = $general->getVar('rice');
|
||||
$rice -= $this->fullLeadership * 4 + 500;
|
||||
$rice -= $this->fullLeadership * 4;
|
||||
|
||||
if ($gold <= 0 || $rice <= 0) {
|
||||
return null;
|
||||
@@ -3714,7 +3718,7 @@ class GeneralAI
|
||||
return $reservedCommand;
|
||||
}
|
||||
|
||||
if ($general->getVar('injury') > 10) {
|
||||
if ($general->getVar('injury') > $this->nationPolicy->cureThreshold) {
|
||||
$result = buildGeneralCommandClass('che_요양', $general, $this->env);
|
||||
$result->reason = 'do요양';
|
||||
return $result;
|
||||
|
||||
@@ -11,6 +11,9 @@ use \sammo\GameConst;
|
||||
use sammo\RandUtil;
|
||||
use \sammo\SpecialityHelper;
|
||||
use sammo\TimeUtil;
|
||||
|
||||
use function sammo\getPersonalityClass;
|
||||
|
||||
class GeneralBuilder{
|
||||
|
||||
protected $generalID = null;
|
||||
@@ -161,7 +164,11 @@ class GeneralBuilder{
|
||||
}
|
||||
|
||||
public function setEgo(?string $ego):self{
|
||||
$this->ego = $ego;
|
||||
if($ego === null){
|
||||
$this->ego = null;
|
||||
return $this;
|
||||
}
|
||||
$this->ego = Util::getClassName(getPersonalityClass($ego));
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class che_격노발동 extends BaseWarUnitTrigger{
|
||||
|
||||
$self->getLogger()->pushGeneralBattleDetailLog("상대의 {$targetAct}에 <C>{$reaction}</>했다!</>", ActionLogger::PLAIN);
|
||||
$oppose->getLogger()->pushGeneralBattleDetailLog("{$targetAct}에 상대가 <R>{$reaction}</>했다!</>", ActionLogger::PLAIN);
|
||||
|
||||
|
||||
if($is진노){
|
||||
$self->addBonusPhase(1);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\Util;
|
||||
|
||||
class che_격노시도 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 300;
|
||||
protected $priority = ObjectTrigger::PRIORITY_BODY + 400;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$oppose->hasActivatedSkill('필살') && !$oppose->hasActivatedSkill('회피')){
|
||||
|
||||
@@ -10,7 +10,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
class che_계략발동 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 100;
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 300;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->hasActivatedSkill('계략')){
|
||||
|
||||
@@ -10,7 +10,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
class che_계략실패 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 200;
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 300;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->hasActivatedSkill('계략실패')){
|
||||
|
||||
@@ -14,7 +14,7 @@ use sammo\ObjectTrigger;
|
||||
|
||||
class che_궁병선제사격 extends BaseWarUnitTrigger
|
||||
{
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN;
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 50;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv): bool
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ use sammo\Util;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_기병병종전투 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_FINAL; //최후미
|
||||
protected $priority = ObjectTrigger::PRIORITY_FINAL + 100; //최후미
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->isAttacker()){
|
||||
|
||||
@@ -10,7 +10,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
class che_반계발동 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 150;
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 250;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->hasActivatedSkill('반계')){
|
||||
@@ -20,7 +20,7 @@ class che_반계발동 extends BaseWarUnitTrigger{
|
||||
$general = $self->getGeneral();
|
||||
|
||||
[$opposeMagic, $damage] = $opposeEnv['magic'];
|
||||
|
||||
|
||||
|
||||
$josaUl = \sammo\JosaUtil::pick($opposeMagic, '을');
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use sammo\Util;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_방어력증가5p extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_FINAL; //최후미
|
||||
protected $priority = ObjectTrigger::PRIORITY_FINAL + 200; //최후미
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->isAttacker()){
|
||||
|
||||
@@ -8,7 +8,7 @@ use sammo\GameUnitDetail;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_성벽부상무효 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 100;
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 150;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
|
||||
|
||||
@@ -14,7 +14,7 @@ use sammo\GameConst;
|
||||
|
||||
class che_약탈발동 extends BaseWarUnitTrigger
|
||||
{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 400;
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 350;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv): bool
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
class che_전멸시페이즈증가 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 700;
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 800;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
/** @var WarUnitGeneral $self */
|
||||
|
||||
@@ -10,7 +10,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\ActionLogger;
|
||||
|
||||
class che_전투치료발동 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 300;
|
||||
protected $priority = ObjectTrigger::PRIORITY_POST + 550;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!$self->hasActivatedSkill('치료')){
|
||||
|
||||
@@ -9,7 +9,7 @@ use sammo\Util;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class che_전투치료시도 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_PRE + 300;
|
||||
protected $priority = ObjectTrigger::PRIORITY_PRE + 350;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
assert($self instanceof WarUnitGeneral, 'General만 발동 가능');
|
||||
|
||||
@@ -9,7 +9,7 @@ use sammo\ObjectTrigger;
|
||||
use sammo\Util;
|
||||
|
||||
class che_필살시도 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_PRE + 100;
|
||||
protected $priority = ObjectTrigger::PRIORITY_PRE + 120;
|
||||
|
||||
protected function actionWar(WarUnit $self, WarUnit $oppose, array &$selfEnv, array &$opposeEnv):bool{
|
||||
if(!($self instanceof WarUnitGeneral)){
|
||||
|
||||
@@ -8,7 +8,7 @@ use sammo\GameUnitDetail;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class 능력치변경 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN;
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 10;
|
||||
|
||||
protected $variable;
|
||||
protected $operator;
|
||||
@@ -54,7 +54,7 @@ class 능력치변경 extends BaseWarUnitTrigger{
|
||||
}
|
||||
|
||||
$this->processConsumableItem();
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ use sammo\GameUnitDetail;
|
||||
use sammo\ObjectTrigger;
|
||||
|
||||
class 전투력보정 extends BaseWarUnitTrigger{
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN;
|
||||
protected $priority = ObjectTrigger::PRIORITY_BEGIN + 20;
|
||||
|
||||
public function __construct(WarUnit $unit, protected int|float $attackerWarPowerMultiplier, protected int|float $defenderWarPowerMultiplier = 1){
|
||||
$this->object = $unit;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./common_legacy.scss";
|
||||
|
||||
@include media-1000px{
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
.small_war_log {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.small_war_log .war_type_attack {
|
||||
color: cyan;
|
||||
}
|
||||
|
||||
.small_war_log .war_type_defense {
|
||||
color: magenta;
|
||||
}
|
||||
|
||||
.small_war_log .war_type_siege {
|
||||
color: white;
|
||||
}
|
||||
|
||||
.small_war_log .name_plate {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
.small_war_log .name_plate_cover {
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
.small_war_log .crew_plate {
|
||||
color: orangered;
|
||||
font-size: 90%;
|
||||
}
|
||||
|
||||
.hidden_but_copyable {
|
||||
color: rgba(0, 0, 0, 0);
|
||||
font-size: 0;
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "@scss/game_bg.scss";
|
||||
@import "./common_legacy.scss";
|
||||
@import "../../css/config.css";
|
||||
|
||||
Vendored
+16
@@ -0,0 +1,16 @@
|
||||
@import "./common/variables.scss";
|
||||
@import "./common/break_500px.scss";
|
||||
|
||||
$body-bg: #000;
|
||||
|
||||
$input-bg: #ddd;
|
||||
$input-color: #303030;
|
||||
|
||||
@import "./common/bootswatch_custom_variables.scss";
|
||||
@import "bootstrap/scss/bootstrap.scss";
|
||||
@import "./common/bootswatch_custom.scss";
|
||||
@import "./common/bootstrap_sammo.scss";
|
||||
@import "./common/vue-multiselect.scss";
|
||||
|
||||
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css");
|
||||
@import "./common/pretendard.scss";
|
||||
@@ -0,0 +1,11 @@
|
||||
@import "./variables.scss";
|
||||
@import "break_500px.scss";
|
||||
|
||||
$body-bg: #000;
|
||||
|
||||
$input-bg: #ddd;
|
||||
$input-color: #303030;
|
||||
|
||||
@import "./bootswatch_custom_variables.scss";
|
||||
@import "bootstrap/scss/functions";
|
||||
@import "bootstrap/scss/variables";
|
||||
Vendored
-16
@@ -1,16 +0,0 @@
|
||||
@import "./pretendard.scss";
|
||||
|
||||
$body-bg: #000;
|
||||
|
||||
$input-bg: #ddd;
|
||||
$input-color: #303030;
|
||||
|
||||
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons/font/bootstrap-icons.css");
|
||||
|
||||
@import "./break_500px.scss";
|
||||
@import "./variables.scss";
|
||||
@import "./bootswatch_custom_variables.scss";
|
||||
@import "bootstrap/scss/bootstrap.scss";
|
||||
@import "./bootswatch_custom.scss";
|
||||
@import "./bootstrap_sammo.scss";
|
||||
@import "./vue-multiselect.scss";
|
||||
Vendored
+33
@@ -69,4 +69,37 @@ $color in $sammoColors {
|
||||
border-color: shade-color($color, 10%);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.buttonPlate {
|
||||
.toolbarButton {
|
||||
@extend .btn;
|
||||
@extend .btn-sammo-base2;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.toolbarButton2 {
|
||||
@extend .btn;
|
||||
@extend .btn-sammo-base2;
|
||||
color: magenta;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:active {
|
||||
color: magenta;
|
||||
}
|
||||
}
|
||||
|
||||
.commandButton {
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Lumen 5.1.3
|
||||
// Lumen 5.2.0
|
||||
// Bootswatch
|
||||
|
||||
|
||||
@@ -88,7 +88,6 @@
|
||||
|
||||
// Forms
|
||||
|
||||
|
||||
.form-control {
|
||||
box-shadow: inset 0 2px 0 rgba(0, 0, 0, .075);
|
||||
}
|
||||
@@ -120,8 +119,8 @@
|
||||
&:not(.disabled):focus,
|
||||
&.active {
|
||||
padding-bottom: add(.5rem, 6px);
|
||||
border-bottom-color: transparent;
|
||||
margin-top: 0;
|
||||
border-bottom-color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,16 +153,16 @@
|
||||
> li > span {
|
||||
position: relative;
|
||||
top: 0;
|
||||
@include shadow();
|
||||
color: $pagination-color;
|
||||
font-weight: 700;
|
||||
color: $pagination-color;
|
||||
text-transform: uppercase;
|
||||
@include shadow();
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
top: 1px;
|
||||
border-bottom-width: 3px;
|
||||
text-decoration: none;
|
||||
border-bottom-width: 3px;
|
||||
}
|
||||
|
||||
&:active {
|
||||
@@ -194,8 +193,8 @@
|
||||
&,
|
||||
&:hover,
|
||||
&:active {
|
||||
border-left-width: 2px;
|
||||
border-right-width: 2px;
|
||||
border-left-width: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -317,8 +316,9 @@ a.list-group-item {
|
||||
}
|
||||
|
||||
.modal,
|
||||
.toast {
|
||||
.toast,
|
||||
.offcanvas {
|
||||
.btn-close {
|
||||
background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000'><path d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/></svg>");
|
||||
background-image: escape-svg(url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='#{$black}'><path d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/></svg>"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -308,7 +308,6 @@ fieldset[disabled] .multiselect {
|
||||
line-height: $vue-multiselect-min-height / 2;
|
||||
text-decoration: none;
|
||||
text-transform: none;
|
||||
vertical-align: middle;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
white-space: nowrap;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./editor_component.scss";
|
||||
|
||||
html * {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./common_legacy.scss";
|
||||
|
||||
@include media-1000px{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./editor_component.scss";
|
||||
@import "./util.scss";
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
|
||||
.map_position {
|
||||
flex: 0 0 auto;
|
||||
width: 700px;
|
||||
width: 700px !important;
|
||||
}
|
||||
|
||||
.nation_position {
|
||||
flex: 0 0 auto;
|
||||
width: 300px;
|
||||
width: 300px !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-33
@@ -1,6 +1,7 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./editor_component.scss";
|
||||
@import "./util.scss";
|
||||
|
||||
body {
|
||||
color: white;
|
||||
background-color: black;
|
||||
@@ -314,38 +315,6 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
.buttonPlate {
|
||||
.toolbarButton {
|
||||
@extend .btn;
|
||||
@extend .btn-sammo-base2;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.toolbarButton2 {
|
||||
@extend .btn;
|
||||
@extend .btn-sammo-base2;
|
||||
color: magenta;
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:active {
|
||||
color: magenta;
|
||||
}
|
||||
}
|
||||
|
||||
.commandButton {
|
||||
width: 100%;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.nation_info td {
|
||||
height: 18px;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./common_legacy.scss";
|
||||
|
||||
@include media-1000px{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '@scss/common/bootstrap5.scss';
|
||||
@import "./common/base.scss";
|
||||
@import "@scss/game_bg.scss";
|
||||
@import "@scss/util.scss";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '@scss/common/bootstrap5.scss';
|
||||
@import "./common/base.scss";
|
||||
@import "@scss/game_bg.scss";
|
||||
@import "@scss/util.scss";
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import '@scss/common/bootstrap5.scss';
|
||||
@import "./common/base.scss";
|
||||
@import "@scss/game_bg.scss";
|
||||
@import "@scss/util.scss";
|
||||
@import "@scss/editor_component.scss";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@import "./common/bootstrap5.scss";
|
||||
@import "./common/base.scss";
|
||||
@import "./editor_component.scss";
|
||||
@import "./common_legacy.scss";
|
||||
@import "./util.scss";
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
@import '@scss/common/bootstrap5.scss';
|
||||
@import "./common/base.scss";
|
||||
@import "@scss/game_bg.scss";
|
||||
@import "@scss/util.scss";
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@ if ($permission < 1) {
|
||||
var permissionLevel = <?= $permission ?>; //
|
||||
</script>
|
||||
<?= WebUtil::printJS('../d_shared/common_path.js') ?>
|
||||
<?= WebUtil::printDist('vue', [], true) ?>
|
||||
<?= WebUtil::printDist('ts', ['common', 'diplomacy']) ?>
|
||||
|
||||
</head>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?=$btnBegin??''?><a href='v_board.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>회 의 실</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='v_board.php?isSecret=true' class='commandButton <?= $permission >= 2 ? '' : 'disabled' ?> <?=$btnClass??""?>'>기 밀 실</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='b_troop.php' class='commandButton <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?> <?=$btnClass??""?>'>부대 편성</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='v_troop.php' class='commandButton <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?> <?=$btnClass??""?>'>부대 편성</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='t_diplomacy.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>외 교 부</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='b_myBossInfo.php' class='commandButton <?= $meLevel >= 1 ? '' : 'disabled' ?> <?=$btnClass??""?>'>인 사 부</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='v_nationStratFinan.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>내 무 부</a><?=$btnEnd??''?>
|
||||
@@ -13,7 +13,7 @@
|
||||
<?=$btnBegin??''?><a href='v_nationGeneral.php' class='commandButton <?=$btnClass??""?> <?= $meLevel >= 1 ? '' : 'disabled' ?>'>세력 장수</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='v_globalDiplomacy.php' class='commandButton <?=$btnClass??""?>'>중원 정보</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='b_currentCity.php' class='commandButton <?=$btnClass??""?>'>현재 도시</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='b_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='v_battleCenter.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>감 찰 부</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='v_inheritPoint.php' class='commandButton <?=$btnClass??""?>'>유산 관리</a><?=$btnEnd??''?>
|
||||
<?=$btnBegin??''?><a href='b_myPage.php' class='commandButton <?=$btnClass??""?>'>내 정보&설정</a><?=$btnEnd??''?>
|
||||
<?=$splitBtnBegin??''?>
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
<template>
|
||||
<div
|
||||
v-for="(officer, _idx) in [chiefList[chiefLevel]]"
|
||||
:key="_idx"
|
||||
:class="[`chiefBox${chiefLevel}`, 'subRows']"
|
||||
:style="style"
|
||||
@click="$emit('click', this)"
|
||||
>
|
||||
<div :class="[`chiefBox${chiefLevel}`, 'subRows']" :style="style" @click="onClick">
|
||||
<div
|
||||
class="bg1 nameHeader"
|
||||
:style="{
|
||||
@@ -35,23 +29,32 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts">
|
||||
<script setup lang="ts">
|
||||
import { getNpcColor } from "@/common_legacy";
|
||||
import type { ChiefResponse } from "@/defs/API/NationCommand";
|
||||
import { mb_strwidth } from "@/util/mb_strwidth";
|
||||
import { defineComponent } from "vue";
|
||||
import type { PropType } from "vue";
|
||||
import VueTypes from "vue-types";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
defineProps({
|
||||
chiefLevel: VueTypes.integer.isRequired,
|
||||
style: VueTypes.object.isRequired,
|
||||
chiefList: VueTypes.object.isRequired,
|
||||
officer: {
|
||||
type: Object as PropType<ChiefResponse['chiefList'][0]>,
|
||||
default: undefined,
|
||||
},
|
||||
isMe: VueTypes.bool.isRequired,
|
||||
},
|
||||
emits: ["click"],
|
||||
methods: {
|
||||
mb_strwidth,
|
||||
getNpcColor,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(event: "click", value: HTMLElement): void,
|
||||
}>();
|
||||
|
||||
function onClick(event: MouseEvent){
|
||||
if(!event.target){
|
||||
return;
|
||||
}
|
||||
const elem = event.target as HTMLElement;
|
||||
emit("click", elem);
|
||||
}
|
||||
</script>
|
||||
|
||||
+14
-2
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<BContainer id="container" :toast="{ root: true }" class="bg0">
|
||||
<BContainer v-if="asyncReady" id="container" :toast="{ root: true }" class="bg0">
|
||||
<TopBackBar type="close" :title="isResAuction ? '경매장' : '유니크 경매장'" :reloadable="true" @reload="tryReload">
|
||||
<BButton @click="isResAuction = true">금/쌀</BButton>
|
||||
<BButton @click="isResAuction = false">유니크</BButton>
|
||||
@@ -22,7 +22,8 @@ import TopBackBar from "@/components/TopBackBar.vue";
|
||||
import BottomBar from "./components/BottomBar.vue";
|
||||
import AuctionResource from "@/components/AuctionResource.vue";
|
||||
import AuctionUniqueItem from "@/components/AuctionUniqueItem.vue";
|
||||
import { ref } from "vue";
|
||||
import { provide, ref } from "vue";
|
||||
import { getGameConstStore, type GameConstStore } from "./GameConstStore";
|
||||
|
||||
const props = defineProps({
|
||||
isResAuction: {
|
||||
@@ -31,6 +32,17 @@ const props = defineProps({
|
||||
},
|
||||
});
|
||||
|
||||
const asyncReady = ref(false);
|
||||
const gameConstStore = ref<GameConstStore>();
|
||||
provide("gameConstStore", gameConstStore);
|
||||
const storeP = getGameConstStore().then((store) => {
|
||||
gameConstStore.value = store;
|
||||
});
|
||||
|
||||
void Promise.all([storeP]).then(() => {
|
||||
asyncReady.value = true;
|
||||
});
|
||||
|
||||
const auctionResource = ref<InstanceType<typeof AuctionResource> | null>(null);
|
||||
const auctionUniqueItem = ref<InstanceType<typeof AuctionUniqueItem> | null>(null);
|
||||
|
||||
|
||||
@@ -0,0 +1,237 @@
|
||||
<template>
|
||||
<BContainer v-if="asyncReady" id="container" :toast="{ root: true }">
|
||||
<TopBackBar title="감찰부" :reloadable="true" type="close" @reload="reload" />
|
||||
|
||||
<div class="row gx-0">
|
||||
<div class="col-4">
|
||||
<BFormSelect v-model="orderBy">
|
||||
<BFormSelectOption
|
||||
v-for="[orderKey, [orderName]] of Object.entries(textMap)"
|
||||
:key="orderKey"
|
||||
:value="orderKey"
|
||||
>
|
||||
{{ orderName }}
|
||||
</BFormSelectOption>
|
||||
</BFormSelect>
|
||||
</div>
|
||||
<div class="col-8">
|
||||
<BFormSelect v-model="targetGeneralID">
|
||||
<BFormSelectOption v-for="general of orderedGeneralList" :key="general.no" :value="general.no">
|
||||
<span
|
||||
:style="{
|
||||
color: getNpcColor(general.npc),
|
||||
}"
|
||||
>{{ general.officerLevel > 4 ? `*${general.name}*` : general.name }}({{ general.turntime.slice(-5) }}){{
|
||||
textMap[orderBy][3](general)
|
||||
}}</span
|
||||
>
|
||||
</BFormSelectOption>
|
||||
</BFormSelect>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="targetGeneral && nationInfo && targetGeneralLogs" class="row gx-0 bg0">
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="bg1 header-cell" style="color: skyblue">장수 정보</div>
|
||||
<GeneralBasicCard :general="targetGeneral" :nation="nationInfo" />
|
||||
<GeneralSupplementCard :general="targetGeneral" />
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="bg1 header-cell">장수 열전</div>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div v-for="[id, log] of targetGeneralLogs.generalHistory" :key="id" v-html="log" />
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="bg1 header-cell">전투 기록</div>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div v-for="[id, log] of targetGeneralLogs.battleDetail" :key="id" v-html="log" />
|
||||
</div>
|
||||
<div class="col-12 col-md-6">
|
||||
<div class="bg1 header-cell">전투 결과</div>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div v-for="[id, log] of targetGeneralLogs.battleResult" :key="id" v-html="log" />
|
||||
</div>
|
||||
<div v-if="targetGeneralLogs.generalAction.size > 0" class="col-12 col-md-6">
|
||||
<div class="bg1 header-cell">개인 기록</div>
|
||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||
<div v-for="[id, log] of targetGeneralLogs.generalAction" :key="id" v-html="log" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<BottomBar type="close"></BottomBar>
|
||||
</BContainer>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
declare const queryValues: {
|
||||
generalID: number | null;
|
||||
};
|
||||
</script>
|
||||
<script lang="ts" setup>
|
||||
import { BContainer, useToast, BFormSelect, BFormSelectOption } from "bootstrap-vue-3";
|
||||
import { onMounted, provide, ref, watch } from "vue";
|
||||
import { getGameConstStore, type GameConstStore } from "./GameConstStore";
|
||||
import TopBackBar from "@/components/TopBackBar.vue";
|
||||
import BottomBar from "@/components/BottomBar.vue";
|
||||
import type { GeneralListItemP1 } from "./defs/API/Nation";
|
||||
import { SammoAPI } from "./SammoAPI";
|
||||
import { unwrap } from "@/util/unwrap";
|
||||
import { merge2DArrToObjectArr } from "@/util/merge2DArrToObjectArr";
|
||||
import { getNpcColor } from "@/common_legacy";
|
||||
import GeneralBasicCard from "./components/GeneralBasicCard.vue";
|
||||
import GeneralSupplementCard from "@/components/GeneralSupplementCard.vue";
|
||||
import type { NationStaticItem } from "./defs";
|
||||
import type { GeneralLogType } from "./defs/API/General";
|
||||
import { isString } from "lodash";
|
||||
import { formatLog } from "./utilGame/formatLog";
|
||||
|
||||
const toasts = unwrap(useToast());
|
||||
|
||||
const generalList = ref(new Map<number, GeneralListItemP1>());
|
||||
const textMap = {
|
||||
recent_war: [
|
||||
"최근 전투",
|
||||
(gen: GeneralListItemP1) => gen.recent_war,
|
||||
false,
|
||||
(gen: GeneralListItemP1) => `[${gen.recent_war.slice(-5)}]`,
|
||||
],
|
||||
warnum: ["전투 횟수", (gen: GeneralListItemP1) => gen.warnum, false, (gen: GeneralListItemP1) => `[${gen.warnum}회]`],
|
||||
turntime: ["최근 턴", (gen: GeneralListItemP1) => gen.turntime, false, (gen: GeneralListItemP1) => ""],
|
||||
name: ["이름", (gen: GeneralListItemP1) => `${gen.npc} ${gen.name}`, true, (gen: GeneralListItemP1) => ""],
|
||||
} as const;
|
||||
|
||||
const orderedGeneralList = ref<GeneralListItemP1[]>([]);
|
||||
const orderBy = ref<keyof typeof textMap>("turntime");
|
||||
const targetGeneral = ref<GeneralListItemP1>();
|
||||
const targetGeneralID = ref(queryValues.generalID ?? undefined);
|
||||
|
||||
type GeneralLogs = {
|
||||
[key in GeneralLogType]: Map<number, string>;
|
||||
};
|
||||
|
||||
const targetGeneralLogs = ref<GeneralLogs>();
|
||||
|
||||
const nationInfo = ref<NationStaticItem>();
|
||||
|
||||
watch([generalList, targetGeneralID], async ([generalList, targetGeneralID]) => {
|
||||
if (targetGeneralID === undefined) {
|
||||
targetGeneral.value = undefined;
|
||||
return;
|
||||
}
|
||||
targetGeneral.value = generalList.get(targetGeneralID);
|
||||
|
||||
const logs: GeneralLogs = {
|
||||
generalHistory: new Map(),
|
||||
battleResult: new Map(),
|
||||
battleDetail: new Map(),
|
||||
generalAction: new Map(),
|
||||
};
|
||||
|
||||
const waiter: Promise<unknown>[] = [];
|
||||
|
||||
for (const reqType of ["generalHistory", "battleResult", "battleDetail", "generalAction"] as const) {
|
||||
waiter.push(
|
||||
SammoAPI.Nation.GetGeneralLog({ generalID: targetGeneralID, reqType }).then(
|
||||
(res) => {
|
||||
const rawLogs: [number, string][] = Object.entries(res.log).map(([key, value]) => [
|
||||
Number(key),
|
||||
formatLog(value),
|
||||
]);
|
||||
rawLogs.sort(([keyLhs], [keyRhs]) => keyRhs - keyLhs);
|
||||
for (const [idx, log] of rawLogs) {
|
||||
logs[reqType].set(Number(idx), formatLog(log));
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
if (!isString(err)) {
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: `${err}`,
|
||||
});
|
||||
}
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
await Promise.all(waiter);
|
||||
console.log(logs);
|
||||
targetGeneralLogs.value = logs;
|
||||
});
|
||||
|
||||
watch([generalList, orderBy], ([generalList, orderBy], [, oldOrderBy]) => {
|
||||
console.log(generalList);
|
||||
const list = Array.from(generalList.values());
|
||||
if (orderBy != oldOrderBy) {
|
||||
targetGeneralID.value = undefined;
|
||||
}
|
||||
|
||||
const idSet = new Set<number>(list.map((gen) => gen.no));
|
||||
list.sort((a, b) => {
|
||||
const [, getter, isAsc] = textMap[orderBy];
|
||||
const aVal = getter(a);
|
||||
const bVal = getter(b);
|
||||
if (aVal === bVal) return 0;
|
||||
return isAsc ? (aVal > bVal ? 1 : -1) : aVal < bVal ? 1 : -1;
|
||||
});
|
||||
orderedGeneralList.value = list;
|
||||
const oldTargetGeneralID = targetGeneralID.value;
|
||||
if (!oldTargetGeneralID) {
|
||||
targetGeneralID.value = list[0].no;
|
||||
} else if (!idSet.has(oldTargetGeneralID)) {
|
||||
targetGeneralID.value = list[0].no;
|
||||
}
|
||||
});
|
||||
|
||||
const asyncReady = ref(false);
|
||||
const gameConstStore = ref<GameConstStore>();
|
||||
provide("gameConstStore", gameConstStore);
|
||||
const storeP = getGameConstStore().then((store) => {
|
||||
gameConstStore.value = store;
|
||||
});
|
||||
|
||||
void Promise.all([storeP]).then(() => {
|
||||
asyncReady.value = true;
|
||||
});
|
||||
|
||||
async function reload(): Promise<void> {
|
||||
console.log("갱신 시도");
|
||||
|
||||
try {
|
||||
const nationP = SammoAPI.Nation.GetNationInfo({});
|
||||
const { column, list, permission, troops, env } = await SammoAPI.Nation.GeneralList();
|
||||
|
||||
if (permission === 0) {
|
||||
throw "권한이 부족합니다.";
|
||||
}
|
||||
|
||||
console.log(list);
|
||||
const rawGeneralList = merge2DArrToObjectArr(column, list);
|
||||
|
||||
const newList = new Map<number, GeneralListItemP1>();
|
||||
for (const general of rawGeneralList) {
|
||||
newList.set(general.no, general);
|
||||
}
|
||||
generalList.value = newList;
|
||||
|
||||
const { nation } = await nationP;
|
||||
nationInfo.value = nation;
|
||||
} catch (e) {
|
||||
toasts.danger({
|
||||
title: "오류",
|
||||
body: `${e}`,
|
||||
});
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
await reload();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.header-cell {
|
||||
color: orange;
|
||||
font-size: 1.3em;
|
||||
text-align: center;
|
||||
border: 1px gray solid;
|
||||
}
|
||||
</style>
|
||||
+85
-106
@@ -32,7 +32,7 @@
|
||||
</div>
|
||||
<div id="board">
|
||||
<template v-if="articles && articles.length">
|
||||
<board-article
|
||||
<BoardArticle
|
||||
v-for="article in articles"
|
||||
:key="article.no"
|
||||
:article="article"
|
||||
@@ -46,8 +46,8 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, onMounted, reactive, ref } from "vue";
|
||||
<script setup lang="ts">
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import TopBackBar from "@/components/TopBackBar.vue";
|
||||
import BottomBar from "@/components/BottomBar.vue";
|
||||
import BoardArticle from "@/components/BoardArticle.vue";
|
||||
@@ -55,7 +55,6 @@ import { convertFormData } from "@util/convertFormData";
|
||||
import axios from "axios";
|
||||
import type { InvalidResponse } from "@/defs";
|
||||
import { autoResizeTextarea } from "@util/autoResizeTextarea";
|
||||
import { unwrap } from "@util/unwrap";
|
||||
export type BoardResponse = {
|
||||
result: true;
|
||||
articles: Record<number, BoardArticleItem>;
|
||||
@@ -85,108 +84,88 @@ export type BoardCommentItem = {
|
||||
text: string;
|
||||
};
|
||||
|
||||
export default defineComponent({
|
||||
name: "PageBoard",
|
||||
components: {
|
||||
TopBackBar,
|
||||
BottomBar,
|
||||
BoardArticle,
|
||||
},
|
||||
props: {
|
||||
isSecretBoard: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props) {
|
||||
const newArticleTextForm = ref<HTMLInputElement>();
|
||||
const articles = reactive<BoardArticleItem[]>([]);
|
||||
|
||||
const reloadArticles = async () => {
|
||||
let boardResponse: BoardResponse;
|
||||
|
||||
try {
|
||||
const response = await axios({
|
||||
url: "j_board_get_articles.php",
|
||||
responseType: "json",
|
||||
method: "post",
|
||||
data: convertFormData({
|
||||
isSecret: props.isSecretBoard,
|
||||
}),
|
||||
});
|
||||
const result: InvalidResponse | BoardResponse = response.data;
|
||||
if (!result.result) {
|
||||
throw result.reason;
|
||||
}
|
||||
boardResponse = result;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert(`에러: ${e}`);
|
||||
return;
|
||||
}
|
||||
|
||||
articles.length = 0;
|
||||
articles.push(...Object.values(boardResponse.articles));
|
||||
articles.reverse();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await reloadArticles();
|
||||
});
|
||||
|
||||
return {
|
||||
newArticleTextForm,
|
||||
articles,
|
||||
reloadArticles,
|
||||
};
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: this.isSecretBoard ? "기밀실" : "회의실",
|
||||
newArticle: {
|
||||
title: "",
|
||||
text: "",
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
autoResizeTextarea,
|
||||
async submitArticle() {
|
||||
const { title, text } = this.newArticle;
|
||||
if (!title && !text) {
|
||||
return;
|
||||
}
|
||||
|
||||
let result: InvalidResponse;
|
||||
|
||||
try {
|
||||
const response = await axios({
|
||||
url: "j_board_article_add.php",
|
||||
method: "post",
|
||||
responseType: "json",
|
||||
data: convertFormData({
|
||||
isSecret: this.isSecretBoard,
|
||||
title,
|
||||
text,
|
||||
}),
|
||||
});
|
||||
result = response.data;
|
||||
if (!result.result) {
|
||||
throw result.reason;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert(`실패했습니다. :${e}`);
|
||||
return;
|
||||
}
|
||||
|
||||
this.newArticle = { title: "", text: "" };
|
||||
const newArticleTextForm = unwrap(this.newArticleTextForm);
|
||||
newArticleTextForm.style.height = "auto";
|
||||
|
||||
await this.reloadArticles();
|
||||
},
|
||||
const props = defineProps({
|
||||
isSecretBoard: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
});
|
||||
|
||||
const newArticleTextForm = ref<HTMLInputElement>();
|
||||
const articles = reactive<BoardArticleItem[]>([]);
|
||||
|
||||
const reloadArticles = async () => {
|
||||
let boardResponse: BoardResponse;
|
||||
|
||||
try {
|
||||
const response = await axios({
|
||||
url: "j_board_get_articles.php",
|
||||
responseType: "json",
|
||||
method: "post",
|
||||
data: convertFormData({
|
||||
isSecret: props.isSecretBoard,
|
||||
}),
|
||||
});
|
||||
const result: InvalidResponse | BoardResponse = response.data;
|
||||
if (!result.result) {
|
||||
throw result.reason;
|
||||
}
|
||||
boardResponse = result;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert(`에러: ${e}`);
|
||||
return;
|
||||
}
|
||||
|
||||
articles.length = 0;
|
||||
articles.push(...Object.values(boardResponse.articles));
|
||||
articles.reverse();
|
||||
};
|
||||
|
||||
onMounted(async () => {
|
||||
await reloadArticles();
|
||||
});
|
||||
|
||||
const title = ref(props.isSecretBoard ? "기밀실" : "회의실");
|
||||
const newArticle = ref({
|
||||
title: "",
|
||||
text: "",
|
||||
});
|
||||
|
||||
async function submitArticle() {
|
||||
const { title, text } = newArticle.value;
|
||||
if (!title && !text) {
|
||||
return;
|
||||
}
|
||||
|
||||
let result: InvalidResponse;
|
||||
|
||||
try {
|
||||
const response = await axios({
|
||||
url: "j_board_article_add.php",
|
||||
method: "post",
|
||||
responseType: "json",
|
||||
data: convertFormData({
|
||||
isSecret: props.isSecretBoard,
|
||||
title,
|
||||
text,
|
||||
}),
|
||||
});
|
||||
result = response.data;
|
||||
if (!result.result) {
|
||||
throw result.reason;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
alert(`실패했습니다. :${e}`);
|
||||
return;
|
||||
}
|
||||
|
||||
newArticle.value = { title: "", text: "" };
|
||||
if (newArticleTextForm.value !== undefined) {
|
||||
newArticleTextForm.value.style.height = "auto";
|
||||
}
|
||||
|
||||
await reloadArticles();
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -75,7 +75,7 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "@/../scss/common/bootstrap5.scss";
|
||||
@import "@scss/common/base.scss";
|
||||
@include media-1000px {
|
||||
#container {
|
||||
width: 700px;
|
||||
|
||||
@@ -2,7 +2,11 @@
|
||||
<div id="container" class="pageChiefCenter">
|
||||
<TopBackBar title="사령부" reloadable @reload="reloadTable" />
|
||||
|
||||
<div v-if="chiefList !== undefined" id="mainTable" :class="`${targetIsMe ? 'targetIsMe' : 'targetIsNotMe'}`">
|
||||
<div
|
||||
v-if="asyncReady && chiefList !== undefined"
|
||||
id="mainTable"
|
||||
:class="`${targetIsMe ? 'targetIsMe' : 'targetIsNotMe'}`"
|
||||
>
|
||||
<template v-for="(chiefLevel, vidx) in [12, 10, 8, 6, 11, 9, 7, 5]" :key="chiefLevel">
|
||||
<div v-if="vidx % 4 == 0" :class="['turnIdx', vidx == 0 && !targetIsMe ? undefined : 'only1000px']">
|
||||
<div :class="['subRows', 'bg0']" :style="mainTableGridRows">
|
||||
@@ -20,7 +24,7 @@
|
||||
<TopItem
|
||||
v-if="officerLevel != chiefLevel"
|
||||
:style="mainTableGridRows"
|
||||
:officer="officer"
|
||||
:officer="postFilterOfficer(chiefList[chiefLevel])"
|
||||
:maxTurn="maxChiefTurn"
|
||||
:turnTerm="turnTerm"
|
||||
/>
|
||||
@@ -33,6 +37,7 @@
|
||||
:turn="officer.turn"
|
||||
:turnTerm="turnTerm"
|
||||
:commandList="unwrap(commandList)"
|
||||
:troopList="unwrap(troopList)"
|
||||
:turnTime="officer.turnTime"
|
||||
:maxTurn="maxChiefTurn"
|
||||
:maxPushTurn="Math.floor(maxChiefTurn / 2)"
|
||||
@@ -63,7 +68,7 @@
|
||||
</div>
|
||||
<BottomItem
|
||||
:chiefLevel="chiefLevel"
|
||||
:chiefList="chiefList"
|
||||
:officer="postFilterOfficer(chiefList[chiefLevel])"
|
||||
:style="subTableGridRows"
|
||||
:isMe="chiefLevel == officerLevel"
|
||||
@click="viewTarget = chiefLevel"
|
||||
@@ -89,7 +94,6 @@ declare const staticValues: {
|
||||
};
|
||||
</script>
|
||||
<script lang="ts" setup>
|
||||
import "@scss/common/bootstrap5.scss";
|
||||
import "@scss/game_bg.scss";
|
||||
import "../../css/config.css";
|
||||
|
||||
@@ -102,22 +106,36 @@ import { isString } from "lodash";
|
||||
import { entriesWithType } from "./util/entriesWithType";
|
||||
import TopItem from "@/ChiefCenter/TopItem.vue";
|
||||
import BottomItem from "@/ChiefCenter/BottomItem.vue";
|
||||
import type { OptionalFull } from "./defs";
|
||||
import type { OptionalFull, TurnObj } from "./defs";
|
||||
import { SammoAPI } from "./SammoAPI";
|
||||
import { unwrap } from "@/util/unwrap";
|
||||
import { StoredActionsHelper } from "./util/StoredActionsHelper";
|
||||
import type { ChiefResponse } from "./defs/API/NationCommand";
|
||||
import { getGameConstStore, type GameConstStore } from "./GameConstStore";
|
||||
import { postFilterNationCommandGen } from "./utilGame/postFilterNationCommandGen";
|
||||
|
||||
const props = defineProps({
|
||||
maxChiefTurn: VueTypes.number.isRequired,
|
||||
});
|
||||
|
||||
const asyncReady = ref<boolean>(false);
|
||||
const gameConstStore = ref<GameConstStore>();
|
||||
provide("gameConstStore", gameConstStore);
|
||||
const storeP = getGameConstStore().then((store) => {
|
||||
gameConstStore.value = store;
|
||||
});
|
||||
|
||||
void Promise.all([storeP]).then(() => {
|
||||
asyncReady.value = true;
|
||||
});
|
||||
|
||||
const tableObj = reactive<Omit<OptionalFull<ChiefResponse>, "result">>({
|
||||
lastExecute: undefined,
|
||||
year: undefined,
|
||||
month: undefined,
|
||||
turnTerm: undefined,
|
||||
date: undefined,
|
||||
troopList: undefined,
|
||||
chiefList: undefined,
|
||||
isChief: undefined,
|
||||
autorun_limit: undefined,
|
||||
@@ -127,7 +145,33 @@ const tableObj = reactive<Omit<OptionalFull<ChiefResponse>, "result">>({
|
||||
unitSet: undefined,
|
||||
});
|
||||
|
||||
const { year, month, turnTerm, date, chiefList, officerLevel, commandList } = toRefs(tableObj);
|
||||
const { year, month, turnTerm, date, chiefList, troopList, officerLevel, commandList } = toRefs(tableObj);
|
||||
|
||||
let postFilterNationCommand = function (turnObj: TurnObj): TurnObj {
|
||||
return turnObj;
|
||||
};
|
||||
|
||||
watch([tableObj, gameConstStore], ([tableObj, gameConstStore]) => {
|
||||
if (tableObj.troopList === undefined) {
|
||||
return;
|
||||
}
|
||||
if (gameConstStore === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
postFilterNationCommand = postFilterNationCommandGen(tableObj.troopList, gameConstStore);
|
||||
});
|
||||
|
||||
type OfficerObj = ChiefResponse["chiefList"][0];
|
||||
function postFilterOfficer(officer: OfficerObj|undefined): OfficerObj|undefined {
|
||||
if(officer === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
...officer,
|
||||
turn: officer.turn.map(postFilterNationCommand),
|
||||
};
|
||||
}
|
||||
|
||||
const viewTarget = ref<number | undefined>();
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ onMounted(() => {
|
||||
@import "@scss/common/break_500px.scss";
|
||||
|
||||
@include media-500px {
|
||||
.optionMenu::v-deep .dropdown-toggle {
|
||||
.optionMenu:deep(.dropdown-toggle) {
|
||||
height: 32px;
|
||||
}
|
||||
.isNationRankingBottom {
|
||||
|
||||
@@ -254,7 +254,6 @@ declare const staticValues: {
|
||||
</script>
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref } from "vue";
|
||||
import "@scss/common/bootstrap5.scss";
|
||||
import "@scss/game_bg.scss";
|
||||
import TopBackBar from "@/components/TopBackBar.vue";
|
||||
import _ from "lodash";
|
||||
|
||||
+1
-2
@@ -272,7 +272,6 @@ declare const staticValues: {
|
||||
};
|
||||
</script>
|
||||
<script lang="ts" setup>
|
||||
import "@scss/common/bootstrap5.scss";
|
||||
import "@scss/game_bg.scss";
|
||||
|
||||
import TopBackBar from "@/components/TopBackBar.vue";
|
||||
@@ -538,7 +537,7 @@ watch(inheritTurnTimeSecond, (newValue: number) => {
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
@import "@scss/common/bootstrap5.scss";
|
||||
@import "@scss/common/base.scss";
|
||||
@import "@scss/editor_component.scss";
|
||||
|
||||
#container {
|
||||
|
||||
@@ -163,6 +163,17 @@
|
||||
훈련/사기진작 기준치입니다. 이보다 같거나 높으면 출병합니다.
|
||||
</NumberInputWithInfo>
|
||||
</div>
|
||||
<div class="col">
|
||||
<NumberInputWithInfo
|
||||
v-model="nationPolicy.cureThreshold"
|
||||
:step="5"
|
||||
:min="10"
|
||||
:max="100"
|
||||
title="요양 기준"
|
||||
>
|
||||
요양 기준 %입니다. 이보다 많이 부상을 입으면 요양합니다.
|
||||
</NumberInputWithInfo>
|
||||
</div>
|
||||
<!--allowNpcAttackCity는 현재 게임 내 비활성-->
|
||||
</div>
|
||||
<div style="padding: 0 8pt">
|
||||
@@ -374,7 +385,6 @@ declare const staticValues: {
|
||||
};
|
||||
</script>
|
||||
<script setup lang="ts">
|
||||
import "@scss/common/bootstrap5.scss";
|
||||
import "@scss/game_bg.scss";
|
||||
|
||||
import { ref } from "vue";
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user