- {{ globalInfo.auctionCount.toLocaleString() }}건 거래 진행중
+
국가 방침
+
접속중인 국가: {{ globalInfo.onlineNations }}
+
【 접속자 】 {{ nationInfo?.onlineGen }}
+
@@ -218,7 +258,7 @@ import CityBasicCard from "./components/CityBasicCard.vue";
import NationBasicCard from "./components/NationBasicCard.vue";
import GeneralBasicCard from "./components/GeneralBasicCard.vue";
import MessagePanel from "./components/MessagePanel.vue";
-import type { NationInfoFull } from "./defs/API/Nation";
+import type { NationInfoFull } from "./defs/API/Nation";
import type { MapResult, NationStaticItem } from "./defs";
import { formatTime } from "./util/formatTime";
import { calcTournamentTerm } from "./utilGame";
@@ -228,6 +268,7 @@ import AutorunInfo from "./components/AutorunInfo.vue";
import { scrollHardTo } from "./util/scrollHardTo";
import MainControlBar from "./components/MainControlBar.vue";
import GlobalMenu from "./components/GlobalMenu.vue";
+import { formatTournamentStep, formatTournamentType, type TournamentStepType } from "./utilGame/formatTournament";
const { serverName, serverNick, serverID } = staticValues;
@@ -431,7 +472,18 @@ const frontInfo = ref();
const globalInfo = ref({} as GetFrontInfoResponse["global"]);
const generalInfo = ref();
const nationStaticInfo = ref();
-const nationInfo = ref();
+const nationInfo = ref();
+const generalCnt = ref(new Map());
+const createdUserCnt = ref(0);
+const createdNPCCnt = ref(0);
+
+const tournamentStep = ref({
+ availableJoin: false,
+ state: "초기화 중",
+ nextText: "",
+});
+const tournamentTime = ref(new Date());
+
let generalInfoLock = false;
watch(refreshCounter, async () => {
@@ -453,6 +505,7 @@ watch(refreshCounter, async () => {
}
const rawNation = response.nation;
+ nationInfo.value = rawNation;
nationStaticInfo.value = {
nation: rawNation.id,
name: rawNation.name,
@@ -473,21 +526,24 @@ watch(refreshCounter, async () => {
}
});
-watch(refreshCounter, async () => {
- try {
- const response = await SammoAPI.Nation.GetNationInfo({full: true});
- console.log('nation', response);
- if(!response.isFull){
- throw 'NationInfo 반환값 에러';
+watch(globalInfo, (global) => {
+ const value = new Map();
+ let userCnt = 0;
+ let npcCnt = 0;
+ for (const [npcType, cnt] of global.genCount) {
+ value.set(npcType, cnt);
+ if (npcType < 2) {
+ userCnt += cnt;
+ } else {
+ npcCnt += cnt;
}
- nationInfo.value = response;
- } catch (e) {
- console.error(e);
- toasts.danger({
- title: "국가 정보 갱신 실패",
- body: `${e}`,
- });
}
+ generalCnt.value = value;
+ createdUserCnt.value = userCnt;
+ createdNPCCnt.value = npcCnt;
+
+ tournamentStep.value = formatTournamentStep(global.tournamentState);
+ tournamentTime.value = parseTime(global.tournamentTime);
});
const map = ref();
@@ -544,6 +600,10 @@ watch(refreshCounter, async () => {
justify-content: space-between;
}
+.gameInfo {
+ text-align: center;
+}
+
.generalInfo {
width: 500px;
}
@@ -552,12 +612,18 @@ watch(refreshCounter, async () => {
display: grid;
}
-.nationNoticeBody{
+.nationNoticeBody {
:deep(p) {
min-height: 1em;
}
}
+.subVoteState, .subAuctionState, .subTournamentState {
+ a {
+ text-decoration: gray underline;
+ }
+}
+
@include media-500px {
#outBlock {
position: absolute;
@@ -578,10 +644,6 @@ watch(refreshCounter, async () => {
#container {
width: 500px;
- > main > div {
- min-height: 100px;
- /* 테스트 */
- }
}
#ingameBoard {
diff --git a/hwe/ts/components/AutorunInfo.vue b/hwe/ts/components/AutorunInfo.vue
index ea38c91c..6e3803cb 100644
--- a/hwe/ts/components/AutorunInfo.vue
+++ b/hwe/ts/components/AutorunInfo.vue
@@ -1,5 +1,5 @@
- 자율행동
+ 자율행동