sao: fix get_m_gasha_medal_shops

This commit is contained in:
2023-11-14 20:51:51 -05:00
parent 1ba14da90c
commit dffa11f420
2 changed files with 69 additions and 5 deletions

View File

@ -894,7 +894,7 @@ class SaoBase:
tmp.sales_end_date = datetime(2100, 1, 1, 0, 0, 0, 0) # always open
resp.data_list.append(tmp)
self.logger.debug(f"Load {len(resp.data_list)} Yui Medal Shops")
return resp.make()
def handle_d5dc(self, header: SaoRequestHeader, request: bytes) -> bytes:
@ -923,12 +923,24 @@ class SaoBase:
tmp.property4_value2 = int(shop['Property4Value2'])
resp.data_list.append(tmp)
self.logger.debug(f"Load {len(resp.data_list)} Yui Medal Shop Items")
return resp.make()
def handle_d5fc(self, header: SaoRequestHeader, request: bytes) -> bytes:
# master_data/get_m_gasha_medal_shops
return SaoNoopResponse(header.cmd + 1).make()
req = GetMGashaMedalShopsRequest(header.cmd + 1).make()
resp = GetMGashaMedalShopsResponse(header.cmd + 1)
shops = self.load_data_csv("GashaMedalShops")
for shop in shops:
tmp = GashaMedalShop.from_args(shop['GashaMedalShopId'], shop['Name'], shop['GashaMedalId'], shop['UseGashaMedalNum'], shop['PurchaseLimit'])
tmp.sales_end_date = datetime(2100, 1, 1, 0, 0, 0, 0) # always open
resp.data_list.append(tmp)
self.logger.debug(f"Load {len(resp.data_list)} Yui Medal Shop Items")
return resp.make()
def handle_d604(self, header: SaoRequestHeader, request: bytes) -> bytes:
# master_data_2/get_m_res_earn_campaign_shops