From 1ba14da90c4052c6f656d107972b87d1700a8044 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Tue, 14 Nov 2023 13:20:05 -0500 Subject: [PATCH] sao: gasha medal shop handler classes --- titles/sao/handlers/base.py | 18 ++++++++++++++++++ titles/sao/handlers/helpers.py | 5 +++++ 2 files changed, 23 insertions(+) diff --git a/titles/sao/handlers/base.py b/titles/sao/handlers/base.py index 426ca5f..3b7e17a 100644 --- a/titles/sao/handlers/base.py +++ b/titles/sao/handlers/base.py @@ -3194,3 +3194,21 @@ class GetMYuiMedalShopItemsResponse(SaoBaseResponse): self.header.length = len(ret) return super().make() + ret + +class GetMGashaMedalShopsRequest(SaoBaseRequest): + def __init__(self, header: SaoRequestHeader, data: bytes) -> None: + super().__init__(header, data) + self.dummy = decode_byte(data, 0) + +class GetMGashaMedalShopsResponse(SaoBaseResponse): + def __init__(self, cmd_id: int) -> None: + super().__init__(cmd_id) + self.result = 1 # byte + self.data_list: List[GashaMedalShop] = [] + + def make(self) -> bytes: + ret = encode_byte(self.result) + ret += encode_arr_cls(self.data_list) + + self.header.length = len(ret) + return super().make() + ret diff --git a/titles/sao/handlers/helpers.py b/titles/sao/handlers/helpers.py index 2a29506..230ab10 100644 --- a/titles/sao/handlers/helpers.py +++ b/titles/sao/handlers/helpers.py @@ -803,3 +803,8 @@ class YuiMedalShopItemData(BaseHelper): ret += encode_int(self.property4_value1) ret += encode_int(self.property4_value2) return ret + +class GashaMedalShop(BaseHelper): + def __init__(self, data: bytes, offset: int) -> None: + super().__init__(data, offset) + \ No newline at end of file