Initial restarted commit

This commit is contained in:
Remik1r3n
2025-01-23 18:52:09 +08:00
commit 83da4636ac
18 changed files with 1753 additions and 0 deletions

61
ActionUnlockVarious.py Normal file
View File

@@ -0,0 +1,61 @@
# 解锁一些东西的外部代码
from loguru import logger
from Static_Settings import *
from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
from HelperUnlockThing import implUnlockThing
def implUnlockPartner(partnerToBeUnlocked: int, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str:
'''
解锁搭档
'''
userItemList = [
{
"itemKind": 10,
"itemId": partnerToBeUnlocked,
"stock": 1,
"isValid": True
}
],
unlockThingResult = implUnlockThing(userItemList, userId, currentLoginTimestamp, currentLoginResult)
return unlockThingResult
def implUnlockMusic(musicToBeUnlocked: int, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str:
'''
解锁乐曲
'''
userItemList = [
{
"itemKind": 5,
"itemId": musicToBeUnlocked,
"stock": 1,
"isValid": True
},
{
"itemKind": 6,
"itemId": musicToBeUnlocked,
"stock": 1,
"isValid": True
},
],
unlockThingResult = implUnlockThing(userItemList, userId, currentLoginTimestamp, currentLoginResult)
return unlockThingResult
if __name__ == "__main__":
userId = testUid
currentLoginTimestamp = generateTimestamp()
loginResult = apiLogin(currentLoginTimestamp, userId)
wantToUnlockItemId = 1
if loginResult['returnCode'] != 1:
logger.info("登录失败")
exit()
try:
# change it
logger.info(implUnlockMusic(wantToUnlockItemId, userId, currentLoginTimestamp, loginResult))
logger.info(apiLogout(currentLoginTimestamp, userId))
except:
logger.info(apiLogout(currentLoginTimestamp, userId))
logger.warning("Error")