1
0
mirror of synced 2024-12-22 09:45:53 +01:00
artemis/titles/wacca/handlers/user_vip.py

49 lines
1.3 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 VipLoginBonus
2023-03-09 17:38:58 +01:00
# --user/vip/get--
class UserVipGetRequest(BaseRequest):
def __init__(self, data: Dict) -> None:
super().__init__(data)
self.profileId = self.params[0]
2023-03-09 17:38:58 +01:00
class UserVipGetResponse(BaseResponse):
def __init__(self) -> None:
super().__init__()
self.vipDays: int = 0
self.unknown1: int = 1
self.unknown2: int = 1
self.presents: List[VipLoginBonus] = []
2023-03-09 17:38:58 +01:00
def make(self) -> Dict:
pres = []
for x in self.presents:
pres.append(x.make())
2023-03-09 17:38:58 +01:00
self.params = [self.vipDays, [self.unknown1, self.unknown2, pres]]
return super().make()
2023-03-09 17:38:58 +01:00
# --user/vip/start--
class UserVipStartRequest(BaseRequest):
def __init__(self, data: Dict) -> None:
super().__init__(data)
self.profileId = self.params[0]
self.cost = self.params[1]
self.days = self.params[2]
2023-03-09 17:38:58 +01:00
class UserVipStartResponse(BaseResponse):
def __init__(self, expires: int = 0) -> None:
super().__init__()
self.whenExpires: int = expires
self.presents = []
def make(self) -> Dict:
2023-03-09 17:38:58 +01:00
self.params = [self.whenExpires, self.presents]
2023-03-09 17:38:58 +01:00
return super().make()