add buddies plus support
This commit is contained in:
parent
6f6a300879
commit
ee4eddd639
36
titles/mai2/buddiesplus.py
Normal file
36
titles/mai2/buddiesplus.py
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
from core.config import CoreConfig
|
||||||
|
from titles.mai2.buddies import Mai2Buddies
|
||||||
|
from titles.mai2.const import Mai2Constants
|
||||||
|
from titles.mai2.config import Mai2Config
|
||||||
|
|
||||||
|
|
||||||
|
class Mai2BuddiesPlus(Mai2Buddies):
|
||||||
|
def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
|
||||||
|
super().__init__(cfg, game_cfg)
|
||||||
|
self.version = Mai2Constants.VER_MAIMAI_DX_BUDDIES_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.45.00"
|
||||||
|
return user_data
|
||||||
|
|
||||||
|
async def handle_get_game_weekly_data_api_request(self, data: Dict) -> Dict:
|
||||||
|
return {
|
||||||
|
"gameWeeklyData": {
|
||||||
|
"missionCategory": 0,
|
||||||
|
"updateDate": "2024-03-21 09:00:00.0",
|
||||||
|
"beforeDate": "2099-12-31 00:00:00.0"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async def handle_create_token_api_request(self, data: Dict) -> Dict:
|
||||||
|
return {
|
||||||
|
"Bearer": "ARTEMiSTOKEN" # duplicate of handle_user_login_api_request from Mai2Festival
|
||||||
|
}
|
||||||
|
|
||||||
|
async def handle_remove_token_api_request(self, data: Dict) -> Dict:
|
||||||
|
return {}
|
@ -55,6 +55,7 @@ class Mai2Constants:
|
|||||||
VER_MAIMAI_DX_FESTIVAL = 19
|
VER_MAIMAI_DX_FESTIVAL = 19
|
||||||
VER_MAIMAI_DX_FESTIVAL_PLUS = 20
|
VER_MAIMAI_DX_FESTIVAL_PLUS = 20
|
||||||
VER_MAIMAI_DX_BUDDIES = 21
|
VER_MAIMAI_DX_BUDDIES = 21
|
||||||
|
VER_MAIMAI_DX_BUDDIES_PLUS = 22
|
||||||
|
|
||||||
VERSION_STRING = (
|
VERSION_STRING = (
|
||||||
"maimai",
|
"maimai",
|
||||||
@ -78,7 +79,8 @@ class Mai2Constants:
|
|||||||
"maimai DX UNiVERSE PLUS",
|
"maimai DX UNiVERSE PLUS",
|
||||||
"maimai DX FESTiVAL",
|
"maimai DX FESTiVAL",
|
||||||
"maimai DX FESTiVAL PLUS",
|
"maimai DX FESTiVAL PLUS",
|
||||||
"maimai DX BUDDiES"
|
"maimai DX BUDDiES",
|
||||||
|
"maimai DX BUDDiES PLUS"
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -30,6 +30,7 @@ from .universeplus import Mai2UniversePlus
|
|||||||
from .festival import Mai2Festival
|
from .festival import Mai2Festival
|
||||||
from .festivalplus import Mai2FestivalPlus
|
from .festivalplus import Mai2FestivalPlus
|
||||||
from .buddies import Mai2Buddies
|
from .buddies import Mai2Buddies
|
||||||
|
from .buddiesplus import Mai2BuddiesPlus
|
||||||
|
|
||||||
|
|
||||||
class Mai2Servlet(BaseServlet):
|
class Mai2Servlet(BaseServlet):
|
||||||
@ -64,7 +65,8 @@ class Mai2Servlet(BaseServlet):
|
|||||||
Mai2UniversePlus,
|
Mai2UniversePlus,
|
||||||
Mai2Festival,
|
Mai2Festival,
|
||||||
Mai2FestivalPlus,
|
Mai2FestivalPlus,
|
||||||
Mai2Buddies
|
Mai2Buddies,
|
||||||
|
Mai2BuddiesPlus
|
||||||
]
|
]
|
||||||
|
|
||||||
self.logger = logging.getLogger("mai2")
|
self.logger = logging.getLogger("mai2")
|
||||||
@ -302,8 +304,10 @@ class Mai2Servlet(BaseServlet):
|
|||||||
internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL
|
||||||
elif version >= 135 and version < 140: # FESTiVAL PLUS
|
elif version >= 135 and version < 140: # FESTiVAL PLUS
|
||||||
internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS
|
||||||
elif version >= 140: # BUDDiES
|
elif version >= 140 and version < 145: # BUDDiES
|
||||||
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES
|
||||||
|
elif version >= 145: # BUDDiES PLUS
|
||||||
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS
|
||||||
elif game_code == "SDGA": # Int
|
elif game_code == "SDGA": # Int
|
||||||
if version < 105: # 1.0
|
if version < 105: # 1.0
|
||||||
internal_ver = Mai2Constants.VER_MAIMAI_DX
|
internal_ver = Mai2Constants.VER_MAIMAI_DX
|
||||||
|
Loading…
x
Reference in New Issue
Block a user