实现农场币换点券、查看当前用户点券,偷偷加后门改农场币。

This commit is contained in:
Mualamx 2025-10-10 13:32:45 +08:00
parent 4841ceb871
commit eb937dd309

View File

@ -1150,11 +1150,15 @@ class CFarmManager:
@classmethod
async def pointToVipPointByUid(cls, uid: str, num: int) -> str:
"""农场币兑换点券
num:用户传参,即将兑换的点券
pro:兑换倍数;兑换倍数乘以num即为需要消耗的农场币
"""
if num <= 0:
return "点券兑换数量必须大于0"
pro = float(Config.get_config("zhenxun_plugin_farm", "点券兑换倍数"))
pro *= float(num)
pro = int(Config.get_config("zhenxun_plugin_farm", "点券兑换倍数"))
pro *= num
point = await g_pDBService.user.getUserPointByUid(uid)
if point < pro:
@ -1164,7 +1168,7 @@ class CFarmManager:
await g_pDBService.user.updateUserPointByUid(uid, int(point))
p = await g_pDBService.user.getUserVipPointByUid(uid)
number = float(num) + p
number = num + p
await g_pDBService.user.updateUserVipPointByUid(uid, int(number))