parent
da02f3e69f
commit
3b6fde8333
Binary file not shown.
@ -1,15 +1,19 @@
|
||||
from sanic import Blueprint
|
||||
|
||||
from .api import bp_sif_api
|
||||
from .login import bp_sif_login
|
||||
from .user import bp_sif_user
|
||||
from .misc import bp_sif_misc
|
||||
from .download import bp_sif_download
|
||||
from .api import bp_sif_api
|
||||
from .live import bp_sif_live
|
||||
from .unit import bp_sif_unit
|
||||
|
||||
bp_sif = Blueprint.group(bp_sif_login,
|
||||
bp_sif_user,
|
||||
bp_sif_misc,
|
||||
bp_sif_download,
|
||||
bp_sif_api,
|
||||
bp_sif_live,
|
||||
bp_sif_unit,
|
||||
url_prefix="main.php")
|
||||
|
||||
|
@ -0,0 +1,74 @@
|
||||
from sanic import Blueprint, Request
|
||||
|
||||
import time
|
||||
|
||||
from .common import common_api
|
||||
from utils.masterdata import get_masterdata
|
||||
|
||||
|
||||
bp_sif_live = Blueprint("sif_live", url_prefix="live")
|
||||
|
||||
|
||||
|
||||
@bp_sif_live.route("liveStatus", methods=["POST"])
|
||||
@common_api
|
||||
async def liveStatus(request: Request):
|
||||
normal_live_status_list = []
|
||||
live_difficulty_id = get_masterdata("live.db", "normal_live_m", ["live_difficulty_id"])
|
||||
for t in live_difficulty_id:
|
||||
normal_live_status_list.append({
|
||||
"live_difficulty_id": t[0],
|
||||
"status": 1,
|
||||
"hi_score": 0,
|
||||
"hi_combo_count": 0,
|
||||
"clear_cnt": 0,
|
||||
"achieved_goal_id_list": []
|
||||
})
|
||||
|
||||
special_live_status_list = []
|
||||
live_difficulty_id = get_masterdata("live.db", "special_live_m", ["live_difficulty_id"])
|
||||
for t in live_difficulty_id:
|
||||
special_live_status_list.append({
|
||||
"live_difficulty_id": t[0],
|
||||
"status": 1,
|
||||
"hi_score": 0,
|
||||
"hi_combo_count": 0,
|
||||
"clear_cnt": 0,
|
||||
"achieved_goal_id_list": []
|
||||
})
|
||||
|
||||
resp = {
|
||||
"normal_live_status_list": normal_live_status_list,
|
||||
"special_live_status_list": special_live_status_list,
|
||||
"training_live_status_list": [],
|
||||
"marathon_live_status_list": [],
|
||||
"free_live_status_list": [],
|
||||
"can_resume_live": True
|
||||
}
|
||||
return resp
|
||||
|
||||
|
||||
|
||||
@bp_sif_live.route("schedule", methods=["POST"])
|
||||
@common_api
|
||||
async def schedule(request: Request):
|
||||
live_list = []
|
||||
live_difficulty_id = get_masterdata("live.db", "special_live_m", ["live_difficulty_id"])
|
||||
for t in live_difficulty_id:
|
||||
live_list.append({
|
||||
"live_difficulty_id": 46,
|
||||
"start_date": "2000-01-01 00:00:00",
|
||||
"end_date": "2099-01-01 00:00:00",
|
||||
"is_random": False
|
||||
})
|
||||
resp = {
|
||||
"event_list": [],
|
||||
"live_list": live_list,
|
||||
"limited_bonus_list": [],
|
||||
"limited_bonus_common_list": [],
|
||||
"random_live_list": [],
|
||||
"free_live_list": [],
|
||||
"training_live_list": []
|
||||
}
|
||||
return resp
|
||||
|
@ -0,0 +1,17 @@
|
||||
from sanic import Blueprint, Request
|
||||
|
||||
import time
|
||||
|
||||
from .common import common_api
|
||||
|
||||
|
||||
|
||||
bp_sif_name = Blueprint("sif_name", url_prefix="name")
|
||||
|
||||
|
||||
|
||||
@bp_sif_name.route("", methods=["POST"])
|
||||
@common_api
|
||||
async def _(request: Request):
|
||||
resp = {}
|
||||
return resp
|
@ -0,0 +1,52 @@
|
||||
from sanic import Blueprint, Request
|
||||
|
||||
import time
|
||||
|
||||
from .common import common_api
|
||||
|
||||
|
||||
|
||||
bp_sif_unit = Blueprint("sif_unit", url_prefix="unit")
|
||||
|
||||
|
||||
|
||||
@bp_sif_unit.route("unitAll", methods=["POST"])
|
||||
@common_api
|
||||
async def unitAll(request: Request):
|
||||
|
||||
### TODO - PLACEHOLDER ###
|
||||
|
||||
active = []
|
||||
for i in range(9):
|
||||
active.append({
|
||||
"unit_owning_user_id": 38383+i,
|
||||
"unit_id": i+1,
|
||||
"exp": 8000,
|
||||
"next_exp": 0,
|
||||
"level": 40,
|
||||
"max_level": 40,
|
||||
"level_limit_id": 0,
|
||||
"rank": 1,
|
||||
"max_rank": 2,
|
||||
"love": 50,
|
||||
"max_love": 50,
|
||||
"unit_skill_exp": 0,
|
||||
"unit_skill_level": 0,
|
||||
"max_hp": 3,
|
||||
"unit_removable_skill_capacity": 0,
|
||||
"favorite_flag": False,
|
||||
"display_rank": 2,
|
||||
"is_rank_max": False,
|
||||
"is_love_max": False,
|
||||
"is_level_max": False,
|
||||
"is_signed": False,
|
||||
"is_skill_level_max": False,
|
||||
"is_removable_skill_capacity_max": False,
|
||||
"insert_date": "2023-03-13 11:47:24"
|
||||
})
|
||||
|
||||
resp = {
|
||||
"active": active,
|
||||
"waiting": []
|
||||
}
|
||||
return resp
|
@ -0,0 +1,9 @@
|
||||
import sqlite3
|
||||
|
||||
def get_masterdata(db: str, table: str, columns: list[str]) -> list[tuple]:
|
||||
con = sqlite3.connect(f"./data/masterdata/{db}")
|
||||
cur = con.cursor()
|
||||
query = f"select {','.join(columns)} from {table}"
|
||||
res = cur.execute(query).fetchall()
|
||||
con.close()
|
||||
return res
|
Loading…
Reference in new issue