From 6ff78279184dbdeb37fdb75166067546f043ce40 Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Sat, 1 Apr 2023 23:05:10 -0400 Subject: [PATCH] diva: fill out StartResponse --- titles/diva/const.py | 2 ++ titles/diva/handlers/user.py | 45 ++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/titles/diva/const.py b/titles/diva/const.py index 08597c4..7bebb31 100644 --- a/titles/diva/const.py +++ b/titles/diva/const.py @@ -6,6 +6,8 @@ class DivaConstants: VER_PROJECT_DIVA_ARCADE = 0 VER_PROJECT_DIVA_ARCADE_FUTURE_TONE = 1 + LUT_TIME_FMT = "%Y-%m-%d %H:%M:%S:16.0" + VERSION_NAMES = ("Project Diva Arcade", "Project Diva Arcade Future Tone") @classmethod diff --git a/titles/diva/handlers/user.py b/titles/diva/handlers/user.py index 9ad9940..c607795 100644 --- a/titles/diva/handlers/user.py +++ b/titles/diva/handlers/user.py @@ -3,7 +3,9 @@ from titles.diva.handlers.base import ( BaseResponse, DivaRequestParseException, ) - +from datetime import datetime +from urllib import parse +from ..const import DivaConstants class PreStartRequest(BaseRequest): pmm: str @@ -66,5 +68,44 @@ class StartRequest(BaseRequest): class StartResponse(BaseResponse): - def __init__(self, cmd_id: str, req_id: int) -> None: + def __init__(self, cmd_id: str, req_id: int, pv_id: int, pv_name: str) -> None: super().__init__(cmd_id, req_id) + pd_id: int = pv_id + start_result: int = 1 + accept_idx: int = 100 + hp_vol: int = 0 + btn_se_vol: int = 1 + btn_se_vol2: int = 1 + sldr_se_vol2: int = 1 + sort_kind: int = 1 + player_name: str = pv_name + lv_num: int = 1 + lv_pnt: int = 0 + lv_efct_id: int = 1 + lv_plt_id: int = 1 + mdl_have: str = "F" * 250 + cstmz_itm_have: str = "F" * 250 + use_pv_mdl_eqp: int = 0 + use_mdl_pri: int = 0 + use_pv_skn_eqp: int = 1 + use_pv_btn_se_eqp: int = 1 + use_pv_sld_se_eqp: int = 1 + use_pv_chn_sld_se_eqp: int = 1 + use_pv_sldr_tch_se_eqp: int = 1 + vcld_pts: int = 0 + nxt_pv_id: int = 1 + nxt_dffclty: int = 1 + nxt_edtn: int = 0 + dsp_clr_brdr: int = 0 + dsp_intrm_rnk: int = 0 + dsp_clr_sts: int = 0 + rgo_sts: int = 0 + my_qst_id: str = ",".join(["-1"] * 25) + my_qst_sts: str = ",".join("0" * 5) + "," + ",".join(["-1"] * 20) + my_qst_prgrs: str = ",".join("0" * 5) + "," + ",".join(["-1"] * 20) + my_qst_et: str = ",".join([parse.quote(datetime.now().strftime(DivaConstants.LUT_TIME_FMT))] * 5) + "," + ",".join(["xxx"] * 20) + clr_sts: str = ",".join("0" * 5) + "," + ",".join(["-1"] * 20) + mdl_eqp_tm: str = parse.quote(datetime.now().strftime(DivaConstants.LUT_TIME_FMT)) + mdl_eqp_ary = ",".join(["-999"] * 3) + c_itm_eqp_ary = ",".join(["-999"] * 12) + ms_itm_flg_ary = ",".join(["-999"] * 12)