@lf_maple/koishi-plugin-phi-plugin-full 0.1.80
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/core/.github/ISSUE_TEMPLATE/bug.yaml +133 -0
- package/core/.github/ISSUE_TEMPLATE/config.yml +1 -0
- package/core/.github/ISSUE_TEMPLATE/enhancement.yml +44 -0
- package/core/.vscode/c_cpp_properties.json +18 -0
- package/core/.vscode/launch.json +24 -0
- package/core/.vscode/settings.json +59 -0
- package/core/CHANGELOG.md +184 -0
- package/core/LICENSE +674 -0
- package/core/README.md +330 -0
- package/core/README_en.md +285 -0
- package/core/apps/Dan.js +129 -0
- package/core/apps/RankList.js +322 -0
- package/core/apps/aliasProposal.js +223 -0
- package/core/apps/apiSetting.js +592 -0
- package/core/apps/b19.js +1329 -0
- package/core/apps/botClient.js +64 -0
- package/core/apps/chart.js +692 -0
- package/core/apps/guessGame/guessIll.js +821 -0
- package/core/apps/guessGame/guessLetter.js +831 -0
- package/core/apps/guessGame/guessTips.js +254 -0
- package/core/apps/guessGame/letterGameUtils.js +74 -0
- package/core/apps/guessGame.js +214 -0
- package/core/apps/help.js +117 -0
- package/core/apps/manage.js +288 -0
- package/core/apps/market.js +243 -0
- package/core/apps/money.js +1064 -0
- package/core/apps/phisong.js +1418 -0
- package/core/apps/session.js +664 -0
- package/core/apps/setting.js +468 -0
- package/core/apps/update.js +541 -0
- package/core/apps/user.js +968 -0
- package/core/components/Config.js +249 -0
- package/core/components/Data.js +304 -0
- package/core/components/FileWatcherRegistry.js +102 -0
- package/core/components/Logger.js +11 -0
- package/core/components/ProcessCleanup.js +113 -0
- package/core/components/Version.js +56 -0
- package/core/components/YamlReader.js +157 -0
- package/core/components/baseClass.js +287 -0
- package/core/components/common.js +47 -0
- package/core/components/index.js +13 -0
- package/core/components/platform/index.js +79 -0
- package/core/components/platform/koishi.js +800 -0
- package/core/components/platform/koishiDatabaseRedis.js +391 -0
- package/core/components/platform/memoryRedis.js +209 -0
- package/core/components/platform/types.d.ts +272 -0
- package/core/components/platform/yunzai.js +604 -0
- package/core/components/segment.js +4 -0
- package/core/config/config//350/277/231/351/207/214/346/230/257/351/205/215/347/275/256/346/226/207/344/273/266/347/233/256/345/275/225.txt +0 -0
- package/core/config/default_config/banGroup.yaml +14 -0
- package/core/config/default_config/config.yaml +159 -0
- package/core/config/default_config/nickconfig.yaml +6 -0
- package/core/config/default_config/otherinfo.yaml +51 -0
- package/core/guoba.support.js +597 -0
- package/core/index.js +85 -0
- package/core/lib/AES.js +40 -0
- package/core/lib/Base64.js +22 -0
- package/core/lib/ByteReader.js +168 -0
- package/core/lib/GameProgress.js +37 -0
- package/core/lib/GameRecord.js +47 -0
- package/core/lib/GameSettings.js +24 -0
- package/core/lib/GameUser.js +19 -0
- package/core/lib/Level.js +6 -0
- package/core/lib/LevelRecord.js +9 -0
- package/core/lib/PhigrosUser.js +135 -0
- package/core/lib/SaveManager.js +117 -0
- package/core/lib/Summary.js +47 -0
- package/core/lib/TapTap/CompleteQRCodeData.js +27 -0
- package/core/lib/TapTap/LCHelper.js +81 -0
- package/core/lib/TapTap/TapTapHelper.js +170 -0
- package/core/lib/TapTap/getQRcode.js +61 -0
- package/core/lib/Util.js +30 -0
- package/core/lib/getQRcode.js +73 -0
- package/core/lib/http.js +105 -0
- package/core/model/README.md +3 -0
- package/core/model/api/aliasProposalService.js +151 -0
- package/core/model/api/apiVersion.js +67 -0
- package/core/model/api/autoSeekApi.js +165 -0
- package/core/model/api/botApiAuth.js +208 -0
- package/core/model/api/botSyncService.js +78 -0
- package/core/model/api/gameRecordPayload.js +24 -0
- package/core/model/api/makeRequest.js +1004 -0
- package/core/model/api/makeRequestFnc.js +17 -0
- package/core/model/api/phiApiClient.js +53 -0
- package/core/model/api/phiApiErrors.js +121 -0
- package/core/model/filesystem/getFile.js +256 -0
- package/core/model/filesystem/path.js +84 -0
- package/core/model/game/Chart.js +57 -0
- package/core/model/game/LevelRecordInfo.js +109 -0
- package/core/model/game/SongsInfo.js +46 -0
- package/core/model/game/b30Analysis.js +93 -0
- package/core/model/game/chartParser/Chart.js +23 -0
- package/core/model/game/chartParser/JudgeLine.js +38 -0
- package/core/model/game/chartParser/base/JudgeLineEvent.js +99 -0
- package/core/model/game/chartParser/base/Note.js +44 -0
- package/core/model/game/chartParser/base/SpeedEvent.js +25 -0
- package/core/model/game/chartParser/base/baseType.js +2 -0
- package/core/model/game/constNum.js +215 -0
- package/core/model/game/fCompute.js +711 -0
- package/core/model/game/getChartTag.js +140 -0
- package/core/model/game/getComment.js +132 -0
- package/core/model/game/getInfo.js +1069 -0
- package/core/model/game/getRksRank.js +77 -0
- package/core/model/game/markdown.js +77 -0
- package/core/model/integrations/Vika.js +103 -0
- package/core/model/integrations/getInfoFromTap.js +80 -0
- package/core/model/render/getPic.js +79 -0
- package/core/model/render/picmodle.js +496 -0
- package/core/model/render/progress-bar.js +44 -0
- package/core/model/render/puppeteer.js +431 -0
- package/core/model/render/renderPressureHistory.js +71 -0
- package/core/model/render/send.js +94 -0
- package/core/model/save/Save.js +953 -0
- package/core/model/save/analyzeSaveHistory.js +413 -0
- package/core/model/save/getBackup.js +328 -0
- package/core/model/save/getSave.js +90 -0
- package/core/model/save/getSaveFromApi.js +46 -0
- package/core/model/save/saveHistory.js +586 -0
- package/core/model/save/scoreHistory.js +101 -0
- package/core/model/theme/catalog.js +192 -0
- package/core/model/theme/installGuard.js +275 -0
- package/core/model/theme/installLock.js +174 -0
- package/core/model/theme/installer.js +398 -0
- package/core/model/theme/manager.js +408 -0
- package/core/model/theme/marketClient.js +294 -0
- package/core/model/theme/paths.js +42 -0
- package/core/model/theme/policy.js +54 -0
- package/core/model/theme/recovery.js +167 -0
- package/core/model/theme/useService.js +187 -0
- package/core/model/type/aliasProposal.d.ts +45 -0
- package/core/model/type/type.js +420 -0
- package/core/model/user/apiPermission.js +62 -0
- package/core/model/user/getBanGroup.js +120 -0
- package/core/model/user/getNotes.js +48 -0
- package/core/model/user/pluginData.js +101 -0
- package/core/model/user/userCredentialStore.js +154 -0
- package/core/model/user/userCredentials.js +860 -0
- package/core/package.json +60 -0
- package/core/resources/0608badSave/save.json +1 -0
- package/core/resources/LICENSE +201 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.art +220 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.css +345 -0
- package/core/resources/html/analyzeSaveHistory/analyzeSaveHistory.html +434 -0
- package/core/resources/html/arcgrosB19/arcgros.png +0 -0
- package/core/resources/html/arcgrosB19/arcgrosB19-orz.html +276 -0
- package/core/resources/html/arcgrosB19/arcgrosB19.art +168 -0
- package/core/resources/html/arcgrosB19/arcgrosB19.css +637 -0
- package/core/resources/html/atlas/atlas-orz.html +313 -0
- package/core/resources/html/atlas/atlas.art +194 -0
- package/core/resources/html/atlas/atlas.css +695 -0
- package/core/resources/html/avatar/-SURREALISM-.png +0 -0
- package/core/resources/html/avatar/Alkaid.png +0 -0
- package/core/resources/html/avatar/Aphasia.png +0 -0
- package/core/resources/html/avatar/Artificial Existence.png +0 -0
- package/core/resources/html/avatar/Bonus Time.png +0 -0
- package/core/resources/html/avatar/Burn.png +0 -0
- package/core/resources/html/avatar/Cereris1.png +0 -0
- package/core/resources/html/avatar/Cereris2.png +0 -0
- package/core/resources/html/avatar/Cereris3.png +0 -0
- package/core/resources/html/avatar/Christmas -2019.png +0 -0
- package/core/resources/html/avatar/Cipher1.png +0 -0
- package/core/resources/html/avatar/Class Memories.png +0 -0
- package/core/resources/html/avatar/Credits.png +0 -0
- package/core/resources/html/avatar/Dash.png +0 -0
- package/core/resources/html/avatar/Dlyrotz.png +0 -0
- package/core/resources/html/avatar/Doppelganger1.png +0 -0
- package/core/resources/html/avatar/Doppelganger2.png +0 -0
- package/core/resources/html/avatar/Drop it.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix1.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix2.png +0 -0
- package/core/resources/html/avatar/Energy Synergy Matrix3.png +0 -0
- package/core/resources/html/avatar/Engine x Start!! (melody mix).png +0 -0
- package/core/resources/html/avatar/Engine x Start!! extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Eradication Catastrophe.png +0 -0
- package/core/resources/html/avatar/FULi AUTO SHOOTER extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/FULi AUTO SHOOTER.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special1.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/264-Special2.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2641.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2642.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2643.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2644.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2645.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2646.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2647.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2648.png +0 -0
- package/core/resources/html/avatar/Feast/350/277/234/344/270/234/344/271/213/345/256/2649.png +0 -0
- package/core/resources/html/avatar/Find_Me.png +0 -0
- package/core/resources/html/avatar/Geopelia 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Geopelia 2 -by cycats.png +0 -0
- package/core/resources/html/avatar/Geopelia 3 -by /344/275/225/345/221/265.png +0 -0
- package/core/resources/html/avatar/Geopelia in WEPLAY -by /346/265/267/344/272/247.png +0 -0
- package/core/resources/html/avatar/Gino-AprilFool.png +0 -0
- package/core/resources/html/avatar/Glaciaxion.png +0 -0
- package/core/resources/html/avatar/HumaN.png +0 -0
- package/core/resources/html/avatar/Indelible Scar.png +0 -0
- package/core/resources/html/avatar/Introduction.png +0 -0
- package/core/resources/html/avatar/Khronostasis Katharsis.png +0 -0
- package/core/resources/html/avatar/MARENOL.png +0 -0
- package/core/resources/html/avatar/Marenol extra 1 -by /345/226/265n/350/221/265.png +0 -0
- package/core/resources/html/avatar/Non-Melodic Ragez (MUG Edit).png +0 -0
- package/core/resources/html/avatar/Non-Melodic Ragez extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/Oblivion +0 -0
- package/core/resources/html/avatar/OblivionPHIN.png +0 -0
- package/core/resources/html/avatar/Para.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz1.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz2.png +0 -0
- package/core/resources/html/avatar/Pixel Rebelz3.png +0 -0
- package/core/resources/html/avatar/RIPPER extra 1 -by cycats.png +0 -0
- package/core/resources/html/avatar/RIPPER extra 2 -by /344/275/225/345/221/265.png +0 -0
- package/core/resources/html/avatar/Sein.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-Special2.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/231/256/351/200/232.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/346/260/264/351/235/222-/346/233/262/347/273/230Ver.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-Special.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/231/256/351/200/232.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240-/346/233/262/347/273/230Ver.png +0 -0
- package/core/resources/html/avatar/ShineAfter-/351/270/240/345/222/214/346/260/264/351/235/222-Special.png +0 -0
- package/core/resources/html/avatar/Snow Desert.png +0 -0
- package/core/resources/html/avatar/Sparkle New Life.png +0 -0
- package/core/resources/html/avatar/Sultan Rage.png +0 -0
- package/core/resources/html/avatar/Winter /342/206/221cube/342/206/223.png +0 -0
- package/core/resources/html/avatar/Xenolith.png +0 -0
- package/core/resources/html/avatar/[PRAW].png +0 -0
- package/core/resources/html/avatar/dB doll.png +0 -0
- package/core/resources/html/avatar/ripper.png +0 -0
- package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2721.png +0 -0
- package/core/resources/html/avatar//343/202/202/343/201/272/343/202/202/343/201/2722.png +0 -0
- package/core/resources/html/avatar//344/270/207/345/220/250/345/214/277/345/220/215/344/277/241.png +0 -0
- package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251 extra 1 -by /345/276/241/345/235/202/346/236/234/345/255/220.png +0 -0
- package/core/resources/html/avatar//344/272/221/345/245/263/345/255/251.png +0 -0
- package/core/resources/html/avatar//345/205/211.png +0 -0
- package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2051.png +0 -0
- package/core/resources/html/avatar//345/274/200/345/277/203/347/227/2052.png +0 -0
- package/core/resources/html/avatar//346/260/264/351/235/222-/344/270/200/345/221/250/345/271/264/347/233/270/350/201/232.png +0 -0
- package/core/resources/html/avatar//346/267/267/344/271/261-Confusion.png +0 -0
- package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2361.png +0 -0
- package/core/resources/html/avatar//347/213/202/345/226/234/350/230/255/350/210/2362.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/201-Special.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2011.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2012.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2013.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2014.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2015.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2016.png +0 -0
- package/core/resources/html/avatar//347/223/267/345/262/2017.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/227-Special.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2271.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2272.png +0 -0
- package/core/resources/html/avatar//347/233/217/350/214/2273.png +0 -0
- package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2611.png +0 -0
- package/core/resources/html/avatar//350/217/257/347/201/257/347/210/2612.png +0 -0
- package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2501.png +0 -0
- package/core/resources/html/avatar//350/220/244/347/201/253/350/231/253/343/201/256/346/200/2502.png +0 -0
- package/core/resources/html/avatar//351/235/222/350/212/275-Special.png +0 -0
- package/core/resources/html/avatar//351/235/222/350/212/275.png +0 -0
- package/core/resources/html/avatar//351/243/216/345/261/277.png +0 -0
- package/core/resources/html/avatar//351/270/240-AprilFool.png +0 -0
- package/core/resources/html/avatar//351/270/240-/344/270/200/345/221/250/345/271/264/347/233/270/350/201/232.png +0 -0
- package/core/resources/html/b19/b19.art +490 -0
- package/core/resources/html/b19/b19.css +1261 -0
- package/core/resources/html/b19/b19666.art +350 -0
- package/core/resources/html/b19/b19666.css +1409 -0
- package/core/resources/html/b19/b19666.html +481 -0
- package/core/resources/html/b19/b19title.css +120 -0
- package/core/resources/html/b19/best19.html +853 -0
- package/core/resources/html/b19/dss2-orz.html +428 -0
- package/core/resources/html/b19/dss2.art +298 -0
- package/core/resources/html/b19/dss2.css +776 -0
- package/core/resources/html/b19/res/666.jpeg +0 -0
- package/core/resources/html/chap/chap-orz.html +93 -0
- package/core/resources/html/chap/chap.art +87 -0
- package/core/resources/html/chap/chap.css +365 -0
- package/core/resources/html/chartImg/chartImg.art +169 -0
- package/core/resources/html/chartImg/chartImg.css +439 -0
- package/core/resources/html/chartImg/echarts-wordcloud.min.js +3 -0
- package/core/resources/html/chartImg/echarts.js +85796 -0
- package/core/resources/html/chartImg/img/Drag.png +0 -0
- package/core/resources/html/chartImg/img/DragHL.png +0 -0
- package/core/resources/html/chartImg/img/Flick.png +0 -0
- package/core/resources/html/chartImg/img/FlickHL.png +0 -0
- package/core/resources/html/chartImg/img/Hold.png +0 -0
- package/core/resources/html/chartImg/img/HoldHL.png +0 -0
- package/core/resources/html/chartImg/img/Hold_End.png +0 -0
- package/core/resources/html/chartImg/img/Hold_Head.png +0 -0
- package/core/resources/html/chartImg/img/Hold_HeadHL.png +0 -0
- package/core/resources/html/chartImg/img/Tap.png +0 -0
- package/core/resources/html/chartImg/img/TapHL.png +0 -0
- package/core/resources/html/chartInfo/chartInfo-orz.html +250 -0
- package/core/resources/html/chartInfo/chartInfo.art +222 -0
- package/core/resources/html/chartInfo/chartInfo.css +265 -0
- package/core/resources/html/chartInfo/echarts-wordcloud.min.js +3 -0
- package/core/resources/html/chartInfo/echarts.js +85796 -0
- package/core/resources/html/clg/clg-orz.html +218 -0
- package/core/resources/html/clg/clg.art +88 -0
- package/core/resources/html/clg/clg.css +230 -0
- package/core/resources/html/clg/demo.jpg +0 -0
- package/core/resources/html/common/common.css +319 -0
- package/core/resources/html/common/css/playerInfo.css +136 -0
- package/core/resources/html/common/font/Aldrich-Regular.ttf +0 -0
- package/core/resources/html/common/font/HIMALAYA.TTF +0 -0
- package/core/resources/html/common/font/NotoColorEmoji-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSans-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSansArabic.ttf +0 -0
- package/core/resources/html/common/font/NotoSansCanadianAboriginal.ttf +0 -0
- package/core/resources/html/common/font/NotoSansJP.ttf +0 -0
- package/core/resources/html/common/font/NotoSansKannada.ttf +0 -0
- package/core/resources/html/common/font/NotoSansMath-Regular.ttf +0 -0
- package/core/resources/html/common/font/NotoSansSymbols2.ttf +0 -0
- package/core/resources/html/common/font/phi.ttf +0 -0
- package/core/resources/html/common/font//345/220/236/345/274/245/346/201/260/344/277/212.ttf +0 -0
- package/core/resources/html/common/layout/default.art +324 -0
- package/core/resources/html/common/layout/elem.art +21 -0
- package/core/resources/html/common/theme/snow/snow.css +17 -0
- package/core/resources/html/common/theme/snow/snow.js +19 -0
- package/core/resources/html/common/theme/star/star.js +201 -0
- package/core/resources/html/common/theme/topText/topText.css +15 -0
- package/core/resources/html/common/theme/topText/topText.js +30 -0
- package/core/resources/html/difficultyHistory/difficultyHistory-orz.html +361 -0
- package/core/resources/html/difficultyHistory/difficultyHistory.art +102 -0
- package/core/resources/html/difficultyHistory/difficultyHistory.css +205 -0
- package/core/resources/html/guess/guess-orz.html +50 -0
- package/core/resources/html/guess/guess.art +51 -0
- package/core/resources/html/guess/guess.css +33 -0
- package/core/resources/html/help/help-orz.html +73 -0
- package/core/resources/html/help/help.art +84 -0
- package/core/resources/html/help/help.css +266 -0
- package/core/resources/html/historyB30/historyB30-orz.html +168 -0
- package/core/resources/html/historyB30/historyB30.art +143 -0
- package/core/resources/html/historyB30/historyB30.css +270 -0
- package/core/resources/html/ill/ill-orz.html +21 -0
- package/core/resources/html/ill/ill.art +23 -0
- package/core/resources/html/ill/ill.css +79 -0
- package/core/resources/html/jrrp/ShineAfter.removebg.png +0 -0
- package/core/resources/html/jrrp/jrrp-orz.html +68 -0
- package/core/resources/html/jrrp/jrrp.art +58 -0
- package/core/resources/html/jrrp/jrrp.css +251 -0
- package/core/resources/html/list/list-orz.html +35 -0
- package/core/resources/html/list/list.art +67 -0
- package/core/resources/html/list/list.css +259 -0
- package/core/resources/html/lvsco/demo.jpg +0 -0
- package/core/resources/html/lvsco/lvsco-orz.html +334 -0
- package/core/resources/html/lvsco/lvsco.art +314 -0
- package/core/resources/html/lvsco/lvsco.css +706 -0
- package/core/resources/html/market/detail.art +44 -0
- package/core/resources/html/market/market.art +86 -0
- package/core/resources/html/market/market.css +64 -0
- package/core/resources/html/newSong/newSong.art +34 -0
- package/core/resources/html/newSong/newSong.css +48 -0
- package/core/resources/html/newSong/newSong.html +23 -0
- package/core/resources/html/newnotice/newnotice.art +47 -0
- package/core/resources/html/newnotice/newnotice.css +83 -0
- package/core/resources/html/otherimg/0.png +0 -0
- package/core/resources/html/otherimg/1.png +0 -0
- package/core/resources/html/otherimg/2.png +0 -0
- package/core/resources/html/otherimg/3.png +0 -0
- package/core/resources/html/otherimg/4.png +0 -0
- package/core/resources/html/otherimg/5.png +0 -0
- package/core/resources/html/otherimg/A.png +0 -0
- package/core/resources/html/otherimg/B.png +0 -0
- package/core/resources/html/otherimg/C.png +0 -0
- package/core/resources/html/otherimg/F.png +0 -0
- package/core/resources/html/otherimg/FC.png +0 -0
- package/core/resources/html/otherimg/NEW.png +0 -0
- package/core/resources/html/otherimg/Phigros_Icon_3.0.0.png +0 -0
- package/core/resources/html/otherimg/S.png +0 -0
- package/core/resources/html/otherimg/Star1.png +0 -0
- package/core/resources/html/otherimg/Star2.png +0 -0
- package/core/resources/html/otherimg/V.png +0 -0
- package/core/resources/html/otherimg/callback.png +0 -0
- package/core/resources/html/otherimg/chapHelp.png +0 -0
- package/core/resources/html/otherimg/dan_code.png +0 -0
- package/core/resources/html/otherimg/data.png +0 -0
- package/core/resources/html/otherimg/helpDoc.png +0 -0
- package/core/resources/html/otherimg/nickSuggest.png +0 -0
- package/core/resources/html/otherimg/phi.png +0 -0
- package/core/resources/html/otherimg/phigros.png +0 -0
- package/core/resources/html/otherimg/snow1.png +0 -0
- package/core/resources/html/otherimg/snow2.png +0 -0
- package/core/resources/html/otherimg/snow3.png +0 -0
- package/core/resources/html/otherimg/snow4.png +0 -0
- package/core/resources/html/otherimg/title.png +0 -0
- package/core/resources/html/rand/rand-orz.html +62 -0
- package/core/resources/html/rand/rand.art +59 -0
- package/core/resources/html/rand/rand.css +257 -0
- package/core/resources/html/rankingList/rankingList-orz.html +456 -0
- package/core/resources/html/rankingList/rankingList.art +171 -0
- package/core/resources/html/rankingList/rankingList.css +570 -0
- package/core/resources/html/rankingList-old/rankingList-orz.html +300 -0
- package/core/resources/html/rankingList-old/rankingList.art +89 -0
- package/core/resources/html/rankingList-old/rankingList.css +265 -0
- package/core/resources/html/score/score-orz.html +625 -0
- package/core/resources/html/score/score.art +249 -0
- package/core/resources/html/score/score.css +435 -0
- package/core/resources/html/score/scoreOld-orz.html +128 -0
- package/core/resources/html/score/scoreOld.art +230 -0
- package/core/resources/html/score/scoreOld.css +475 -0
- package/core/resources/html/score/scoreRankList-orz.html +613 -0
- package/core/resources/html/score/scoreRankList.art +231 -0
- package/core/resources/html/score/scoreRankList.css +197 -0
- package/core/resources/html/setting/setting-orz.html +123 -0
- package/core/resources/html/setting/setting.art +72 -0
- package/core/resources/html/setting/setting.css +170 -0
- package/core/resources/html/setting/userSetting-orz.html +132 -0
- package/core/resources/html/setting/userSetting.art +48 -0
- package/core/resources/html/setting/userSetting.css +160 -0
- package/core/resources/html/sign/sign-orz.html +262 -0
- package/core/resources/html/sign/sign.art +163 -0
- package/core/resources/html/sign/sign.css +706 -0
- package/core/resources/html/suggest/suggest.art +271 -0
- package/core/resources/html/suggest/suggest.css +300 -0
- package/core/resources/html/table/table-orz.html +228 -0
- package/core/resources/html/table/table.art +163 -0
- package/core/resources/html/table/table.css +401 -0
- package/core/resources/html/tasks/tasks-orz.html +83 -0
- package/core/resources/html/tasks/tasks.art +118 -0
- package/core/resources/html/tasks/tasks.css +334 -0
- package/core/resources/html/update/update-orz.html +735 -0
- package/core/resources/html/update/update.art +259 -0
- package/core/resources/html/update/update.css +676 -0
- package/core/resources/html/userinfo/userinfo-old-orz.html +408 -0
- package/core/resources/html/userinfo/userinfo-old.art +233 -0
- package/core/resources/html/userinfo/userinfo-old.css +466 -0
- package/core/resources/html/userinfo/userinfo-orz.html +543 -0
- package/core/resources/html/userinfo/userinfo.art +288 -0
- package/core/resources/html/userinfo/userinfo.css +757 -0
- package/core/resources/info/DLC/arc.json +412 -0
- package/core/resources/info/DLC/chunithm.json +1172 -0
- package/core/resources/info/DLC/dynamix.json +455 -0
- package/core/resources/info/DLC/fanshi.json +132 -0
- package/core/resources/info/DLC/lanota.json +412 -0
- package/core/resources/info/DLC/maimai.json +1110 -0
- package/core/resources/info/DLC/orz.json +158 -0
- package/core/resources/info/DLC/rizline.json +40 -0
- package/core/resources/info/DLC/rotaeno.json +159 -0
- package/core/resources/info/DLC/ryceam.json +53 -0
- package/core/resources/info/avatar.txt +109 -0
- package/core/resources/info/chaplist.yaml +102 -0
- package/core/resources/info/help/api.json +83 -0
- package/core/resources/info/help.json +436 -0
- package/core/resources/info/info.csv +315 -0
- package/core/resources/info/infolist.json +1758 -0
- package/core/resources/info/jrrp.json +92 -0
- package/core/resources/info/nicklist.yaml +2373 -0
- package/core/resources/info/notesInfo.json +1 -0
- package/core/resources/info/notice.json +11 -0
- package/core/resources/info/oldInfo/100/change.csv +218 -0
- package/core/resources/info/oldInfo/100/info.json +7 -0
- package/core/resources/info/oldInfo/101/change.csv +218 -0
- package/core/resources/info/oldInfo/101/info.json +7 -0
- package/core/resources/info/oldInfo/102/change.csv +223 -0
- package/core/resources/info/oldInfo/102/info.json +7 -0
- package/core/resources/info/oldInfo/103/change.csv +224 -0
- package/core/resources/info/oldInfo/103/info.json +7 -0
- package/core/resources/info/oldInfo/104/change.csv +225 -0
- package/core/resources/info/oldInfo/104/info.json +7 -0
- package/core/resources/info/oldInfo/105/change.csv +228 -0
- package/core/resources/info/oldInfo/105/info.json +7 -0
- package/core/resources/info/oldInfo/106/change.csv +229 -0
- package/core/resources/info/oldInfo/106/info.json +7 -0
- package/core/resources/info/oldInfo/108/change.csv +233 -0
- package/core/resources/info/oldInfo/108/info.json +7 -0
- package/core/resources/info/oldInfo/109/change.csv +235 -0
- package/core/resources/info/oldInfo/109/info.json +7 -0
- package/core/resources/info/oldInfo/110/change.csv +235 -0
- package/core/resources/info/oldInfo/110/info.json +7 -0
- package/core/resources/info/oldInfo/111/change.csv +242 -0
- package/core/resources/info/oldInfo/111/info.json +7 -0
- package/core/resources/info/oldInfo/112/change.csv +242 -0
- package/core/resources/info/oldInfo/112/info.json +7 -0
- package/core/resources/info/oldInfo/113/change.csv +244 -0
- package/core/resources/info/oldInfo/113/info.json +7 -0
- package/core/resources/info/oldInfo/115/change.csv +247 -0
- package/core/resources/info/oldInfo/115/info.json +7 -0
- package/core/resources/info/oldInfo/116/change.csv +249 -0
- package/core/resources/info/oldInfo/116/info.json +7 -0
- package/core/resources/info/oldInfo/118/change.csv +252 -0
- package/core/resources/info/oldInfo/118/info.json +7 -0
- package/core/resources/info/oldInfo/119/change.csv +255 -0
- package/core/resources/info/oldInfo/119/info.json +7 -0
- package/core/resources/info/oldInfo/120/change.csv +255 -0
- package/core/resources/info/oldInfo/120/info.json +7 -0
- package/core/resources/info/oldInfo/121/change.csv +257 -0
- package/core/resources/info/oldInfo/121/info.json +7 -0
- package/core/resources/info/oldInfo/122/change.csv +260 -0
- package/core/resources/info/oldInfo/122/info.json +7 -0
- package/core/resources/info/oldInfo/123/change.csv +260 -0
- package/core/resources/info/oldInfo/123/info.json +7 -0
- package/core/resources/info/oldInfo/124/change.csv +262 -0
- package/core/resources/info/oldInfo/124/info.json +7 -0
- package/core/resources/info/oldInfo/125/change.csv +266 -0
- package/core/resources/info/oldInfo/125/info.json +7 -0
- package/core/resources/info/oldInfo/126/change.csv +269 -0
- package/core/resources/info/oldInfo/126/info.json +7 -0
- package/core/resources/info/oldInfo/127/change.csv +270 -0
- package/core/resources/info/oldInfo/127/info.json +7 -0
- package/core/resources/info/oldInfo/128/change.csv +273 -0
- package/core/resources/info/oldInfo/128/info.json +7 -0
- package/core/resources/info/oldInfo/129/change.csv +274 -0
- package/core/resources/info/oldInfo/129/info.json +7 -0
- package/core/resources/info/oldInfo/130/change.csv +275 -0
- package/core/resources/info/oldInfo/130/info.json +7 -0
- package/core/resources/info/oldInfo/131/change.csv +278 -0
- package/core/resources/info/oldInfo/131/info.json +7 -0
- package/core/resources/info/oldInfo/132/change.csv +280 -0
- package/core/resources/info/oldInfo/132/info.json +7 -0
- package/core/resources/info/oldInfo/133/change.csv +284 -0
- package/core/resources/info/oldInfo/133/info.json +7 -0
- package/core/resources/info/oldInfo/134/change.csv +286 -0
- package/core/resources/info/oldInfo/134/info.json +7 -0
- package/core/resources/info/oldInfo/135/change.csv +290 -0
- package/core/resources/info/oldInfo/135/info.json +7 -0
- package/core/resources/info/oldInfo/136/change.csv +290 -0
- package/core/resources/info/oldInfo/136/info.json +7 -0
- package/core/resources/info/oldInfo/137/change.csv +293 -0
- package/core/resources/info/oldInfo/137/info.json +7 -0
- package/core/resources/info/oldInfo/138/change.csv +295 -0
- package/core/resources/info/oldInfo/138/info.json +7 -0
- package/core/resources/info/oldInfo/139/change.csv +295 -0
- package/core/resources/info/oldInfo/139/info.json +7 -0
- package/core/resources/info/oldInfo/140/change.csv +298 -0
- package/core/resources/info/oldInfo/140/info.json +7 -0
- package/core/resources/info/oldInfo/141/change.csv +300 -0
- package/core/resources/info/oldInfo/141/info.json +7 -0
- package/core/resources/info/oldInfo/142/change.csv +302 -0
- package/core/resources/info/oldInfo/142/info.json +7 -0
- package/core/resources/info/oldInfo/143/change.csv +303 -0
- package/core/resources/info/oldInfo/143/info.json +7 -0
- package/core/resources/info/oldInfo/144/change.csv +303 -0
- package/core/resources/info/oldInfo/144/info.json +7 -0
- package/core/resources/info/oldInfo/145/change.csv +305 -0
- package/core/resources/info/oldInfo/145/info.json +7 -0
- package/core/resources/info/oldInfo/146/change.csv +305 -0
- package/core/resources/info/oldInfo/146/info.json +7 -0
- package/core/resources/info/oldInfo/148/change.csv +307 -0
- package/core/resources/info/oldInfo/148/info.json +7 -0
- package/core/resources/info/oldInfo/149/change.csv +307 -0
- package/core/resources/info/oldInfo/149/info.json +7 -0
- package/core/resources/info/oldInfo/151/change.csv +309 -0
- package/core/resources/info/oldInfo/151/info.json +7 -0
- package/core/resources/info/oldInfo/152/change.csv +312 -0
- package/core/resources/info/oldInfo/152/info.json +7 -0
- package/core/resources/info/oldInfo/153/change.csv +313 -0
- package/core/resources/info/oldInfo/153/info.json +7 -0
- package/core/resources/info/oldInfo/154/change.csv +315 -0
- package/core/resources/info/oldInfo/154/info.json +7 -0
- package/core/resources/info/oldInfo/92/change.csv +204 -0
- package/core/resources/info/oldInfo/92/info.json +7 -0
- package/core/resources/info/oldInfo/93/change.csv +206 -0
- package/core/resources/info/oldInfo/93/info.json +7 -0
- package/core/resources/info/oldInfo/94/change.csv +209 -0
- package/core/resources/info/oldInfo/94/info.json +7 -0
- package/core/resources/info/oldInfo/95/change.csv +211 -0
- package/core/resources/info/oldInfo/95/info.json +7 -0
- package/core/resources/info/oldInfo/96/change.csv +216 -0
- package/core/resources/info/oldInfo/96/info.json +7 -0
- package/core/resources/info/oldInfo/98/change.csv +216 -0
- package/core/resources/info/oldInfo/98/info.json +7 -0
- package/core/resources/info/oldInfo/99/change.csv +217 -0
- package/core/resources/info/oldInfo/99/info.json +7 -0
- package/core/resources/info/oldNotesInfo.json +1 -0
- package/core/resources/info/sentences.json +1 -0
- package/core/resources/info/spinfo.json +362 -0
- package/core/resources/info/tips.txt +278 -0
- package/core/resources/otherill//351/233/252/351/231/215SP.png +0 -0
- package/core/resources/song-select.html +535 -0
- package/core/resources/themes/README.md +24 -0
- package/core/resources/themes/milthm/A.png +0 -0
- package/core/resources/themes/milthm/B.png +0 -0
- package/core/resources/themes/milthm/C.png +0 -0
- package/core/resources/themes/milthm/F.png +0 -0
- package/core/resources/themes/milthm/FC.png +0 -0
- package/core/resources/themes/milthm/S.png +0 -0
- package/core/resources/themes/milthm/V.png +0 -0
- package/core/resources/themes/milthm/arcgrosB19.css +36 -0
- package/core/resources/themes/milthm/b19.art +464 -0
- package/core/resources/themes/milthm/b19.css +1314 -0
- package/core/resources/themes/milthm/bg.png +0 -0
- package/core/resources/themes/milthm/clg.css +37 -0
- package/core/resources/themes/milthm/difficultyHistory.css +42 -0
- package/core/resources/themes/milthm/font.ttf +0 -0
- package/core/resources/themes/milthm/help.css +36 -0
- package/core/resources/themes/milthm/historyB30.css +48 -0
- package/core/resources/themes/milthm/info.yaml +45 -0
- package/core/resources/themes/milthm/list.css +39 -0
- package/core/resources/themes/milthm/phi.png +0 -0
- package/core/resources/themes/milthm/setting.css +37 -0
- package/core/resources/themes/milthm/sign.css +81 -0
- package/core/resources/themes/milthm/suggest.css +40 -0
- package/core/resources/themes/milthm/table.css +54 -0
- package/core/resources/themes/milthm/update.css +68 -0
- package/core/tests/aliasProposalService.test.js +82 -0
- package/core/tests/apiAccountDeletion.test.js +125 -0
- package/core/tests/apiPermission.test.js +44 -0
- package/core/tests/apiVersion.test.js +55 -0
- package/core/tests/b30Analysis.test.js +38 -0
- package/core/tests/backgroundIllustration.test.js +21 -0
- package/core/tests/botApiAuthRecovery.test.js +148 -0
- package/core/tests/botSyncService.test.js +42 -0
- package/core/tests/fileWatcherRegistry.test.js +44 -0
- package/core/tests/gameRecordPayload.test.js +34 -0
- package/core/tests/guessLetter.test.js +79 -0
- package/core/tests/makeRequestHandling.test.js +118 -0
- package/core/tests/marketOverflow.test.js +31 -0
- package/core/tests/platformTemplateCache.test.js +92 -0
- package/core/tests/pluginDataThemePreference.test.js +36 -0
- package/core/tests/processCleanup.test.js +58 -0
- package/core/tests/puppeteerShutdown.test.js +17 -0
- package/core/tests/renderPressureHistory.test.js +59 -0
- package/core/tests/saveStats.test.js +26 -0
- package/core/tests/themeInstallGuard.test.js +289 -0
- package/core/tests/themeManager.test.js +625 -0
- package/core/tests/themeManagerInit.test.js +11 -0
- package/core/tests/themeMarket.test.js +855 -0
- package/core/tests/themePageRouting.test.js +431 -0
- package/core/tests/themePolicy.test.js +28 -0
- package/core/tests/themeStorageRecovery.test.js +192 -0
- package/core/tests/userCredentialModuleBoundaries.test.js +41 -0
- package/core/tests/userCredentials.test.js +285 -0
- package/core/tsconfig.json +32 -0
- package/core/types/vendor.d.ts +14 -0
- package/lib/index.cjs +358 -0
- package/lib/index.d.cts +182 -0
- package/lib/index.d.ts +182 -0
- package/lib/index.js +320 -0
- package/package.json +74 -0
- package/readme.md +3 -0
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import { allLevel, LevelNum, MAX_DIFFICULTY } from "../game/constNum.js"
|
|
2
|
+
import Save from "./Save.js"
|
|
3
|
+
import fCompute from "../game/fCompute.js";
|
|
4
|
+
import LevelRecordInfo from "../game/LevelRecordInfo.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @template T
|
|
8
|
+
* @typedef {object} formatedHistoryBaseObject<T>
|
|
9
|
+
* @property {Date} date - 日期
|
|
10
|
+
* @property {T} value - 值
|
|
11
|
+
*/
|
|
12
|
+
export default class saveHistory {
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* @param { (saveHistoryObject & {version?: number}) } data
|
|
17
|
+
*/
|
|
18
|
+
constructor(data) {
|
|
19
|
+
|
|
20
|
+
const ids = fCompute.objectKeys(data?.scoreHistory || {})
|
|
21
|
+
|
|
22
|
+
for (const id of ids) {
|
|
23
|
+
const record = data?.scoreHistory?.[id];
|
|
24
|
+
if (!record) continue;
|
|
25
|
+
for (const level of allLevel) {
|
|
26
|
+
if (!record[level]) continue;
|
|
27
|
+
record[level].forEach(item => {
|
|
28
|
+
//@ts-ignore
|
|
29
|
+
item[2] = new Date(item[2]);
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* @type {{[id:idString]: Partial<Record<allLevelKind, ScoreDetail[]>>}}
|
|
36
|
+
* @property {Array<[number, number, Date, boolean]>} [acc, score, date, fc] acc为4位小数,score为整数,date为日期,fc为boolean
|
|
37
|
+
*/
|
|
38
|
+
//@ts-ignore
|
|
39
|
+
this.scoreHistory = data?.scoreHistory || {};
|
|
40
|
+
/**
|
|
41
|
+
* @type {formatedHistoryBaseObject<number[]>[]}
|
|
42
|
+
* @description data货币变更记录
|
|
43
|
+
*/
|
|
44
|
+
this.data = [];
|
|
45
|
+
|
|
46
|
+
data?.data?.forEach(item => {
|
|
47
|
+
this.data.push({
|
|
48
|
+
date: new Date(item.date),
|
|
49
|
+
value: item.value
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @type {formatedHistoryBaseObject<number>[]}
|
|
55
|
+
* @description rks变更记录
|
|
56
|
+
*/
|
|
57
|
+
this.rks = [];
|
|
58
|
+
|
|
59
|
+
data?.rks?.forEach(item => {
|
|
60
|
+
this.rks.push({
|
|
61
|
+
date: new Date(item.date),
|
|
62
|
+
value: item.value
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @type {formatedHistoryBaseObject<number>[]}
|
|
68
|
+
* @description 课题模式成绩
|
|
69
|
+
*/
|
|
70
|
+
this.challengeModeRank = [];
|
|
71
|
+
|
|
72
|
+
data?.challengeModeRank?.forEach(item => {
|
|
73
|
+
this.challengeModeRank.push({
|
|
74
|
+
date: new Date(item.date),
|
|
75
|
+
value: item.value
|
|
76
|
+
})
|
|
77
|
+
});
|
|
78
|
+
/**v1.0,取消对当次更新内容的存储,取消对task的记录,更正scoreHistory */
|
|
79
|
+
/**v1.1,更正scoreHistory */
|
|
80
|
+
/**v2,由于曲名错误,删除所有记录,曲名使用id记录 */
|
|
81
|
+
/**v3,添加课题模式历史记录 */
|
|
82
|
+
/**历史记录版本号 */
|
|
83
|
+
this.version = data?.version
|
|
84
|
+
/**民间考核 */
|
|
85
|
+
|
|
86
|
+
/**检查版本 */
|
|
87
|
+
if (!this.version || this.version < 2) {
|
|
88
|
+
if (this.scoreHistory) {
|
|
89
|
+
for (let i in this.scoreHistory) {
|
|
90
|
+
if (!i.includes('.0')) {
|
|
91
|
+
this.scoreHistory = {}
|
|
92
|
+
}
|
|
93
|
+
break
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
this.version = 2
|
|
97
|
+
}
|
|
98
|
+
if (this.version < 3) {
|
|
99
|
+
this.challengeModeRank = []
|
|
100
|
+
this.version = 3
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 合并记录
|
|
106
|
+
* @param {saveHistory} data 另一个 History 存档
|
|
107
|
+
*/
|
|
108
|
+
add(data) {
|
|
109
|
+
this.data = merge(this.data, data.data)
|
|
110
|
+
this.rks = merge(this.rks, data.rks)
|
|
111
|
+
this.challengeModeRank = merge(this.challengeModeRank, data.challengeModeRank)
|
|
112
|
+
const ids = fCompute.objectKeys(data.scoreHistory || {})
|
|
113
|
+
for (let id of ids) {
|
|
114
|
+
if (!this.scoreHistory[id]) this.scoreHistory[id] = {}
|
|
115
|
+
for (let dif of allLevel) {
|
|
116
|
+
if (this.scoreHistory[id] && this.scoreHistory[id][dif]) {
|
|
117
|
+
if (data.scoreHistory[id][dif]) {
|
|
118
|
+
this.scoreHistory[id][dif] = [...this.scoreHistory[id][dif], ...data.scoreHistory[id][dif]]
|
|
119
|
+
this.scoreHistory[id][dif].sort((a, b) => {
|
|
120
|
+
return openHistory(a).date.getTime() - openHistory(b).date.getTime()
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
this.scoreHistory[id][dif] = data.scoreHistory[id][dif]
|
|
125
|
+
}
|
|
126
|
+
if (!this.scoreHistory[id][dif]) continue
|
|
127
|
+
let i = 1
|
|
128
|
+
while (i < this.scoreHistory[id][dif].length) {
|
|
129
|
+
let last = openHistory(this.scoreHistory[id][dif][i - 1])
|
|
130
|
+
let now = openHistory(this.scoreHistory[id][dif][i])
|
|
131
|
+
if (last.score == now.score && last.acc == now.acc && last.fc == now.fc) {
|
|
132
|
+
// console.info(last.date.toISOString(), now.date.toISOString())
|
|
133
|
+
this.scoreHistory[id][dif].splice(i, 1)
|
|
134
|
+
} else {
|
|
135
|
+
++i
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 检查新存档中的变更并记录
|
|
144
|
+
* @param {Save} save 新存档
|
|
145
|
+
*/
|
|
146
|
+
update(save) {
|
|
147
|
+
/**更新单曲成绩 */
|
|
148
|
+
const ids = fCompute.objectKeys(save.gameRecord || {})
|
|
149
|
+
for (let id of ids) {
|
|
150
|
+
if (!this.scoreHistory[id]) this.scoreHistory[id] = {}
|
|
151
|
+
for (let i in save.gameRecord[id]) {
|
|
152
|
+
/**难度映射 */
|
|
153
|
+
let level = allLevel[i]
|
|
154
|
+
/**
|
|
155
|
+
* 提取成绩
|
|
156
|
+
* @type {LevelRecordInfo & {date?: Date} | null}
|
|
157
|
+
*/
|
|
158
|
+
let now = save.gameRecord[id][i]
|
|
159
|
+
if (!now) continue
|
|
160
|
+
now.date = save.saveInfo.modifiedAt.iso
|
|
161
|
+
/**本地无记录 */
|
|
162
|
+
if (!this.scoreHistory[id][level] || !this.scoreHistory[id][level].length) {
|
|
163
|
+
this.scoreHistory[id][level] = [createHistory(now.acc, now.score, save.saveInfo.modifiedAt.iso, now.fc)];
|
|
164
|
+
continue
|
|
165
|
+
}
|
|
166
|
+
/**新存档该难度无成绩 */
|
|
167
|
+
if (!save.gameRecord[id][i]) continue
|
|
168
|
+
/**本地记录日期为递增 */
|
|
169
|
+
for (let i = this.scoreHistory[id][level].length - 1; i >= 0; --i) {
|
|
170
|
+
/**第i项记录 */
|
|
171
|
+
let old = openHistory(this.scoreHistory[id][level][i])
|
|
172
|
+
// console.info(old.date.toISOString(), new Date(now.date).toISOString(), old.date.toISOString() == new Date(now.date).toISOString())
|
|
173
|
+
/**日期完全相同则认为已存储 */
|
|
174
|
+
if (old.score == now.score && old.acc == now.acc && old.fc == now.fc) {
|
|
175
|
+
/**标记已处理 */
|
|
176
|
+
now = null
|
|
177
|
+
break
|
|
178
|
+
}
|
|
179
|
+
/**找到第一个日期小于新成绩的日期 */
|
|
180
|
+
if (old.date < new Date(now.date)) {
|
|
181
|
+
/**历史记录acc仅保存4位,检查是否与第一个小于该日期的记录一致 */
|
|
182
|
+
if (old.acc != Number(now.acc.toFixed(4)) || old.score != now.score || old.fc != now.fc) {
|
|
183
|
+
/**不一致在第i项插入 */
|
|
184
|
+
this.scoreHistory[id][level].splice(i, 0, createHistory(now.acc, now.score, save.saveInfo.modifiedAt.iso, now.fc))
|
|
185
|
+
}
|
|
186
|
+
/**标记已处理 */
|
|
187
|
+
now = null
|
|
188
|
+
break
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**未被处理,有该难度记录,说明日期早于本地记录 */
|
|
192
|
+
if (now) {
|
|
193
|
+
// console.info(11)
|
|
194
|
+
this.scoreHistory[id][level].unshift(createHistory(now.acc, now.score, save.saveInfo.modifiedAt.iso, now.fc))
|
|
195
|
+
}
|
|
196
|
+
/**查重 */
|
|
197
|
+
let j = 1
|
|
198
|
+
while (j < this.scoreHistory[id][level].length) {
|
|
199
|
+
let last = openHistory(this.scoreHistory[id][level][j - 1])
|
|
200
|
+
let now = openHistory(this.scoreHistory[id][level][j])
|
|
201
|
+
if (last.score == now.score && last.acc == now.acc && last.fc == now.fc) {
|
|
202
|
+
// console.info(last.date.toISOString(), now.date.toISOString())
|
|
203
|
+
this.scoreHistory[id][level].splice(j, 1)
|
|
204
|
+
} else {
|
|
205
|
+
++j
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**更新rks记录 */
|
|
211
|
+
for (let i = this.rks.length - 1; i >= 0; i--) {
|
|
212
|
+
if (save.saveInfo.modifiedAt.iso > new Date(this.rks[i].date)) {
|
|
213
|
+
if (!this.rks[i + 1] || (this.rks[i].value != save.saveInfo.summary.rankingScore || this.rks[i + 1]?.value != save.saveInfo.summary.rankingScore)) {
|
|
214
|
+
this.rks.splice(i + 1, 0, {
|
|
215
|
+
date: save.saveInfo.modifiedAt.iso,
|
|
216
|
+
value: save.saveInfo.summary.rankingScore
|
|
217
|
+
})
|
|
218
|
+
}
|
|
219
|
+
break
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (!this.rks.length) {
|
|
223
|
+
this.rks.push({
|
|
224
|
+
date: save.saveInfo.modifiedAt.iso,
|
|
225
|
+
value: save.saveInfo.summary.rankingScore
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
/**更新data记录 */
|
|
229
|
+
for (let i = this.data.length - 1; i >= 0; i--) {
|
|
230
|
+
if (save.saveInfo.modifiedAt.iso > new Date(this.data[i].date)) {
|
|
231
|
+
if (!this.data[i + 1] || (checkValue(this.data[i].value, save.gameProgress.money) && checkValue(this.data[i + 1]?.value, save.gameProgress.money))) {
|
|
232
|
+
this.data.splice(i + 1, 0, {
|
|
233
|
+
date: save.saveInfo.modifiedAt.iso,
|
|
234
|
+
value: save.gameProgress.money
|
|
235
|
+
})
|
|
236
|
+
}
|
|
237
|
+
break
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!this.data.length) {
|
|
241
|
+
this.data.push({
|
|
242
|
+
date: save.saveInfo.modifiedAt.iso,
|
|
243
|
+
value: save.gameProgress.money
|
|
244
|
+
})
|
|
245
|
+
}
|
|
246
|
+
/**更新课题模式记录 */
|
|
247
|
+
for (let i = this.challengeModeRank.length - 1; i >= 0; i--) {
|
|
248
|
+
if (save.saveInfo.modifiedAt.iso > new Date(this.challengeModeRank[i].date)) {
|
|
249
|
+
let clg = save.saveInfo.summary.challengeModeRank
|
|
250
|
+
if (clg != this.challengeModeRank[i].value && (this.challengeModeRank[i + 1]?.value != clg)) {
|
|
251
|
+
this.challengeModeRank.splice(i + 1, 0, {
|
|
252
|
+
date: save.saveInfo.modifiedAt.iso,
|
|
253
|
+
value: save.saveInfo.summary.challengeModeRank
|
|
254
|
+
})
|
|
255
|
+
}
|
|
256
|
+
break
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
if (!this.challengeModeRank.length) {
|
|
260
|
+
this.challengeModeRank.push({
|
|
261
|
+
date: save.saveInfo.modifiedAt.iso,
|
|
262
|
+
value: save.saveInfo.summary.challengeModeRank
|
|
263
|
+
})
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* 根据给定日期还原该日期前最新的存档状态
|
|
269
|
+
* @param {Date|string} date 目标日期
|
|
270
|
+
* @returns {{ gameRecord: Record<idString, (LevelRecordInfo | null)[]>, money: number[], rks: number, challengeModeRank: number, version: number }}
|
|
271
|
+
*/
|
|
272
|
+
restoreToDate(date) {
|
|
273
|
+
const targetDate = new Date(date)
|
|
274
|
+
|
|
275
|
+
/** @type {Record<idString, (LevelRecordInfo | null)[]>} */
|
|
276
|
+
const gameRecord = {}
|
|
277
|
+
const ids = fCompute.objectKeys(this.scoreHistory)
|
|
278
|
+
|
|
279
|
+
// 1. 还原每首歌每个难度在目标日期前最新的成绩
|
|
280
|
+
for (const id of ids) {
|
|
281
|
+
const songHistory = this.scoreHistory[id]
|
|
282
|
+
gameRecord[id] = []
|
|
283
|
+
|
|
284
|
+
for (let levelIdx = 0; levelIdx < allLevel.length; levelIdx++) {
|
|
285
|
+
const level = allLevel[levelIdx]
|
|
286
|
+
const records = songHistory[level]
|
|
287
|
+
if (!records || !records.length) {
|
|
288
|
+
gameRecord[id][levelIdx] = null
|
|
289
|
+
continue
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
// 二分查找最后一个 <= targetDate 的记录(records 按日期升序)
|
|
293
|
+
let selected = null
|
|
294
|
+
for (const record of records) {
|
|
295
|
+
const recordDate = new Date(record[2])
|
|
296
|
+
if (recordDate <= targetDate) {
|
|
297
|
+
selected = record
|
|
298
|
+
} else {
|
|
299
|
+
break
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (selected) {
|
|
304
|
+
const opened = openHistory(selected)
|
|
305
|
+
gameRecord[id][levelIdx] = new LevelRecordInfo(
|
|
306
|
+
{ acc: opened.acc, score: opened.score, fc: opened.fc },
|
|
307
|
+
id,
|
|
308
|
+
levelIdx
|
|
309
|
+
)
|
|
310
|
+
} else {
|
|
311
|
+
gameRecord[id][levelIdx] = null
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
// 2. 还原 data 货币数量
|
|
317
|
+
let money = null
|
|
318
|
+
for (let i = this.data.length - 1; i >= 0; i--) {
|
|
319
|
+
if (this.data[i].date <= targetDate) {
|
|
320
|
+
money = this.data[i].value
|
|
321
|
+
break
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (!money) money = [0, 0, 0, 0, 0]
|
|
325
|
+
|
|
326
|
+
// 3. 还原 rks
|
|
327
|
+
let rks = 0
|
|
328
|
+
for (let i = this.rks.length - 1; i >= 0; i--) {
|
|
329
|
+
if (this.rks[i].date <= targetDate) {
|
|
330
|
+
rks = this.rks[i].value
|
|
331
|
+
break
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// 4. 还原 challengeModeRank
|
|
336
|
+
let challengeModeRank = 0
|
|
337
|
+
for (let i = this.challengeModeRank.length - 1; i >= 0; i--) {
|
|
338
|
+
if (this.challengeModeRank[i].date <= targetDate) {
|
|
339
|
+
challengeModeRank = this.challengeModeRank[i].value
|
|
340
|
+
break
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
return {
|
|
345
|
+
gameRecord,
|
|
346
|
+
money,
|
|
347
|
+
rks,
|
|
348
|
+
challengeModeRank,
|
|
349
|
+
version: this.version
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* 获取歌曲最新的历史记录
|
|
355
|
+
* @param {idString} id 曲目id
|
|
356
|
+
* @returns
|
|
357
|
+
*/
|
|
358
|
+
async getSongsLastRecord(id) {
|
|
359
|
+
let t = { ...this.scoreHistory[id] }
|
|
360
|
+
/**
|
|
361
|
+
* @type {Partial<Record<allLevelKind, LevelRecordInfo & {date?: Date}>>}
|
|
362
|
+
*/
|
|
363
|
+
const result = {}
|
|
364
|
+
for (let level of allLevel) {
|
|
365
|
+
if (!t[level]) continue
|
|
366
|
+
const lastRecord = t[level] ? openHistory(t[level][t[level].length - 1]) : null
|
|
367
|
+
if (!lastRecord) continue
|
|
368
|
+
let date = lastRecord?.date
|
|
369
|
+
result[level] = new LevelRecordInfo(lastRecord, id, LevelNum[level])
|
|
370
|
+
result[level].date = date
|
|
371
|
+
}
|
|
372
|
+
return result
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* @typedef {Object} rksAndDataLineObject
|
|
377
|
+
* @property {Array<Array<number>>} rks_history - RKS历史折线数据点集合
|
|
378
|
+
* @property {number[]} rks_range - RKS值域范围 [min, max]
|
|
379
|
+
* @property {number[]} rks_date - RKS时间戳范围 [最早, 最晚]
|
|
380
|
+
* @property {number[][]} data_history - 数据历史折线数据点集合
|
|
381
|
+
* @property {(number | string)[]} data_range - 数据值域范围,可能为数值数组 [min, max] 或格式化字符串数组,如 ['1MiB', '4GiB']
|
|
382
|
+
* @property {number[]} data_date - 数据时间戳范围 [最早, 最晚]
|
|
383
|
+
*/
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* 折线图数据
|
|
387
|
+
* @returns {rksAndDataLineObject}
|
|
388
|
+
*/
|
|
389
|
+
getRksAndDataLine() {
|
|
390
|
+
let rks = this.getRksLine()
|
|
391
|
+
let data = this.getDataLine()
|
|
392
|
+
return { ...rks, ...data }
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
getRksLine() {
|
|
396
|
+
|
|
397
|
+
/**@type {formatedHistoryBaseObject<number>[]} */
|
|
398
|
+
let rks_history_ = []
|
|
399
|
+
let user_rks_data = this.rks
|
|
400
|
+
let rks_range = [MAX_DIFFICULTY, 0]
|
|
401
|
+
/** @type {[dateBegin: number, dateAfter: number]} */
|
|
402
|
+
let rks_date = [0, 0];
|
|
403
|
+
let rks_history = []
|
|
404
|
+
|
|
405
|
+
if (user_rks_data.length) {
|
|
406
|
+
rks_date = [new Date(user_rks_data[0].date).getTime(), 0]
|
|
407
|
+
user_rks_data.forEach((item, i) => {
|
|
408
|
+
item.date = new Date(item.date)
|
|
409
|
+
if (i <= 1 || item.value != rks_history_[rks_history_.length - 2].value) {
|
|
410
|
+
rks_history_.push(item)
|
|
411
|
+
rks_range[0] = Math.min(rks_range[0], item.value)
|
|
412
|
+
rks_range[1] = Math.max(rks_range[1], item.value)
|
|
413
|
+
} else {
|
|
414
|
+
rks_history_[rks_history_.length - 1].date = item.date
|
|
415
|
+
}
|
|
416
|
+
rks_date[1] = item.date.getTime()
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
rks_history_.forEach((item, i) => {
|
|
420
|
+
|
|
421
|
+
i = Number(i)
|
|
422
|
+
|
|
423
|
+
if (!rks_history_[i + 1]) return
|
|
424
|
+
let x1 = fCompute.range(item.date.getTime(), rks_date)
|
|
425
|
+
let y1 = fCompute.range(item.value, rks_range)
|
|
426
|
+
let x2 = fCompute.range(rks_history_[i + 1].date.getTime(), rks_date)
|
|
427
|
+
let y2 = fCompute.range(rks_history_[i + 1].value, rks_range)
|
|
428
|
+
rks_history.push([x1, y1, x2, y2])
|
|
429
|
+
});
|
|
430
|
+
if (!rks_history.length) {
|
|
431
|
+
rks_history.push([0, 50, 100, 50])
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
|
|
436
|
+
return {
|
|
437
|
+
rks_history,
|
|
438
|
+
rks_range,
|
|
439
|
+
rks_date,
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
getDataLine() {
|
|
444
|
+
|
|
445
|
+
/**@type {formatedHistoryBaseObject<number>[]} */
|
|
446
|
+
let data_history_ = []
|
|
447
|
+
let user_data_data = this.data
|
|
448
|
+
const data_range_num = [1e16, 0]
|
|
449
|
+
const data_range = ['', '']
|
|
450
|
+
/** @type {[dateBegin: number, dateAfter: number] | []} */
|
|
451
|
+
let data_date = []
|
|
452
|
+
/** @type {[x1: number, y1: number, x2: number, y2: number][]} */
|
|
453
|
+
let data_history = []
|
|
454
|
+
|
|
455
|
+
if (user_data_data.length) {
|
|
456
|
+
data_date = [new Date(user_data_data[0].date).getTime(), 0]
|
|
457
|
+
user_data_data.forEach((item, i) => {
|
|
458
|
+
const value = item.value
|
|
459
|
+
const totValue = (((value[4] * 1024 + value[3]) * 1024 + value[2]) * 1024 + value[1]) * 1024 + value[0]
|
|
460
|
+
item.date = new Date(item.date)
|
|
461
|
+
const temObj = {
|
|
462
|
+
date: item.date,
|
|
463
|
+
value: totValue
|
|
464
|
+
}
|
|
465
|
+
if (i <= 1 || temObj.value != data_history_[data_history_.length - 2].value) {
|
|
466
|
+
data_history_.push(temObj)
|
|
467
|
+
data_range_num[0] = Math.min(data_range_num[0], totValue)
|
|
468
|
+
data_range_num[1] = Math.max(data_range_num[1], totValue)
|
|
469
|
+
} else {
|
|
470
|
+
data_history_[data_history_.length - 1].date = item.date
|
|
471
|
+
}
|
|
472
|
+
data_date[1] = item.date.getTime()
|
|
473
|
+
})
|
|
474
|
+
|
|
475
|
+
data_history_.forEach((item, i) => {
|
|
476
|
+
|
|
477
|
+
i = Number(i)
|
|
478
|
+
|
|
479
|
+
if (!data_history_[i + 1]) return
|
|
480
|
+
let x1 = fCompute.range(item.date.getTime(), data_date)
|
|
481
|
+
let y1 = fCompute.range(item.value, data_range_num)
|
|
482
|
+
let x2 = fCompute.range(data_history_[i + 1].date.getTime(), data_date)
|
|
483
|
+
let y2 = fCompute.range(data_history_[i + 1].value, data_range_num)
|
|
484
|
+
data_history.push([x1, y1, x2, y2])
|
|
485
|
+
})
|
|
486
|
+
if (!data_history.length) {
|
|
487
|
+
data_history.push([0, 50, 100, 50])
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
let unit = ["KiB", "MiB", "GiB", "TiB", "Pib"]
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
for (const i of [4, 3, 2, 1, 0]) {
|
|
496
|
+
if (data_range_num[0] / (Math.pow(1024, i)) < 1024) {
|
|
497
|
+
data_range[0] = `${Math.floor(data_range_num[0] / (Math.pow(1024, i)))}${unit[i]}`
|
|
498
|
+
break;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
for (const i of [4, 3, 2, 1, 0]) {
|
|
503
|
+
if (data_range_num[1] / (Math.pow(1024, i)) < 1024) {
|
|
504
|
+
data_range[1] = `${Math.floor(data_range_num[1] / (Math.pow(1024, i)))}${unit[i]}`
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return {
|
|
511
|
+
data_history,
|
|
512
|
+
data_range: data_range_num,
|
|
513
|
+
data_date
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* 数组合并按照 date 排序并去重
|
|
521
|
+
* @param {formatedHistoryBaseObject<any>[]} m
|
|
522
|
+
* @param {formatedHistoryBaseObject<any>[]} n
|
|
523
|
+
*/
|
|
524
|
+
function merge(m, n) {
|
|
525
|
+
let t = m.concat(n)
|
|
526
|
+
t.sort((a, b) => {
|
|
527
|
+
return new Date(a.date).getTime() - new Date(b.date).getTime()
|
|
528
|
+
})
|
|
529
|
+
let i = 1
|
|
530
|
+
while (i < t.length - 1) {
|
|
531
|
+
/**因绘制折线图需要,需要保留同一值两端 */
|
|
532
|
+
if (checkValue(t[i].value, t[i - 1].value) && checkValue(t[i].value, t[i + 1].value)) {
|
|
533
|
+
t.splice(i, 1)
|
|
534
|
+
} else {
|
|
535
|
+
++i
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return t
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
/**
|
|
542
|
+
*
|
|
543
|
+
* @param {number} acc
|
|
544
|
+
* @param {number} score
|
|
545
|
+
* @param {Date} date
|
|
546
|
+
* @param {boolean} fc
|
|
547
|
+
* @returns {ScoreDetail}
|
|
548
|
+
*/
|
|
549
|
+
function createHistory(acc, score, date, fc) {
|
|
550
|
+
return [acc.toFixed(4), score, date.toISOString(), fc]
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* 展开信息
|
|
556
|
+
* @param {ScoreDetail} data 历史成绩
|
|
557
|
+
*/
|
|
558
|
+
function openHistory(data) {
|
|
559
|
+
return {
|
|
560
|
+
acc: Number(data[0]),
|
|
561
|
+
score: Number(data[1]),
|
|
562
|
+
date: new Date(data[2]),
|
|
563
|
+
fc: Boolean(data[3])
|
|
564
|
+
}
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* 比较两个数组
|
|
569
|
+
* @param {any} a
|
|
570
|
+
* @param {any} b
|
|
571
|
+
* @returns {boolean}
|
|
572
|
+
*/
|
|
573
|
+
function checkValue(a, b) {
|
|
574
|
+
/**非数组 */
|
|
575
|
+
if (Object.prototype.toString.call(a) != '[object Array]') {
|
|
576
|
+
return a == b
|
|
577
|
+
}
|
|
578
|
+
if (!a || !b) {
|
|
579
|
+
return false
|
|
580
|
+
}
|
|
581
|
+
/**数组 */
|
|
582
|
+
for (let i in a) {
|
|
583
|
+
if (a[i] != b[i]) return false
|
|
584
|
+
}
|
|
585
|
+
return true
|
|
586
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import fCompute from "../game/fCompute.js"
|
|
2
|
+
import getInfo from "../game/getInfo.js"
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {object} extendedScoreHistoryDetail
|
|
7
|
+
* @property {idString|object} song 曲目id或曲目对象
|
|
8
|
+
* @property {allLevelKind} rank 难度
|
|
9
|
+
* @property {string} illustration 插画链接
|
|
10
|
+
* @property {string} Rating 该成绩的Rating
|
|
11
|
+
* @property {number} [rks_new] 新成绩的RKS
|
|
12
|
+
* @property {number} [rks_old] 旧成绩的RKS
|
|
13
|
+
* @property {number} acc_new 新成绩的准确率
|
|
14
|
+
* @property {number} [acc_old] 旧成绩的准确率
|
|
15
|
+
* @property {number} score_new 新成绩的分数
|
|
16
|
+
* @property {number} [score_old] 旧成绩的分数
|
|
17
|
+
* @property {Date} date_new 新成绩的日期
|
|
18
|
+
* @property {Date} [date_old] 旧成绩的日期
|
|
19
|
+
*/
|
|
20
|
+
export default class ScoreHistory {
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 生成成绩记录数组
|
|
24
|
+
* @param {number} acc
|
|
25
|
+
* @param {number} score
|
|
26
|
+
* @param {Date} date
|
|
27
|
+
* @param {boolean} fc
|
|
28
|
+
* @returns []
|
|
29
|
+
*/
|
|
30
|
+
static create(acc, score, date, fc) {
|
|
31
|
+
return [acc.toFixed(4), score, date, fc]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* 扩充信息
|
|
36
|
+
* @param {idString} songId 曲目id
|
|
37
|
+
* @param {allLevelKind} level 难度
|
|
38
|
+
* @param {ScoreDetail} now
|
|
39
|
+
* @param {ScoreDetail} [old=undefined]
|
|
40
|
+
* @returns {extendedScoreHistoryDetail} 扩展后的成绩信息
|
|
41
|
+
*/
|
|
42
|
+
static extend(songId, level, now, old = undefined) {
|
|
43
|
+
let song = getInfo.idgetsong(songId) || songId
|
|
44
|
+
let nowAcc = Number(now[0])
|
|
45
|
+
let oldAcc = old ? Number(old[0]) : undefined
|
|
46
|
+
const info = getInfo.info(songId, true)
|
|
47
|
+
if (info?.chart[level]?.difficulty) {
|
|
48
|
+
/**有难度信息 */
|
|
49
|
+
return {
|
|
50
|
+
song: song,
|
|
51
|
+
rank: level,
|
|
52
|
+
illustration: getInfo.getill(songId),
|
|
53
|
+
Rating: fCompute.rate(now[1], now[3]),
|
|
54
|
+
rks_new: fCompute.rks(nowAcc, info.chart[level].difficulty),
|
|
55
|
+
rks_old: oldAcc ? fCompute.rks(oldAcc, info.chart[level].difficulty) : undefined,
|
|
56
|
+
acc_new: nowAcc,
|
|
57
|
+
acc_old: old ? oldAcc : undefined,
|
|
58
|
+
score_new: now[1],
|
|
59
|
+
score_old: old ? old[1] : undefined,
|
|
60
|
+
date_new: new Date(now[2]),
|
|
61
|
+
date_old: old ? new Date(old[2]) : undefined
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
/**无难度信息 */
|
|
65
|
+
return {
|
|
66
|
+
song: song,
|
|
67
|
+
rank: level,
|
|
68
|
+
illustration: getInfo.getill(songId),
|
|
69
|
+
Rating: fCompute.rate(now[1], now[3]),
|
|
70
|
+
acc_new: nowAcc,
|
|
71
|
+
acc_old: old ? oldAcc : undefined,
|
|
72
|
+
score_new: now[1],
|
|
73
|
+
score_old: old ? old[1] : undefined,
|
|
74
|
+
date_new: new Date(now[2]),
|
|
75
|
+
date_old: old ? new Date(old[2]) : undefined
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 展开信息
|
|
82
|
+
* @param {ScoreDetail} data 历史成绩
|
|
83
|
+
*/
|
|
84
|
+
static open(data) {
|
|
85
|
+
return {
|
|
86
|
+
acc: Number(data[0]),
|
|
87
|
+
score: data[1],
|
|
88
|
+
date: new Date(data[2]),
|
|
89
|
+
fc: Boolean(data[3])
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 获取该成绩记录的日期
|
|
95
|
+
* @param {ScoreDetail} data 成绩记录
|
|
96
|
+
* @returns {Date} 该成绩的日期
|
|
97
|
+
*/
|
|
98
|
+
static date(data) {
|
|
99
|
+
return new Date(data[2])
|
|
100
|
+
}
|
|
101
|
+
}
|