@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,953 @@
|
|
|
1
|
+
import Config from '../../components/Config.js'
|
|
2
|
+
import logger from '../../components/Logger.js'
|
|
3
|
+
import Version from '../../components/Version.js'
|
|
4
|
+
import PhigrosUser from '../../lib/PhigrosUser.js'
|
|
5
|
+
import { canUseApi } from '../user/apiPermission.js'
|
|
6
|
+
import { Level, LevelNum, MAX_DIFFICULTY } from '../game/constNum.js'
|
|
7
|
+
import fCompute from '../game/fCompute.js'
|
|
8
|
+
import getInfo from '../game/getInfo.js'
|
|
9
|
+
import getRksRank from '../game/getRksRank.js'
|
|
10
|
+
import makeRequest from '../api/makeRequest.js'
|
|
11
|
+
import LevelRecordInfo from '../game/LevelRecordInfo.js'
|
|
12
|
+
|
|
13
|
+
export default class Save {
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @param {oriSave | PhigrosUser} data
|
|
17
|
+
* @param {boolean} ignore 跳过存档检查
|
|
18
|
+
*/
|
|
19
|
+
constructor(data, ignore = false) {
|
|
20
|
+
this.session = data.session
|
|
21
|
+
/**是否是国际版 */
|
|
22
|
+
this.global = data.global
|
|
23
|
+
if ('apiId' in data) {
|
|
24
|
+
this.apiId = data.apiId
|
|
25
|
+
} else {
|
|
26
|
+
this.apiId = undefined
|
|
27
|
+
}
|
|
28
|
+
/**@type {playerInfo} */
|
|
29
|
+
this.playerInfo = data.playerInfo
|
|
30
|
+
/**@type {saveInfo} */
|
|
31
|
+
this.saveInfo = data.saveInfo
|
|
32
|
+
this.saveInfo.modifiedAt.iso = new Date(this.saveInfo.modifiedAt.iso)
|
|
33
|
+
/**官方存档版本号 */
|
|
34
|
+
this.Recordver = data.Recordver
|
|
35
|
+
this.gameProgress = data.gameProgress ? {
|
|
36
|
+
/**首次运行 */
|
|
37
|
+
isFirstRun: data.gameProgress.isFirstRun,
|
|
38
|
+
/**过去的章节已完成 */
|
|
39
|
+
legacyChapterFinished: data.gameProgress.legacyChapterFinished,
|
|
40
|
+
/**已展示收藏品Tip */
|
|
41
|
+
alreadyShowCollectionTip: data.gameProgress.alreadyShowCollectionTip,
|
|
42
|
+
/**已展示自动解锁IN Tip */
|
|
43
|
+
alreadyShowAutoUnlockINTip: data.gameProgress.alreadyShowAutoUnlockINTip,
|
|
44
|
+
/**剧情完成(显示全部歌曲和课题模式入口) */
|
|
45
|
+
completed: data.gameProgress.completed,
|
|
46
|
+
/**??? */
|
|
47
|
+
songUpdateInfo: data.gameProgress.songUpdateInfo,
|
|
48
|
+
/**课题分 */
|
|
49
|
+
challengeModeRank: data.gameProgress.challengeModeRank,
|
|
50
|
+
/**data货币 */
|
|
51
|
+
money: data.gameProgress.money,
|
|
52
|
+
/**痉挛解锁 */
|
|
53
|
+
unlockFlagOfSpasmodic: data.gameProgress.unlockFlagOfSpasmodic,
|
|
54
|
+
/**Igallta解锁 */
|
|
55
|
+
unlockFlagOfIgallta: data.gameProgress.unlockFlagOfIgallta,
|
|
56
|
+
/**Rrhar'il解锁 */
|
|
57
|
+
unlockFlagOfRrharil: data.gameProgress.unlockFlagOfRrharil,
|
|
58
|
+
/**IN达到S(倒霉蛋,船,Shadow,心之所向,inferior,DESTRUCTION 3,2,1,Distorted Fate) */
|
|
59
|
+
flagOfSongRecordKey: data.gameProgress.flagOfSongRecordKey,
|
|
60
|
+
/**Random切片解锁 */
|
|
61
|
+
randomVersionUnlocked: data.gameProgress.randomVersionUnlocked,
|
|
62
|
+
/**第八章入场 */
|
|
63
|
+
chapter8UnlockBegin: data.gameProgress.chapter8UnlockBegin,
|
|
64
|
+
/**第八章第二阶段 */
|
|
65
|
+
chapter8UnlockSecondPhase: data.gameProgress.chapter8UnlockSecondPhase,
|
|
66
|
+
/**第八章通过 */
|
|
67
|
+
chapter8Passed: data.gameProgress.chapter8Passed,
|
|
68
|
+
/**第八章各曲目解锁 */
|
|
69
|
+
chapter8SongUnlocked: data.gameProgress.chapter8SongUnlocked
|
|
70
|
+
} : {
|
|
71
|
+
money: [0, 0, 0, 0, 0]
|
|
72
|
+
}
|
|
73
|
+
this.gameuser = {
|
|
74
|
+
/**user */
|
|
75
|
+
name: data.gameuser?.name || '',
|
|
76
|
+
/**版本 */
|
|
77
|
+
version: data.gameuser?.version || '',
|
|
78
|
+
/**是否展示Id */
|
|
79
|
+
showPlayerId: data.gameuser?.showPlayerId || false,
|
|
80
|
+
/**简介 */
|
|
81
|
+
selfIntro: data.gameuser?.selfIntro || '',
|
|
82
|
+
/**头像 */
|
|
83
|
+
avatar: data.gameuser?.avatar || '',
|
|
84
|
+
/**背景 */
|
|
85
|
+
background: data.gameuser?.background || '',
|
|
86
|
+
}
|
|
87
|
+
if (checkIg(this)) {
|
|
88
|
+
getRksRank.delUserRks(this.session)
|
|
89
|
+
logger.error(`封禁tk ${this.session}`)
|
|
90
|
+
throw new Error(`您的存档rks异常,该 token 已禁用,如有异议请联系机器人管理员。\n${this.session}`)
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* @type {Record<idString, (LevelRecordInfo|null)[]>}
|
|
94
|
+
*/
|
|
95
|
+
this.gameRecord = {}
|
|
96
|
+
|
|
97
|
+
/**@type {idString[]} */
|
|
98
|
+
const idList = /**@type {any} */ (Object.keys(data.gameRecord))
|
|
99
|
+
|
|
100
|
+
for (const id of idList) {
|
|
101
|
+
this.gameRecord[id] = []
|
|
102
|
+
for (let i in data.gameRecord[id]) {
|
|
103
|
+
let level = Number(i)
|
|
104
|
+
if (!data.gameRecord[id][level]) {
|
|
105
|
+
this.gameRecord[id][level] = null
|
|
106
|
+
continue
|
|
107
|
+
}
|
|
108
|
+
// this.gameRecord[id][level] = new (import('./LevelRecordInfo')).default(data.gameRecord[id][level], id, level)
|
|
109
|
+
|
|
110
|
+
if (!ignore) {
|
|
111
|
+
if (data.gameRecord[id][level].acc > 100 || data.gameRecord[id][level].acc < 0) {
|
|
112
|
+
// Starduster.Quree EZ难度 远古存档BUG特判
|
|
113
|
+
if (id == "Starduster.Quree.0" && level == 0 && data.gameRecord[id][level].acc <= 102.57 && data.gameRecord[id][level].acc >= 0) {
|
|
114
|
+
continue
|
|
115
|
+
}
|
|
116
|
+
logger.error(`acc > 100 封禁tk ${this.session}`)
|
|
117
|
+
getRksRank.delUserRks(this.session)
|
|
118
|
+
throw new Error(`您的存档 acc 异常,该 token 已禁用,如有异议请联系机器人管理员。\n${this.session}\n${id} ${level} ${data.gameRecord[id][level].acc}`)
|
|
119
|
+
}
|
|
120
|
+
if (data.gameRecord[id][level].score > 1000000 || data.gameRecord[id][level].score < 0) {
|
|
121
|
+
logger.error(`score > 1000000 封禁tk ${this.session}`)
|
|
122
|
+
getRksRank.delUserRks(this.session)
|
|
123
|
+
throw new Error(`您的存档 score 异常,该 token 已禁用,如有异议请联系机器人管理员。\n${this.session}\n${id} ${level} ${data.gameRecord[id][level].score}`)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
this.gameRecord[id][level] = new LevelRecordInfo(data.gameRecord[id][level], id, level)
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async init() {
|
|
132
|
+
// for (let id in this.gameRecord) {
|
|
133
|
+
// for (let i in this.gameRecord[id]) {
|
|
134
|
+
// let level = Number(i)
|
|
135
|
+
// if (!this.gameRecord[id][level]) {
|
|
136
|
+
// continue
|
|
137
|
+
// }
|
|
138
|
+
// }
|
|
139
|
+
// }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
checkNoInfo() {
|
|
143
|
+
/**@type {idString[]} */
|
|
144
|
+
let err = []
|
|
145
|
+
|
|
146
|
+
/**@type {idString[]} */
|
|
147
|
+
const ids = /**@type {any} */(Object.keys(this.gameRecord))
|
|
148
|
+
|
|
149
|
+
ids.forEach(id => {
|
|
150
|
+
if (!getInfo.idgetsong(id)) {
|
|
151
|
+
err.push(id)
|
|
152
|
+
}
|
|
153
|
+
})
|
|
154
|
+
return err
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* 获取存档
|
|
159
|
+
* @returns 按照 rks 排序的数组
|
|
160
|
+
*/
|
|
161
|
+
getRecord() {
|
|
162
|
+
if (this.sortedRecord) {
|
|
163
|
+
return this.sortedRecord
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* @type {LevelRecordInfo[]}
|
|
167
|
+
*/
|
|
168
|
+
let sortedRecord = []
|
|
169
|
+
const ids = fCompute.objectKeys(this.gameRecord)
|
|
170
|
+
for (let id of ids) {
|
|
171
|
+
this.gameRecord[id].forEach((recording, level) => {
|
|
172
|
+
if (level == 4) return; // LEGACY
|
|
173
|
+
let tem = this.gameRecord[id][level]
|
|
174
|
+
if (!tem?.score) return;
|
|
175
|
+
sortedRecord.push(tem)
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
sortedRecord.sort((a, b) => { return b.rks - a.rks })
|
|
180
|
+
this.sortedRecord = sortedRecord
|
|
181
|
+
return sortedRecord
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* 筛选满足ACC条件的成绩
|
|
186
|
+
* @param {number} acc ≥acc
|
|
187
|
+
* @param {boolean} [same=false] 是否筛选最高rks
|
|
188
|
+
* @returns 按照rks排序的数组
|
|
189
|
+
*/
|
|
190
|
+
findAccRecord(acc, same = false) {
|
|
191
|
+
/**
|
|
192
|
+
* @type {LevelRecordInfo[]}
|
|
193
|
+
*/
|
|
194
|
+
let record = []
|
|
195
|
+
const ids = fCompute.objectKeys(this.gameRecord)
|
|
196
|
+
for (const id of ids) {
|
|
197
|
+
if (!this.gameRecord[id]) continue;
|
|
198
|
+
for (let level of [0, 1, 2, 3]) {
|
|
199
|
+
/**LEGACY */
|
|
200
|
+
let tem = this.gameRecord[id]?.[level]
|
|
201
|
+
if (!tem) continue
|
|
202
|
+
if (tem.acc >= acc) {
|
|
203
|
+
record.push(tem)
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
record.sort((a, b) => { return b.rks - a.rks })
|
|
208
|
+
if (same) {
|
|
209
|
+
for (let i = 0; i < record.length - 1; i++) {
|
|
210
|
+
if (record[i].rks != record[i + 1]?.rks) {
|
|
211
|
+
return record.slice(0, i + 1)
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return record
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**计算rks+0.01的最低所需要提升的rks */
|
|
219
|
+
minUpRks() {
|
|
220
|
+
/**考虑屁股肉四舍五入原则 */
|
|
221
|
+
let minuprks = Math.floor(this.saveInfo.summary.rankingScore * 100) / 100 + 0.005 - this.saveInfo.summary.rankingScore
|
|
222
|
+
return minuprks < 0 ? minuprks + 0.01 : minuprks
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**简单检查存档是否存在问题 */
|
|
226
|
+
checkRecord() {
|
|
227
|
+
let error = ``
|
|
228
|
+
const ids = fCompute.objectKeys(this.gameRecord)
|
|
229
|
+
for (const id of ids) {
|
|
230
|
+
if (!this.gameRecord[id]) continue;
|
|
231
|
+
for (let level of [0, 1, 2, 3]) {
|
|
232
|
+
|
|
233
|
+
let score = this.gameRecord[id][level]
|
|
234
|
+
if (!score) continue;
|
|
235
|
+
if (score.acc > 100 || score.acc < 0 || score.score > 1000000 || score.score < 0) {
|
|
236
|
+
error += `\n${id} ${Level[level]} ${score.fc} ${score.acc} ${score.score} 非法的成绩`
|
|
237
|
+
}
|
|
238
|
+
// if (!score.fc && (score.score >= 1000000 || score.acc >= 100)) {
|
|
239
|
+
// error += `\n${i} ${Level[j]} ${score.fc} ${score.acc} ${score.score} 不符合预期的值`
|
|
240
|
+
// }
|
|
241
|
+
if ((score.score >= 1000000 && score.acc < 100) || (score.score < 1000000 && score.acc >= 100)) {
|
|
242
|
+
error += `\n${id} ${Level[level]} ${score.fc} ${score.acc} ${score.score} 成绩不自洽`
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return error
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
*
|
|
251
|
+
* @param {idString} id 曲目id
|
|
252
|
+
* @returns {(LevelRecordInfo | null)[] | undefined} 曲目所有难度的成绩
|
|
253
|
+
*/
|
|
254
|
+
getSongsRecord(id) {
|
|
255
|
+
|
|
256
|
+
return this.gameRecord[id] ? [...(this.gameRecord[id])] : undefined
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**@import {botEvent} from '../../components/baseClass.js' */
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @param {botEvent} e
|
|
263
|
+
* @param {number} num B几
|
|
264
|
+
* @param {object} option
|
|
265
|
+
* @param {"all" | "b30" | "top" | "none"} [option.avgType]
|
|
266
|
+
* @param {"red" | "gold" | "blue" | "green"} [option.color]
|
|
267
|
+
* @param {boolean} [option.avgValue] 平均值是否直接返回
|
|
268
|
+
* @param {boolean} [option.allPhi] 是否计算所有phi成绩而非仅限p3
|
|
269
|
+
* @returns phi, b19_list
|
|
270
|
+
*/
|
|
271
|
+
async getB19(e, num, option = { avgType: "all", color: "blue", avgValue: false, allPhi: false }) {
|
|
272
|
+
|
|
273
|
+
/**计算得到的rks,仅作为测试使用 */
|
|
274
|
+
let sum_rks = 0
|
|
275
|
+
/**满分且 rks 最高的成绩数组 */
|
|
276
|
+
let philist = this.findAccRecord(100);
|
|
277
|
+
|
|
278
|
+
for (let i = 0, j = 0; i < philist.length; ++i) {
|
|
279
|
+
if (philist[i].rks < philist[j].rks) {
|
|
280
|
+
if (i <= 3) {
|
|
281
|
+
j = i;
|
|
282
|
+
continue;
|
|
283
|
+
}
|
|
284
|
+
if (j < 3) {
|
|
285
|
+
let tem = philist.slice(j, i - 1);
|
|
286
|
+
philist.splice(j);
|
|
287
|
+
tem = fCompute.randArray(tem);
|
|
288
|
+
philist.push(...tem);
|
|
289
|
+
}
|
|
290
|
+
philist.splice(i);
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @typedef {object} otherLevelRecordInfo
|
|
297
|
+
* @property {number|string} num B几
|
|
298
|
+
* @property {string} suggest 推分建议
|
|
299
|
+
* @property {number} suggestType 推分建议类型 0-5 分别对应 红橙黄绿青蓝六种建议等级
|
|
300
|
+
* @property {string | number} accAvg 同rks玩家的平均准确率
|
|
301
|
+
* @property {string} accKind 同rks玩家的平均准确率类型 'Higher' 'Lower' 'Hyper' 'Finished' 分别对应高于平均、低于平均、远高于平均、完成推分建议的玩家占比超过95%四种情况
|
|
302
|
+
* @property {object} cpToOld 若为旧版本,则对比新定数与旧版本rks 'Higher' 'Lower'
|
|
303
|
+
* @property {string} cpToOld.type 对比结果 'Higher' 'Lower'
|
|
304
|
+
* @property {string} cpToOld.dif 与旧版本rks差值
|
|
305
|
+
* @property {string} cpToOld.rks 与旧版本rks差值(保留两位小数)
|
|
306
|
+
*/
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* @type {((LevelRecordInfo & Partial<otherLevelRecordInfo>) | undefined)[]}
|
|
310
|
+
*/
|
|
311
|
+
let phi = [];
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
// console.info(phi)
|
|
315
|
+
/**处理数据 */
|
|
316
|
+
const phiNum = Math.max((option.allPhi ? philist.length : 3), 3)
|
|
317
|
+
for (let i = 0; i < phiNum; ++i) {
|
|
318
|
+
if (!philist[i]) {
|
|
319
|
+
phi[i] = undefined;
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const x = philist[i];
|
|
323
|
+
if (x?.rks) {
|
|
324
|
+
const tem = { ...x };
|
|
325
|
+
phi[i] = tem;
|
|
326
|
+
const y = phi[i];
|
|
327
|
+
if (!y) continue;
|
|
328
|
+
sum_rks += Number(y.rks) //计算rks
|
|
329
|
+
y.illustration = getInfo.getill(y.id)
|
|
330
|
+
y.suggest = "无法推分"
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* 所有成绩
|
|
336
|
+
* @type {(LevelRecordInfo & Partial<otherLevelRecordInfo>)[]}
|
|
337
|
+
*/
|
|
338
|
+
let rkslist = this.getRecord()
|
|
339
|
+
/**真实 rks */
|
|
340
|
+
let userrks = this.saveInfo.summary.rankingScore
|
|
341
|
+
/**考虑屁股肉四舍五入原则的最小上升rks */
|
|
342
|
+
let minuprks = Math.floor(userrks * 100) / 100 + 0.005 - userrks
|
|
343
|
+
if (minuprks < 0) {
|
|
344
|
+
minuprks += 0.01
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/** @type {idString[]} */
|
|
348
|
+
const b19Ids = []
|
|
349
|
+
/** @type {{songId: idString, rank: levelKind, acc: number}[]} */
|
|
350
|
+
const b19Dual = []
|
|
351
|
+
|
|
352
|
+
/**bestN 列表 */
|
|
353
|
+
let b19_list = []
|
|
354
|
+
for (let i = 0; i < num && i < rkslist.length; ++i) {
|
|
355
|
+
/**计算rks */
|
|
356
|
+
if (i < 27) sum_rks += Number(rkslist[i].rks)
|
|
357
|
+
/**是 Best 几 */
|
|
358
|
+
rkslist[i].num = i + 1
|
|
359
|
+
/**推分建议 */
|
|
360
|
+
if (rkslist[i].acc < 100) {
|
|
361
|
+
let suggest = fCompute.suggest(Number((i < 26) ? rkslist[i].rks : rkslist[26].rks) + minuprks * 30, rkslist[i].difficulty)
|
|
362
|
+
if (suggest == -1 && (!phi?.[0] || (rkslist[i].rks > (phi[phi.length - 1]?.rks || 0)))) {
|
|
363
|
+
suggest = 100;
|
|
364
|
+
}
|
|
365
|
+
if (suggest != -1) {
|
|
366
|
+
rkslist[i].suggest = suggest.toFixed(2) + '%'
|
|
367
|
+
if (suggest < 98.5) {
|
|
368
|
+
rkslist[i].suggestType = 0
|
|
369
|
+
} else if (suggest < 99) {
|
|
370
|
+
rkslist[i].suggestType = 1
|
|
371
|
+
} else if (suggest < 99.5) {
|
|
372
|
+
rkslist[i].suggestType = 2
|
|
373
|
+
} else if (suggest < 99.7) {
|
|
374
|
+
rkslist[i].suggestType = 3
|
|
375
|
+
} else if (suggest < 99.85) {
|
|
376
|
+
rkslist[i].suggestType = 4
|
|
377
|
+
} else {
|
|
378
|
+
rkslist[i].suggestType = 5
|
|
379
|
+
}
|
|
380
|
+
} else {
|
|
381
|
+
rkslist[i].suggest = "无法推分"
|
|
382
|
+
}
|
|
383
|
+
} else {
|
|
384
|
+
rkslist[i].suggest = "无法推分"
|
|
385
|
+
}
|
|
386
|
+
/**曲绘 */
|
|
387
|
+
rkslist[i].illustration = getInfo.getill(rkslist[i].id, 'common')
|
|
388
|
+
/**b19列表 */
|
|
389
|
+
b19_list.push(rkslist[i])
|
|
390
|
+
b19Ids.push(rkslist[i].id);
|
|
391
|
+
b19Dual.push({ songId: rkslist[i].id, rank: /**@type {levelKind} */(rkslist[i].rank), acc: rkslist[i].acc })
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
let com_rks = sum_rks / 30
|
|
395
|
+
|
|
396
|
+
if (option.avgType !== 'none' && await canUseApi(e, 'scoreStatistics') !== false) {
|
|
397
|
+
try {
|
|
398
|
+
|
|
399
|
+
if (!option.avgType || option.avgType === "all") {
|
|
400
|
+
const res = await makeRequest.getAllSongAccAvg({
|
|
401
|
+
songIds: b19Ids,
|
|
402
|
+
minRks: Math.floor((com_rks - 0.05) / 0.05) * 0.05,
|
|
403
|
+
maxRks: Math.floor((com_rks + 0.05) / 0.05) * 0.05
|
|
404
|
+
}, { event: e })
|
|
405
|
+
if (!res) {
|
|
406
|
+
throw new Error('avg-getAllSongAccAvg failed')
|
|
407
|
+
}
|
|
408
|
+
let allhiger = true
|
|
409
|
+
for (let i = 0; i < b19_list.length; ++i) {
|
|
410
|
+
if (i >= 27 && allhiger) {
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
const x = b19_list[i];
|
|
414
|
+
if (x.rank == 'LEGACY') continue;
|
|
415
|
+
const accAvg = res[x.id][x.rank]?.accAvg
|
|
416
|
+
if (accAvg != null && !isNaN(accAvg)) {
|
|
417
|
+
b19_list[i].accAvg = option.avgValue ? accAvg : `Avg: ${accAvg.toFixed(4)}%`
|
|
418
|
+
if (x.acc < accAvg) {
|
|
419
|
+
allhiger = false
|
|
420
|
+
b19_list[i].accKind = 'Lower'
|
|
421
|
+
} else {
|
|
422
|
+
b19_list[i].accKind = 'Higher'
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
if (allhiger) {
|
|
427
|
+
const res = await makeRequest.getAllSongAccAvg(
|
|
428
|
+
{ songIds: b19Ids, minRks: (Math.floor((com_rks - 0.05) / 0.05) + 2) * 0.05, maxRks: (Math.ceil((com_rks + 0.05) / 0.05) + 2) * 0.05 },
|
|
429
|
+
{ event: e },
|
|
430
|
+
)
|
|
431
|
+
if (!res) {
|
|
432
|
+
throw new Error('avg-getAllSongAccAvg-up failed')
|
|
433
|
+
}
|
|
434
|
+
for (let i = 0; i < b19_list.length; ++i) {
|
|
435
|
+
const x = b19_list[i];
|
|
436
|
+
if (x.rank == 'LEGACY') continue;
|
|
437
|
+
const accAvg = res[x.id][x.rank]?.accAvg
|
|
438
|
+
if (accAvg != null && !isNaN(accAvg)) {
|
|
439
|
+
b19_list[i].accAvg = option.avgValue ? accAvg : `Avg: ${accAvg.toFixed(4)}%`
|
|
440
|
+
if (x.acc < accAvg) {
|
|
441
|
+
allhiger = false
|
|
442
|
+
b19_list[i].accKind = 'Hyper'
|
|
443
|
+
} else {
|
|
444
|
+
b19_list[i].accKind = 'Finished'
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
} else if (option.avgType === "b30") {
|
|
450
|
+
const res = await makeRequest.getAllSongAccAvgB30({
|
|
451
|
+
songIds: b19Ids,
|
|
452
|
+
minRks: Math.floor((com_rks - 0.05) / 0.05) * 0.05,
|
|
453
|
+
maxRks: Math.floor((com_rks + 0.05) / 0.05) * 0.05
|
|
454
|
+
}, { event: e })
|
|
455
|
+
if (!res) {
|
|
456
|
+
throw new Error('avg-getAllSongAccAvgB30 failed')
|
|
457
|
+
}
|
|
458
|
+
const kind = option.color === "red" || option.color === "gold";
|
|
459
|
+
const low = kind ? "Lower" : "Hyper"
|
|
460
|
+
const high = kind ? "Higher" : "Finished"
|
|
461
|
+
for (let i = 0; i < b19_list.length; ++i) {
|
|
462
|
+
const x = b19_list[i];
|
|
463
|
+
if (x.rank == 'LEGACY') continue;
|
|
464
|
+
const accAvg = res[x.id][x.rank]?.accAvg
|
|
465
|
+
if (accAvg != null && !isNaN(accAvg)) {
|
|
466
|
+
b19_list[i].accAvg = option.avgValue ? accAvg : `BAvg: ${accAvg.toFixed(4)}%`;
|
|
467
|
+
if (x.acc < accAvg) {
|
|
468
|
+
b19_list[i].accKind = low
|
|
469
|
+
} else {
|
|
470
|
+
b19_list[i].accKind = high
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
} else if (option.avgType === "top") {
|
|
475
|
+
const res = await makeRequest.getAllSongAccRank({
|
|
476
|
+
queries: b19Dual,
|
|
477
|
+
dimension: ["all", "b30"],
|
|
478
|
+
minRks: Math.floor((com_rks - 0.05) / 0.05) * 0.05,
|
|
479
|
+
maxRks: Math.floor((com_rks + 0.05) / 0.05) * 0.05
|
|
480
|
+
}, { event: e })
|
|
481
|
+
if (!res) {
|
|
482
|
+
throw new Error('avg-getAllSongAccRank failed')
|
|
483
|
+
}
|
|
484
|
+
let kind = "Finished"
|
|
485
|
+
switch (option.color) {
|
|
486
|
+
case "red":
|
|
487
|
+
kind = "Lower";
|
|
488
|
+
break;
|
|
489
|
+
case "gold":
|
|
490
|
+
kind = "Higher";
|
|
491
|
+
break;
|
|
492
|
+
case "blue":
|
|
493
|
+
kind = "Hyper";
|
|
494
|
+
break;
|
|
495
|
+
case "green":
|
|
496
|
+
kind = "Finished";
|
|
497
|
+
break;
|
|
498
|
+
}
|
|
499
|
+
for (let i = 0; i < b19_list.length; ++i) {
|
|
500
|
+
const x = b19_list[i];
|
|
501
|
+
if (x.rank == 'LEGACY') continue;
|
|
502
|
+
const topAll = res.all?.[i].topPercent;
|
|
503
|
+
const topB30 = res.b30?.[i].topPercent;
|
|
504
|
+
b19_list[i].accKind = kind
|
|
505
|
+
if (topAll != null && !isNaN(topAll) && topB30 != null && !isNaN(topB30)) {
|
|
506
|
+
b19_list[i].accAvg = `Top ${topAll.toFixed(2)}% / ${topB30.toFixed(2)}%`
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
} catch (e) {
|
|
511
|
+
logger.warn(`[phi-plugin][avg]均值数据获取失败,已跳过均值显示`)
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
/**如果版本低于插件对应pgr版本 */
|
|
516
|
+
const saveVer = this.saveInfo.summary.gameVersion
|
|
517
|
+
if (saveVer &&
|
|
518
|
+
!isNaN(saveVer) &&
|
|
519
|
+
saveVer < Number(Version.phigrosVerNum) &&
|
|
520
|
+
getInfo.versionInfoByCode[`${saveVer}`]) {
|
|
521
|
+
const oldGameRecord = buildGameRecord(this.gameRecord, `${saveVer}`);
|
|
522
|
+
const addCp = (/**@type {(LevelRecordInfo & Partial<otherLevelRecordInfo>) | undefined} */record) => {
|
|
523
|
+
if (!record) return;
|
|
524
|
+
const oldRecord = oldGameRecord[record.id]?.[LevelNum[record.rank]]
|
|
525
|
+
if (!oldRecord?.rks) return;
|
|
526
|
+
if (record.difficulty == oldRecord.difficulty) return; //定数未变动不对比
|
|
527
|
+
record.cpToOld = { type: '', dif: Math.abs(record.rks - oldRecord.rks).toFixed(1), rks: Math.abs(record.rks - oldRecord.rks).toFixed(2) }
|
|
528
|
+
if (record.difficulty > oldRecord.difficulty) {
|
|
529
|
+
record.cpToOld.type = 'Higher'
|
|
530
|
+
} else if (record.difficulty < oldRecord.difficulty) {
|
|
531
|
+
record.cpToOld.type = 'Lower'
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
phi.forEach(addCp)
|
|
535
|
+
b19_list.forEach(addCp)
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
this.B19List = { phi, b19_list }
|
|
540
|
+
|
|
541
|
+
this.b19_rks = b19_list[Math.min(b19_list.length - 1, 26)]?.rks || 0
|
|
542
|
+
return { phi, b19_list, com_rks }
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
/**
|
|
546
|
+
*
|
|
547
|
+
* @param {number} num B几
|
|
548
|
+
* @param {(recordLimit | customRecordLimit)[]} limit
|
|
549
|
+
* @param {boolean} [withPhi=true] 是否包含 phi
|
|
550
|
+
*/
|
|
551
|
+
async getBestWithLimit(num, limit, withPhi = true) {
|
|
552
|
+
let getInfo = (await import('../game/getInfo.js')).default
|
|
553
|
+
/**计算得到的rks,仅作为测试使用 */
|
|
554
|
+
let sum_rks = 0
|
|
555
|
+
/**满分且 rks 最高的成绩数组 */
|
|
556
|
+
let philist = this.findAccRecord(100)
|
|
557
|
+
|
|
558
|
+
/**处理条件 */
|
|
559
|
+
for (let i = 0; i < philist.length; ++i) {
|
|
560
|
+
if (!checkLimit(philist[i], limit)) {
|
|
561
|
+
philist.splice(i, 1)
|
|
562
|
+
i--
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* @type {(LevelRecordInfo & {suggestType?: number, suggest?: string} | undefined)[] | undefined}
|
|
568
|
+
*/
|
|
569
|
+
let phi = undefined;
|
|
570
|
+
|
|
571
|
+
/**p3 */
|
|
572
|
+
if (withPhi) {
|
|
573
|
+
phi = philist.splice(0, Math.min(philist.length, 3))
|
|
574
|
+
|
|
575
|
+
for (let i = 0; i < 3; ++i) {
|
|
576
|
+
if (!phi[i]) {
|
|
577
|
+
phi[i] = undefined;
|
|
578
|
+
continue
|
|
579
|
+
}
|
|
580
|
+
const x = phi[i];
|
|
581
|
+
if (x?.rks) {
|
|
582
|
+
const tem = { ...x }
|
|
583
|
+
phi[i] = tem
|
|
584
|
+
const y = phi[i];
|
|
585
|
+
if (!y) continue;
|
|
586
|
+
sum_rks += Number(y.rks) //计算rks
|
|
587
|
+
y.illustration = getInfo.getill(y.id)
|
|
588
|
+
y.suggest = "无法推分"
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
/**
|
|
594
|
+
* 所有成绩
|
|
595
|
+
* @type {(LevelRecordInfo & {suggestType?: number, suggest?: string, num?: number|string})[]}
|
|
596
|
+
*/
|
|
597
|
+
let rkslist = this.getRecord()
|
|
598
|
+
/**真实 rks */
|
|
599
|
+
let userrks = this.saveInfo.summary.rankingScore
|
|
600
|
+
/**考虑屁股肉四舍五入原则的最小上升rks */
|
|
601
|
+
let minuprks = Math.floor(userrks * 100) / 100 + 0.005 - userrks
|
|
602
|
+
if (minuprks < 0) {
|
|
603
|
+
minuprks += 0.01
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
/**处理条件 */
|
|
607
|
+
for (let i = 0; i < rkslist.length; ++i) {
|
|
608
|
+
if (!checkLimit(rkslist[i], limit)) {
|
|
609
|
+
rkslist.splice(i, 1)
|
|
610
|
+
i--
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**bestN 列表 */
|
|
615
|
+
let b19_list = []
|
|
616
|
+
for (let i = 0; i < num && i < rkslist.length; ++i) {
|
|
617
|
+
const x = rkslist[i];
|
|
618
|
+
if (!x?.rks) continue;
|
|
619
|
+
/**计算rks */
|
|
620
|
+
if (i < (withPhi ? 27 : 30)) sum_rks += Number(x.rks)
|
|
621
|
+
/**是 Best 几 */
|
|
622
|
+
x.num = i + 1
|
|
623
|
+
/**推分建议 */
|
|
624
|
+
if (x.acc < 100) {
|
|
625
|
+
x.suggest = fCompute.suggest(Number((i < 26) ? x.rks : rkslist[26].rks) + minuprks * 30, x.difficulty, 2)
|
|
626
|
+
if (x.suggest.includes('无') && (!phi?.[0] || (x.rks > (phi[phi.length - 1]?.rks || 0))) && x.rks < 100) {
|
|
627
|
+
x.suggest = "100.00%"
|
|
628
|
+
}
|
|
629
|
+
} else {
|
|
630
|
+
x.suggest = "无法推分"
|
|
631
|
+
}
|
|
632
|
+
/**曲绘 */
|
|
633
|
+
x.illustration = getInfo.getill(x.id, 'common')
|
|
634
|
+
/**b19列表 */
|
|
635
|
+
b19_list.push(x)
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
let com_rks = sum_rks / 30
|
|
639
|
+
return { phi, b19_list, com_rks }
|
|
640
|
+
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
/**
|
|
644
|
+
* @overload
|
|
645
|
+
* @param {idString} id
|
|
646
|
+
* @param {number} lv
|
|
647
|
+
* @param {number} count 保留位数
|
|
648
|
+
* @param {number} difficulty
|
|
649
|
+
* @returns {string}
|
|
650
|
+
*/
|
|
651
|
+
/**
|
|
652
|
+
* @overload
|
|
653
|
+
* @param {idString} id
|
|
654
|
+
* @param {number} lv
|
|
655
|
+
* @param {undefined} count 保留位数
|
|
656
|
+
* @param {number} difficulty
|
|
657
|
+
* @returns {number}
|
|
658
|
+
*/
|
|
659
|
+
/**
|
|
660
|
+
*
|
|
661
|
+
* @param {idString} id
|
|
662
|
+
* @param {number} lv
|
|
663
|
+
* @param {number | undefined} count 保留位数
|
|
664
|
+
* @param {number} difficulty
|
|
665
|
+
* @returns
|
|
666
|
+
*/
|
|
667
|
+
getSuggest(id, lv, count, difficulty) {
|
|
668
|
+
if (this.b19_rks === undefined || this.b0_rks === undefined) {
|
|
669
|
+
let record = this.getRecord()
|
|
670
|
+
this.b19_rks = record.length > 26 ? record[26].rks : 0
|
|
671
|
+
this.b0_rks = this.findAccRecord(100, true)[0]?.rks
|
|
672
|
+
}
|
|
673
|
+
// console.info(this.b19_rks, this.gameRecord[id][lv]?.rks ? this.gameRecord[id][lv].rks : 0, this.gameRecord[id])
|
|
674
|
+
let suggest = 0
|
|
675
|
+
if (!this.gameRecord[id] || !this.gameRecord[id][lv] || !this.gameRecord[id][lv].rks) {
|
|
676
|
+
suggest = fCompute.suggest(Math.max(this.b19_rks, 0) + this.minUpRks() * 30, difficulty)
|
|
677
|
+
} else {
|
|
678
|
+
suggest = fCompute.suggest(Math.max(this.b19_rks, this.gameRecord[id][lv].rks) + this.minUpRks() * 30, difficulty)
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
if (suggest == -1 && difficulty > this.b0_rks + this.minUpRks() * 30) {
|
|
682
|
+
suggest = 100
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
if (count == undefined) {
|
|
686
|
+
return suggest
|
|
687
|
+
} else {
|
|
688
|
+
if (suggest != -1) {
|
|
689
|
+
return suggest.toFixed(count) + '%'
|
|
690
|
+
} else {
|
|
691
|
+
return "无法推分"
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* 获取存档RKS
|
|
698
|
+
* @returns {number}
|
|
699
|
+
*/
|
|
700
|
+
getRks() {
|
|
701
|
+
return Number(this.saveInfo.summary.rankingScore)
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* 获取存档sessionToken
|
|
706
|
+
* @returns {phigrosToken}
|
|
707
|
+
*/
|
|
708
|
+
getSessionToken() {
|
|
709
|
+
return this.session
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
/**
|
|
713
|
+
* 获取存档成绩总览
|
|
714
|
+
* @returns
|
|
715
|
+
*/
|
|
716
|
+
async getStats() {
|
|
717
|
+
/**'EZ', 'HD', 'IN', 'AT' */
|
|
718
|
+
let tot = [0, 0, 0, 0]
|
|
719
|
+
|
|
720
|
+
const Record = this.gameRecord
|
|
721
|
+
const Level = getInfo.allLevel
|
|
722
|
+
|
|
723
|
+
let stats_ = {
|
|
724
|
+
title: '',
|
|
725
|
+
Rating: '',
|
|
726
|
+
unlock: 0,
|
|
727
|
+
tot: 0,
|
|
728
|
+
cleared: 0,
|
|
729
|
+
fc: 0,
|
|
730
|
+
phi: 0,
|
|
731
|
+
real_score: 0,
|
|
732
|
+
tot_score: 0,
|
|
733
|
+
highest: 0,
|
|
734
|
+
lowest: 18,
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
let stats = [{ ...stats_ }, { ...stats_ }, { ...stats_ }, { ...stats_ }]
|
|
738
|
+
|
|
739
|
+
const idsFromRecord = fCompute.objectKeys(Record)
|
|
740
|
+
const idsFromInfo = fCompute.objectKeys(getInfo.ori_info)
|
|
741
|
+
for (let id of idsFromInfo) {
|
|
742
|
+
let info = getInfo.ori_info[id]
|
|
743
|
+
if (!info?.chart) continue
|
|
744
|
+
if (info.chart['AT'] && Number(info.chart['AT'].difficulty)) {
|
|
745
|
+
++tot[3]
|
|
746
|
+
}
|
|
747
|
+
if (info.chart['IN'] && Number(info.chart['IN'].difficulty)) {
|
|
748
|
+
++tot[2]
|
|
749
|
+
}
|
|
750
|
+
if (info.chart['HD'] && Number(info.chart['HD'].difficulty)) {
|
|
751
|
+
++tot[1]
|
|
752
|
+
}
|
|
753
|
+
if (info.chart['EZ'] && Number(info.chart['EZ'].difficulty)) {
|
|
754
|
+
++tot[0]
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
stats[0].tot = tot[0]
|
|
759
|
+
stats[0].title = Level[0]
|
|
760
|
+
|
|
761
|
+
stats[1].tot = tot[1]
|
|
762
|
+
stats[1].title = Level[1]
|
|
763
|
+
|
|
764
|
+
stats[2].tot = tot[2]
|
|
765
|
+
stats[2].title = Level[2]
|
|
766
|
+
|
|
767
|
+
stats[3].tot = tot[3]
|
|
768
|
+
stats[3].title = Level[3]
|
|
769
|
+
|
|
770
|
+
for (let id of idsFromRecord) {
|
|
771
|
+
// 记录数组会为 Legacy 槽位保留下标 3 的 null 占位,必须以当前曲库谱面为准。
|
|
772
|
+
const info = getInfo.ori_info[id]
|
|
773
|
+
if (!info?.chart) continue
|
|
774
|
+
let record = Record[id]
|
|
775
|
+
for (let lv of [0, 1, 2, 3]) {
|
|
776
|
+
const chart = info.chart[Level[lv]]
|
|
777
|
+
if (!chart || !Number(chart.difficulty)) continue
|
|
778
|
+
if (record.length <= lv || record[lv] === undefined) continue
|
|
779
|
+
|
|
780
|
+
++stats[lv].unlock
|
|
781
|
+
|
|
782
|
+
if (record[lv] === null) continue
|
|
783
|
+
|
|
784
|
+
if (record[lv].score >= 700000) {
|
|
785
|
+
++stats[lv].cleared
|
|
786
|
+
}
|
|
787
|
+
if (record[lv].fc || record[lv].score == 1000000) {
|
|
788
|
+
++stats[lv].fc
|
|
789
|
+
}
|
|
790
|
+
if (record[lv].score == 1000000) {
|
|
791
|
+
++stats[lv].phi
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
stats[lv].real_score += record[lv].score
|
|
796
|
+
stats[lv].tot_score += 1000000
|
|
797
|
+
|
|
798
|
+
stats[lv].highest = Math.max(record[lv].rks, stats[lv].highest)
|
|
799
|
+
stats[lv].lowest = Math.min(record[lv].rks, stats[lv].lowest)
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
for (let lv of [0, 1, 2, 3]) {
|
|
804
|
+
stats[lv].Rating = fCompute.rate(stats[lv].real_score, stats[lv].fc == stats[lv].unlock, stats[lv].tot_score)
|
|
805
|
+
if (stats[lv].lowest == 18) {
|
|
806
|
+
stats[lv].lowest = 0
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
return stats
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
/**
|
|
814
|
+
* 获取指定歌曲和难度等级的成绩
|
|
815
|
+
* @param {idString} id
|
|
816
|
+
* @param {levelKind} lv
|
|
817
|
+
* @returns
|
|
818
|
+
*/
|
|
819
|
+
getScore(id, lv) {
|
|
820
|
+
return this.gameRecord[id]?.[LevelNum[lv]]
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
getPlayerInfo() {
|
|
824
|
+
const money = this.gameProgress.money
|
|
825
|
+
return {
|
|
826
|
+
avatar: getInfo.idgetavatar(this.gameuser.avatar),
|
|
827
|
+
ChallengeMode: Math.floor(this.saveInfo.summary.challengeModeRank / 100),
|
|
828
|
+
ChallengeModeRank: this.saveInfo.summary.challengeModeRank % 100,
|
|
829
|
+
rks: this.saveInfo.summary.rankingScore,
|
|
830
|
+
data: `${money[4] ? `${money[4]}PiB ` : ''}${money[3] ? `${money[3]}TiB ` : ''}${money[2] ? `${money[2]}GiB ` : ''}${money[1] ? `${money[1]}MiB ` : ''}${money[0] ? `${money[0]}KiB ` : ''}`,
|
|
831
|
+
selfIntro: this.gameuser.selfIntro,
|
|
832
|
+
backgroundUrl: fCompute.getBackground(this.gameuser.background),
|
|
833
|
+
PlayerId: fCompute.convertRichText(this.saveInfo.PlayerId),
|
|
834
|
+
date: fCompute.formatDate(this.saveInfo.summary.updatedAt)
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
/**
|
|
839
|
+
* @param {Save} save
|
|
840
|
+
*/
|
|
841
|
+
equalRecord(save) {
|
|
842
|
+
const record1 = this.gameRecord
|
|
843
|
+
const record2 = save.gameRecord
|
|
844
|
+
const ids = fCompute.objectKeys(record1)
|
|
845
|
+
const ids2 = fCompute.objectKeys(record2)
|
|
846
|
+
if (ids.length != ids2.length) return false
|
|
847
|
+
for (let id of ids) {
|
|
848
|
+
if (!record2[id]) return false
|
|
849
|
+
const levels = record1[id]?.length
|
|
850
|
+
const levels2 = record1[id]?.length
|
|
851
|
+
if (levels != levels2) return false
|
|
852
|
+
for (let level = 0; level < levels; level++) {
|
|
853
|
+
const r1 = record1[id][level]
|
|
854
|
+
const r2 = record2[id][level]
|
|
855
|
+
if (!r1 && !r2) continue
|
|
856
|
+
if (!r1) return false
|
|
857
|
+
if (!r2) return false
|
|
858
|
+
if (r1.acc != r2.acc) return false
|
|
859
|
+
if (r1.score != r2.score) return false
|
|
860
|
+
if (r1.fc != r2.fc) return false
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
return true
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* @typedef recordLimit
|
|
869
|
+
* @property {'acc'|'score'|'rks'} type 类型
|
|
870
|
+
* @property {number[]} value 数值范围或自定义函数
|
|
871
|
+
*/
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* @typedef customRecordLimit
|
|
875
|
+
* @property {'custom'} type 类型
|
|
876
|
+
* @property {(record: LevelRecordInfo)=>boolean} value 数值范围或自定义函数
|
|
877
|
+
*/
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
*
|
|
881
|
+
* @param {LevelRecordInfo} record
|
|
882
|
+
* @param {(recordLimit | customRecordLimit)[]} limit
|
|
883
|
+
* @returns
|
|
884
|
+
*/
|
|
885
|
+
function checkLimit(record, limit) {
|
|
886
|
+
for (let i in limit) {
|
|
887
|
+
let l = limit[i]
|
|
888
|
+
switch (l.type) {
|
|
889
|
+
case 'acc':
|
|
890
|
+
if (record.acc < l.value[0] || record.acc > l.value[1]) return false
|
|
891
|
+
break
|
|
892
|
+
case 'score':
|
|
893
|
+
if (record.score < l.value[0] || record.score > l.value[1]) return false
|
|
894
|
+
break
|
|
895
|
+
case 'rks':
|
|
896
|
+
if (record.rks < l.value[0] || record.rks > l.value[1]) return false
|
|
897
|
+
break
|
|
898
|
+
case 'custom':
|
|
899
|
+
if (!l.value(record)) return false
|
|
900
|
+
break
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
return true
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
/**
|
|
907
|
+
* 检查是否非法存档
|
|
908
|
+
* @param {Save} save
|
|
909
|
+
* @returns
|
|
910
|
+
*/
|
|
911
|
+
function checkIg(save) {
|
|
912
|
+
if (save.saveInfo.summary.rankingScore > MAX_DIFFICULTY) return true
|
|
913
|
+
if (!save.saveInfo.summary.rankingScore && save.saveInfo.summary.rankingScore != 0) return true
|
|
914
|
+
if (save.saveInfo.summary.challengeModeRank % 100 > 51) return true
|
|
915
|
+
if (save.saveInfo.summary.challengeModeRank < 0) return true
|
|
916
|
+
if (save.saveInfo.summary.challengeModeRank % 100 == 0 && save.saveInfo.summary.challengeModeRank != 0) return true
|
|
917
|
+
if (Math.floor(save.saveInfo.summary.challengeModeRank / 100) == 0 && save.saveInfo.summary.challengeModeRank != 0) return true
|
|
918
|
+
if (save.saveInfo.summary.challengeModeRank % 1 != 0) return true
|
|
919
|
+
return false
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
|
|
923
|
+
/**
|
|
924
|
+
*
|
|
925
|
+
* @param {Record<idString, (ori_record|null)[]>} data
|
|
926
|
+
* @param {string} ver
|
|
927
|
+
*/
|
|
928
|
+
function buildGameRecord(data, ver) {
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* @type {Record<idString, (LevelRecordInfo|null)[]>}
|
|
932
|
+
*/
|
|
933
|
+
const gameRecord = {};
|
|
934
|
+
|
|
935
|
+
/**@type {idString[]} */
|
|
936
|
+
const idList = fCompute.objectKeys(data)
|
|
937
|
+
|
|
938
|
+
for (const id of idList) {
|
|
939
|
+
gameRecord[id] = []
|
|
940
|
+
for (let i in data[id]) {
|
|
941
|
+
let level = Number(i)
|
|
942
|
+
if (!data[id][level]) {
|
|
943
|
+
gameRecord[id][level] = null
|
|
944
|
+
continue
|
|
945
|
+
}
|
|
946
|
+
// this.gameRecord[id][level] = new (import('./LevelRecordInfo')).default(data.gameRecord[id][level], id, level)
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
gameRecord[id][level] = new LevelRecordInfo(data[id][level], id, level, ver)
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
return gameRecord
|
|
953
|
+
}
|