mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-14 11:47:28 +08:00
database support for prism
kaleidxScope Key Condition store
This commit is contained in:
@@ -49,6 +49,22 @@ class Mai2Prism(Mai2BuddiesPlus):
|
||||
}
|
||||
|
||||
async def handle_get_user_kaleidx_scope_api_request(self, data: Dict) -> Dict:
|
||||
# kaleidxscope keyget condition judgement
|
||||
# player may get key before GateFound
|
||||
for gate in range(1,7):
|
||||
condition_list = await self.data.static.get_kaleidxscope_condition(gate)
|
||||
if not condition_list:
|
||||
continue
|
||||
condition_satisfy = 0
|
||||
for condition in condition_list:
|
||||
score_list = await self.data.score.get_best_scores(user_id=data["userId"], song_id=condition[3])
|
||||
if score_list:
|
||||
condition_satisfy = condition_satisfy + 1
|
||||
if len(condition_list) == condition_satisfy:
|
||||
new_kaleidxscope = {'gateId': gate, "isKeyFound": True}
|
||||
await self.data.score.put_user_kaleidxscope(data["userId"], new_kaleidxscope)
|
||||
|
||||
|
||||
kaleidxscope = await self.data.score.get_user_kaleidxscope_list(data["userId"])
|
||||
|
||||
if kaleidxscope is None:
|
||||
|
||||
Reference in New Issue
Block a user