feat(WIP): 내무부
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ return [
|
|||||||
'hwe/b_betting.php',
|
'hwe/b_betting.php',
|
||||||
'hwe/v_chiefCenter.php',
|
'hwe/v_chiefCenter.php',
|
||||||
'hwe/b_currentCity.php',
|
'hwe/b_currentCity.php',
|
||||||
'hwe/b_dipcenter.php',
|
'hwe/v_nationStratFinan.php',
|
||||||
'hwe/b_diplomacy.php',
|
'hwe/b_diplomacy.php',
|
||||||
'hwe/b_genList.php',
|
'hwe/b_genList.php',
|
||||||
'hwe/b_myBossInfo.php',
|
'hwe/b_myBossInfo.php',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<?=$btnBegin??''?><a href='b_troop.php' class='commandButton <?= ($meLevel >= 1 && $nationLevel >= 1) ? '' : 'disabled' ?> <?=$btnClass??""?>'>부대 편성</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='b_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='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='b_myBossInfo.php' class='commandButton <?= $meLevel >= 1 ? '' : 'disabled' ?> <?=$btnClass??""?>'>인 사 부</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='b_dipcenter.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>내 무 부</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='v_nationStratFinan.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>내 무 부</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='v_chiefCenter.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>사 령 부</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='v_chiefCenter.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>사 령 부</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='v_NPCControl.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>NPC 정책</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='v_NPCControl.php' class='commandButton <?= $showSecret ? '' : 'disabled' ?> <?=$btnClass??""?>'>NPC 정책</a><?=$btnEnd??''?>
|
||||||
<?=$btnBegin??''?><a href='b_genList.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>암 행 부</a><?=$btnEnd??''?>
|
<?=$btnBegin??''?><a href='b_genList.php' target='_blank' class='open-window commandButton <?=$btnClass??""?> <?= $showSecret ? '' : 'disabled' ?>'>암 행 부</a><?=$btnEnd??''?>
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<div>위쪽버튼</div>
|
||||||
|
<div>외교관계</div>
|
||||||
|
|
||||||
<div>국 가 방 침 & 임관 권유 메시지</div>
|
<div>국 가 방 침 & 임관 권유 메시지</div>
|
||||||
<div id="noticeForm">
|
<div id="noticeForm">
|
||||||
<div class="bg1" style="display: flex; justify-content: space-around">
|
<div class="bg1" style="display: flex; justify-content: space-around">
|
||||||
@@ -24,9 +27,7 @@
|
|||||||
<div class="bg1" style="display: flex; justify-content: space-around">
|
<div class="bg1" style="display: flex; justify-content: space-around">
|
||||||
<div style="flex: 1 1 auto">임관 권유</div>
|
<div style="flex: 1 1 auto">임관 권유</div>
|
||||||
<div>
|
<div>
|
||||||
<b-button
|
<b-button @click="enableEditScoutMsg" v-if="editable && !inEditScoutMsg"
|
||||||
@click="enableEditScoutMsg"
|
|
||||||
v-if="editable && !inEditScoutMsg"
|
|
||||||
>임관 권유문 수정</b-button
|
>임관 권유문 수정</b-button
|
||||||
>
|
>
|
||||||
<b-button @click="saveScoutMsg" v-if="editable && inEditScoutMsg"
|
<b-button @click="saveScoutMsg" v-if="editable && inEditScoutMsg"
|
||||||
@@ -44,81 +45,140 @@
|
|||||||
<TipTap v-model="scoutMsg" :editable="inEditScoutMsg" />
|
<TipTap v-model="scoutMsg" :editable="inEditScoutMsg" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>예산&정책</div>
|
||||||
|
<div>추가 설정</div>
|
||||||
|
<div>돌아가기</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import "@scss/dipcenter.scss";
|
import "@scss/dipcenter.scss";
|
||||||
import "@scss/common_legacy.scss";
|
import "@scss/common_legacy.scss";
|
||||||
import "@scss/editor_component.scss";
|
import "@scss/editor_component.scss";
|
||||||
import TipTap from "./components/TipTap.vue";
|
import TipTap from "./components/TipTap.vue";
|
||||||
import { defineComponent } from "vue";
|
import { defineComponent, reactive, ref, toRefs } from "vue";
|
||||||
import { sammoAPI } from "./util/sammoAPI";
|
import { sammoAPI } from "./util/sammoAPI";
|
||||||
import { isString } from "lodash";
|
import { isString } from "lodash";
|
||||||
declare const editable: boolean;
|
import { diplomacyState, NationStaticItem } from "./defs";
|
||||||
declare const nationMsg: string;
|
|
||||||
declare const scoutMsg: string;
|
type NationItem = NationStaticItem & {
|
||||||
|
cityCnt: number;
|
||||||
|
diplomacy: {
|
||||||
|
state: diplomacyState;
|
||||||
|
term: number | null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
declare const staticValues: {
|
||||||
|
editable: boolean;
|
||||||
|
nationMsg: string;
|
||||||
|
scoutMsg: string;
|
||||||
|
nationID: number;
|
||||||
|
officerLevel: number;
|
||||||
|
year: number;
|
||||||
|
month: number;
|
||||||
|
nationsList: Record<number, NationItem>;
|
||||||
|
|
||||||
|
gold: number;
|
||||||
|
rice: number;
|
||||||
|
income: {
|
||||||
|
gold: {
|
||||||
|
city: number;
|
||||||
|
war: number;
|
||||||
|
};
|
||||||
|
rice: {
|
||||||
|
city: number;
|
||||||
|
wall: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
polcy: {
|
||||||
|
rate: number;
|
||||||
|
bill: number;
|
||||||
|
secretLimit: number;
|
||||||
|
blockScout: boolean;
|
||||||
|
blockWar: boolean;
|
||||||
|
};
|
||||||
|
warSettingCnt: {
|
||||||
|
remain: number;
|
||||||
|
inc: number;
|
||||||
|
max: number;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: "PartialDipcenter",
|
|
||||||
components: {
|
components: {
|
||||||
TipTap,
|
TipTap,
|
||||||
},
|
},
|
||||||
data() {
|
setup() {
|
||||||
return {
|
const self = reactive(staticValues);
|
||||||
editable,
|
|
||||||
oldNationMsg: nationMsg,
|
let oldNationMsg = staticValues.nationMsg;
|
||||||
oldScoutMsg: scoutMsg,
|
const inEditNationMsg = ref(false);
|
||||||
nationMsg,
|
|
||||||
scoutMsg,
|
function enableEditNationMsg() {
|
||||||
inEditNationMsg: false,
|
inEditNationMsg.value = true;
|
||||||
inEditScoutMsg: false,
|
}
|
||||||
};
|
|
||||||
},
|
function rollbackNationMsg() {
|
||||||
methods: {
|
inEditNationMsg.value = false;
|
||||||
enableEditNationMsg() {
|
self.nationMsg = oldNationMsg;
|
||||||
this.inEditNationMsg = true;
|
}
|
||||||
},
|
|
||||||
rollbackNationMsg() {
|
async function saveNationMsg() {
|
||||||
this.inEditNationMsg = false;
|
const msg = self.nationMsg;
|
||||||
this.nationMsg = this.oldNationMsg;
|
|
||||||
},
|
|
||||||
async saveNationMsg() {
|
|
||||||
const msg = this.nationMsg;
|
|
||||||
try {
|
try {
|
||||||
await sammoAPI("Nation/SetNotice", {
|
await sammoAPI("Nation/SetNotice", {
|
||||||
msg,
|
msg,
|
||||||
});
|
});
|
||||||
this.oldNationMsg = msg;
|
oldNationMsg = msg;
|
||||||
this.inEditNationMsg = false;
|
inEditNationMsg.value = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (isString(e)) {
|
if (isString(e)) {
|
||||||
alert(e);
|
alert(e);
|
||||||
}
|
}
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
enableEditScoutMsg() {
|
let oldScoutMsg = staticValues.scoutMsg;
|
||||||
this.inEditScoutMsg = true;
|
const inEditScoutMsg = ref(false);
|
||||||
},
|
|
||||||
rollbackScoutMsg() {
|
function enableEditScoutMsg() {
|
||||||
this.inEditScoutMsg = false;
|
inEditScoutMsg.value = true;
|
||||||
this.scoutMsg = this.oldScoutMsg;
|
}
|
||||||
},
|
function rollbackScoutMsg() {
|
||||||
async saveScoutMsg() {
|
inEditScoutMsg.value = false;
|
||||||
const msg = this.scoutMsg;
|
self.scoutMsg = oldScoutMsg;
|
||||||
|
}
|
||||||
|
async function saveScoutMsg() {
|
||||||
|
const msg = self.scoutMsg;
|
||||||
try {
|
try {
|
||||||
await sammoAPI("Nation/SetScoutMsg", {
|
await sammoAPI("Nation/SetScoutMsg", {
|
||||||
msg,
|
msg,
|
||||||
});
|
});
|
||||||
this.oldScoutMsg = msg;
|
oldScoutMsg = msg;
|
||||||
this.inEditScoutMsg = false;
|
inEditScoutMsg.value = false;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (isString(e)) {
|
if (isString(e)) {
|
||||||
alert(e);
|
alert(e);
|
||||||
}
|
}
|
||||||
console.error(e);
|
console.error(e);
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return {
|
||||||
|
...toRefs(self),
|
||||||
|
inEditNationMsg,
|
||||||
|
inEditScoutMsg,
|
||||||
|
enableEditNationMsg,
|
||||||
|
rollbackNationMsg,
|
||||||
|
saveNationMsg,
|
||||||
|
enableEditScoutMsg,
|
||||||
|
rollbackScoutMsg,
|
||||||
|
saveScoutMsg,
|
||||||
|
};
|
||||||
},
|
},
|
||||||
|
methods: {},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
"v_NPCControl": "v_NPCControl.ts",
|
"v_NPCControl": "v_NPCControl.ts",
|
||||||
"v_join": "v_join.ts",
|
"v_join": "v_join.ts",
|
||||||
"v_main": "v_main.ts",
|
"v_main": "v_main.ts",
|
||||||
"v_dipcenter": "v_dipcenter.ts",
|
"v_nationStratFinan": "v_nationStratFinan.ts",
|
||||||
"v_processing": "v_processing.ts"
|
"v_processing": "v_processing.ts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { createApp } from 'vue'
|
|
||||||
import PartialDipcenter from '@/PartialDipcenter.vue';
|
|
||||||
import BootstrapVue3 from 'bootstrap-vue-3';
|
|
||||||
import { htmlReady } from './util/htmlReady';
|
|
||||||
//import { activateFlip } from './legacy/activateFlip';
|
|
||||||
//import { activateFlip } from "@/legacy/activateFlip";
|
|
||||||
import { setAxiosXMLHttpRequest } from '@util/setAxiosXMLHttpRequest';
|
|
||||||
//import { htmlReady } from './util/htmlReady';
|
|
||||||
|
|
||||||
createApp(PartialDipcenter).use(BootstrapVue3).mount('#editorForm');
|
|
||||||
setAxiosXMLHttpRequest();
|
|
||||||
|
|
||||||
|
|
||||||
htmlReady(function(){
|
|
||||||
//activateFlip();
|
|
||||||
})
|
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
import { createApp } from 'vue'
|
||||||
|
import PageNationStratFinan from '@/PageNationStratFinan.vue';
|
||||||
|
import BootstrapVue3 from 'bootstrap-vue-3';
|
||||||
|
import { auto500px } from './util/auto500px';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
auto500px();
|
||||||
|
createApp(PageNationStratFinan).use(BootstrapVue3).mount('#container');
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace sammo;
|
||||||
|
|
||||||
|
include "lib.php";
|
||||||
|
include "func.php";
|
||||||
|
//로그인 검사
|
||||||
|
$session = Session::requireGameLogin()->setReadOnly();
|
||||||
|
$userID = Session::getUserID();
|
||||||
|
|
||||||
|
$db = DB::db();
|
||||||
|
$gameStor = KVStorage::getStorage($db, 'game_env');
|
||||||
|
|
||||||
|
increaseRefresh("내무부", 1);
|
||||||
|
|
||||||
|
$me = $db->queryFirstRow('SELECT no, nation, officer_level, con, turntime, belong, permission, penalty FROM general WHERE owner=%i', $userID);
|
||||||
|
|
||||||
|
$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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$nationID = $me['nation'];
|
||||||
|
$nation = $db->queryFirstRow('SELECT nation,level,name,color,type,gold,rice,bill,rate,scout,war,secretlimit,capital FROM nation WHERE nation = %i', $nationID);
|
||||||
|
|
||||||
|
$nationStor = KVStorage::getStorage($db, $nationID, 'nation_env');
|
||||||
|
|
||||||
|
[$year, $month] = $gameStor->getValuesAsArray(['year', 'month']);
|
||||||
|
$nationStor->cacheValues(['notice', 'scout_msg', 'available_war_setting_cnt']);
|
||||||
|
|
||||||
|
$cityCntList = Util::convertPairArrayToDict($db->queryAllLists('SELECT nation, count(city) FROM city GROUP BY nation'));
|
||||||
|
$dipStateList = Util::convertArrayToDict($db->query('SELECT you,state,term FROM diplomacy WHERE me = %i', $nationID), 'you');
|
||||||
|
|
||||||
|
$nationsList = getAllNationStaticInfo();
|
||||||
|
|
||||||
|
$cityList = $db->query('SELECT * FROM city WHERE nation=%i', $nationID);
|
||||||
|
$dedicationList = $db->query('SELECT dedication FROM general WHERE nation=%i AND npc!=5', $nationID);
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($nationsList as &$nationItem) {
|
||||||
|
|
||||||
|
$staticNationID = $nationItem['nation'];
|
||||||
|
//속령수
|
||||||
|
$nationItem['cityCnt'] = $cityCntList[$staticNationID] ?? 0;
|
||||||
|
if ($staticNationID !== $nationID) {
|
||||||
|
$diplomacyItem = $dipStateList[$staticNationID];
|
||||||
|
|
||||||
|
$nationItem['diplomacy'] = [
|
||||||
|
'state' => $diplomacyItem['state'],
|
||||||
|
'term' => $diplomacyItem['term'],
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
$nationItem['diplomacy'] = [
|
||||||
|
'state' => 7,
|
||||||
|
'term' => null,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 수입 연산
|
||||||
|
$goldIncome = getGoldIncome(
|
||||||
|
$nation['nation'],
|
||||||
|
$nation['level'],
|
||||||
|
$nation['rate'],
|
||||||
|
$nation['capital'],
|
||||||
|
$nation['type'],
|
||||||
|
$cityList
|
||||||
|
);
|
||||||
|
$warIncome = getWarGoldIncome($nation['type'], $cityList);
|
||||||
|
|
||||||
|
$riceIncome = getRiceIncome(
|
||||||
|
$nation['nation'],
|
||||||
|
$nation['level'],
|
||||||
|
$nation['rate'],
|
||||||
|
$nation['capital'],
|
||||||
|
$nation['type'],
|
||||||
|
$cityList
|
||||||
|
);
|
||||||
|
$wallIncome = getWallIncome(
|
||||||
|
$nation['nation'],
|
||||||
|
$nation['level'],
|
||||||
|
$nation['rate'],
|
||||||
|
$nation['capital'],
|
||||||
|
$nation['type'],
|
||||||
|
$cityList
|
||||||
|
);
|
||||||
|
|
||||||
|
$incomes = [
|
||||||
|
'gold' => [
|
||||||
|
'city' => $goldIncome,
|
||||||
|
'war' => $warIncome,
|
||||||
|
],
|
||||||
|
'rice' => [
|
||||||
|
'city' => $riceIncome,
|
||||||
|
'wall' => $wallIncome,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
$outcome = getOutcome(100, $dedicationList);
|
||||||
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=500" />
|
||||||
|
<title><?= UniqueConst::$serverName ?>: 내무부</title>
|
||||||
|
<?= WebUtil::printStaticValues([
|
||||||
|
'staticValues' => [
|
||||||
|
'editable' => ($me['officer_level'] >= 5 || $permission == 4),
|
||||||
|
'nationMsg' => $nationStor->notice ?? '',
|
||||||
|
'scoutMsg' => $nationStor->scout_msg ?? '',
|
||||||
|
'nationID' => $nationID,
|
||||||
|
'officerLevel' => $me['officer_level'],
|
||||||
|
'year' => $year,
|
||||||
|
'month' => $month,
|
||||||
|
'nationsList' => $nationsList,
|
||||||
|
|
||||||
|
'gold' => $nation['gold'],
|
||||||
|
'rice' => $nation['rice'],
|
||||||
|
'income' => $incomeList,
|
||||||
|
'outcome' => $outcome,
|
||||||
|
|
||||||
|
'policy' => [
|
||||||
|
'rate' => $nation['rate'],
|
||||||
|
'bill' => $nation['bill'],
|
||||||
|
'secretLimit' => $nation['secretlimit'],
|
||||||
|
'blockScout' => $nation['scout']!=0,
|
||||||
|
'blockWar' => $nation['war']!=0,
|
||||||
|
],
|
||||||
|
'warSettingCnt' => [
|
||||||
|
'remain' => $nationStor->getValue('available_war_setting_cnt'),
|
||||||
|
'inc' => GameConst::$incAvailableWarSettingCnt,
|
||||||
|
'max' => GameConst::$maxAvailableWarSettingCnt
|
||||||
|
],
|
||||||
|
]
|
||||||
|
]) ?>
|
||||||
|
<?= 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', 'v_nationStratFinan', true) ?>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="container"></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user