mirror of
https://github.com/drmext/MonkeyBusiness.git
synced 2024-11-23 22:51:03 +01:00
Fix
This commit is contained in:
parent
2ea73c1006
commit
f076453f64
@ -89,13 +89,19 @@ async def iidx30grade_raised(request: Request):
|
|||||||
game_profile["grade_values"] = grades
|
game_profile["grade_values"] = grades
|
||||||
|
|
||||||
grade_sp = db.table("iidx_class_best").search(
|
grade_sp = db.table("iidx_class_best").search(
|
||||||
(where("iidx_id") == iidx_id) & (where("gtype") == 0) & (where("cstage") == 4)
|
(where("game_version") == game_version)
|
||||||
|
& (where("iidx_id") == iidx_id)
|
||||||
|
& (where("gtype") == 0)
|
||||||
|
& (where("cstage") == 4)
|
||||||
)
|
)
|
||||||
|
|
||||||
game_profile["grade_single"] = max([x["gid"] for x in grade_sp], default=-1)
|
game_profile["grade_single"] = max([x["gid"] for x in grade_sp], default=-1)
|
||||||
|
|
||||||
grade_dp = db.table("iidx_class_best").search(
|
grade_dp = db.table("iidx_class_best").search(
|
||||||
(where("iidx_id") == iidx_id) & (where("gtype") == 1) & (where("cstage") == 4)
|
(where("game_version") == game_version)
|
||||||
|
& (where("iidx_id") == iidx_id)
|
||||||
|
& (where("gtype") == 1)
|
||||||
|
& (where("cstage") == 4)
|
||||||
)
|
)
|
||||||
|
|
||||||
game_profile["grade_double"] = max([x["gid"] for x in grade_dp], default=-1)
|
game_profile["grade_double"] = max([x["gid"] for x in grade_dp], default=-1)
|
||||||
|
@ -483,7 +483,7 @@ async def iidx30music_appoint(request: Request):
|
|||||||
|
|
||||||
|
|
||||||
@router.post("/{gameinfo}/IIDX30music/arenaCPU")
|
@router.post("/{gameinfo}/IIDX30music/arenaCPU")
|
||||||
async def iidx30music_arenaCPU(request: Request):
|
async def iidx30music_arenacpu(request: Request):
|
||||||
request_info = await core_process_request(request)
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
root = request_info["root"][0]
|
root = request_info["root"][0]
|
||||||
@ -492,21 +492,19 @@ async def iidx30music_arenaCPU(request: Request):
|
|||||||
cpu_list = root.findall("cpu_list")
|
cpu_list = root.findall("cpu_list")
|
||||||
cpu_count = len(cpu_list)
|
cpu_count = len(cpu_list)
|
||||||
|
|
||||||
cpu_scores = {}
|
cpu = {}
|
||||||
cpu_ghosts = {}
|
|
||||||
for music in music_list:
|
for music in music_list:
|
||||||
i = int(music.find("index").text)
|
music_idx = int(music.find("index").text)
|
||||||
exscore_max = int(music.find("total_notes").text) * 2
|
exscore_max = int(music.find("total_notes").text) * 2
|
||||||
|
|
||||||
cpu_scores[i] = {}
|
cpu[music_idx] = {}
|
||||||
cpu_ghosts[i] = {}
|
|
||||||
|
|
||||||
for j in range(cpu_count):
|
for bot_idx in range(cpu_count):
|
||||||
cpu_scores[i][j] = {}
|
cpu[music_idx][bot_idx] = {}
|
||||||
cpu_ghosts[i][j] = {}
|
|
||||||
|
|
||||||
exscore = round(exscore_max * random.uniform(0.77, 0.93))
|
exscore = round(exscore_max * random.uniform(0.77, 0.93))
|
||||||
cpu_scores[i][j]["exscore"] = exscore
|
cpu[music_idx][bot_idx]["exscore"] = exscore
|
||||||
|
|
||||||
ghost_len = 64
|
ghost_len = 64
|
||||||
ghost_data = [0] * ghost_len
|
ghost_data = [0] * ghost_len
|
||||||
@ -515,29 +513,77 @@ async def iidx30music_arenaCPU(request: Request):
|
|||||||
if (exscore % ghost_len) > x:
|
if (exscore % ghost_len) > x:
|
||||||
ghost_data[x] += 1
|
ghost_data[x] += 1
|
||||||
|
|
||||||
cpu_ghosts[i][j]["ghost_data"] = ghost_data
|
cpu[music_idx][bot_idx]["ghost_data"] = ghost_data
|
||||||
|
|
||||||
response = E.response(
|
response = E.response(
|
||||||
E.IIDX30music(
|
E.IIDX30music(
|
||||||
*[
|
*[
|
||||||
E.cpu_score_list(
|
E.cpu_score_list(
|
||||||
E.index(i, __type="s32"),
|
E.index(bot_idx, __type="s32"),
|
||||||
*[
|
*[
|
||||||
E.score_list(
|
E.score_list(
|
||||||
E.index(j, __type="s32"),
|
E.index(music_idx, __type="s32"),
|
||||||
E.score(cpu_scores[i][j]["exscore"], __type="s32"),
|
E.score(cpu[music_idx][bot_idx]["exscore"], __type="s32"),
|
||||||
E.ghost(cpu_ghosts[i][j]["ghost_data"], __type="u8"),
|
E.ghost(cpu[music_idx][bot_idx]["ghost_data"], __type="u8"),
|
||||||
E.enable_score(1, __type="bool"),
|
E.enable_score(1, __type="bool"),
|
||||||
E.enable_ghost(1, __type="bool"),
|
E.enable_ghost(1, __type="bool"),
|
||||||
E.location_id("X000000001", __type="str"),
|
E.location_id("X000000001", __type="str"),
|
||||||
)
|
)
|
||||||
for j in range(cpu_count)
|
for music_idx in range(music_count)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
for i in range(music_count)
|
for bot_idx in range(cpu_count)
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
response_body, response_headers = await core_prepare_response(request, response)
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
return Response(content=response_body, headers=response_headers)
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30music/retry")
|
||||||
|
async def iidx30music_retry(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(
|
||||||
|
E.IIDX30music(
|
||||||
|
E.session(session_id=1),
|
||||||
|
status=0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30music/play")
|
||||||
|
async def iidx30music_play(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(E.IIDX30music())
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30music/nosave")
|
||||||
|
async def iidx30music_nosave(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(E.IIDX30music())
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30music/movieinfo")
|
||||||
|
async def iidx30music_movieinfo(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(
|
||||||
|
E.IIDX30music(
|
||||||
|
status=0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
@ -391,7 +391,7 @@ async def iidx30pc_get(request: Request):
|
|||||||
E.enable_qr_reward(),
|
E.enable_qr_reward(),
|
||||||
E.nostalgia_open(),
|
E.nostalgia_open(),
|
||||||
E.language_setting(language=profile["language_setting"]),
|
E.language_setting(language=profile["language_setting"]),
|
||||||
E.movie_agreement(agreement_version=profile["movie_agreement"]),
|
E.movie_agreement(agreement_version=profile.get("movie_agreement", 0)),
|
||||||
E.bpl_virtual(),
|
E.bpl_virtual(),
|
||||||
E.lightning_play_data(
|
E.lightning_play_data(
|
||||||
spnum=profile["lightning_play_data_spnum"],
|
spnum=profile["lightning_play_data_spnum"],
|
||||||
@ -758,7 +758,7 @@ async def iidx30pc_common(request: Request):
|
|||||||
E.movie_agreement(version=1),
|
E.movie_agreement(version=1),
|
||||||
E.license("None", __type="str"),
|
E.license("None", __type="str"),
|
||||||
E.file_recovery(url=str(config.ip)),
|
E.file_recovery(url=str(config.ip)),
|
||||||
E.movie_upload(url=str(config.ip)),
|
E.movie_upload(url=f"http://{str(request.client.host)}:4399/movie/"), # use https://github.com/bookqaq/010-record-api
|
||||||
# E.button_release_frame(frame=''),
|
# E.button_release_frame(frame=''),
|
||||||
# E.trigger_logic_type(type=''),
|
# E.trigger_logic_type(type=''),
|
||||||
# E.cm_movie_info(type=''),
|
# E.cm_movie_info(type=''),
|
||||||
@ -907,6 +907,16 @@ async def iidx30pc_save(request: Request):
|
|||||||
if concentration is not None:
|
if concentration is not None:
|
||||||
game_profile["lightning_setting_concentration"] = int(concentration.text)
|
game_profile["lightning_setting_concentration"] = int(concentration.text)
|
||||||
|
|
||||||
|
movie_agreement = request_info["root"][0].find("movie_agreement")
|
||||||
|
if movie_agreement is not None and "agreement_version" in movie_agreement.attrib:
|
||||||
|
game_profile["movie_agreement"] = int(
|
||||||
|
movie_agreement.attrib["agreement_version"]
|
||||||
|
)
|
||||||
|
|
||||||
|
hide_name = request_info["root"][0].find("movie_setting/hide_name")
|
||||||
|
if hide_name is not None:
|
||||||
|
game_profile["hide_name"] = int(hide_name.text)
|
||||||
|
|
||||||
lightning_customize_flg = request_info["root"][0].find("lightning_customize_flg")
|
lightning_customize_flg = request_info["root"][0].find("lightning_customize_flg")
|
||||||
if lightning_customize_flg is not None:
|
if lightning_customize_flg is not None:
|
||||||
for k in [
|
for k in [
|
||||||
@ -1339,6 +1349,35 @@ async def iidx30pc_eaappliresult(request: Request):
|
|||||||
return Response(content=response_body, headers=response_headers)
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30pc/playstart")
|
||||||
|
async def iidx30pc_playstart(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(E.IIDX30pc())
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30pc/playend")
|
||||||
|
async def iidx30pc_playend(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(E.IIDX30pc())
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX30pc/delete")
|
||||||
|
async def iidx30pc_delete(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(E.IIDX30pc())
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
@router.post("/{gameinfo}/IIDX30pc/logout")
|
@router.post("/{gameinfo}/IIDX30pc/logout")
|
||||||
async def iidx30pc_logout(request: Request):
|
async def iidx30pc_logout(request: Request):
|
||||||
request_info = await core_process_request(request)
|
request_info = await core_process_request(request)
|
||||||
|
@ -576,3 +576,16 @@ async def iidx31music_nosave(request: Request):
|
|||||||
|
|
||||||
response_body, response_headers = await core_prepare_response(request, response)
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
return Response(content=response_body, headers=response_headers)
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX31music/movieinfo")
|
||||||
|
async def iidx31music_movieinfo(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(
|
||||||
|
E.IIDX31music(
|
||||||
|
status=0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
@ -310,7 +310,7 @@ async def iidx31pc_get(request: Request):
|
|||||||
tour_id=i,
|
tour_id=i,
|
||||||
progress=50, # set to 49 to see WT folders, 50 is completed/hidden
|
progress=50, # set to 49 to see WT folders, 50 is completed/hidden
|
||||||
)
|
)
|
||||||
for i in range(16)
|
for i in range(17)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
E.lightning_setting(
|
E.lightning_setting(
|
||||||
@ -809,7 +809,7 @@ async def iidx31pc_common(request: Request):
|
|||||||
E.movie_agreement(version=1),
|
E.movie_agreement(version=1),
|
||||||
E.license("None", __type="str"),
|
E.license("None", __type="str"),
|
||||||
E.file_recovery(url=str(config.ip)),
|
E.file_recovery(url=str(config.ip)),
|
||||||
E.movie_upload(url=f"http://{str(config.ip)}:4399/movie/"),
|
E.movie_upload(url=f"http://{str(request.client.host)}:4399/movie/"), # use https://github.com/bookqaq/010-record-api
|
||||||
# E.button_release_frame(frame=''),
|
# E.button_release_frame(frame=''),
|
||||||
# E.trigger_logic_type(type=''),
|
# E.trigger_logic_type(type=''),
|
||||||
# E.cm_movie_info(type=''),
|
# E.cm_movie_info(type=''),
|
||||||
|
@ -590,3 +590,17 @@ async def iidx32music_getranksub(request: Request):
|
|||||||
|
|
||||||
response_body, response_headers = await core_prepare_response(request, response)
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
return Response(content=response_body, headers=response_headers)
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
@router.post("/{gameinfo}/IIDX32music/movieinfo")
|
||||||
|
async def iidx32music_movieinfo(request: Request):
|
||||||
|
request_info = await core_process_request(request)
|
||||||
|
|
||||||
|
response = E.response(
|
||||||
|
E.IIDX32music(
|
||||||
|
status=0,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
response_body, response_headers = await core_prepare_response(request, response)
|
||||||
|
return Response(content=response_body, headers=response_headers)
|
||||||
|
|
||||||
|
@ -665,7 +665,7 @@ async def iidx32pc_common(request: Request):
|
|||||||
E.movie_agreement(version=1),
|
E.movie_agreement(version=1),
|
||||||
E.license("None", __type="str"),
|
E.license("None", __type="str"),
|
||||||
E.file_recovery(url=str(config.ip)),
|
E.file_recovery(url=str(config.ip)),
|
||||||
E.movie_upload(url=f"http://{str(config.ip)}:4399/movie/"),
|
E.movie_upload(url=f"http://{str(request.client.host)}:4399/movie/"), # use https://github.com/bookqaq/010-record-api
|
||||||
# E.button_release_frame(frame=''),
|
# E.button_release_frame(frame=''),
|
||||||
# E.trigger_logic_type(type=''),
|
# E.trigger_logic_type(type=''),
|
||||||
# E.cm_movie_info(type=''),
|
# E.cm_movie_info(type=''),
|
||||||
|
Loading…
Reference in New Issue
Block a user