From b02ce11ea47494d8e576607d31fa040c91b09306 Mon Sep 17 00:00:00 2001 From: armv7a Date: Mon, 7 Jul 2025 01:35:52 +0800 Subject: [PATCH 1/3] fix upsert --- API_AuthLiteDelivery.py | 4 +- HelperUploadUserPlayLog.py | 226 +++++++++++++++++++------------------ HelperUserAll.py | 20 +++- 3 files changed, 134 insertions(+), 116 deletions(-) diff --git a/API_AuthLiteDelivery.py b/API_AuthLiteDelivery.py index a16288b..77798ca 100644 --- a/API_AuthLiteDelivery.py +++ b/API_AuthLiteDelivery.py @@ -28,7 +28,7 @@ def auth_lite_decrypt(ciphertext: bytes) -> str: content = decrypted_data[16:] # 去除头部的16字节 return content.decode('utf-8').strip() -def getRawDelivery(title_ver:str="1.50"): +def getRawDelivery(title_ver:str="1.51"): encrypted = auth_lite_encrypt(f'title_id=SDGB&title_ver={title_ver}&client_id=A63E01C2805') r = httpx.post( 'http://at.sys-allnet.cn/net/delivery/instruction', @@ -120,7 +120,7 @@ def parseUpdateIni(iniText): return final_message if __name__ == '__main__': - urlList = parseRawDelivery(getRawDelivery("1.40")) + urlList = parseRawDelivery(getRawDelivery("1.51")) for url in urlList: iniText = getUpdateIniFromURL(url) message = parseUpdateIni(iniText) diff --git a/HelperUploadUserPlayLog.py b/HelperUploadUserPlayLog.py index c81f214..df7da43 100644 --- a/HelperUploadUserPlayLog.py +++ b/HelperUploadUserPlayLog.py @@ -19,120 +19,122 @@ def apiUploadUserPlaylog(userId:int, musicDataToBeUploaded, currentUserData2, lo # 构建一个 PlayLog data = json.dumps({ "userId": int(userId), - "userPlaylog": { - "userId": 0, - "orderId": 0, - "playlogId": loginId, - "version": 1050000, - "placeId": placeId, - "placeName": placeName, - "loginDate": int(time.time()), #似乎和登录timestamp不同 - "playDate": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d'), - "userPlayDate": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') + '.0', - "type": 0, - "musicId": int(musicDataToBeUploaded['musicId']), - "level": int(musicDataToBeUploaded['level']), - "trackNo": 1, - "vsMode": 0, - "vsUserName": "", - "vsStatus": 0, - "vsUserRating": 0, - "vsUserAchievement": 0, - "vsUserGradeRank": 0, - "vsRank": 0, - "playerNum": 1, - "playedUserId1": 0, - "playedUserName1": "", - "playedMusicLevel1": 0, - "playedUserId2": 0, - "playedUserName2": "", - "playedMusicLevel2": 0, - "playedUserId3": 0, - "playedUserName3": "", - "playedMusicLevel3": 0, - "characterId1": currentUserData2['charaSlot'][0], - "characterLevel1": random.randint(1000,6500), - "characterAwakening1": 5, - "characterId2": currentUserData2['charaSlot'][1], - "characterLevel2": random.randint(1000,6500), - "characterAwakening2": 5, - "characterId3": currentUserData2['charaSlot'][2], - "characterLevel3": random.randint(1000,6500), - "characterAwakening3": 5, - "characterId4": currentUserData2['charaSlot'][3], - "characterLevel4": random.randint(1000,6500), - "characterAwakening4": 5, - "characterId5": currentUserData2['charaSlot'][4], - "characterLevel5": random.randint(1000,6500), - "characterAwakening5": 5, - "achievement": int(musicDataToBeUploaded['achievement']), - "deluxscore": int(musicDataToBeUploaded['deluxscoreMax']), - "scoreRank": int(musicDataToBeUploaded['scoreRank']), - "maxCombo": 0, - "totalCombo": random.randint(700,900), - "maxSync": 0, - "totalSync": 0, - "tapCriticalPerfect": 0, - "tapPerfect": 0, - "tapGreat": 0, - "tapGood": 0, - "tapMiss": random.randint(1,10), - "holdCriticalPerfect": 0, - "holdPerfect": 0, - "holdGreat": 0, - "holdGood": 0, - "holdMiss": random.randint(1,15), - "slideCriticalPerfect": 0, - "slidePerfect": 0, - "slideGreat": 0, - "slideGood": 0, - "slideMiss": random.randint(1,15), - "touchCriticalPerfect": 0, - "touchPerfect": 0, - "touchGreat": 0, - "touchGood": 0, - "touchMiss": random.randint(1,15), - "breakCriticalPerfect": 0, - "breakPerfect": 0, - "breakGreat": 0, - "breakGood": 0, - "breakMiss": random.randint(1,15), - "isTap": True, - "isHold": True, - "isSlide": True, - "isTouch": True, - "isBreak": True, - "isCriticalDisp": True, - "isFastLateDisp": True, - "fastCount": 0, - "lateCount": 0, - "isAchieveNewRecord": True, - "isDeluxscoreNewRecord": True, - "comboStatus": 0, - "syncStatus": 0, - "isClear": False, - 'beforeRating': currentUserData2['playerRating'], - 'afterRating': currentUserData2['playerRating'], - "beforeGrade": 0, - "afterGrade": 0, - "afterGradeRank": 1, - 'beforeDeluxRating': currentUserData2['playerRating'], - 'afterDeluxRating': currentUserData2['playerRating'], - "isPlayTutorial": False, - "isEventMode": False, - "isFreedomMode": False, - "playMode": 0, - "isNewFree": False, - "trialPlayAchievement": -1, - "extNum1": 0, - "extNum2": 0, - "extNum4": 3020, - "extBool1": False + "userPlaylogList": [ + { + "userId": 0, + "orderId": 0, + "playlogId": loginId, + "version": 1050000, + "placeId": placeId, + "placeName": placeName, + "loginDate": int(time.time()), #似乎和登录timestamp不同 + "playDate": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d'), + "userPlayDate": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') + '.0', + "type": 0, + "musicId": int(musicDataToBeUploaded['musicId']), + "level": int(musicDataToBeUploaded['level']), + "trackNo": 1, + "vsMode": 0, + "vsUserName": "", + "vsStatus": 0, + "vsUserRating": 0, + "vsUserAchievement": 0, + "vsUserGradeRank": 0, + "vsRank": 0, + "playerNum": 1, + "playedUserId1": 0, + "playedUserName1": "", + "playedMusicLevel1": 0, + "playedUserId2": 0, + "playedUserName2": "", + "playedMusicLevel2": 0, + "playedUserId3": 0, + "playedUserName3": "", + "playedMusicLevel3": 0, + "characterId1": currentUserData2['charaSlot'][0], + "characterLevel1": random.randint(1000,6500), + "characterAwakening1": 5, + "characterId2": currentUserData2['charaSlot'][1], + "characterLevel2": random.randint(1000,6500), + "characterAwakening2": 5, + "characterId3": currentUserData2['charaSlot'][2], + "characterLevel3": random.randint(1000,6500), + "characterAwakening3": 5, + "characterId4": currentUserData2['charaSlot'][3], + "characterLevel4": random.randint(1000,6500), + "characterAwakening4": 5, + "characterId5": currentUserData2['charaSlot'][4], + "characterLevel5": random.randint(1000,6500), + "characterAwakening5": 5, + "achievement": int(musicDataToBeUploaded['achievement']), + "deluxscore": int(musicDataToBeUploaded['deluxscoreMax']), + "scoreRank": int(musicDataToBeUploaded['scoreRank']), + "maxCombo": 0, + "totalCombo": random.randint(700,900), + "maxSync": 0, + "totalSync": 0, + "tapCriticalPerfect": 0, + "tapPerfect": 0, + "tapGreat": 0, + "tapGood": 0, + "tapMiss": random.randint(1,10), + "holdCriticalPerfect": 0, + "holdPerfect": 0, + "holdGreat": 0, + "holdGood": 0, + "holdMiss": random.randint(1,15), + "slideCriticalPerfect": 0, + "slidePerfect": 0, + "slideGreat": 0, + "slideGood": 0, + "slideMiss": random.randint(1,15), + "touchCriticalPerfect": 0, + "touchPerfect": 0, + "touchGreat": 0, + "touchGood": 0, + "touchMiss": random.randint(1,15), + "breakCriticalPerfect": 0, + "breakPerfect": 0, + "breakGreat": 0, + "breakGood": 0, + "breakMiss": random.randint(1,15), + "isTap": True, + "isHold": True, + "isSlide": True, + "isTouch": True, + "isBreak": True, + "isCriticalDisp": True, + "isFastLateDisp": True, + "fastCount": 0, + "lateCount": 0, + "isAchieveNewRecord": True, + "isDeluxscoreNewRecord": True, + "comboStatus": 0, + "syncStatus": 0, + "isClear": False, + "beforeRating": currentUserData2['playerRating'], + "afterRating": currentUserData2['playerRating'], + "beforeGrade": 0, + "afterGrade": 0, + "afterGradeRank": 1, + "beforeDeluxRating": currentUserData2['playerRating'], + "afterDeluxRating": currentUserData2['playerRating'], + "isPlayTutorial": False, + "isEventMode": False, + "isFreedomMode": False, + "playMode": 0, + "isNewFree": False, + "trialPlayAchievement": -1, + "extNum1": 0, + "extNum2": 0, + "extNum4": 3020, + "extBool1": False, + "extBool2": False } - }) + ] +}) # 发送请求 - result = apiSDGB(data, "UploadUserPlaylogApi", userId) + result = apiSDGB(data, "UploadUserPlaylogListApi", userId) logger.info("上传游玩记录:结果:"+ str(result)) # 返回响应 return result - diff --git a/HelperUserAll.py b/HelperUserAll.py index 244dfab..6a1eff7 100644 --- a/HelperUserAll.py +++ b/HelperUserAll.py @@ -52,7 +52,10 @@ def generateFullUserAll(userId, currentLoginResult, currentLoginTimestamp, curre def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, currentUserData2, currentPlaySpecial): """构建一个非常基础的 UserAll 数据,必须手动填充一些数据""" - + + # 我不知道放在哪里好了,你修改一下 TwT + currentUserMission = implGetUser_("MissionData", userId, True) + data = { "userId": userId, "playlogId": currentLoginResult['loginId'], @@ -64,6 +67,8 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "accessCode": "", "userName": currentUserData2['userName'], "isNetMember": 1, + "point": currentUserData2['point'], + "totalPoint": currentUserData2['totalPoint'], "iconId": currentUserData2['iconId'], "plateId": currentUserData2['plateId'], "titleId": currentUserData2['titleId'], @@ -157,6 +162,8 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "userChargeList": [], #需要填上 "userFavoriteList": [], "userActivityList": [], #需要填上 + "userMissionDataList": [], + "userWeeklyData": currentUserMission['userWeeklyData'], "userGamePlaylogList": [ { "playlogId": currentLoginResult['loginId'], @@ -191,7 +198,16 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "isNewMusicDetailList": "", #可选但经常要填上 "isNewCourseList": "0", "isNewFavoriteList": "", - "isNewFriendSeasonRankingList": "" + "isNewFriendSeasonRankingList": "", + "userIntimateList": [], + "userShopItemStockList": [], + "userGetPointList": [], + "userTradeItemList": [], + "userFavoritemusicList": [], + "userKaleidxScopeList": [], + "isNewUserIntimateList": "", + "isNewFavoritemusicList": "", + "isNewKaleidxScopeList": "" } } return data From fe7b17ad8045163b39ecc8b0d49f1974fdf8aa52 Mon Sep 17 00:00:00 2001 From: alice Date: Mon, 7 Jul 2025 18:28:40 +0800 Subject: [PATCH 2/3] update 1.51 --- HelperUploadUserPlayLog.py | 2 +- HelperUserAll.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HelperUploadUserPlayLog.py b/HelperUploadUserPlayLog.py index df7da43..8ab526e 100644 --- a/HelperUploadUserPlayLog.py +++ b/HelperUploadUserPlayLog.py @@ -24,7 +24,7 @@ def apiUploadUserPlaylog(userId:int, musicDataToBeUploaded, currentUserData2, lo "userId": 0, "orderId": 0, "playlogId": loginId, - "version": 1050000, + "version": 1051000, "placeId": placeId, "placeName": placeName, "loginDate": int(time.time()), #似乎和登录timestamp不同 diff --git a/HelperUserAll.py b/HelperUserAll.py index 6a1eff7..57ede87 100644 --- a/HelperUserAll.py +++ b/HelperUserAll.py @@ -167,7 +167,7 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "userGamePlaylogList": [ { "playlogId": currentLoginResult['loginId'], - "version": "1.50.00", + "version": "1.51.00", "playDate": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%Y-%m-%d %H:%M:%S') + '.0', "playMode": 0, "useTicketId": -1, From e1a95adae601fa3f988c754bc29be78617e038ff Mon Sep 17 00:00:00 2001 From: Remik1r3n <62464927+Remik1r3n@users.noreply.github.com> Date: Mon, 14 Jul 2025 11:30:07 +0800 Subject: [PATCH 3/3] Update HelperUserAll.py --- HelperUserAll.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/HelperUserAll.py b/HelperUserAll.py index 57ede87..dce6ab6 100644 --- a/HelperUserAll.py +++ b/HelperUserAll.py @@ -145,6 +145,7 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "playerOldRating": currentUserData2['playerOldRating'], "playerNewRating": currentUserData2['playerNewRating'], "banState": 0, + "friendRegistSkip": currentUserData2['friendRegistSkip'], "dateTime": currentLoginTimestamp } ], @@ -191,6 +192,12 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "placeId": 0, "user2pPlaylogDetailList": [] }, + "userIntimateList": [], + "userShopItemStockList": [], + "userGetPointList": [], + "userTradeItemList": [], + "userFavoritemusicList": [], + "userKaleidxScopeList": [], "isNewCharacterList": "", "isNewMapList": "", "isNewLoginBonusList": "", @@ -199,12 +206,6 @@ def generateUserAllData(userId, currentLoginResult, currentLoginTimestamp, curre "isNewCourseList": "0", "isNewFavoriteList": "", "isNewFriendSeasonRankingList": "", - "userIntimateList": [], - "userShopItemStockList": [], - "userGetPointList": [], - "userTradeItemList": [], - "userFavoritemusicList": [], - "userKaleidxScopeList": [], "isNewUserIntimateList": "", "isNewFavoritemusicList": "", "isNewKaleidxScopeList": ""