mirror of
https://gitea.tendokyu.moe/Hay1tsme/artemis.git
synced 2026-02-14 19:57:27 +08:00
diva: add stage_result, end handlers
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from typing import Union
|
||||
from titles.diva.handlers.base import (
|
||||
BaseRequest,
|
||||
BaseResponse,
|
||||
@@ -25,10 +26,9 @@ class PreStartRequest(BaseRequest):
|
||||
except AttributeError as e:
|
||||
raise DivaRequestParseException(f"PreStartRequest: {e}")
|
||||
|
||||
|
||||
class PreStartResponse(BaseResponse):
|
||||
def __init__(self, cmd_id: str, req_id: int, pd_id: int) -> None:
|
||||
super().__init__(cmd_id, req_id)
|
||||
def __init__(self, req_id: int, pd_id: int) -> None:
|
||||
super().__init__("pre_start", req_id)
|
||||
self.ps_result = 1
|
||||
self.pd_id = pd_id
|
||||
self.accept_idx = 100
|
||||
@@ -54,7 +54,6 @@ class PreStartResponse(BaseResponse):
|
||||
# But this is how it's stored in the db, so w/e for now
|
||||
self.mdl_eqp_ary = "-999,-999,-999"
|
||||
|
||||
|
||||
class StartRequest(BaseRequest):
|
||||
def __init__(self, raw: str) -> None:
|
||||
super().__init__(raw)
|
||||
@@ -65,10 +64,9 @@ class StartRequest(BaseRequest):
|
||||
except AttributeError as e:
|
||||
raise DivaRequestParseException(f"StartRequest: {e}")
|
||||
|
||||
|
||||
class StartResponse(BaseResponse):
|
||||
def __init__(self, cmd_id: str, req_id: int, pv_id: int, pv_name: str) -> None:
|
||||
super().__init__(cmd_id, req_id)
|
||||
def __init__(self, req_id: int, pv_id: int, pv_name: str) -> None:
|
||||
super().__init__("start", req_id)
|
||||
self.pd_id: int = pv_id
|
||||
self.start_result: int = 1
|
||||
self.accept_idx: int = 100
|
||||
@@ -118,16 +116,15 @@ class StartResponse(BaseResponse):
|
||||
self.ms_itm_flg_ary = ",".join(["1"] * 12)
|
||||
|
||||
class RegisterRequest(BaseRequest):
|
||||
pmm: str
|
||||
idm: str
|
||||
mmgameid: str
|
||||
mmuid: str
|
||||
a_code: str
|
||||
aime_a_code: str
|
||||
player_name: str
|
||||
passwd: str
|
||||
|
||||
def __init__(self, raw: str) -> None:
|
||||
self.pmm: str
|
||||
self.idm: str
|
||||
self.mmgameid: str
|
||||
self.mmuid: str
|
||||
self.a_code: str
|
||||
self.aime_a_code: str
|
||||
self.player_name: str
|
||||
self.passwd: str
|
||||
super().__init__(raw)
|
||||
try:
|
||||
self.aime_id = int(self.aime_id)
|
||||
@@ -137,7 +134,20 @@ class RegisterRequest(BaseRequest):
|
||||
raise DivaRequestParseException(f"RegisterRequest: {e}")
|
||||
|
||||
class RegisterResponse(BaseResponse):
|
||||
def __init__(self, cmd_id: str, req_id: int, pv_id: int) -> None:
|
||||
super().__init__(cmd_id, req_id)
|
||||
def __init__(self, req_id: int, pv_id: int) -> None:
|
||||
super().__init__("register", req_id)
|
||||
self.cd_adm_result: int = 1
|
||||
self.pd_id: int = pv_id
|
||||
|
||||
class EndRequest(BaseRequest):
|
||||
def __init__(self, raw: str | bytes) -> None:
|
||||
self.my_qst_id: str
|
||||
self.my_qst_sts: str
|
||||
|
||||
super().__init__(raw)
|
||||
try:
|
||||
self.pd_id = int(self.pd_id)
|
||||
|
||||
except AttributeError as e:
|
||||
raise DivaRequestParseException(f"EndRequest: {e}")
|
||||
|
||||
Reference in New Issue
Block a user