From cea00133d230cbc5a8aa9c3a242a29a671b9abaa Mon Sep 17 00:00:00 2001 From: Hide_D Date: Thu, 11 Aug 2022 02:29:07 +0900 Subject: [PATCH 01/61] init --- hwe/ts/PageFront.vue | 183 ++++++++++++++++++++++++++++++++++++++ hwe/ts/SammoAPI.ts | 2 +- hwe/ts/build_exports.json | 3 +- hwe/ts/defs/API/Global.ts | 2 +- hwe/ts/v_front.ts | 12 +++ hwe/v_front.php | 56 ++++++++++++ 6 files changed, 255 insertions(+), 3 deletions(-) create mode 100644 hwe/ts/PageFront.vue create mode 100644 hwe/ts/v_front.ts create mode 100644 hwe/v_front.php diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue new file mode 100644 index 00000000..392d471f --- /dev/null +++ b/hwe/ts/PageFront.vue @@ -0,0 +1,183 @@ + + + + diff --git a/hwe/ts/SammoAPI.ts b/hwe/ts/SammoAPI.ts index d13390e4..5e984e57 100644 --- a/hwe/ts/SammoAPI.ts +++ b/hwe/ts/SammoAPI.ts @@ -22,7 +22,7 @@ import type { SetBlockWarResponse, GeneralListResponse as NationGeneralListRespo import type { UploadImageResponse } from "./defs/API/Misc"; import type { GeneralLogType, GetGeneralLogResponse, JoinArgs } from "./defs/API/General"; import type { -ExecuteResponse, + ExecuteResponse, GetConstResponse, GetCurrentHistoryResponse, GetDiplomacyResponse, diff --git a/hwe/ts/build_exports.json b/hwe/ts/build_exports.json index 555bbde0..3db70d2b 100644 --- a/hwe/ts/build_exports.json +++ b/hwe/ts/build_exports.json @@ -37,6 +37,7 @@ "v_nationGeneral": "v_nationGeneral.ts", "v_globalDiplomacy": "v_globalDiplomacy", "v_troop": "v_troop.ts", - "v_vote": "v_vote.ts" + "v_vote": "v_vote.ts", + "v_front": "v_front.ts" } } \ No newline at end of file diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index 7b51ea32..7eb9039d 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -83,7 +83,7 @@ export type ExecuteResponse = { updated: boolean; locked: boolean; lastExecuted: string; -}; +} export type GetRecentRecordResponse = { result: true; diff --git a/hwe/ts/v_front.ts b/hwe/ts/v_front.ts new file mode 100644 index 00000000..26fff4d2 --- /dev/null +++ b/hwe/ts/v_front.ts @@ -0,0 +1,12 @@ +import { createApp } from 'vue' +import { BootstrapVue3, BToastPlugin } from 'bootstrap-vue-3' +import { auto500px } from './util/auto500px'; +import { htmlReady } from './util/htmlReady'; +import { insertCustomCSS } from './util/customCSS'; +import PageFront from './PageFront.vue'; +auto500px(); + +htmlReady(() => { + insertCustomCSS(); +}); +createApp(PageFront).use(BootstrapVue3).use(BToastPlugin).mount('#app'); diff --git a/hwe/v_front.php b/hwe/v_front.php new file mode 100644 index 00000000..5d8ce371 --- /dev/null +++ b/hwe/v_front.php @@ -0,0 +1,56 @@ +setReadOnly(); +$userID = Session::getUserID(); + +//턴 실행 대기 및 갱신 증가는 API에서 + +//TODO: 내 정보도 API에서, 사망 여부도 + +//TODO: 설문 및 메시지 여부도 API에서 + +//TODO: lock 정보도 API에서(턴실행대기에서 받아오기) + +//TODO: 국가정보 받아오기 + +//TODO: 시나리오 정보는 gameConst 받아올때 가져오기 + +$db = DB::db(); +$gameStor = KVStorage::getStorage($db, 'game_env'); + +$generalID = $session->generalID; +?> + + + + + + + + <?= UniqueConst::$serverName ?>: 메인 + [ + 'serverName' => $serverName, + 'serverCnt' => $serverCnt, + 'serverNick' => DB::prefix(), + 'serverID' => UniqueConst::$serverID, + 'mapName' => GameConst::$mapName, + 'unitSet' => GameConst::$unitSet, + ] + ], false) ?> + + + + + + + +
+ + + \ No newline at end of file -- 2.54.0 From 6d00966d1591e71bb1b553b8b5c711ff6da85021 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 17 Aug 2022 01:10:37 +0900 Subject: [PATCH 02/61] =?UTF-8?q?wip:=20=EB=A9=94=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EA=B0=B1=EC=8B=A0=20=EB=B2=84=ED=8A=BC=20?= =?UTF-8?q?=EC=9E=91=EB=8F=99=20=EC=8B=9C=EC=9E=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Global/GetRecentRecord.php | 65 +++++---- hwe/ts/PageFront.vue | 159 ++++++++++++++++++++--- hwe/v_front.php | 6 - 3 files changed, 169 insertions(+), 61 deletions(-) diff --git a/hwe/sammo/API/Global/GetRecentRecord.php b/hwe/sammo/API/Global/GetRecentRecord.php index ecae8dd8..edf0691d 100644 --- a/hwe/sammo/API/Global/GetRecentRecord.php +++ b/hwe/sammo/API/Global/GetRecentRecord.php @@ -16,13 +16,13 @@ class GetRecentRecord extends \sammo\BaseAPI public function validateArgs(): ?string { $v = new Validator($this->args); - $v->rule('int', 'lastGeneralRecordID') - ->rule('int', 'lastWorldHistoryID'); + $v->rule('integer', 'lastGeneralRecordID') + ->rule('integer', 'lastWorldHistoryID'); if (!$v->validate()) { return $v->errorStr(); } - $this->args['lastGeneralRecordID'] = (int)($this->args['lastGeneralRecordID']??0); - $this->args['lastWorldHistoryID'] = (int)($this->args['lastWorldHistoryID']??0); + $this->args['lastGeneralRecordID'] = (int)($this->args['lastGeneralRecordID'] ?? 0); + $this->args['lastWorldHistoryID'] = (int)($this->args['lastWorldHistoryID'] ?? 0); return null; } @@ -81,38 +81,35 @@ class GetRecentRecord extends \sammo\BaseAPI $globalRecord = $this->getGlobalRecord($lastRecordID); $generalRecord = $this->getGeneralRecord($session->generalID, $lastRecordID); - $flushHistory = true; - $flushGlobalRecord = true; - $flushGeneralRecord = true; + $flushHistory = false; + $flushGlobalRecord = false; + $flushGeneralRecord = false; - if($history){ - if(Util::array_last($history)[0] == $lastHistoryID){ - $flushHistory = false; - array_pop($history); - } - else if(count($history) > static::ROW_LIMIT){ - array_pop($history); - } + if (!$history) { + $flushHistory = false; + } else if (Util::array_last($history)[0] <= $lastHistoryID) { + $flushHistory = false; + array_pop($history); + } else if (count($history) > static::ROW_LIMIT) { + array_pop($history); } - if($globalRecord){ - if(Util::array_last($globalRecord)[0] == $lastRecordID){ - $flushGlobalRecord = false; - array_pop($globalRecord); - } - else if(count($globalRecord) > static::ROW_LIMIT){ - array_pop($globalRecord); - } + if (!$globalRecord) { + $flushGlobalRecord = false; + } else if (Util::array_last($globalRecord)[0] == $lastRecordID) { + $flushGlobalRecord = false; + array_pop($globalRecord); + } else if (count($globalRecord) > static::ROW_LIMIT) { + array_pop($globalRecord); } - if($generalRecord){ - if(Util::array_last($generalRecord)[0] == $lastRecordID){ - $flushGeneralRecord = false; - array_pop($generalRecord); - } - else if(count($generalRecord) > static::ROW_LIMIT){ - array_pop($generalRecord); - } + if (!$generalRecord) { + $flushGeneralRecord = false; + } else if (Util::array_last($generalRecord)[0] == $lastRecordID) { + $flushGeneralRecord = false; + array_pop($generalRecord); + } else if (count($generalRecord) > static::ROW_LIMIT) { + array_pop($generalRecord); } return [ @@ -120,9 +117,9 @@ class GetRecentRecord extends \sammo\BaseAPI 'history' => $history, 'global' => $globalRecord, 'general' => $generalRecord, - 'flushHistory' => $flushHistory?1:0, - 'flushGlobal' => $flushGlobalRecord?1:0, - 'flushGeneral' => $flushGeneralRecord?1:0, + 'flushHistory' => $flushHistory ? 1 : 0, + 'flushGlobal' => $flushGlobalRecord ? 1 : 0, + 'flushGeneral' => $flushGeneralRecord ? 1 : 0, ]; } } diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 392d471f..9a17c069 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -21,6 +21,7 @@
접속중인
국방
접속자
+
갱신
지도
예턴
@@ -29,9 +30,27 @@
장수 정보
국가 툴바
갱신/로비 버튼
-
장수 동향
-
개인 기록
-
중원 정세
+
+
장수 동향
+ +
+
+
개인 기록
+ +
+
+
중원 정세
+ +
툴바?
메시지 입력
전체 메시지
@@ -41,9 +60,7 @@
툴바?
-
- 서버 갱신 중입니다. -
+
서버 갱신 중입니다.
-
+
툴바?
시나리오
토너먼트/설문
@@ -26,10 +26,10 @@
지도
예턴
도시 정보
-
- +
+
-
+
{ generalInfo.value = response.general; const newLastExecuted = parseTime(response.global.lastExecuted); - if(newLastExecuted.getTime() > lastExecuted.value.getTime()){ + if (newLastExecuted.getTime() > lastExecuted.value.getTime()) { lastExecuted.value = newLastExecuted; } @@ -322,6 +322,10 @@ watch(refreshCounter, async () => { justify-content: space-between; } +.generalInfo { + width: 500px; +} + @include media-500px { #outBlock { position: absolute; diff --git a/hwe/ts/components/NationBasicCard.vue b/hwe/ts/components/NationBasicCard.vue index 47140073..16d172f3 100644 --- a/hwe/ts/components/NationBasicCard.vue +++ b/hwe/ts/components/NationBasicCard.vue @@ -1,63 +1,178 @@ + \ No newline at end of file + -- 2.54.0 From aab00fc4272274a76f0a7083e4b8a65d08879d38 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 26 Aug 2022 02:55:05 +0900 Subject: [PATCH 09/61] feat: CityBasicCard --- hwe/sammo/API/General/GetFrontInfo.php | 2 +- hwe/ts/PageFront.vue | 5 +- hwe/ts/components/CityBasicCard.vue | 228 +++++++++++++++++++++++++ 3 files changed, 233 insertions(+), 2 deletions(-) create mode 100644 hwe/ts/components/CityBasicCard.vue diff --git a/hwe/sammo/API/General/GetFrontInfo.php b/hwe/sammo/API/General/GetFrontInfo.php index 36508e4b..054a1fcb 100644 --- a/hwe/sammo/API/General/GetFrontInfo.php +++ b/hwe/sammo/API/General/GetFrontInfo.php @@ -378,7 +378,7 @@ class GetFrontInfo extends \sammo\BaseAPI $nationColor = $staticNation['color']; } - $rawOfficerList = $db->query('SELECT officer_level, name, npc FROM general WHERE city = %i AND officer_level IN (4,3,2)', $cityID); + $rawOfficerList = $db->query('SELECT officer_level, name, npc FROM general WHERE officer_city = %i AND officer_level IN (4,3,2)', $cityID); $officerList = [4 => null, 3 => null, 2 => null]; foreach ($rawOfficerList as $officer) { $officerLevel = $officer['officer_level']; diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 524cef20..c5cbe190 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -25,7 +25,9 @@
지도
예턴
-
도시 정보
+
+ +
@@ -99,6 +101,7 @@ import Denque from "denque"; import { formatLog } from "@/utilGame/formatLog"; import type { ExecuteResponse, GetFrontInfoResponse } from "./defs/API/Global"; import { delay } from "./util/delay"; +import CityBasicCard from "./components/CityBasicCard.vue"; import NationBasicCard from "./components/NationBasicCard.vue"; import GeneralBasicCard from "./components/GeneralBasicCard.vue"; import type { GeneralListItemP1 } from "./defs/API/Nation"; diff --git a/hwe/ts/components/CityBasicCard.vue b/hwe/ts/components/CityBasicCard.vue new file mode 100644 index 00000000..1584e311 --- /dev/null +++ b/hwe/ts/components/CityBasicCard.vue @@ -0,0 +1,228 @@ + + + -- 2.54.0 From a72cfc8e1cd12181aea68237a4c9a15263e686b3 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 26 Aug 2022 13:02:49 +0900 Subject: [PATCH 10/61] =?UTF-8?q?misc:=20calcTournamentTerm=20ts=20?= =?UTF-8?q?=EC=9D=B4=EC=8B=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/utilGame/index.ts | 3 ++- hwe/ts/utilGame/tournament.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 hwe/ts/utilGame/tournament.ts diff --git a/hwe/ts/utilGame/index.ts b/hwe/ts/utilGame/index.ts index d3b26892..cf9046a0 100644 --- a/hwe/ts/utilGame/index.ts +++ b/hwe/ts/utilGame/index.ts @@ -13,4 +13,5 @@ export { getNPCColor } from "./getNPCColor"; export { isValidObjKey } from "./isValidObjKey"; export { nextExpLevelRemain } from "./nextExpLevelRemain"; export { postFilterNationCommandGen } from "./postFilterNationCommandGen"; -export { isTechLimited, convTechLevel, getMaxRelativeTechLevel } from "./techLevel"; \ No newline at end of file +export { isTechLimited, convTechLevel, getMaxRelativeTechLevel } from "./techLevel"; +export { calcTournamentTerm } from "./tournament"; \ No newline at end of file diff --git a/hwe/ts/utilGame/tournament.ts b/hwe/ts/utilGame/tournament.ts new file mode 100644 index 00000000..3b740100 --- /dev/null +++ b/hwe/ts/utilGame/tournament.ts @@ -0,0 +1,4 @@ +import { clamp } from 'lodash-es'; +export function calcTournamentTerm(turnTerm: number): number{ + return clamp(turnTerm, 5, 120); +} \ No newline at end of file -- 2.54.0 From 9ed3b0a921fe5f3433a02bd54538c00cb04b8e25 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 26 Aug 2022 13:04:04 +0900 Subject: [PATCH 11/61] =?UTF-8?q?wip:=20PageFront=20=EC=83=81=EB=8B=A8=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/PageFront.vue | 39 ++++++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index c5cbe190..9e7e8a56 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -16,10 +16,32 @@
툴바?
-
시나리오
-
토너먼트/설문
-
접속중인
-
국방
+
시나리오
+
+
{{globalInfo.scenarioText}}
+
NPC 수, 상성: {{globalInfo.extendedGeneral?'확장':'표준'}} {{globalInfo.isFiction?'가상':'사실'}}
+
NPC선택: {{['불가능','가능','선택 생성'][globalInfo.npcMode]}}
+
토너먼트: 경기당 {{calcTournamentTerm(globalInfo.turnterm)}}분
+
기타 설정: (TODO)자율행동[내정, 훈련/사기진작, 사령턴, 24시간 유효]
+
현재: {{globalInfo.year}}年 {{globalInfo.month}}月 ({{globalInfo.turnterm}}분 턴 서버)
+
전체 접속자 수: {{globalInfo.onlineUserCnt.toLocaleString()}}명
+
턴당 갱신횟수: {{globalInfo.apiLimit.toLocaleString()}}회
+
+ 등록 장수: 유저 + {{globalInfo.genCount.toLocaleString()}} / {{globalInfo.generalCntLimit.toLocaleString()}} + + NPC TODO:NPC Cnt 명 +
+
TODO: tournament Text
+
동작 시각: {{formatTime(lastExecuted).substring(5)}}
+
{{globalInfo.auctionCount.toLocaleString()}}건 거래 진행중
+
진행중인 거래 없음
+
+ 설문 진행 중: {{globalInfo.lastVote.title}} +
+
진행중인 설문 없음
+
+
접속중인 국가: {{globalInfo.onlineNations}}
+
국가 방침
접속자
갱신
@@ -29,14 +51,14 @@
- +
@@ -106,6 +128,8 @@ import NationBasicCard from "./components/NationBasicCard.vue"; import GeneralBasicCard from "./components/GeneralBasicCard.vue"; import type { GeneralListItemP1 } from "./defs/API/Nation"; import type { NationStaticItem } from "./defs"; +import { formatTime } from "./util/formatTime"; +import { calcTournamentTerm } from "./utilGame"; const { serverName, serverNick, serverID } = staticValues; @@ -268,7 +292,7 @@ watch(refreshCounter, async () => { }); const frontInfo = ref(); - +const globalInfo = ref({} as GetFrontInfoResponse['global']) const generalInfo = ref(); const nationStaticInfo = ref(); @@ -284,6 +308,7 @@ watch(refreshCounter, async () => { generalInfoLock = false; frontInfo.value = response; + globalInfo.value = response.global; generalInfo.value = response.general; const newLastExecuted = parseTime(response.global.lastExecuted); -- 2.54.0 From e7e9ba2201ce57d81c587640996c5da7584bb6ee Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 25 Feb 2023 04:23:22 +0900 Subject: [PATCH 12/61] feat, refac: MessagePlate --- hwe/ts/components/MessagePlate.vue | 260 +++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 hwe/ts/components/MessagePlate.vue diff --git a/hwe/ts/components/MessagePlate.vue b/hwe/ts/components/MessagePlate.vue new file mode 100644 index 00000000..79259e99 --- /dev/null +++ b/hwe/ts/components/MessagePlate.vue @@ -0,0 +1,260 @@ + + + -- 2.54.0 From 245d363c99b45d522148cdf4e34742a2d48e5718 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 27 Feb 2023 01:21:36 +0900 Subject: [PATCH 13/61] =?UTF-8?q?feat:=20GetFrontInfo=EC=97=90=20permissio?= =?UTF-8?q?n=20=EC=A0=95=EB=B3=B4=20=ED=8F=AC=ED=95=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/General/GetFrontInfo.php | 5 +++++ hwe/ts/defs/API/Global.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/hwe/sammo/API/General/GetFrontInfo.php b/hwe/sammo/API/General/GetFrontInfo.php index 054a1fcb..c3f18991 100644 --- a/hwe/sammo/API/General/GetFrontInfo.php +++ b/hwe/sammo/API/General/GetFrontInfo.php @@ -26,6 +26,7 @@ use function sammo\checkLimit; use function sammo\getTournamentTermText; use function sammo\buildNationTypeClass; use function sammo\calcLeadershipBonus; +use function sammo\checkSecretPermission; use function sammo\getBillByLevel; use function sammo\getDed; use function sammo\getHonor; @@ -244,6 +245,8 @@ class GetFrontInfo extends \sammo\BaseAPI public function generateGeneralInfo(MeekroDB $db, General $general, array $rawNation): array { + $permission = checkSecretPermission($general->getRaw()); + $result = [ 'no' => $general->getID(), // number; 'name' => $general->getName(), // string; @@ -318,6 +321,8 @@ class GetFrontInfo extends \sammo\BaseAPI 'deathcrew' => $general->getRankVar(RankColumn::deathcrew), // number; 'firenum' => $general->getRankVar(RankColumn::firenum), // number; //P1 End + + 'permission' => $permission, ]; $nationID = $general->getNationID(); diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index b7c90451..9bd1f8be 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -133,6 +133,7 @@ export type GetFrontInfoResponse = { lastVote: VoteInfo | null; }; general: GeneralListItemP1 & { + permission: number; troopInfo?: { leader: { city: number; -- 2.54.0 From 951143120bac2fb92e88b30fbd672456f3867a5e Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 27 Feb 2023 01:54:19 +0900 Subject: [PATCH 14/61] =?UTF-8?q?fix:=20General=EA=B0=9D=EC=B2=B4=EC=97=90?= =?UTF-8?q?=EC=84=9C=20permission=EA=B3=BC=20penalty=EB=A5=BC=20=EB=B0=9B?= =?UTF-8?q?=EC=95=84=EC=98=A4=EC=A7=80=20=EC=95=8A=EB=8A=94=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/General/GetFrontInfo.php | 1 + hwe/sammo/General.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hwe/sammo/API/General/GetFrontInfo.php b/hwe/sammo/API/General/GetFrontInfo.php index c3f18991..9b2ae5fe 100644 --- a/hwe/sammo/API/General/GetFrontInfo.php +++ b/hwe/sammo/API/General/GetFrontInfo.php @@ -76,6 +76,7 @@ class GetFrontInfo extends \sammo\BaseAPI 'conlimit', ]); + $lastVote = null; if ($lastVoteID) { $voteStor = KVStorage::getStorage($db, 'vote'); $lastVote = VoteInfo::fromArray($voteStor->getValue("vote_{$lastVoteID}")); diff --git a/hwe/sammo/General.php b/hwe/sammo/General.php index bdac693a..5f715220 100644 --- a/hwe/sammo/General.php +++ b/hwe/sammo/General.php @@ -1082,7 +1082,7 @@ class General implements iAction 'personal', 'special', 'special2', 'defence_train', 'tnmt', 'npc', 'npc_org', 'deadyear', 'npcmsg', 'dex1', 'dex2', 'dex3', 'dex4', 'dex5', 'betray', 'recent_war', 'last_turn', 'myset', - 'specage', 'specage2', 'con', 'connect', 'aux', 'lastrefresh', + 'specage', 'specage2', 'con', 'connect', 'aux', 'lastrefresh', 'permission', 'penalty', ]; if ($reqColumns === null) { -- 2.54.0 From c4f8e551a5406942c72c1d9045445cd33227a656 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 27 Feb 2023 01:54:35 +0900 Subject: [PATCH 15/61] wip: MessagePanel --- hwe/ts/PageFront.vue | 16 +- hwe/ts/components/MessagePanel.vue | 236 +++++++++++++++++++++++++++++ hwe/ts/components/MessagePlate.vue | 1 - hwe/v_front.php | 1 - 4 files changed, 245 insertions(+), 9 deletions(-) create mode 100644 hwe/ts/components/MessagePanel.vue diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 9e7e8a56..465dc2ff 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -27,7 +27,7 @@
전체 접속자 수: {{globalInfo.onlineUserCnt.toLocaleString()}}명
턴당 갱신횟수: {{globalInfo.apiLimit.toLocaleString()}}회
- 등록 장수: 유저 + 등록 장수: 유저 {{globalInfo.genCount.toLocaleString()}} / {{globalInfo.generalCntLimit.toLocaleString()}} + NPC TODO:NPC Cnt 명
@@ -86,11 +86,7 @@
툴바?
-
메시지 입력
-
전체 메시지
-
국가 메시지
-
개인 메시지
-
외교 메시지
+
툴바?
@@ -126,6 +122,7 @@ import { delay } from "./util/delay"; 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 { GeneralListItemP1 } from "./defs/API/Nation"; import type { NationStaticItem } from "./defs"; import { formatTime } from "./util/formatTime"; @@ -150,7 +147,12 @@ const storeP = getGameConstStore().then((store) => { let responseLock = false; +const msgPanel = ref>(); + async function tryRefresh() { + + msgPanel.value?.tryRefresh(); + if (responseLock) { return; } @@ -293,7 +295,7 @@ watch(refreshCounter, async () => { const frontInfo = ref(); const globalInfo = ref({} as GetFrontInfoResponse['global']) -const generalInfo = ref(); +const generalInfo = ref(); const nationStaticInfo = ref(); let generalInfoLock = false; diff --git a/hwe/ts/components/MessagePanel.vue b/hwe/ts/components/MessagePanel.vue new file mode 100644 index 00000000..32e01ff1 --- /dev/null +++ b/hwe/ts/components/MessagePanel.vue @@ -0,0 +1,236 @@ + + + diff --git a/hwe/ts/components/MessagePlate.vue b/hwe/ts/components/MessagePlate.vue index 79259e99..911e39c5 100644 --- a/hwe/ts/components/MessagePlate.vue +++ b/hwe/ts/components/MessagePlate.vue @@ -143,7 +143,6 @@ watch( icon: defaultIcon, }; }, - { immediate: true } ); const deletableTimer: Ref = ref(); diff --git a/hwe/v_front.php b/hwe/v_front.php index f7fd6517..0af1d43e 100644 --- a/hwe/v_front.php +++ b/hwe/v_front.php @@ -7,7 +7,6 @@ include "func.php"; //로그인 검사 Session::requireGameLogin()->setReadOnly(); - //턴 실행 대기 및 갱신 증가는 API에서 //TODO: 내 정보도 API에서, 사망 여부도 -- 2.54.0 From dbab94bc6e9b6c78e05a3ca8edbe8b4a1bdbd6c7 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 28 Feb 2023 00:02:48 +0900 Subject: [PATCH 16/61] =?UTF-8?q?feat:=20=EB=A9=94=EC=8B=9C=EC=A7=80=20?= =?UTF-8?q?=EB=9D=84=EC=9A=B0=EA=B8=B0(wip)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Message/GetRecentMessage.php | 2 +- hwe/ts/components/MessagePanel.vue | 59 ++++++++++++++++++---- 2 files changed, 51 insertions(+), 10 deletions(-) diff --git a/hwe/sammo/API/Message/GetRecentMessage.php b/hwe/sammo/API/Message/GetRecentMessage.php index 815ba283..b157fcc1 100644 --- a/hwe/sammo/API/Message/GetRecentMessage.php +++ b/hwe/sammo/API/Message/GetRecentMessage.php @@ -29,7 +29,7 @@ class GetRecentMessage extends \sammo\BaseAPI public function getRequiredSessionMode(): int { - return static::REQ_GAME_LOGIN; + return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; } private function delayFrequentCall(Session $session): void diff --git a/hwe/ts/components/MessagePanel.vue b/hwe/ts/components/MessagePanel.vue index 32e01ff1..287b191e 100644 --- a/hwe/ts/components/MessagePanel.vue +++ b/hwe/ts/components/MessagePanel.vue @@ -20,18 +20,45 @@ +
개인 메시지
+
외교 메시지
+
@@ -42,6 +69,10 @@ import { SammoAPI } from "@/SammoAPI"; import { isString } from "lodash"; import type { MsgItem, MsgResponse, MsgType } from "@/defs/API/Message"; import MessagePlate from "@/components/MessagePlate.vue"; +import { useToast } from "bootstrap-vue-3"; +import { unwrap } from "@/util/unwrap"; + +const toasts = unwrap(useToast()); const emit = defineEmits<{ (event: "request-refresh"): void; @@ -66,7 +97,7 @@ onMounted(() => { const lastSequence = ref(-1); -const initRefreshLimit = 5; +const initRefreshLimit = 20; let refreshLimit = initRefreshLimit; const refreshP: Set> = new Set(); let lastRefreshDone = 0; @@ -93,11 +124,11 @@ function updateMsgResponse(response: MsgResponse) { } } - if(response.generalName != generalName.value){ + if (response.generalName != generalName.value) { emit("request-refresh"); return; } - if(response.nationID != nationID.value){ + if (response.nationID != nationID.value) { emit("request-refresh"); return; } @@ -107,7 +138,6 @@ function updateMsgResponse(response: MsgResponse) { for (const msgType of Object.keys(messageIndexedList) as (keyof typeof messageIndexedList)[]) { const msgList = messageIndexedList[msgType]; - const newMsgList = response[msgType]; console.log(msgType, msgList, newMsgList); if (newMsgList.length == 0) { @@ -171,11 +201,19 @@ function beginRefreshTimer() { if (refreshP.size > refreshLimit && refreshTimer) { clearInterval(refreshTimer); refreshTimer = null; - alert("서버 응답이 없습니다. 새로고침을 해주세요."); + toasts.danger( + { + title: "메시지 자동 갱신 실패", + body: "서버 응답이 없습니다. 새로고침을 해주세요.", + }, + { + delay: 1000 * 3600, + } + ); return; } - refreshP.add(tryRefresh()); + void tryRefresh(); } }, 2500); } @@ -196,15 +234,17 @@ async function tryRefresh() { if (lastRefreshDone < now) { lastRefreshDone = now; } - } catch (e) { if (isString(e)) { - alert(e); + toasts.warning({ + title: '갱신 실패', + body: e, + }); } console.error(e); } - if(!response){ + if (!response) { return false; } @@ -214,6 +254,7 @@ async function tryRefresh() { })(); void waiterP.then((result) => { if (!result) { + console.error("?! result"); refreshLimit--; } else { refreshLimit = initRefreshLimit; -- 2.54.0 From 35ae7d95e734b90530f0e634bbcc24a0751c1216 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Tue, 28 Feb 2023 00:17:24 +0900 Subject: [PATCH 17/61] rollback: GetRecentMessage --- hwe/sammo/API/Message/GetRecentMessage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/sammo/API/Message/GetRecentMessage.php b/hwe/sammo/API/Message/GetRecentMessage.php index b157fcc1..815ba283 100644 --- a/hwe/sammo/API/Message/GetRecentMessage.php +++ b/hwe/sammo/API/Message/GetRecentMessage.php @@ -29,7 +29,7 @@ class GetRecentMessage extends \sammo\BaseAPI public function getRequiredSessionMode(): int { - return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY; + return static::REQ_GAME_LOGIN; } private function delayFrequentCall(Session $session): void -- 2.54.0 From 073d1c22360dbad7ad3ecd0f5cbc12879a1c1a02 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Wed, 1 Mar 2023 01:06:58 +0900 Subject: [PATCH 18/61] =?UTF-8?q?feat:=20=EB=A9=94=EC=9D=B8=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=A7=80=EB=8F=84=20=ED=91=9C=EA=B8=B0(wi?= =?UTF-8?q?p)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/scss/map.scss | 2 + hwe/ts/PageFront.vue | 96 ++++++++++++++++++++++++++++++++++---------- hwe/v_front.php | 2 + 3 files changed, 79 insertions(+), 21 deletions(-) diff --git a/hwe/scss/map.scss b/hwe/scss/map.scss index 26d500ba..178436a7 100644 --- a/hwe/scss/map.scss +++ b/hwe/scss/map.scss @@ -1,3 +1,5 @@ +@charset 'utf-8'; + .map_title_tooltiptext .tooltip-inner { max-width: 220px; width: 220px; diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 465dc2ff..020e1109 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -18,34 +18,55 @@
툴바?
시나리오
-
{{globalInfo.scenarioText}}
-
NPC 수, 상성: {{globalInfo.extendedGeneral?'확장':'표준'}} {{globalInfo.isFiction?'가상':'사실'}}
-
NPC선택: {{['불가능','가능','선택 생성'][globalInfo.npcMode]}}
-
토너먼트: 경기당 {{calcTournamentTerm(globalInfo.turnterm)}}분
+
{{ globalInfo.scenarioText }}
+
+ NPC 수, 상성: {{ globalInfo.extendedGeneral ? "확장" : "표준" }} + {{ globalInfo.isFiction ? "가상" : "사실" }} +
+
NPC선택: {{ ["불가능", "가능", "선택 생성"][globalInfo.npcMode] }}
+
토너먼트: 경기당 {{ calcTournamentTerm(globalInfo.turnterm) }}분
기타 설정: (TODO)자율행동[내정, 훈련/사기진작, 사령턴, 24시간 유효]
-
현재: {{globalInfo.year}}年 {{globalInfo.month}}月 ({{globalInfo.turnterm}}분 턴 서버)
-
전체 접속자 수: {{globalInfo.onlineUserCnt.toLocaleString()}}명
-
턴당 갱신횟수: {{globalInfo.apiLimit.toLocaleString()}}회
+
+ 현재: {{ globalInfo.year }}年 {{ globalInfo.month }}月 ({{ globalInfo.turnterm }}분 턴 서버) +
+
전체 접속자 수: {{ globalInfo.onlineUserCnt.toLocaleString() }}명
+
턴당 갱신횟수: {{ globalInfo.apiLimit.toLocaleString() }}회
등록 장수: 유저 - {{globalInfo.genCount.toLocaleString()}} / {{globalInfo.generalCntLimit.toLocaleString()}} + {{ globalInfo.genCount.toLocaleString() }} / {{ globalInfo.generalCntLimit.toLocaleString() }} + NPC TODO:NPC Cnt 명
TODO: tournament Text
-
동작 시각: {{formatTime(lastExecuted).substring(5)}}
-
{{globalInfo.auctionCount.toLocaleString()}}건 거래 진행중
-
진행중인 거래 없음
-
- 설문 진행 중: {{globalInfo.lastVote.title}} +
+ 동작 시각: {{ formatTime(lastExecuted).substring(5) }}
-
진행중인 설문 없음
+
+ {{ globalInfo.auctionCount.toLocaleString() }}건 거래 진행중 +
+
진행중인 거래 없음
+
+ 설문 진행 중: {{ globalInfo.lastVote.title }} +
+
진행중인 설문 없음
-
접속중인 국가: {{globalInfo.onlineNations}}
+
접속중인 국가: {{ globalInfo.onlineNations }}
국가 방침
접속자
갱신
-
지도
+
+ +
예턴
@@ -86,7 +107,14 @@
툴바?
- +
툴바?
@@ -106,6 +134,10 @@ declare const staticValues: { mapName: string; unitSet: string; }; + +declare const getCityPosition: () => CityPositionMap; +declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed; + -- 2.54.0 From a2b800b2efed6d9b7f5a01a1caf07b6c40d148fc Mon Sep 17 00:00:00 2001 From: Hide_D Date: Fri, 3 Mar 2023 02:15:57 +0900 Subject: [PATCH 27/61] =?UTF-8?q?feat:=20=EC=A4=91=EC=95=99=20=EC=BB=A8?= =?UTF-8?q?=ED=8A=B8=EB=A1=A4=20=EB=B0=94(wip)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/PageFront.vue | 43 +++++++--- hwe/ts/components/MainControlBar.vue | 117 +++++++++++++++++++++++++++ 2 files changed, 150 insertions(+), 10 deletions(-) create mode 100644 hwe/ts/components/MainControlBar.vue diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index cc9ca4d3..0fd29705 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -104,7 +104,16 @@ /> -
국가 툴바
+
+ +
@@ -179,7 +188,7 @@ declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed; + + -- 2.54.0 From 72657692ee51d0c6ec24f01469bb3f3512d7b11b Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 17:10:58 +0900 Subject: [PATCH 28/61] =?UTF-8?q?feat:=20GlobalMenu=20API=20-=20GlobalMenu?= =?UTF-8?q?=20=EC=9E=91=EC=84=B1=EC=9A=A9=20DTO(MenuItem,=20MenuMulti,=20M?= =?UTF-8?q?enuSplit)=20-=20d=5Fsetting=EC=97=90=20GlobalMenu=EB=A5=BC=20?= =?UTF-8?q?=EC=A7=81=EC=A0=91=20=EC=9E=91=EC=84=B1=20=EA=B0=80=EB=8A=A5?= =?UTF-8?q?=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=A0=9C=EA=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/d_setting/GlobalMenu.orig.php | 53 ++++++++++++++++++++++++++ hwe/sammo/API/Global/GetGlobalMenu.php | 47 +++++++++++++++++++++++ hwe/sammo/DTO/MenuItem.php | 26 +++++++++++++ hwe/sammo/DTO/MenuMulti.php | 19 +++++++++ hwe/sammo/DTO/MenuSplit.php | 20 ++++++++++ hwe/sammo/GlobalMenu.php | 53 ++++++++++++++++++++++++++ hwe/ts/SammoAPI.ts | 2 + hwe/ts/defs/API/Global.ts | 26 +++++++++++++ 8 files changed, 246 insertions(+) create mode 100644 hwe/d_setting/GlobalMenu.orig.php create mode 100644 hwe/sammo/API/Global/GetGlobalMenu.php create mode 100644 hwe/sammo/DTO/MenuItem.php create mode 100644 hwe/sammo/DTO/MenuMulti.php create mode 100644 hwe/sammo/DTO/MenuSplit.php create mode 100644 hwe/sammo/GlobalMenu.php diff --git a/hwe/d_setting/GlobalMenu.orig.php b/hwe/d_setting/GlobalMenu.orig.php new file mode 100644 index 00000000..53c203dd --- /dev/null +++ b/hwe/d_setting/GlobalMenu.orig.php @@ -0,0 +1,53 @@ + true, + 'menu' => array_map(function (DTO $dto) { + return $dto->toArray(); + }, GlobalMenu::getMenu()), + ]; + } + public function tryCache(): ?APICacheResult + { + $version = GlobalMenu::version; + return new APICacheResult( + null, + "v{$version}", + 60 * 60 * 6, + true + ); + } +} diff --git a/hwe/sammo/DTO/MenuItem.php b/hwe/sammo/DTO/MenuItem.php new file mode 100644 index 00000000..1c3f1231 --- /dev/null +++ b/hwe/sammo/DTO/MenuItem.php @@ -0,0 +1,26 @@ +type = 'item'; + } +} \ No newline at end of file diff --git a/hwe/sammo/DTO/MenuMulti.php b/hwe/sammo/DTO/MenuMulti.php new file mode 100644 index 00000000..e3275e9a --- /dev/null +++ b/hwe/sammo/DTO/MenuMulti.php @@ -0,0 +1,19 @@ +type = 'multi'; + } +} \ No newline at end of file diff --git a/hwe/sammo/DTO/MenuSplit.php b/hwe/sammo/DTO/MenuSplit.php new file mode 100644 index 00000000..a01df416 --- /dev/null +++ b/hwe/sammo/DTO/MenuSplit.php @@ -0,0 +1,20 @@ +type = 'split'; + } +} \ No newline at end of file diff --git a/hwe/sammo/GlobalMenu.php b/hwe/sammo/GlobalMenu.php new file mode 100644 index 00000000..11c2fa02 --- /dev/null +++ b/hwe/sammo/GlobalMenu.php @@ -0,0 +1,53 @@ +, + GetGlobalMenu: GET as APICallT, }, InheritAction: { BuyHiddenBuff: PUT as APICallT<{ diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index 4ad0618a..fbc0ff69 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -218,3 +218,29 @@ export type GetFrontInfoResponse = { >; }; }; + +export type MenuItem = { + type: 'item'; + name: string; + url: string; + icon?: string; + newTab?: boolean; + condHightlightVar?: string; + condShowVar?: string; +} + +export type MenuSplit = { + type: 'split'; + main: MenuItem; + subMenu: MenuItem[]; +} + +export type MenuMulti = { + type: 'multi'; + subMenu: MenuItem[]; +} + +export type GetMenuResponse = { + result: true; + menu: (MenuItem | MenuSplit | MenuMulti)[]; +} \ No newline at end of file -- 2.54.0 From f9ba185158f63179a4c307bd6bbda4b4cfa35f06 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 20:02:58 +0900 Subject: [PATCH 29/61] =?UTF-8?q?feat:=20MenuMulti=EC=97=90=EC=84=9C?= =?UTF-8?q?=EB=8A=94=20=EB=8C=80=ED=91=9C=20=EC=9D=B4=EB=A6=84=20=EC=84=A4?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/d_setting/GlobalMenu.orig.php | 4 ++-- hwe/sammo/DTO/MenuMulti.php | 1 + hwe/sammo/GlobalMenu.php | 4 ++-- hwe/ts/defs/API/Global.ts | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/hwe/d_setting/GlobalMenu.orig.php b/hwe/d_setting/GlobalMenu.orig.php index 53c203dd..d064a2f4 100644 --- a/hwe/d_setting/GlobalMenu.orig.php +++ b/hwe/d_setting/GlobalMenu.orig.php @@ -19,7 +19,7 @@ class GlobalMenu { } static::$menu = [ new MenuItem('천통국 베팅', 'v_nationBetting.php', condHighlightVar: 'nationBetting'), - new MenuMulti([ + new MenuMulti('게임정보', [ new MenuItem('세력일람', 'a_kingdomList.php', newTab: true), new MenuItem('장수일람', 'a_genList.php', newTab: true), new MenuItem('명장일람', 'a_bestGeneral.php', newTab: true), @@ -42,7 +42,7 @@ class GlobalMenu { ], ), new MenuItem('전투 시뮬레이터', 'battle_simulator.php', newTab: true), - new MenuMulti([ + new MenuMulti('기타 정보', [ new MenuItem('접속량정보', 'a_traffic.php', newTab: true), new MenuItem('빙의일람', 'a_npcList', newTab: true, condShowVar: 'npcMode'), ]), diff --git a/hwe/sammo/DTO/MenuMulti.php b/hwe/sammo/DTO/MenuMulti.php index e3275e9a..d3204595 100644 --- a/hwe/sammo/DTO/MenuMulti.php +++ b/hwe/sammo/DTO/MenuMulti.php @@ -11,6 +11,7 @@ class MenuMulti extends DTO{ /** @param MenuItem[] $subMenu */ public function __construct( + public string $name, #[Convert(ArrayConverter::class, [DTO::class])] public array $subMenu, ){ diff --git a/hwe/sammo/GlobalMenu.php b/hwe/sammo/GlobalMenu.php index 11c2fa02..33087809 100644 --- a/hwe/sammo/GlobalMenu.php +++ b/hwe/sammo/GlobalMenu.php @@ -19,7 +19,7 @@ class GlobalMenu { } static::$menu = [ new MenuItem('천통국 베팅', 'v_nationBetting.php', condHighlightVar: 'nationBetting'), - new MenuMulti([ + new MenuMulti('게임정보', [ new MenuItem('세력일람', 'a_kingdomList.php', newTab: true), new MenuItem('장수일람', 'a_genList.php', newTab: true), new MenuItem('명장일람', 'a_bestGeneral.php', newTab: true), @@ -42,7 +42,7 @@ class GlobalMenu { ], ), new MenuItem('전투 시뮬레이터', 'battle_simulator.php', newTab: true), - new MenuMulti([ + new MenuMulti('기타 정보', [ new MenuItem('접속량정보', 'a_traffic.php', newTab: true), new MenuItem('빙의일람', 'a_npcList', newTab: true, condShowVar: 'npcMode'), ]), diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index fbc0ff69..81b8338e 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -237,6 +237,7 @@ export type MenuSplit = { export type MenuMulti = { type: 'multi'; + name: MenuItem; subMenu: MenuItem[]; } -- 2.54.0 From 587a11107222abaf97032bd16dcea7a3fb7e2d39 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 20:36:34 +0900 Subject: [PATCH 30/61] =?UTF-8?q?fix:=20MenuMulti=20=ED=83=80=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/defs/API/Global.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index 81b8338e..33674e9f 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -237,7 +237,7 @@ export type MenuSplit = { export type MenuMulti = { type: 'multi'; - name: MenuItem; + name: string; subMenu: MenuItem[]; } -- 2.54.0 From 7a7cacd8d05d0265212c3a3e89c2a85b324ae2c4 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 22:03:28 +0900 Subject: [PATCH 31/61] feat: GlobalMenu Component(wip) --- hwe/ts/PageFront.vue | 41 +++++++- hwe/ts/components/GlobalMenu.vue | 154 +++++++++++++++++++++++++++++++ 2 files changed, 190 insertions(+), 5 deletions(-) create mode 100644 hwe/ts/components/GlobalMenu.vue diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 0fd29705..0d1c7109 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -15,7 +15,14 @@
-
툴바?
+
+ +
시나리오
{{ globalInfo.scenarioText }}
@@ -111,7 +118,7 @@ :showSecret="showSecret" :myLevel="generalInfo.officerLevel" :nationLevel="nationStaticInfo?.level ?? 0" - :nationColor="nationStaticInfo?.color.substring(1,7) ?? '000000'" + :nationColor="nationStaticInfo?.color.substring(1, 7) ?? '000000'" />
@@ -162,7 +169,14 @@ :permissionLevel="generalInfo.permission" ref="msgPanel" /> -
툴바?
+
+ +
서버 갱신 중입니다.
@@ -188,14 +202,14 @@ declare const formatCityInfo: (city: MapCityParsedRaw) => MapCityParsed; + + -- 2.54.0 From db428e5b0d1086903f2763c1a9383686394f7d30 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 22:39:54 +0900 Subject: [PATCH 32/61] =?UTF-8?q?feat:=20GetNationInfo=EC=97=90=20?= =?UTF-8?q?=EA=B5=AD=EB=B0=A9=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Nation/GetNationInfo.php | 6 +++++- hwe/ts/defs/API/Nation.ts | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hwe/sammo/API/Nation/GetNationInfo.php b/hwe/sammo/API/Nation/GetNationInfo.php index fe0c2fd0..8f836f05 100644 --- a/hwe/sammo/API/Nation/GetNationInfo.php +++ b/hwe/sammo/API/Nation/GetNationInfo.php @@ -94,11 +94,15 @@ class GetNationInfo extends \sammo\BaseAPI $troopName[$troopID] = $tName; } - return [ + $result = [ 'result' => true, + 'isFull' => $isFull, 'nation' => $nation, 'impossibleStrategicCommandLists' => $impossibleStrategicCommandLists, + 'nationNotice' => $nationStor->nationNotice, 'troops' => $troopName, ]; + + return $result; } } diff --git a/hwe/ts/defs/API/Nation.ts b/hwe/ts/defs/API/Nation.ts index 85b26c67..c2124ff4 100644 --- a/hwe/ts/defs/API/Nation.ts +++ b/hwe/ts/defs/API/Nation.ts @@ -156,6 +156,8 @@ export type NationInfoResponse = }) | (ValidResponse & { nation: NationItem; + isFull: true, impossibleStrategicCommandLists: [string, number][]; + nationNotice: string, troops: Record; }); -- 2.54.0 From 555b4c9cc6e132040d7bd68b064391b73b2ccf97 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 23:02:24 +0900 Subject: [PATCH 33/61] feat: GetNationInfo Full Type --- hwe/ts/defs/API/Nation.ts | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/hwe/ts/defs/API/Nation.ts b/hwe/ts/defs/API/Nation.ts index c2124ff4..e77dc5a8 100644 --- a/hwe/ts/defs/API/Nation.ts +++ b/hwe/ts/defs/API/Nation.ts @@ -150,14 +150,17 @@ export type LiteNationInfoResponse = ValidResponse & { nation: NationStaticItem; }; +export type NationInfoFull = ValidResponse & { + nation: NationItem; + isFull: true, + impossibleStrategicCommandLists: [string, number][]; + nationNotice: string, + troops: Record; +} + export type NationInfoResponse = | (ValidResponse & { nation: NationStaticItem; + isFull?: false; }) - | (ValidResponse & { - nation: NationItem; - isFull: true, - impossibleStrategicCommandLists: [string, number][]; - nationNotice: string, - troops: Record; - }); + | NationInfoFull; -- 2.54.0 From 8f0057ff5134793e7ce6dcb53057926fdb85b55d Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 23:45:23 +0900 Subject: [PATCH 34/61] fix: GetNationInfo Full mode --- hwe/sammo/API/Nation/GetNationInfo.php | 4 ++-- hwe/ts/defs/API/Nation.ts | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hwe/sammo/API/Nation/GetNationInfo.php b/hwe/sammo/API/Nation/GetNationInfo.php index 8f836f05..63d73bd4 100644 --- a/hwe/sammo/API/Nation/GetNationInfo.php +++ b/hwe/sammo/API/Nation/GetNationInfo.php @@ -27,7 +27,7 @@ class GetNationInfo extends \sammo\BaseAPI public function validateArgs(): ?string { $v = new Validator($this->args); - $v->rule('boolean', 'full'); + $v->rule('in', 'full', ['true', 'false']); if (!$v->validate()) { return $v->errorStr(); @@ -70,7 +70,7 @@ class GetNationInfo extends \sammo\BaseAPI $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', + '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 nation = %i', $nationID ); $nationStor = \sammo\KVStorage::getStorage($db, $nationID, 'nation_env'); diff --git a/hwe/ts/defs/API/Nation.ts b/hwe/ts/defs/API/Nation.ts index e77dc5a8..34f2f340 100644 --- a/hwe/ts/defs/API/Nation.ts +++ b/hwe/ts/defs/API/Nation.ts @@ -154,10 +154,17 @@ export type NationInfoFull = ValidResponse & { nation: NationItem; isFull: true, impossibleStrategicCommandLists: [string, number][]; - nationNotice: string, + nationNotice: NationNotice, troops: Record; } +export type NationNotice = { + date: string, + msg: string, + author: string, + authorID: number, +} + export type NationInfoResponse = | (ValidResponse & { nation: NationStaticItem; -- 2.54.0 From ba27c95653d50c8d88af277cf3a7018a7e91fdb9 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 4 Mar 2023 23:45:41 +0900 Subject: [PATCH 35/61] misc: dbg message --- hwe/ts/components/MessagePanel.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/hwe/ts/components/MessagePanel.vue b/hwe/ts/components/MessagePanel.vue index 287b191e..bc789b44 100644 --- a/hwe/ts/components/MessagePanel.vue +++ b/hwe/ts/components/MessagePanel.vue @@ -139,7 +139,6 @@ function updateMsgResponse(response: MsgResponse) { const msgList = messageIndexedList[msgType]; const newMsgList = response[msgType]; - console.log(msgType, msgList, newMsgList); if (newMsgList.length == 0) { continue; } -- 2.54.0 From abccc7c2684c47a8a00fab1fcb4844238cd242a0 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 5 Mar 2023 00:06:37 +0900 Subject: [PATCH 36/61] =?UTF-8?q?feat:=20PageFront=20=EA=B5=AD=EA=B0=80?= =?UTF-8?q?=EB=B0=A9=EC=B9=A8=20=EC=B6=9C=EB=A0=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/PageFront.vue | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 0d1c7109..804847fa 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -61,7 +61,10 @@
접속중인 국가: {{ globalInfo.onlineNations }}
접속자
-
국가 방침
+
국가 방침 + +
+
@@ -215,7 +218,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 { GeneralListItemP1 } 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"; @@ -428,7 +431,7 @@ const frontInfo = ref(); const globalInfo = ref({} as GetFrontInfoResponse["global"]); const generalInfo = ref(); const nationStaticInfo = ref(); - +const nationInfo = ref(); let generalInfoLock = false; watch(refreshCounter, async () => { @@ -470,6 +473,23 @@ watch(refreshCounter, async () => { } }); +watch(refreshCounter, async () => { + try { + const response = await SammoAPI.Nation.GetNationInfo({full: true}); + console.log('nation', response); + if(!response.isFull){ + throw 'NationInfo 반환값 에러'; + } + nationInfo.value = response; + } catch (e) { + console.error(e); + toasts.danger({ + title: "국가 정보 갱신 실패", + body: `${e}`, + }); + } +}); + const map = ref(); const cityPosition = getCityPosition(); @@ -532,6 +552,12 @@ watch(refreshCounter, async () => { display: grid; } +.nationNoticeBody{ + :deep(p) { + min-height: 1em; + } +} + @include media-500px { #outBlock { position: absolute; -- 2.54.0 From f1219c5db423f9c35be3c62297a45cef8a8531be Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 5 Mar 2023 00:35:18 +0900 Subject: [PATCH 37/61] =?UTF-8?q?feat:=20GetFrontInfo=EC=97=90=20serverCnt?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/General/GetFrontInfo.php | 3 +++ hwe/ts/defs/API/Global.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/hwe/sammo/API/General/GetFrontInfo.php b/hwe/sammo/API/General/GetFrontInfo.php index 9b2ae5fe..207c881d 100644 --- a/hwe/sammo/API/General/GetFrontInfo.php +++ b/hwe/sammo/API/General/GetFrontInfo.php @@ -66,6 +66,7 @@ class GetFrontInfo extends \sammo\BaseAPI $year, $month, $startYear, $generalCntLimit, $apiLimit, + $serverCnt, ] = $gameStor->getValuesAsArray([ 'scenario_text', 'extended_general', 'fiction', 'npcmode', 'join_mode', 'autorun_user', 'turnterm', 'turntime', @@ -74,6 +75,7 @@ class GetFrontInfo extends \sammo\BaseAPI 'year', 'month', 'startyear', 'maxgeneral', 'conlimit', + 'server_cnt', ]); $lastVote = null; @@ -122,6 +124,7 @@ class GetFrontInfo extends \sammo\BaseAPI 'tournamentState' => $tournamentState, 'genCount' => $globalGenCount, 'generalCntLimit' => $generalCntLimit, + 'serverCnt' => $serverCnt, 'lastVote' => $lastVote === null ? null : $lastVote->toArray(), ]; } diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index 33674e9f..8e934dc4 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -133,6 +133,7 @@ export type GetFrontInfoResponse = { tournamentState: string; genCount: number; generalCntLimit: number; + serverCnt: number; lastVote: VoteInfo | null; }; general: GeneralListItemP1 & { -- 2.54.0 From 230a7d888ca7ec77b23d1aaf9cb1bdd3a2c085a2 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 5 Mar 2023 00:47:17 +0900 Subject: [PATCH 38/61] =?UTF-8?q?fix:=20GetFrontInfo=EC=9D=98=20genCount?= =?UTF-8?q?=20=ED=91=9C=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/defs/API/Global.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hwe/ts/defs/API/Global.ts b/hwe/ts/defs/API/Global.ts index 8e934dc4..dcf771ab 100644 --- a/hwe/ts/defs/API/Global.ts +++ b/hwe/ts/defs/API/Global.ts @@ -131,7 +131,7 @@ export type GetFrontInfoResponse = { isLocked: boolean; tournamentType: null | 0 | 1 | 2 | 3; tournamentState: string; - genCount: number; + genCount: [number, number][]; generalCntLimit: number; serverCnt: number; lastVote: VoteInfo | null; -- 2.54.0 From 5fde900554a3ef24facefe78575cd1ea38257ba3 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 5 Mar 2023 01:38:37 +0900 Subject: [PATCH 39/61] =?UTF-8?q?fix:=20GetNationInfo=EC=97=90=EB=8A=94=20?= =?UTF-8?q?nationNotice=EA=B0=80=20=ED=95=84=EC=9A=94=ED=95=98=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Nation/GetNationInfo.php | 1 - hwe/ts/defs/API/Nation.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/hwe/sammo/API/Nation/GetNationInfo.php b/hwe/sammo/API/Nation/GetNationInfo.php index 63d73bd4..f7eae16f 100644 --- a/hwe/sammo/API/Nation/GetNationInfo.php +++ b/hwe/sammo/API/Nation/GetNationInfo.php @@ -99,7 +99,6 @@ class GetNationInfo extends \sammo\BaseAPI 'isFull' => $isFull, 'nation' => $nation, 'impossibleStrategicCommandLists' => $impossibleStrategicCommandLists, - 'nationNotice' => $nationStor->nationNotice, 'troops' => $troopName, ]; diff --git a/hwe/ts/defs/API/Nation.ts b/hwe/ts/defs/API/Nation.ts index 34f2f340..161fef06 100644 --- a/hwe/ts/defs/API/Nation.ts +++ b/hwe/ts/defs/API/Nation.ts @@ -154,7 +154,6 @@ export type NationInfoFull = ValidResponse & { nation: NationItem; isFull: true, impossibleStrategicCommandLists: [string, number][]; - nationNotice: NationNotice, troops: Record; } -- 2.54.0 From 5dabdb263616148acd4f5f00090b9886ac3a9999 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 5 Mar 2023 01:43:20 +0900 Subject: [PATCH 40/61] =?UTF-8?q?feat:=20PageFront=20=EC=83=81=EB=8B=A8=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4(wip)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/General/GetFrontInfo.php | 6 +- hwe/ts/PageFront.vue | 156 +++++++++++++++++-------- hwe/ts/components/AutorunInfo.vue | 2 +- hwe/ts/defs/API/Global.ts | 9 +- hwe/ts/utilGame/formatTournament.ts | 35 ++++++ 5 files changed, 155 insertions(+), 53 deletions(-) create mode 100644 hwe/ts/utilGame/formatTournament.ts diff --git a/hwe/sammo/API/General/GetFrontInfo.php b/hwe/sammo/API/General/GetFrontInfo.php index 207c881d..b0cba471 100644 --- a/hwe/sammo/API/General/GetFrontInfo.php +++ b/hwe/sammo/API/General/GetFrontInfo.php @@ -92,7 +92,8 @@ class GetFrontInfo extends \sammo\BaseAPI $isTournamentApplicationOpen = $gameStor->tournament == 1; $isBettingActive = $gameStor->tournament == 6; $tournamentType = $gameStor->tnmt_type; - $tournamentState = getTournamentTermText($gameStor->turnterm); + $tournamentState = $gameStor->tournament; + $tournamentTime = $gameStor->tnmt_time; $isLocked = boolval($db->queryFirstField('SELECT plock FROM plock WHERE `type`="GAME" LIMIT 1')); $globalGenCount = $db->queryAllLists('SELECT npc, count(no) FROM general GROUP BY npc'); @@ -122,6 +123,7 @@ class GetFrontInfo extends \sammo\BaseAPI 'isLocked' => $isLocked, 'tournamentType' => $tournamentType, 'tournamentState' => $tournamentState, + 'tournamentTime' => $tournamentTime, 'genCount' => $globalGenCount, 'generalCntLimit' => $generalCntLimit, 'serverCnt' => $serverCnt, @@ -176,6 +178,7 @@ class GetFrontInfo extends \sammo\BaseAPI return [ 'id' => $nationID, + 'full' => true, 'name' => $rawNation['name'], 'population' => $nationPopulation, 'crew' => $nationCrew, @@ -214,6 +217,7 @@ class GetFrontInfo extends \sammo\BaseAPI $staticInfo = getNationStaticInfo(0); return [ 'id' => 0, + 'full' => false, 'name' => $staticInfo['name'], 'population' => [ 'cityCnt' => 0, diff --git a/hwe/ts/PageFront.vue b/hwe/ts/PageFront.vue index 804847fa..259ee453 100644 --- a/hwe/ts/PageFront.vue +++ b/hwe/ts/PageFront.vue @@ -23,47 +23,87 @@ variant="sammo-base2" />
-
시나리오
-
-
{{ globalInfo.scenarioText }}
-
- NPC 수, 상성: {{ globalInfo.extendedGeneral ? "확장" : "표준" }} +

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

+
+
+ {{ globalInfo.scenarioText }} +
+
+ NPC 수, 상성: + {{ globalInfo.extendedGeneral ? "확장" : "표준" }} {{ globalInfo.isFiction ? "가상" : "사실" }}
-
NPC선택: {{ ["불가능", "가능", "선택 생성"][globalInfo.npcMode] }}
-
토너먼트: 경기당 {{ calcTournamentTerm(globalInfo.turnterm) }}분
-
+
+ NPC선택: {{ ["불가능", "가능", "선택 생성"][globalInfo.npcMode] }} +
+
+ 토너먼트: 경기당 {{ calcTournamentTerm(globalInfo.turnterm) }}분 +
+
기타 설정:
-
+
현재: {{ globalInfo.year }}年 {{ globalInfo.month }}月 ({{ globalInfo.turnterm }}분 턴 서버)
-
전체 접속자 수: {{ globalInfo.onlineUserCnt.toLocaleString() }}명
-
턴당 갱신횟수: {{ globalInfo.apiLimit.toLocaleString() }}회
-
- 등록 장수: 유저 - {{ globalInfo.genCount.toLocaleString() }} / {{ globalInfo.generalCntLimit.toLocaleString() }} - + NPC TODO:NPC Cnt 명 +
+ 전체 접속자 수: {{ globalInfo.onlineUserCnt.toLocaleString() }}명
-
TODO: tournament Text
-
+
+ 턴당 갱신횟수: {{ 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 }}
-
접속자
-
국가 방침 +
접속중인 국가: {{ 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 @@ + + \ No newline at end of file diff --git a/hwe/ts/components/MessagePlate.vue b/hwe/ts/components/MessagePlate.vue index 911e39c5..e881ce5d 100644 --- a/hwe/ts/components/MessagePlate.vue +++ b/hwe/ts/components/MessagePlate.vue @@ -2,7 +2,7 @@
@@ -54,7 +54,7 @@ @@ -109,9 +109,9 @@ const emit = defineEmits<{ }>(); const src: Ref = ref(props.modelValue.src); -const dest: Ref = ref(props.modelValue.src); -const srcColorType = computed(() => isBrightColor(src.value.color)) ? "bright" : "dark"; -const destColorType = computed(() => isBrightColor(dest.value.color)) ? "bright" : "dark"; +const dest: Ref = ref(props.modelValue.dest ?? props.modelValue.src); +const srcColorType = computed(() => isBrightColor(src.value.color) ? "bright" : "dark"); +const destColorType = computed(() => isBrightColor(dest.value.color) ? "bright" : "dark"); const msg = toRef(props, "modelValue"); const defaultIcon = `${window.pathConfig.sharedIcon}/default.jpg`; @@ -257,3 +257,104 @@ async function tryDecline() { emit("request-refresh"); } + + \ No newline at end of file -- 2.54.0 From f056ef9da3fc8564c2a900dd1ebf6a075169eb2f Mon Sep 17 00:00:00 2001 From: Hide_D Date: Mon, 6 Mar 2023 02:17:17 +0900 Subject: [PATCH 43/61] =?UTF-8?q?feat:=20PageFront=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EC=9E=85=EB=A0=A5(wip)=20-=20'=EC=A6=90=EA=B2=A8?= =?UTF-8?q?=EC=B0=BE=EA=B8=B0'=20=EA=B8=B0=EB=8A=A5=20=EC=97=86=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/MessagePanel.vue | 233 ++++++++++++++++++++++++++--- 1 file changed, 216 insertions(+), 17 deletions(-) diff --git a/hwe/ts/components/MessagePanel.vue b/hwe/ts/components/MessagePanel.vue index df27ee9d..932bc9bc 100644 --- a/hwe/ts/components/MessagePanel.vue +++ b/hwe/ts/components/MessagePanel.vue @@ -1,6 +1,38 @@ @@ -591,6 +591,12 @@ onMounted(async () => { .only-mobile { display: none; } + + .MessageList{ + overflow-y: auto; + overflow-x: hidden; + height: 650px; + } } @include media-500px { -- 2.54.0 From e404f3145c24932207a0fa320de8a62daf151544 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Thu, 9 Mar 2023 01:16:13 +0900 Subject: [PATCH 55/61] =?UTF-8?q?feat:=20SendMessage=20=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=EB=AC=BC=EC=9D=98=20=EB=A9=94=EC=8B=9C=EC=A7=80=20=ED=83=80?= =?UTF-8?q?=EC=9E=85=EC=9D=84=20=EB=B0=98=ED=99=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Message/SendMessage.php | 4 ++++ hwe/ts/SammoAPI.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hwe/sammo/API/Message/SendMessage.php b/hwe/sammo/API/Message/SendMessage.php index b9564087..96452624 100644 --- a/hwe/sammo/API/Message/SendMessage.php +++ b/hwe/sammo/API/Message/SendMessage.php @@ -185,6 +185,7 @@ class SendMessage extends \sammo\BaseAPI if ($mailbox === Message::MAILBOX_PUBLIC) { $msgID = $this->genPublicMessage($src, $text)->send(); return [ + 'msgType' => 'public', 'msgID' => $msgID ]; } @@ -201,6 +202,7 @@ class SendMessage extends \sammo\BaseAPI if ($destNationID === $nationID) { $msgID = $this->genNationalMessage($src, $text)->send(); return [ + 'msgType' => 'national', 'msgID' => $msgID ]; } @@ -211,6 +213,7 @@ class SendMessage extends \sammo\BaseAPI } $msgID = $msgObjOrError->send(); return [ + 'msgType' => 'diplomacy', 'msgID' => $msgID ]; } @@ -231,6 +234,7 @@ class SendMessage extends \sammo\BaseAPI $msgID = $msgObjOrError->send(); return [ + 'msgType' => 'private', 'msgID' => $msgID ]; } diff --git a/hwe/ts/SammoAPI.ts b/hwe/ts/SammoAPI.ts index 437a71f4..cfc61373 100644 --- a/hwe/ts/SammoAPI.ts +++ b/hwe/ts/SammoAPI.ts @@ -199,7 +199,7 @@ const apiRealPath = { SendMessage: POST as APICallT<{ mailbox: number; text: string; - }, ValidResponse & {msgID: number}> + }, ValidResponse & {msgID: number, msgType: MsgType}> }, Misc: { UploadImage: POST as APICallT< -- 2.54.0 From 1d477a285abb80e2ea3119388f7e666d88e62987 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Thu, 9 Mar 2023 01:45:09 +0900 Subject: [PATCH 56/61] =?UTF-8?q?feat:=20=EA=B0=9C=EC=9D=B8=20=EB=A9=94?= =?UTF-8?q?=EC=8B=9C=EC=A7=80,=20=EC=99=B8=EA=B5=90=20=EB=A9=94=EC=8B=9C?= =?UTF-8?q?=EC=A7=80=20=EC=88=98=EC=8B=A0=20=EC=8B=9C=20toast=20=EC=95=8C?= =?UTF-8?q?=EB=A6=BC,=20=EB=AA=A8=EB=91=90=20=EC=9D=BD=EC=9D=8C=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/components/MessagePanel.vue | 143 +++++++++++++++++++++++++++-- 1 file changed, 136 insertions(+), 7 deletions(-) diff --git a/hwe/ts/components/MessagePanel.vue b/hwe/ts/components/MessagePanel.vue index abeb571e..bef39014 100644 --- a/hwe/ts/components/MessagePanel.vue +++ b/hwe/ts/components/MessagePanel.vue @@ -27,7 +27,7 @@
- +
서신전달&갱신 @@ -83,7 +83,18 @@
-
개인 메시지
+
+
개인 메시지
+
+ 모두 읽음 +
+
@@ -107,7 +118,18 @@
-
외교 메시지
+
+
외교 메시지
+
+ 모두 읽음 +
+
@@ -132,17 +154,27 @@
+