diff --git a/hwe/scss/gameEvent.scss b/hwe/scss/gameEvent.scss new file mode 100644 index 00000000..05897017 --- /dev/null +++ b/hwe/scss/gameEvent.scss @@ -0,0 +1,28 @@ +.ev_warning { + color: orangered; +} + +.ev_notice { + color: orangered; +} + +.ev_succes { + color: lightgreen; +} + +.ev_sell { + color: orange; +} + +.ev_failed { + color: orangered; +} + +.ev_highlight { + color: orangered; +} + +.hidden_but_copyable { + color: rgba(0, 0, 0, 0); + font-size: 0; +} diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 7de52731..1c4a1ba3 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -23,81 +23,13 @@ variant="sammo-base2" /> -

- {{ gameConstStore?.gameConst.title }} {{ serverName }}{{ frontInfo?.global.serverCnt }}기 - {{ frontInfo?.global.scenarioText }} -

-
-
- {{ globalInfo.scenarioText }} -
-
- NPC 수, 상성: - {{ globalInfo.extendedGeneral ? "확장" : "표준" }} - {{ globalInfo.isFiction ? "가상" : "사실" }} -
-
- NPC선택: {{ ["불가능", "가능", "선택 생성"][globalInfo.npcMode] }} -
-
- 토너먼트: 경기당 {{ calcTournamentTerm(globalInfo.turnterm) }}분 -
-
- 기타 설정: - -
-
- 현재: {{ globalInfo.year }}年 {{ globalInfo.month }}月 ({{ globalInfo.turnterm }}분 턴 서버) -
-
- 전체 접속자 수: {{ globalInfo.onlineUserCnt.toLocaleString() }}명 -
-
- 턴당 갱신횟수: {{ globalInfo.apiLimit.toLocaleString() }}회 -
-
- 등록 장수: 유저 - {{ createdUserCnt.toLocaleString() }} / {{ globalInfo.generalCntLimit.toLocaleString() }} + - NPC {{ createdNPCCnt.toLocaleString() }} 명 -
-
- - - ↑{{ formatTournamentType(frontInfo.global.tournamentType) }} - {{ tournamentStep.state }} {{ tournamentStep.nextText }} - {{ formatTime(tournamentTime).substring(11, 16) }}↑ - - - ↑{{ formatTournamentType(frontInfo.global.tournamentType) }} - {{ tournamentStep.state }} {{ tournamentStep.nextText }} - {{ formatTime(tournamentTime).substring(11, 16) }}↑ - - - 현재 토너먼트 경기 없음 -
-
- 동작 시각: {{ formatTime(lastExecuted).substring(5) }} -
-
- - {{ globalInfo.auctionCount.toLocaleString() }}건 거래 진행중 - - 진행중인 거래 없음 -
-
- - 설문 진행 중: {{ globalInfo.lastVote.title }} - - 진행중인 설문 없음 -
-
+
접속중인 국가: {{ globalInfo.onlineNations }}
【 접속자 】 {{ nationInfo?.onlineGen }}
@@ -216,11 +148,11 @@
{ try { recordLock = true; + const response = await SammoAPI.Global.GetRecentRecord({ lastGeneralRecordID: lastGeneralRecordID.value, lastWorldHistoryID: lastWorldHistoryID.value, }); recordLock = false; - if (response.flushGeneral) { - generalRecords.value = new Denque<[number, string]>(); - } - if (response.flushGlobal) { - globalRecords.value = new Denque<[number, string]>(); - } - if (response.flushHistory) { - worldHistory.value = new Denque<[number, string]>(); - } - if (response.general.length) { - lastGeneralRecordID.value = Math.max(lastGeneralRecordID.value, response.general[0][0]); - } - if (response.global.length) { - lastGeneralRecordID.value = Math.max(lastGeneralRecordID.value, response.global[0][0]); - } - if (response.history.length) { - lastWorldHistoryID.value = Math.max(lastWorldHistoryID.value, response.history[0][0]); - } + const recordIter = [ + ['flushGeneral', generalRecords, 'general'], + ['flushGlobal', globalRecords, 'global'], + ['flushHistory', worldHistory, 'history'], + ] as const; - while (response.general.length) { - const [id, record] = unwrap(response.general.pop()); - if (!generalRecords.value.isEmpty() && id <= unwrap(generalRecords.value.get(0))[0]) { - continue; + for(const [flushKey, recordRef, recordKey] of recordIter) { + if (response[flushKey]) { + recordRef.value = new Denque<[number, string]>(); } - if (generalRecords.value.length >= 15) { - generalRecords.value.pop(); + if (response[recordKey].length) { + lastGeneralRecordID.value = Math.max(lastGeneralRecordID.value, response[recordKey][0][0]); } - generalRecords.value.unshift([id, record]); - } - - while (response.global.length) { - const [id, record] = unwrap(response.global.pop()); - if (!globalRecords.value.isEmpty() && id <= unwrap(globalRecords.value.get(0))[0]) { - continue; + const subRecord = response[recordKey]; + while(subRecord.length){ + const [id, record] = unwrap(subRecord.pop()); + if(!recordRef.value.isEmpty() && id <= unwrap(recordRef.value.get(0))[0]){ + continue; + } + if(recordRef.value.length >= 15){ + recordRef.value.pop(); + } + recordRef.value.unshift([id, formatLog(record)]); } - if (globalRecords.value.length >= 15) { - globalRecords.value.pop(); - } - globalRecords.value.unshift([id, record]); - } - - while (response.history.length) { - const [id, record] = unwrap(response.history.pop()); - if (!worldHistory.value.isEmpty() && id <= unwrap(worldHistory.value.get(0))[0]) { - continue; - } - if (worldHistory.value.length >= 15) { - worldHistory.value.pop(); - } - worldHistory.value.unshift([id, record]); } } catch (e) { recordLock = false; @@ -483,16 +386,6 @@ const globalInfo = ref({} as GetFrontInfoRespons const generalInfo = ref(); const nationStaticInfo = 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; @@ -536,26 +429,6 @@ watch(refreshCounter, async () => { } }); -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; - } - } - generalCnt.value = value; - createdUserCnt.value = userCnt; - createdNPCCnt.value = npcCnt; - - tournamentStep.value = formatTournamentStep(global.tournamentState); - tournamentTime.value = parseTime(global.tournamentTime); -}); - const map = ref(); const cityPosition = getCityPosition(); @@ -599,10 +472,8 @@ watch(refreshCounter, async () => {