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