From d28a5e095a703b1ba15f1399fffccc0918ef77e6 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sun, 15 May 2022 18:09:18 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=97=B0=EA=B0=90=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=EC=97=90=EC=84=9C=20=EC=A7=80=EB=8F=84=EA=B0=80=20?= =?UTF-8?q?=EB=8B=A4=EB=A5=B8=20=EC=99=95=EC=A1=B0=20=EC=9D=BC=EB=9E=8C=20?= =?UTF-8?q?=EC=97=AD=EC=82=AC=20=EC=A7=80=EB=8F=84=20=EC=97=90=EB=9F=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/ts/PageHistory.vue | 34 ++++++++++++++++++++++++---------- hwe/v_history.php | 10 +++++++++- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/hwe/ts/PageHistory.vue b/hwe/ts/PageHistory.vue index 749dee28..f26268bb 100644 --- a/hwe/ts/PageHistory.vue +++ b/hwe/ts/PageHistory.vue @@ -15,7 +15,7 @@ @@ -40,7 +40,7 @@
@@ -56,6 +56,7 @@ declare const staticValues: { currentYearMonth: number; serverNick: string; serverID: string; + mapName: string; }; declare const query: { yearMonth: number | null; @@ -76,7 +77,7 @@ import { joinYearMonth } from "./util/joinYearMonth"; import { parseYearMonth } from "./util/parseYearMonth"; import { formatLog } from "./utilGame/formatLog"; import SimpleNationList from "./components/SimpleNationList.vue"; -import MapViewer, { type CityPositionMap, type MapCityParsedRaw, type MapCityParsed} from "./components/MapViewer.vue"; +import MapViewer, { type CityPositionMap, type MapCityParsedRaw, type MapCityParsed } from "./components/MapViewer.vue"; import { getGameConstStore, type GameConstStore } from "./GameConstStore"; import { unwrap } from "@/util/unwrap"; @@ -99,6 +100,7 @@ void Promise.all([storeP]).then(() => { asyncReady.value = true; }); +const mapName = staticValues.mapName; const cityPosition = getCityPosition(); const formatCityInfoText = formatCityInfo; const imagePath = window.pathConfig.gameImage; @@ -122,8 +124,11 @@ function generateYearMonthList(): { text: string; value: number }[] { if (queryYearMonth.value === yearMonth) { info.push("선택"); } - info.push("현재"); - result.push({ text: `${year}년 ${month}월 ${info.length > 0 ? `(${info.join(", ")})` : ""}`, value: yearMonth }); + + if (staticValues.serverID === query.serverID) { + info.push("현재"); + result.push({ text: `${year}년 ${month}월 ${info.length > 0 ? `(${info.join(", ")})` : ""}`, value: yearMonth }); + } return result; } @@ -136,12 +141,21 @@ watch(queryYearMonth, async (yearMonth) => { queryYearMonth.value = firstYearMonth.value; return; } - if (yearMonth > lastYearMonth.value + 1) { - queryYearMonth.value = lastYearMonth.value + 1; - return; + + if (staticValues.serverID === query.serverID) { + if (yearMonth > lastYearMonth.value + 1) { + queryYearMonth.value = lastYearMonth.value + 1; + return; + } + } + else{ + if (yearMonth > lastYearMonth.value) { + queryYearMonth.value = lastYearMonth.value; + return; + } } - if (yearMonth > lastYearMonth.value) { + if (yearMonth > lastYearMonth.value && staticValues.serverID === query.serverID) { try { const result = await SammoAPI.Global.GetCurrentHistory(); history.value = result.data; diff --git a/hwe/v_history.php b/hwe/v_history.php index d2094926..1e89969d 100644 --- a/hwe/v_history.php +++ b/hwe/v_history.php @@ -23,7 +23,14 @@ if ($serverID !== UniqueConst::$serverID) { [$f_year, $f_month] = $db->queryFirstList('SELECT year, month FROM ng_history WHERE server_id = %s ORDER BY year ASC, month ASC LIMIT 1', $serverID); [$l_year, $l_month] = $db->queryFirstList('SELECT year, month FROM ng_history WHERE server_id = %s ORDER BY year DESC, month DESC LIMIT 1', $serverID); -[$currentYear, $currentMonth] = $gameStor->getValuesAsArray(['year', 'month']); + +if($serverID === UniqueConst::$serverID){ + [$currentYear, $currentMonth] = $gameStor->getValuesAsArray(['year', 'month']); +} +else{ + [$currentYear, $currentMonth] = [$l_year, $l_month]; +} + $me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner = %i', $userID); @@ -46,6 +53,7 @@ $me = $db->queryFirstRow('SELECT con, turntime FROM general WHERE owner = %i', $ 'currentYearMonth' => Util::joinYearMonth($currentYear, $currentMonth), 'serverNick' => DB::prefix(), 'serverID' => UniqueConst::$serverID, + 'mapName' => $mapName, ], 'query' => [ 'serverID' => $serverID,