forked from Hay1tsme/artemis
add GetUserNewItemListApi handler
This commit is contained in:
@ -31,6 +31,7 @@ from .festival import Mai2Festival
|
|||||||
from .festivalplus import Mai2FestivalPlus
|
from .festivalplus import Mai2FestivalPlus
|
||||||
from .buddies import Mai2Buddies
|
from .buddies import Mai2Buddies
|
||||||
from .buddiesplus import Mai2BuddiesPlus
|
from .buddiesplus import Mai2BuddiesPlus
|
||||||
|
from .prism import Mai2Prism
|
||||||
|
|
||||||
|
|
||||||
class Mai2Servlet(BaseServlet):
|
class Mai2Servlet(BaseServlet):
|
||||||
@ -66,7 +67,8 @@ class Mai2Servlet(BaseServlet):
|
|||||||
Mai2Festival,
|
Mai2Festival,
|
||||||
Mai2FestivalPlus,
|
Mai2FestivalPlus,
|
||||||
Mai2Buddies,
|
Mai2Buddies,
|
||||||
Mai2BuddiesPlus
|
Mai2BuddiesPlus,
|
||||||
|
Mai2Prism
|
||||||
]
|
]
|
||||||
|
|
||||||
self.logger = logging.getLogger("mai2")
|
self.logger = logging.getLogger("mai2")
|
||||||
@ -306,8 +308,11 @@ class Mai2Servlet(BaseServlet):
|
|||||||
internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL_PLUS
|
||||||
elif version >= 140 and version < 145: # 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
|
elif version >= 145 and version <150: # BUDDiES PLUS
|
||||||
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS,
|
||||||
|
elif version >=150:
|
||||||
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM
|
||||||
|
|
||||||
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
|
||||||
@ -325,6 +330,12 @@ 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 and version < 145: # BUDDiES
|
||||||
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES
|
||||||
|
elif version >= 145 and version <150: # BUDDiES PLUS
|
||||||
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES_PLUS,
|
||||||
|
elif version >=150:
|
||||||
|
internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM
|
||||||
|
|
||||||
if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32:
|
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
|
# If we get a 32 character long hex string, it's a hash and we're
|
||||||
|
25
titles/mai2/prism.py
Normal file
25
titles/mai2/prism.py
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
from typing import Dict
|
||||||
|
|
||||||
|
from core.config import CoreConfig
|
||||||
|
from titles.mai2.buddiesplus import Mai2BuddiesPlus
|
||||||
|
from titles.mai2.const import Mai2Constants
|
||||||
|
from titles.mai2.config import Mai2Config
|
||||||
|
|
||||||
|
class Mai2Prism(Mai2BuddiesPlus):
|
||||||
|
def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
|
||||||
|
super().__init__(cfg, game_cfg)
|
||||||
|
self.version = Mai2Constants.VER_MAIMAI_DX_PRISM
|
||||||
|
|
||||||
|
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.50.00"
|
||||||
|
return user_data
|
||||||
|
|
||||||
|
|
||||||
|
async def handle_get_user_new_item_list_api_request(self, data: Dict) -> Dict:
|
||||||
|
return {
|
||||||
|
"user_id": data["userId"],
|
||||||
|
"userItemList": []
|
||||||
|
}
|
Reference in New Issue
Block a user