2023-04-23 10:38:28 +02:00
|
|
|
import struct
|
|
|
|
from typing import Tuple, List, Dict
|
|
|
|
|
|
|
|
from .base import IDZHandlerBase
|
|
|
|
from core.config import CoreConfig
|
|
|
|
from ..config import IDZConfig
|
|
|
|
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-04-23 10:38:28 +02:00
|
|
|
class IDZHandlerDiscoverProfile(IDZHandlerBase):
|
2023-04-24 03:04:52 +02:00
|
|
|
cmd_codes = [0x006B, 0x0067]
|
|
|
|
rsp_codes = [0x006C, 0x0068, 0x0068, 0x0068]
|
2023-04-23 10:38:28 +02:00
|
|
|
name = "discover_profile"
|
|
|
|
|
|
|
|
def __init__(self, core_cfg: CoreConfig, game_cfg: IDZConfig, version: int) -> None:
|
|
|
|
super().__init__(core_cfg, game_cfg, version)
|
|
|
|
self.size = 0x0010
|
2023-04-24 03:04:52 +02:00
|
|
|
|
2023-04-23 10:38:28 +02:00
|
|
|
def handle(self, data: bytes) -> bytearray:
|
|
|
|
ret = super().handle(data)
|
|
|
|
user_id = struct.unpack_from("<I", data, 0x04)[0]
|
|
|
|
profile = None
|
|
|
|
|
|
|
|
struct.pack_into("<H", ret, 0x04, int(profile is not None))
|
|
|
|
return ret
|