启用gacha

This commit is contained in:
baiqwerdvd 2024-05-28 18:44:59 +08:00
parent 807d5714fb
commit 6a6e8bbfb0
No known key found for this signature in database
GPG Key ID: 7717E46E1797411A
3 changed files with 14 additions and 9 deletions

View File

@ -11,7 +11,6 @@ sv_ark_gacha = SV("ark十连")
@sv_ark_gacha.on_fullmatch(f"{PREFIX}十连")
async def send_gacha_info(bot: Bot, ev: Event):
return "WIP"
user_id = ev.at if ev.at else ev.user_id
uid = await ArknightsBind.get_uid_by_game(user_id, ev.bot_id)
if uid is None:

View File

@ -47,14 +47,14 @@ async def gacha(uid: str):
gacha=GachaTrackModel(),
),
)
json.dump({"uid": uid, "data": msgjson.decode(msgjson.encode(data))}, f)
json.dump({"uid": uid, "data": msgjson.decode(msgjson.encode(data))}, f, indent=4)
with open(cur_path / Path(f"{uid}.json"), "r") as f:
data = json.load(f)
data = convert(data["data"], PlayerDataDetail)
char_get = await testTenAdvancedGacha("SINGLE_45_0_7", data, 0)
with open(cur_path / Path(f"{uid}.json"), "w") as f:
json.dump({"uid": uid, "data": msgjson.decode(msgjson.encode(data))}, f)
json.dump({"uid": uid, "data": msgjson.decode(msgjson.encode(data))}, f, indent=4)
return char_get

View File

@ -100,7 +100,8 @@ class GachaService:
state.init = 1
if not poolClient.openTime <= now <= poolClient.endTime:
raise ValueError("gacha pool not open")
pass
# raise ValueError("gacha pool not open")
## === ↓ ***基础数据校验*** ↓ ===
# poolClient.openTime <= now <= poolClient.endTime -> gacha pool not open
@ -157,7 +158,8 @@ class GachaService:
state.init = 1
if not carousel.startTime <= now <= carousel.endTime or not curPool.openFlag:
raise ValueError("gacha pool not open")
pass
# raise ValueError("gacha pool not open")
## === ↓ ***基础数据校验*** ↓ ===
# carousel.startTime <= now <= carousel.endTime | openFlag -> gacha pool not open
@ -185,7 +187,8 @@ class GachaService:
state.init = 1
if not carousel.startTime <= now <= carousel.endTime or not curPool.openFlag:
raise ValueError("gacha pool not open")
pass
# raise ValueError("gacha pool not open")
## === ↓ ***基础数据校验*** ↓ ===
# carousel.startTime <= now <= carousel.endTime | openFlag -> gacha pool not open
@ -219,7 +222,8 @@ class GachaService:
state.init = 1
if not poolClient.openTime <= now <= poolClient.endTime:
raise ValueError("gacha pool not open")
pass
# raise ValueError("gacha pool not open")
## === ↓ ***基础数据校验*** ↓ ===
# poolClient.openTime <= now <= poolClient.endTime -> gacha pool not open
@ -249,7 +253,8 @@ class GachaService:
state.init = 1
if not poolClient.openTime <= now <= poolClient.endTime:
raise ValueError("gacha pool not open")
pass
# raise ValueError("gacha pool not open")
## === ↓ ***基础数据校验*** ↓ ===
# poolClient.openTime <= now <= poolClient.endTime -> gacha pool not open
@ -310,7 +315,8 @@ class GachaService:
state.init = 1
if not poolClient.openTime <= now <= poolClient.endTime:
raise ValueError("gacha pool not open")
pass
# raise ValueError("gacha pool not open")
## === ↓ ***基础数据校验*** ↓ ===
# poolClient.openTime <= now <= poolClient.endTime -> gacha pool not open