@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,17 @@
|
|
|
1
|
+
import fCompute from '../game/fCompute.js'
|
|
2
|
+
|
|
3
|
+
export default class makeRequestFnc {
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @param {import('../../components/baseClass.js').botEvent } e
|
|
7
|
+
* @returns {import('./makeRequest.js').platformAuth}
|
|
8
|
+
*/
|
|
9
|
+
static makePlatform(e) {
|
|
10
|
+
return {
|
|
11
|
+
platform: fCompute.getAdapterName(e),
|
|
12
|
+
platform_id: typeof e.user_id == 'string' ? e.user_id.replace('', ':') : `${e.user_id}`,
|
|
13
|
+
_local_user_id: `${e.user_id}`,
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Config } from '../../components/index.js'
|
|
2
|
+
import logger from '../../components/Logger.js'
|
|
3
|
+
import autoSeekApi from './autoSeekApi.js'
|
|
4
|
+
import botApiAuth from './botApiAuth.js'
|
|
5
|
+
import {
|
|
6
|
+
classifyApiConnectionError,
|
|
7
|
+
isApiConnectionError,
|
|
8
|
+
PhiApiError,
|
|
9
|
+
} from './phiApiErrors.js'
|
|
10
|
+
import { isApiVersionBlocked } from './apiVersion.js'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 发送带 Bot HMAC 的底层 phi-plugin-api 请求。
|
|
14
|
+
* 用户身份由请求体中的 sessionToken 或 API ID确定,本函数只负责 Bot HMAC 传输。
|
|
15
|
+
* @param {string} originalPath 包含查询参数的 API 原始路径
|
|
16
|
+
* @param {any} [params] 最终发送的请求参数
|
|
17
|
+
* @param {'POST'|'GET'|'PUT'} [method='POST'] HTTP 方法
|
|
18
|
+
* @param {{timeout?:number}} [transportOptions] 端点专用传输选项
|
|
19
|
+
* @returns {Promise<any>} API JSON 响应
|
|
20
|
+
*/
|
|
21
|
+
async function request(originalPath, params = {}, method = 'POST', transportOptions = {}) {
|
|
22
|
+
if (isApiVersionBlocked()) {
|
|
23
|
+
throw new PhiApiError(
|
|
24
|
+
'API协议大版本不兼容,请更新 phi-plugin 后重启',
|
|
25
|
+
0,
|
|
26
|
+
'api_version_incompatible',
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
await botApiAuth.initialize()
|
|
31
|
+
const json = await botApiAuth.signedRequest(originalPath, params, method, undefined, {}, transportOptions)
|
|
32
|
+
if (Config.getUserCfg('config', 'debug') > 3) {
|
|
33
|
+
logger.info(`[phi-plugin] API请求成功: ${originalPath}`)
|
|
34
|
+
}
|
|
35
|
+
return json
|
|
36
|
+
} catch (/** @type {any} */ error) {
|
|
37
|
+
if (error instanceof PhiApiError) {
|
|
38
|
+
logger.warn(`[phi-plugin] API请求失败 ${originalPath}: ${error.code} (${error.status})`)
|
|
39
|
+
if (isApiConnectionError(error)) autoSeekApi.seekApi()
|
|
40
|
+
throw error
|
|
41
|
+
}
|
|
42
|
+
logger.error(`[phi-plugin] API网络错误 ${originalPath}: ${error?.message || String(error)}`)
|
|
43
|
+
autoSeekApi.seekApi()
|
|
44
|
+
throw classifyApiConnectionError(error)
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* phi-plugin-api 的全局请求实例。业务模块统一导入该实例,不传递请求函数。
|
|
50
|
+
*/
|
|
51
|
+
export const phiApiClient = { request }
|
|
52
|
+
|
|
53
|
+
export default phiApiClient
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import Config from '../../components/Config.js'
|
|
2
|
+
|
|
3
|
+
export class PhiApiError extends Error {
|
|
4
|
+
/** @param {string} message @param {number} [status] @param {string} [code] @param {any} [data] */
|
|
5
|
+
constructor(message, status = 0, code = 'api_request_failed', data = undefined) {
|
|
6
|
+
super(message)
|
|
7
|
+
this.name = 'PhiApiError'
|
|
8
|
+
this.status = status
|
|
9
|
+
this.code = code
|
|
10
|
+
this.data = data
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const FATAL_IDENTITY_ERROR_CODES = new Set([
|
|
15
|
+
'bot_client_unknown',
|
|
16
|
+
'bot_client_revoked',
|
|
17
|
+
'bot_key_version_invalid',
|
|
18
|
+
'bot_signature_invalid',
|
|
19
|
+
])
|
|
20
|
+
|
|
21
|
+
const CONNECTION_ERROR_CODES = new Set([
|
|
22
|
+
'api_timeout',
|
|
23
|
+
'api_dns_error',
|
|
24
|
+
'api_connection_refused',
|
|
25
|
+
'api_tls_error',
|
|
26
|
+
'api_network_error',
|
|
27
|
+
'api_offline',
|
|
28
|
+
])
|
|
29
|
+
|
|
30
|
+
/** @type {Record<string, string | (() => string)>} */
|
|
31
|
+
const USER_ERROR_MESSAGES = {
|
|
32
|
+
api_timeout: 'API请求超时,请稍后重试。',
|
|
33
|
+
api_dns_error: '无法解析API地址,请Bot主人检查网络或API地址配置。',
|
|
34
|
+
api_connection_refused: 'API暂时拒绝连接,插件会自动重试。',
|
|
35
|
+
api_tls_error: 'API证书校验失败,请Bot主人检查系统时间或证书配置。',
|
|
36
|
+
api_network_error: '连接API时网络异常,插件会自动重试。',
|
|
37
|
+
api_offline: '暂时无法连接API,插件会自动重试。',
|
|
38
|
+
api_version_incompatible: 'API协议大版本不兼容,API功能已自动关闭,请更新 phi-plugin 后重启。',
|
|
39
|
+
bot_identity_missing: 'Bot尚未获得API身份,API恢复后会自动注册。',
|
|
40
|
+
bot_client_unknown: '本地Bot凭证不被API识别,请Bot主人执行“重置API Bot身份”。',
|
|
41
|
+
bot_client_revoked: '该Bot身份已被撤销,请Bot主人执行“重置API Bot身份”。',
|
|
42
|
+
bot_key_version_invalid: 'Bot密钥版本已失效,请Bot主人执行“重置API Bot身份”。',
|
|
43
|
+
bot_signature_invalid: 'Bot凭证签名校验失败,请Bot主人执行“重置API Bot身份”。',
|
|
44
|
+
bot_registration_rate_limited: 'Bot身份申请过于频繁,插件稍后会自动重试。',
|
|
45
|
+
invalid_registration_response: 'API返回的Bot身份数据无效,插件稍后会自动重试。',
|
|
46
|
+
theme_store_bot_not_whitelisted: '当前 Bot 未被主题商店授权安装该主题。',
|
|
47
|
+
theme_not_allowed_by_bot: 'Bot 主人设置的主题范围不允许使用该主题。',
|
|
48
|
+
theme_not_found: '主题商店中未找到该主题,或主题尚未发布。',
|
|
49
|
+
theme_version_not_found: '主题商店中未找到可安装的主题版本。',
|
|
50
|
+
theme_version_incompatible: '当前 phi-plugin 版本与该主题不兼容。',
|
|
51
|
+
theme_download_rate_limited: '主题下载请求过于频繁,请稍后重试。',
|
|
52
|
+
theme_store_invalid_response: '主题商店返回了无效数据,请稍后重试。',
|
|
53
|
+
theme_store_unavailable: '主题商店暂时不可用,请稍后重试。',
|
|
54
|
+
integration_not_configured: '主题商店集成尚未配置,请联系服务管理员。',
|
|
55
|
+
binding_not_found: '当前平台账号尚未绑定,请使用sessionToken绑定。',
|
|
56
|
+
bot_user_credential_required: '当前请求缺少 sessionToken 或 API ID,请重新绑定。',
|
|
57
|
+
binding_conflict_requires_sstk: '当前平台已绑定其他查分ID,请使用sessionToken重新绑定。',
|
|
58
|
+
user_id_binding_disabled: () => {
|
|
59
|
+
const commandHead = `${Config.getUserCfg('config', 'cmdhead')}`
|
|
60
|
+
return `该用户未开启API ID绑定,请使用 /${commandHead} bind <sessionToken> 或 /${commandHead} bind qrcode 扫码重新绑定。`
|
|
61
|
+
},
|
|
62
|
+
user_not_found: '未找到对应的查分ID,请检查后重试。',
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @param {any} error */
|
|
66
|
+
export function classifyApiConnectionError(error) {
|
|
67
|
+
if (error instanceof PhiApiError) return error
|
|
68
|
+
const nativeCode = String(error?.code || error?.cause?.code || '').toUpperCase()
|
|
69
|
+
const nativeMessage = String(error?.message || error?.cause?.message || '').toLowerCase()
|
|
70
|
+
|
|
71
|
+
if (nativeCode === 'ECONNABORTED' || nativeCode === 'ETIMEDOUT' || nativeMessage.includes('timeout')) {
|
|
72
|
+
return new PhiApiError('API请求超时', 0, 'api_timeout')
|
|
73
|
+
}
|
|
74
|
+
if (nativeCode === 'ENOTFOUND' || nativeCode === 'EAI_AGAIN') {
|
|
75
|
+
return new PhiApiError('无法解析API地址', 0, 'api_dns_error')
|
|
76
|
+
}
|
|
77
|
+
if (nativeCode === 'ECONNREFUSED') {
|
|
78
|
+
return new PhiApiError('API拒绝连接', 0, 'api_connection_refused')
|
|
79
|
+
}
|
|
80
|
+
if (
|
|
81
|
+
nativeCode.startsWith('ERR_TLS_')
|
|
82
|
+
|| nativeCode.startsWith('CERT_')
|
|
83
|
+
|| nativeCode === 'DEPTH_ZERO_SELF_SIGNED_CERT'
|
|
84
|
+
|| nativeCode === 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
|
|
85
|
+
|| nativeMessage.includes('certificate')
|
|
86
|
+
|| nativeMessage.includes('tls')
|
|
87
|
+
) {
|
|
88
|
+
return new PhiApiError('API证书校验失败', 0, 'api_tls_error')
|
|
89
|
+
}
|
|
90
|
+
if (
|
|
91
|
+
['ECONNRESET', 'ENETUNREACH', 'EHOSTUNREACH', 'ENETDOWN', 'ERR_NETWORK'].includes(nativeCode)
|
|
92
|
+
|| nativeMessage.includes('network error')
|
|
93
|
+
|| nativeMessage.includes('socket hang up')
|
|
94
|
+
) {
|
|
95
|
+
return new PhiApiError('API网络连接异常', 0, 'api_network_error')
|
|
96
|
+
}
|
|
97
|
+
return new PhiApiError('无法连接API', 0, 'api_offline')
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** @param {any} error */
|
|
101
|
+
export function isApiConnectionError(error) {
|
|
102
|
+
return CONNECTION_ERROR_CODES.has(String(error?.code || ''))
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/** @param {any} error */
|
|
106
|
+
export function isFatalBotIdentityError(error) {
|
|
107
|
+
return FATAL_IDENTITY_ERROR_CODES.has(String(error?.code || ''))
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/** @param {any} error */
|
|
111
|
+
export function hasPhiApiUserMessage(error) {
|
|
112
|
+
return Object.hasOwn(USER_ERROR_MESSAGES, String(error?.code || ''))
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** @param {any} error */
|
|
116
|
+
export function getPhiApiUserMessage(error) {
|
|
117
|
+
const code = String(error?.code || '')
|
|
118
|
+
const message = USER_ERROR_MESSAGES[code]
|
|
119
|
+
if (typeof message === 'function') return message()
|
|
120
|
+
return message || error?.message || String(error?.cause || error || '未知错误')
|
|
121
|
+
}
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import YAML from 'yaml'
|
|
3
|
+
import { dataPath, pluginDataPath, savePath } from "./path.js";
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import getRksRank from '../game/getRksRank.js';
|
|
6
|
+
import logger from '../../components/Logger.js';
|
|
7
|
+
import userCredentialStore from '../user/userCredentialStore.js';
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export default class readFile {
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 读取文件
|
|
15
|
+
* @param {string} filePath 完整路径
|
|
16
|
+
* @param {'JSON'|'YAML'|'CSV'|'TSV'|'TXT'} [style=undefined] 强制设置文件格式
|
|
17
|
+
* @returns {Promise<any>|any}
|
|
18
|
+
*/
|
|
19
|
+
static FileReader(filePath, style = undefined) {
|
|
20
|
+
try {
|
|
21
|
+
if (!fs.existsSync(filePath)) { return false }
|
|
22
|
+
// console.info(filePath)
|
|
23
|
+
if (!style) {
|
|
24
|
+
style = /** @type {any} */(path.extname(filePath).toUpperCase().replace('.', ''))
|
|
25
|
+
}
|
|
26
|
+
switch (style) {
|
|
27
|
+
case 'JSON': {
|
|
28
|
+
return JSON.parse(fs.readFileSync(filePath, 'utf8'))
|
|
29
|
+
}
|
|
30
|
+
case 'YAML': {
|
|
31
|
+
return YAML.parse(fs.readFileSync(filePath, 'utf8'))
|
|
32
|
+
}
|
|
33
|
+
case 'CSV':
|
|
34
|
+
case 'TSV': {
|
|
35
|
+
const csvData = fs.readFileSync(filePath, 'utf8').replace(/\r/g, '');
|
|
36
|
+
const lines = csvData.split('\n');
|
|
37
|
+
/**@type {any[]} */
|
|
38
|
+
const result = [];
|
|
39
|
+
const headers = lines[0].split('\t');
|
|
40
|
+
for (let i = 1; i < lines.length; i++) {
|
|
41
|
+
if (!lines[i]) continue;
|
|
42
|
+
/**@type {any} */
|
|
43
|
+
const obj = {};
|
|
44
|
+
const currentline = lines[i].split('\t');
|
|
45
|
+
for (let j = 0; j < headers.length; j++) {
|
|
46
|
+
obj[headers[j]] = currentline[j];
|
|
47
|
+
}
|
|
48
|
+
result.push(obj);
|
|
49
|
+
}
|
|
50
|
+
return result;
|
|
51
|
+
}
|
|
52
|
+
case 'TXT': {
|
|
53
|
+
return fs.readFileSync(filePath, 'utf8')
|
|
54
|
+
}
|
|
55
|
+
default: {
|
|
56
|
+
logger.error(`[phi-plugin][Read]不支持的文件格式`, style, filePath)
|
|
57
|
+
return fs.readFileSync(filePath, 'utf8')
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
logger.warn(`[phi-plugin][${filePath}] 读取失败`)
|
|
62
|
+
logger.warn(error)
|
|
63
|
+
return false
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 存储文件
|
|
69
|
+
* @param {string} filepath 文件名,含后缀
|
|
70
|
+
* @param {any} data 目标数据
|
|
71
|
+
* @param {'JSON'|'YAML'|'TXT'} [style=undefined] 强制指定保存格式
|
|
72
|
+
*/
|
|
73
|
+
static SetFile(filepath, data, style = undefined) {
|
|
74
|
+
try {
|
|
75
|
+
const fatherPath = path.dirname(filepath)
|
|
76
|
+
const fileName = path.basename(filepath)
|
|
77
|
+
// console.info(filepath, fatherPath, fileName)
|
|
78
|
+
if (!fs.existsSync(fatherPath)) {
|
|
79
|
+
// 递归创建目录
|
|
80
|
+
fs.mkdirSync(fatherPath, { recursive: true });
|
|
81
|
+
}
|
|
82
|
+
if (!style) {
|
|
83
|
+
style = /** @type {any} */(path.extname(filepath).toUpperCase().replace('.', ''))
|
|
84
|
+
}
|
|
85
|
+
switch (style) {
|
|
86
|
+
case 'JSON': {
|
|
87
|
+
fs.writeFileSync(filepath, JSON.stringify(data), 'utf8')
|
|
88
|
+
break
|
|
89
|
+
}
|
|
90
|
+
case 'YAML': {
|
|
91
|
+
fs.writeFileSync(filepath, YAML.stringify(data), 'utf8')
|
|
92
|
+
break
|
|
93
|
+
}
|
|
94
|
+
case 'TXT': {
|
|
95
|
+
fs.writeFileSync(filepath, data, 'utf8')
|
|
96
|
+
}
|
|
97
|
+
default: {
|
|
98
|
+
// logger.error(`[phi-plugin][Set]不支持的文件格式`, style, filepath)
|
|
99
|
+
fs.writeFileSync(filepath, data, 'utf8')
|
|
100
|
+
break
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return true
|
|
104
|
+
} catch (error) {
|
|
105
|
+
console.info(error)
|
|
106
|
+
logger.warn(`[phi-plugin]写入文件 ${filepath} 时遇到错误`)
|
|
107
|
+
logger.warn(error)
|
|
108
|
+
return false
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 删除指定文件
|
|
114
|
+
* @param {string} path
|
|
115
|
+
*/
|
|
116
|
+
static async DelFile(path) {
|
|
117
|
+
try {
|
|
118
|
+
if (!fs.existsSync(`${path}`)) { return false }
|
|
119
|
+
fs.unlink(`${path}`, (err) => {
|
|
120
|
+
if (err) throw err
|
|
121
|
+
})
|
|
122
|
+
return true
|
|
123
|
+
} catch (error) {
|
|
124
|
+
logger.warn(`[phi-plugin][${path}] 删除失败`)
|
|
125
|
+
logger.warn(error)
|
|
126
|
+
return false
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 删除指定路径下的所有空文件夹
|
|
132
|
+
* @param {*} _path
|
|
133
|
+
*/
|
|
134
|
+
static async rmEmptyDir(_path, level = 0) {
|
|
135
|
+
if (!fs.existsSync(_path)) return false
|
|
136
|
+
if (!fs.lstatSync(_path).isDirectory()) return false
|
|
137
|
+
const files = fs.readdirSync(_path);
|
|
138
|
+
if (files.length > 0) {
|
|
139
|
+
let tempFile = 0;
|
|
140
|
+
files.forEach(file => {
|
|
141
|
+
tempFile++;
|
|
142
|
+
this.rmEmptyDir(`${_path}/${file}`, 1);
|
|
143
|
+
});
|
|
144
|
+
if (tempFile === files.length && level !== 0 && fs.lstatSync(_path).isDirectory()) {
|
|
145
|
+
try {
|
|
146
|
+
fs.rmdirSync(_path);
|
|
147
|
+
} catch { }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
if (fs.lstatSync(_path).isDirectory()) {
|
|
152
|
+
try {
|
|
153
|
+
fs.rmdirSync(_path);
|
|
154
|
+
} catch { }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* 更改数据储存位置,user_id和sessionToken关系转移到redis中
|
|
161
|
+
* @param {string} _path 旧存储路径
|
|
162
|
+
*/
|
|
163
|
+
static async movJsonFile(_path) {
|
|
164
|
+
let user_token = await this.FileReader(path.join(_path, 'user_token.json')) || {}
|
|
165
|
+
if (!fs.existsSync(`${_path}`)) { return false }
|
|
166
|
+
const files = fs.readdirSync(_path);
|
|
167
|
+
|
|
168
|
+
if (files.length > 0) {
|
|
169
|
+
|
|
170
|
+
let tot = 0
|
|
171
|
+
let already = 0
|
|
172
|
+
files.forEach(file => {
|
|
173
|
+
if (!fs.lstatSync(`${_path}/${file}`).isDirectory() && file != 'user_token.json') {
|
|
174
|
+
++tot
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
files.forEach(file => {
|
|
178
|
+
if (!fs.lstatSync(`${_path}/${file}`).isDirectory() && file != 'user_token.json') {
|
|
179
|
+
let user_id = file.replace('.json', '')
|
|
180
|
+
this.FileReader(`${_path}/${file}`).then((/** @type {any} */ json) => {
|
|
181
|
+
if (json) {
|
|
182
|
+
let session = json.session
|
|
183
|
+
/**保存user_id和session映射 */
|
|
184
|
+
user_token[user_id] = session
|
|
185
|
+
++already
|
|
186
|
+
if (this.SetFile(path.join(savePath, session, 'save.json'), json)) {
|
|
187
|
+
this.FileReader(path.join(pluginDataPath, `${user_id}_.json`)).then((/** @type {any} */ json_) => {
|
|
188
|
+
if (json_) {
|
|
189
|
+
let tem_file = {
|
|
190
|
+
data: json_.data,
|
|
191
|
+
rks: json_.rks,
|
|
192
|
+
scoreHistory: json_.scoreHistory,
|
|
193
|
+
CLGMOD: json_.CLGMOD,
|
|
194
|
+
version: json_.version,
|
|
195
|
+
}
|
|
196
|
+
this.SetFile(path.join(savePath, session, 'history.json'), tem_file)
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
fs.rmSync(path.join(_path, file))
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
})
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
async function check() {
|
|
207
|
+
while (already < tot) {
|
|
208
|
+
logger.mark('[phi-plugin][数据整合,请勿中断进程]', `${already}/${tot}`)
|
|
209
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
210
|
+
}
|
|
211
|
+
logger.mark('[phi-plugin][数据整合]', `${already}/${tot}`)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
await check();
|
|
215
|
+
|
|
216
|
+
// let list = await getRksRank.getAllRank()
|
|
217
|
+
|
|
218
|
+
// for (let i = 0; i < list.length; i++) {
|
|
219
|
+
// await getRksRank.delUserRks(list[i])
|
|
220
|
+
// }
|
|
221
|
+
|
|
222
|
+
await this.SetFile("user_token.json", user_token)
|
|
223
|
+
|
|
224
|
+
already = 0
|
|
225
|
+
tot = Object.keys(user_token).length
|
|
226
|
+
for (let id in user_token) {
|
|
227
|
+
try {
|
|
228
|
+
logger.mark('[phi-plugin][数据转移,请勿中断进程]', `${already}/${tot}`)
|
|
229
|
+
await userCredentialStore.setSessionToken(id, user_token[id])
|
|
230
|
+
const save = await this.FileReader(path.join(savePath, user_token[id], 'save.json'))
|
|
231
|
+
const rks = Number(save?.saveInfo?.summary?.rankingScore)
|
|
232
|
+
if (!save) continue
|
|
233
|
+
if (!Number.isFinite(rks)) {
|
|
234
|
+
logger.mark('[phi-plugin][数据转移,请勿中断进程]', `奇怪的rks ${save?.saveInfo?.summary?.rankingScore}`)
|
|
235
|
+
continue
|
|
236
|
+
}
|
|
237
|
+
await getRksRank.addUserRks(user_token[id], rks)
|
|
238
|
+
} catch (err) {
|
|
239
|
+
logger.error('[phi-plugin][数据转移,请勿中断进程]', err, `跳过该用户${id} ${user_token[id]}`)
|
|
240
|
+
} finally {
|
|
241
|
+
++already
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
logger.mark('[phi-plugin][数据转移,请勿中断进程]', `${already}/${tot}`)
|
|
245
|
+
|
|
246
|
+
// list = await getRksRank.getAllRank()
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
await this.DelFile(path.join(dataPath, 'user_token.json'));
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import path from 'path'
|
|
2
|
+
import { fileURLToPath } from 'url'
|
|
3
|
+
|
|
4
|
+
const __filename = fileURLToPath(import.meta.url)
|
|
5
|
+
const __dirname = path.dirname(__filename)
|
|
6
|
+
|
|
7
|
+
/**宿主进程根目录 */
|
|
8
|
+
export const _path = process.cwd()
|
|
9
|
+
|
|
10
|
+
/**插件根目录 */
|
|
11
|
+
export const pluginRoot = path.resolve(__dirname, '..', '..')
|
|
12
|
+
|
|
13
|
+
/**插件名 */
|
|
14
|
+
export const pluginName = path.basename(pluginRoot)
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Koishi 移植专用:运行数据根目录。
|
|
18
|
+
* 由 koishi 插件入口在加载 core 之前设置,指向 Koishi 的
|
|
19
|
+
* `<ctx.baseDir>/data/<plugin>`,避免把存档/配置写在 node_modules 内。
|
|
20
|
+
*/
|
|
21
|
+
const koishiRoot = process.env.PHI_PLUGIN_KOISHI_ROOT
|
|
22
|
+
? path.resolve(process.env.PHI_PLUGIN_KOISHI_ROOT)
|
|
23
|
+
: null
|
|
24
|
+
|
|
25
|
+
/**插件临时文件目录 */
|
|
26
|
+
export const tempPath = koishiRoot
|
|
27
|
+
? path.join(koishiRoot, 'temp')
|
|
28
|
+
: path.join(pluginRoot, 'temp')
|
|
29
|
+
|
|
30
|
+
/**插件资源目录 */
|
|
31
|
+
export const pluginResources = path.join(pluginRoot, 'resources')
|
|
32
|
+
|
|
33
|
+
/**曲绘资源、曲目信息路径 */
|
|
34
|
+
export const infoPath = path.join(pluginResources, 'info')
|
|
35
|
+
|
|
36
|
+
/**额外曲目名称信息(开字母用) */
|
|
37
|
+
export const DlcInfoPath = path.join(pluginResources, 'info', 'DLC')
|
|
38
|
+
|
|
39
|
+
/**上个版本曲目信息 */
|
|
40
|
+
export const oldInfoPath = path.join(pluginResources, 'info', 'oldInfo')
|
|
41
|
+
|
|
42
|
+
/**数据路径 */
|
|
43
|
+
export const dataPath = koishiRoot
|
|
44
|
+
? path.join(koishiRoot, 'data')
|
|
45
|
+
: path.join(pluginRoot, 'data')
|
|
46
|
+
|
|
47
|
+
/**用户娱乐数据路径 */
|
|
48
|
+
export const pluginDataPath = path.join(dataPath, 'pluginData')
|
|
49
|
+
|
|
50
|
+
/**用户存档数据路径 */
|
|
51
|
+
export const savePath = path.join(dataPath, 'saveData')
|
|
52
|
+
|
|
53
|
+
/**API用户存档数据路径 */
|
|
54
|
+
export const apiSavePath = path.join(dataPath, 'apiSaveData')
|
|
55
|
+
|
|
56
|
+
/**其他插件数据路径 */
|
|
57
|
+
export const otherDataPath = path.join(dataPath, 'otherData')
|
|
58
|
+
|
|
59
|
+
/**用户设置路径 */
|
|
60
|
+
export const configPath = koishiRoot
|
|
61
|
+
? path.join(koishiRoot, 'config', 'config')
|
|
62
|
+
: path.join(pluginRoot, 'config', 'config')
|
|
63
|
+
|
|
64
|
+
/**默认设置路径 */
|
|
65
|
+
export const defaultPath = path.join(pluginRoot, 'config', 'default_config')
|
|
66
|
+
|
|
67
|
+
/**默认图片路径 */
|
|
68
|
+
export const imgPath = path.join(pluginResources, 'html', 'otherimg')
|
|
69
|
+
|
|
70
|
+
/**用户图片路径 */
|
|
71
|
+
export const ortherIllPath = path.join(pluginResources, 'otherill')
|
|
72
|
+
|
|
73
|
+
/**原画资源 */
|
|
74
|
+
export const originalIllPath = koishiRoot
|
|
75
|
+
? path.join(koishiRoot, 'cache', 'original_ill')
|
|
76
|
+
: path.join(pluginResources, 'original_ill')
|
|
77
|
+
|
|
78
|
+
/**音频资源 */
|
|
79
|
+
export const guessMicPath = path.join(pluginResources, 'splited_music')
|
|
80
|
+
|
|
81
|
+
/**备份路径 */
|
|
82
|
+
export const backupPath = koishiRoot
|
|
83
|
+
? path.join(koishiRoot, 'backup')
|
|
84
|
+
: path.join(pluginRoot, 'backup')
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
|
|
2
|
+
export default class Chart {
|
|
3
|
+
/**
|
|
4
|
+
* @param {any} data 原始数据
|
|
5
|
+
*/
|
|
6
|
+
constructor(data) {
|
|
7
|
+
/** @type {idString} */
|
|
8
|
+
this.id = data?.id
|
|
9
|
+
|
|
10
|
+
/** @type {allLevelKind} */
|
|
11
|
+
this.rank = data?.rank
|
|
12
|
+
|
|
13
|
+
/** @type {string} */
|
|
14
|
+
this.charter = data.charter
|
|
15
|
+
|
|
16
|
+
/** @type {number} */
|
|
17
|
+
this.difficulty = Number(data.difficulty)
|
|
18
|
+
|
|
19
|
+
// /** @type {number | undefined} */
|
|
20
|
+
// this.tap = Number(data.tap)
|
|
21
|
+
|
|
22
|
+
// /** @type {number | undefined} */
|
|
23
|
+
// this.hold = Number(data.hold)
|
|
24
|
+
|
|
25
|
+
// /** @type {number | undefined} */
|
|
26
|
+
// this.flick = Number(data.flick)
|
|
27
|
+
|
|
28
|
+
// /** @type {number | undefined} */
|
|
29
|
+
// this.combo = Number(data.combo)
|
|
30
|
+
|
|
31
|
+
// /** @type {number | undefined} */
|
|
32
|
+
// this.maxTime = Number(data.maxTime)
|
|
33
|
+
|
|
34
|
+
// /** @type {[number,number,number,number,number][]} [tap,drag,hold,flick,tot] */
|
|
35
|
+
// this.distribution = data.distribution
|
|
36
|
+
|
|
37
|
+
if (data.tap) {
|
|
38
|
+
|
|
39
|
+
this.tap = Number(data.tap)
|
|
40
|
+
|
|
41
|
+
this.drag = Number(data.drag)
|
|
42
|
+
|
|
43
|
+
this.hold = Number(data.hold)
|
|
44
|
+
|
|
45
|
+
this.flick = Number(data.flick)
|
|
46
|
+
|
|
47
|
+
this.combo = Number(data.combo)
|
|
48
|
+
|
|
49
|
+
/** s */
|
|
50
|
+
this.maxTime = Number(data.maxTime)
|
|
51
|
+
|
|
52
|
+
/** @type {[number,number,number,number,number][]} [tap,drag,hold,flick,tot] */
|
|
53
|
+
this.distribution = data.distribution
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}
|
|
57
|
+
}
|