Tested and fixed stupid bug

This commit is contained in:
Remik1r3n
2025-01-23 19:16:27 +08:00
parent 83da4636ac
commit 6e05b211ac
3 changed files with 14 additions and 10 deletions

View File

@@ -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: