From 6e05b211ac68c49f5d440d75f4d06a95181e9597 Mon Sep 17 00:00:00 2001 From: Remik1r3n Date: Thu, 23 Jan 2025 19:16:27 +0800 Subject: [PATCH] Tested and fixed stupid bug --- ActionLoginBonus.py | 3 ++- ActionUnlockVarious.py | 17 +++++++++-------- HelperUnlockThing.py | 4 +++- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ActionLoginBonus.py b/ActionLoginBonus.py index 519a0a1..08c45ff 100644 --- a/ActionLoginBonus.py +++ b/ActionLoginBonus.py @@ -170,7 +170,8 @@ if __name__ == "__main__": logger.info("登录失败") exit() try: - logger.info(implLoginBonus(userId, currentLoginTimestamp, loginResult)) + # Remember to change the mode to 1 if you want to give all bonuses + logger.info(implLoginBonus(userId, currentLoginTimestamp, loginResult, 1)) logger.info(apiLogout(currentLoginTimestamp, userId)) except: logger.info(apiLogout(currentLoginTimestamp, userId)) diff --git a/ActionUnlockVarious.py b/ActionUnlockVarious.py index dc3dc45..afae837 100644 --- a/ActionUnlockVarious.py +++ b/ActionUnlockVarious.py @@ -6,18 +6,18 @@ from Static_Settings import * from HelperLogInOut import apiLogin, apiLogout, generateTimestamp from HelperUnlockThing import implUnlockThing -def implUnlockPartner(partnerToBeUnlocked: int, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str: +def implUnlockSingleItem(itemId: int, itemKind: int, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str: ''' - 解锁搭档 + 发单个东西,比如搭档 10 ''' userItemList = [ { - "itemKind": 10, - "itemId": partnerToBeUnlocked, + "itemKind": itemKind, + "itemId": itemId, "stock": 1, "isValid": True } - ], + ] unlockThingResult = implUnlockThing(userItemList, userId, currentLoginTimestamp, currentLoginResult) return unlockThingResult @@ -38,7 +38,7 @@ def implUnlockMusic(musicToBeUnlocked: int, userId: int, currentLoginTimestamp:i "stock": 1, "isValid": True }, - ], + ] unlockThingResult = implUnlockThing(userItemList, userId, currentLoginTimestamp, currentLoginResult) return unlockThingResult @@ -47,13 +47,14 @@ if __name__ == "__main__": currentLoginTimestamp = generateTimestamp() loginResult = apiLogin(currentLoginTimestamp, userId) - wantToUnlockItemId = 1 + # Change you want item ID + wantToUnlockItemId = 11 if loginResult['returnCode'] != 1: logger.info("登录失败") exit() try: - # change it + # Change you want to unlock music or something logger.info(implUnlockMusic(wantToUnlockItemId, userId, currentLoginTimestamp, loginResult)) logger.info(apiLogout(currentLoginTimestamp, userId)) except: diff --git a/HelperUnlockThing.py b/HelperUnlockThing.py index 65912ac..da5c277 100644 --- a/HelperUnlockThing.py +++ b/HelperUnlockThing.py @@ -9,7 +9,7 @@ from HelperGetUserThing import implGetUser_ from HelperUploadUserPlayLog import apiUploadUserPlaylog from HelperUserAll import generateFullUserAll -def implUnlockThing(newUserItemList:list, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str: +def implUnlockThing(newUserItemList, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str: ''' 解锁东西的实现 Note: itemKind 如下 @@ -56,6 +56,8 @@ def implUnlockThing(newUserItemList:list, userId: int, currentLoginTimestamp:int currentUserAll['upsertUserAll']["userMusicDetailList"] = [musicDataToBeUploaded] currentUserAll['upsertUserAll']['isNewMusicDetailList'] = "1" # Insert mode(Not overriding) currentUserAll['upsertUserAll']['userItemList'] = newUserItemList + + currentUserAll['upsertUserAll']['isNewItemList'] = "1" * len(newUserItemList) data = json.dumps(currentUserAll) try: currentUserAllResult = json.loads(apiSDGB(data, "UpsertUserAllApi", userId))