1
0
mirror of synced 2024-12-24 18:34:49 +01:00
artemis/titles/wacca/handlers/user_trial.py

56 lines
1.5 KiB
Python
Raw Normal View History

from typing import Dict, List
from titles.wacca.handlers.base import BaseRequest, BaseResponse
from titles.wacca.handlers.helpers import StageInfo, StageupClearType, GenericItemRecv
2023-03-09 17:38:58 +01:00
# --user/trial/get--
class UserTrialGetRequest(BaseRequest):
profileId: int = 0
def __init__(self, data: Dict) -> None:
super().__init__(data)
self.profileId = self.params[0]
2023-03-09 17:38:58 +01:00
class UserTrialGetResponse(BaseResponse):
def __init__(self) -> None:
super().__init__()
2023-03-09 17:38:58 +01:00
self.stageList: List[StageInfo] = []
def make(self) -> Dict:
dans = []
for x in self.stageList:
dans.append(x.make())
2023-03-09 17:38:58 +01:00
self.params = [dans]
return super().make()
2023-03-09 17:38:58 +01:00
# --user/trial/update--
class UserTrialUpdateRequest(BaseRequest):
def __init__(self, data: Dict) -> None:
super().__init__(data)
self.profileId: int = self.params[0]
self.stageId: int = self.params[1]
self.stageLevel: int = self.params[2]
self.clearType = StageupClearType(self.params[3])
self.songScores: List[int] = self.params[4]
self.numSongsCleared: int = self.params[5]
self.itemsObtained: List[GenericItemRecv] = []
self.unk7: List = []
for x in self.params[6]:
self.itemsObtained.append(GenericItemRecv(x[0], x[1], x[2]))
if len(self.params) == 8:
self.unk7 = self.params[7]
2023-03-09 17:38:58 +01:00
class UserTrialUpdateResponse(BaseResponse):
def __init__(self) -> None:
super().__init__()
2023-03-09 17:38:58 +01:00
def make(self) -> Dict:
2023-03-09 17:38:58 +01:00
return super().make()