From 7953519e683b46e026fa0d362ad71081d575df7e Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Fri, 3 Mar 2023 13:03:48 -0500 Subject: [PATCH] wacca: fix UserInfoUpdateRequest, per #5 --- titles/wacca/handlers/helpers.py | 8 ++++++++ titles/wacca/handlers/user_info.py | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/titles/wacca/handlers/helpers.py b/titles/wacca/handlers/helpers.py index 9f6ba8b..1192237 100644 --- a/titles/wacca/handlers/helpers.py +++ b/titles/wacca/handlers/helpers.py @@ -840,3 +840,11 @@ class GateTutorialFlag: self.tutorialId, int(self.flagWatched) ] + +class DateUpdate: + def __init__(self, date_id: int = 0, timestamp: int = 0) -> None: + self.id = date_id + self.timestamp = timestamp + + def make(self) -> List: + return [self.id, self.timestamp] diff --git a/titles/wacca/handlers/user_info.py b/titles/wacca/handlers/user_info.py index 6498488..5665676 100644 --- a/titles/wacca/handlers/user_info.py +++ b/titles/wacca/handlers/user_info.py @@ -1,7 +1,7 @@ from typing import List, Dict from titles.wacca.handlers.base import BaseRequest, BaseResponse -from titles.wacca.handlers.helpers import UserOption +from titles.wacca.handlers.helpers import UserOption, DateUpdate # ---user/info/update--- class UserInfoUpdateRequest(BaseRequest): @@ -9,12 +9,16 @@ class UserInfoUpdateRequest(BaseRequest): super().__init__(data) self.profileId = int(self.params[0]) self.optsUpdated: List[UserOption] = [] - self.datesUpdated: List = self.params[3] + self.unknown2: List = self.params[2] + self.datesUpdated: List[DateUpdate] = [] self.favoritesAdded: List[int] = self.params[4] self.favoritesRemoved: List[int] = self.params[5] - for x in self.params[2]: + for x in self.params[1]: self.optsUpdated.append(UserOption(x[0], x[1])) + + for x in self.params[3]: + self.datesUpdated.append(DateUpdate[x[0], x[1]]) # ---user/info/getMyroom--- TODO: Understand this better class UserInfogetMyroomRequest(BaseRequest):