From 9bc18f179dbee153116444000a44ffb887128b80 Mon Sep 17 00:00:00 2001 From: SoulGateKey Date: Wed, 2 Apr 2025 12:37:43 +0800 Subject: [PATCH 1/4] add prism+ consts and cm support --- titles/cm/read.py | 3 ++- titles/mai2/const.py | 4 +++- titles/mai2/index.py | 16 +++++++++++----- titles/mai2/prismplus.py | 22 ++++++++++++++++++++++ 4 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 titles/mai2/prismplus.py diff --git a/titles/cm/read.py b/titles/cm/read.py index cf697c6..f4617e5 100644 --- a/titles/cm/read.py +++ b/titles/cm/read.py @@ -208,7 +208,8 @@ class CardMakerReader(BaseReader): "1.35": Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS, "1.40": Mai2Constants.VER_MAIMAI_DX_BUDDIES, "1.45": Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS, - "1.50": Mai2Constants.VER_MAIMAI_DX_PRISM + "1.50": Mai2Constants.VER_MAIMAI_DX_PRISM, + "1.55": Mai2Constants.VER_MAIMAI_DX_PRISM_PLUS } for root, dirs, files in os.walk(base_dir): diff --git a/titles/mai2/const.py b/titles/mai2/const.py index 1d6a4dd..50d7b17 100644 --- a/titles/mai2/const.py +++ b/titles/mai2/const.py @@ -57,6 +57,7 @@ class Mai2Constants: VER_MAIMAI_DX_BUDDIES = 21 VER_MAIMAI_DX_BUDDIES_PLUS = 22 VER_MAIMAI_DX_PRISM = 23 + VER_MAIMAI_DX_PRISM_PLUS = 24 VERSION_STRING = ( "maimai", @@ -82,7 +83,8 @@ class Mai2Constants: "maimai DX FESTiVAL PLUS", "maimai DX BUDDiES", "maimai DX BUDDiES PLUS", - "maimai DX PRiSM" + "maimai DX PRiSM", + "maimai DX PRiSM PLUS" ) @classmethod diff --git a/titles/mai2/index.py b/titles/mai2/index.py index 86923e7..1f0a6be 100644 --- a/titles/mai2/index.py +++ b/titles/mai2/index.py @@ -32,6 +32,7 @@ from .festivalplus import Mai2FestivalPlus from .buddies import Mai2Buddies from .buddiesplus import Mai2BuddiesPlus from .prism import Mai2Prism +from .prismplus import Mai2PrismPlus class Mai2Servlet(BaseServlet): @@ -68,7 +69,8 @@ class Mai2Servlet(BaseServlet): Mai2FestivalPlus, Mai2Buddies, Mai2BuddiesPlus, - Mai2Prism + Mai2Prism, + Mai2PrismPlus ] self.logger = logging.getLogger("mai2") @@ -308,10 +310,12 @@ class Mai2Servlet(BaseServlet): internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS elif version >= 140 and version < 145: # BUDDiES internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES - elif version >= 145 and version <150: # BUDDiES PLUS + elif version >= 145 and version < 150: # BUDDiES PLUS internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS, - elif version >=150: + elif version >= 150 and version < 155: internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM + elif version >= 155: + internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM_PLUS elif game_code == "SDGA": # Int if version < 105: # 1.0 @@ -332,10 +336,12 @@ class Mai2Servlet(BaseServlet): internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS elif version >= 140 and version < 145: # BUDDiES internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES - elif version >= 145 and version <150: # BUDDiES PLUS + elif version >= 145 and version < 150: # BUDDiES PLUS internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS, - elif version >=150: + elif version >= 150 and version < 155: internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM + elif version >= 155: + internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM_PLUS if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32: # If we get a 32 character long hex string, it's a hash and we're diff --git a/titles/mai2/prismplus.py b/titles/mai2/prismplus.py new file mode 100644 index 0000000..296207c --- /dev/null +++ b/titles/mai2/prismplus.py @@ -0,0 +1,22 @@ +from typing import Dict + +from core.config import CoreConfig +from titles.mai2.prism import Mai2Prism +from titles.mai2.const import Mai2Constants +from titles.mai2.config import Mai2Config + + + +class Mai2PrismPlus(Mai2Prism): + def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None: + super().__init__(cfg, game_cfg) + self.version = Mai2Constants.VER_MAIMAI_DX_PRISM_PLUS + + async def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict: + user_data = await super().handle_cm_get_user_preview_api_request(data) + + # hardcode lastDataVersion for CardMaker + user_data["lastDataVersion"] = "1.55.00" + return user_data + + From f8888c2392acc485c611d835b0e4883377076f92 Mon Sep 17 00:00:00 2001 From: SoulGateKey Date: Wed, 2 Apr 2025 12:42:40 +0800 Subject: [PATCH 2/4] add prism+ playlog support --- ...10616ba4_mai2_add_prism_playlog_support.py | 28 +++++++++++++++++++ titles/mai2/schema/score.py | 1 + 2 files changed, 29 insertions(+) create mode 100644 core/data/alembic/versions/bdf710616ba4_mai2_add_prism_playlog_support.py diff --git a/core/data/alembic/versions/bdf710616ba4_mai2_add_prism_playlog_support.py b/core/data/alembic/versions/bdf710616ba4_mai2_add_prism_playlog_support.py new file mode 100644 index 0000000..49eab78 --- /dev/null +++ b/core/data/alembic/versions/bdf710616ba4_mai2_add_prism_playlog_support.py @@ -0,0 +1,28 @@ +"""Mai2 add PRiSM+ playlog support + +Revision ID: bdf710616ba4 +Revises: 16f34bf7b968 +Create Date: 2025-04-02 12:42:08.981516 + +""" +from alembic import op +import sqlalchemy as sa + + +# revision identifiers, used by Alembic. +revision = 'bdf710616ba4' +down_revision = '16f34bf7b968' +branch_labels = None +depends_on = None + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('mai2_playlog', sa.Column('extBool3', sa.Boolean(), nullable=True,server_default=sa.text("NULL"))) + # ### end Alembic commands ### + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('mai2_playlog', 'extBool3') + # ### end Alembic commands ### diff --git a/titles/mai2/schema/score.py b/titles/mai2/schema/score.py index f3e7002..06e686b 100644 --- a/titles/mai2/schema/score.py +++ b/titles/mai2/schema/score.py @@ -149,6 +149,7 @@ playlog = Table( Column("extNum4", Integer), Column("extBool1", Boolean), # new with buddies Column("extBool2", Boolean), # new with prism + Column("extBool3", Boolean), # new with prism+ Column("trialPlayAchievement", Integer), mysql_charset="utf8mb4", ) From 4ceac7db3547f1660e453b737c1037dd559e7396 Mon Sep 17 00:00:00 2001 From: SoulGateKey Date: Wed, 2 Apr 2025 13:49:46 +0800 Subject: [PATCH 3/4] add clientplaytimeapi support --- titles/mai2/prismplus.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/titles/mai2/prismplus.py b/titles/mai2/prismplus.py index 296207c..ff9c5fc 100644 --- a/titles/mai2/prismplus.py +++ b/titles/mai2/prismplus.py @@ -19,4 +19,8 @@ class Mai2PrismPlus(Mai2Prism): user_data["lastDataVersion"] = "1.55.00" return user_data - + async def handle_upsert_client_play_time_api_request(self, data: Dict) -> Dict: + return{ + "returnCode": 1, + "apiName": "UpsertClientPlayTimeApi" + } From 756c7ce951aa96302ea2b0c077150c39797c1a91 Mon Sep 17 00:00:00 2001 From: SoulGateKey Date: Wed, 2 Apr 2025 13:56:56 +0800 Subject: [PATCH 4/4] update readme.md and game_specific_info.md --- docs/game_specific_info.md | 52 +++++++++++++++++++------------------- readme.md | 1 + 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/docs/game_specific_info.md b/docs/game_specific_info.md index 6bb3f67..052498d 100644 --- a/docs/game_specific_info.md +++ b/docs/game_specific_info.md @@ -203,32 +203,32 @@ Presents are items given to the user when they login, with a little animation (f ### Versions | Game Code | Version ID | Version Name | -|-----------|------------|-------------------------| -| SBXL | 0 | maimai | -| SBXL | 1 | maimai PLUS | -| SBZF | 2 | maimai GreeN | -| SBZF | 3 | maimai GreeN PLUS | -| SDBM | 4 | maimai ORANGE | -| SDBM | 5 | maimai ORANGE PLUS | -| SDCQ | 6 | maimai PiNK | -| SDCQ | 7 | maimai PiNK PLUS | -| SDDK | 8 | maimai MURASAKi | -| SDDK | 9 | maimai MURASAKi PLUS | -| SDDZ | 10 | maimai MiLK | -| SDDZ | 11 | maimai MiLK PLUS | -| SDEY | 12 | maimai FiNALE | -| SDEZ | 13 | maimai DX | -| SDEZ | 14 | maimai DX PLUS | -| SDEZ | 15 | maimai DX Splash | -| SDEZ | 16 | maimai DX Splash PLUS | -| SDEZ | 17 | maimai DX UNiVERSE | -| SDEZ | 18 | maimai DX UNiVERSE PLUS | -| SDEZ | 19 | maimai DX FESTiVAL | -| SDEZ | 20 | maimai DX FESTiVAL PLUS | -| SDEZ | 21 | maimai DX BUDDiES | -| SDEZ | 22 | maimai DX BUDDiES PLUS | -| SDEZ | 23 | maimai DX PRiSM | - +|----------|------------|-------------------------| +| SBXL | 0 | maimai | +| SBXL | 1 | maimai PLUS | +| SBZF | 2 | maimai GreeN | +| SBZF | 3 | maimai GreeN PLUS | +| SDBM | 4 | maimai ORANGE | +| SDBM | 5 | maimai ORANGE PLUS | +| SDCQ | 6 | maimai PiNK | +| SDCQ | 7 | maimai PiNK PLUS | +| SDDK | 8 | maimai MURASAKi | +| SDDK | 9 | maimai MURASAKi PLUS | +| SDDZ | 10 | maimai MiLK | +| SDDZ | 11 | maimai MiLK PLUS | +| SDEY | 12 | maimai FiNALE | +| SDEZ | 13 | maimai DX | +| SDEZ | 14 | maimai DX PLUS | +| SDEZ | 15 | maimai DX Splash | +| SDEZ | 16 | maimai DX Splash PLUS | +| SDEZ | 17 | maimai DX UNiVERSE | +| SDEZ | 18 | maimai DX UNiVERSE PLUS | +| SDEZ | 19 | maimai DX FESTiVAL | +| SDEZ | 20 | maimai DX FESTiVAL PLUS | +| SDEZ | 21 | maimai DX BUDDiES | +| SDEZ | 22 | maimai DX BUDDiES PLUS | +| SDEZ | 23 | maimai DX PRiSM | +| SDEZ | 24 | maimai DX PRiSM PLUS | ### Importer diff --git a/readme.md b/readme.md index e29784d..663b7cd 100644 --- a/readme.md +++ b/readme.md @@ -53,6 +53,7 @@ Games listed below have been tested and confirmed working. Only game versions ol + BUDDiES + BUDDiES PLUS + PRiSM + + PRiSM PLUS + O.N.G.E.K.I. + SUMMER