chore: unlock ソルト
This commit is contained in:
@@ -2,57 +2,59 @@
|
|||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
from Config import *
|
from MyConfig import testUid8
|
||||||
from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
from HelperLogInOut import apiLogin, apiLogout, generateTimestamp
|
||||||
from HelperUnlockThing import implUnlockThing
|
from HelperUnlockThing import implUnlockThing
|
||||||
|
|
||||||
def implUnlockSingleItem(itemId: int, itemKind: int, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str:
|
|
||||||
|
def implUnlockSingleItem(
|
||||||
|
itemId: int,
|
||||||
|
itemKind: int,
|
||||||
|
userId: int,
|
||||||
|
currentLoginTimestamp: int,
|
||||||
|
currentLoginResult,
|
||||||
|
) -> str:
|
||||||
"""
|
"""
|
||||||
发单个东西,比如搭档 10
|
发单个东西,比如搭档 10
|
||||||
"""
|
"""
|
||||||
userItemList = [
|
userItemList = [
|
||||||
{
|
{"itemKind": itemKind, "itemId": itemId, "stock": 1, "isValid": True}
|
||||||
"itemKind": itemKind,
|
|
||||||
"itemId": itemId,
|
|
||||||
"stock": 1,
|
|
||||||
"isValid": True
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
unlockThingResult = implUnlockThing(userItemList, userId, currentLoginTimestamp, currentLoginResult)
|
unlockThingResult = implUnlockThing(
|
||||||
|
userItemList, userId, currentLoginTimestamp, currentLoginResult
|
||||||
|
)
|
||||||
return unlockThingResult
|
return unlockThingResult
|
||||||
|
|
||||||
def implUnlockMusic(musicToBeUnlocked: int, userId: int, currentLoginTimestamp:int, currentLoginResult) -> str:
|
|
||||||
|
def implUnlockMusic(
|
||||||
|
musicToBeUnlocked: int, userId: int, currentLoginTimestamp: int, currentLoginResult
|
||||||
|
) -> str:
|
||||||
"""
|
"""
|
||||||
解锁乐曲
|
解锁乐曲
|
||||||
"""
|
"""
|
||||||
userItemList = [
|
userItemList = [
|
||||||
{
|
{"itemKind": 5, "itemId": musicToBeUnlocked, "stock": 1, "isValid": True},
|
||||||
"itemKind": 5,
|
{"itemKind": 6, "itemId": musicToBeUnlocked, "stock": 1, "isValid": True},
|
||||||
"itemId": musicToBeUnlocked,
|
|
||||||
"stock": 1,
|
|
||||||
"isValid": True
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"itemKind": 6,
|
|
||||||
"itemId": musicToBeUnlocked,
|
|
||||||
"stock": 1,
|
|
||||||
"isValid": True
|
|
||||||
},
|
|
||||||
]
|
]
|
||||||
unlockThingResult = implUnlockThing(userItemList, userId, currentLoginTimestamp, currentLoginResult)
|
unlockThingResult = implUnlockThing(
|
||||||
|
userItemList, userId, currentLoginTimestamp, currentLoginResult
|
||||||
|
)
|
||||||
return unlockThingResult
|
return unlockThingResult
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
userId = testUid2
|
userId = testUid8
|
||||||
currentLoginTimestamp = generateTimestamp()
|
currentLoginTimestamp = generateTimestamp()
|
||||||
loginResult = apiLogin(currentLoginTimestamp, userId)
|
loginResult = apiLogin(currentLoginTimestamp, userId)
|
||||||
|
|
||||||
if loginResult['returnCode'] != 1:
|
if loginResult["returnCode"] != 1:
|
||||||
logger.info("登录失败")
|
logger.info("登录失败")
|
||||||
exit()
|
exit()
|
||||||
try:
|
try:
|
||||||
logger.info(implWipeTickets(userId, currentLoginTimestamp, loginResult))
|
logger.info(
|
||||||
|
implUnlockSingleItem(10, 14, userId, currentLoginTimestamp, loginResult)
|
||||||
|
)
|
||||||
logger.info(apiLogout(currentLoginTimestamp, userId))
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
finally:
|
finally:
|
||||||
logger.info(apiLogout(currentLoginTimestamp, userId))
|
logger.info(apiLogout(currentLoginTimestamp, userId))
|
||||||
#logger.warning("Error")
|
# logger.warning("Error")
|
||||||
|
|||||||
Reference in New Issue
Block a user