diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..e34dfec
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,21 @@
+FROM python:3.9.15-slim-bullseye
+
+RUN apt update && apt install default-libmysqlclient-dev build-essential libtk nodejs npm -y
+
+WORKDIR /app
+COPY requirements.txt requirements.txt
+RUN pip3 install -r requirements.txt
+RUN npm i -g nodemon
+
+COPY entrypoint.sh entrypoint.sh
+RUN chmod +x entrypoint.sh
+
+COPY index.py index.py
+COPY dbutils.py dbutils.py
+ADD core core
+ADD titles titles
+ADD config config
+ADD log log
+ADD cert cert
+
+ENTRYPOINT [ "/app/entrypoint.sh" ]
\ No newline at end of file
diff --git a/changelog.md b/changelog.md
index e1b5642..40d2e48 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,56 @@
# Changelog
Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to.
+## 20230716
+### General
++ Docker files added (#19)
++ Added support for threading
+ + This comes with the caviat that enabling it will not allow you to use Ctrl + C to stop the server.
+
+### Webui
++ Small improvements
++ Add card display
+
+### Allnet
++ Billing format validation
++ Fix naomitest.html endpoint
++ Add event logging for auths and billing
++ LoaderStateRecorder endpoint handler added
+
+### Mucha
++ Fixed log level always being "Info"
++ Add stub handler for DownloadState
+
+### Sword Art Online
++ Support added
+
+### Crossbeats
++ Added threading to profile loading
+ + This should cause a noticeable speed-up
+
+### Card Maker
++ DX Passes fixed
++ Various improvements
+
+### Diva
++ Added clear status calculation
++ Various minor fixes and improvements
+
+### Maimai
++ Added support for memorial photo uploads
++ Added support for the following versions
+ + Festival
+ + FiNALE
++ Various bug fixes and improvements
+
+### Wacca
++ Fixed an error that sometimes occoured when trying to unlock songs (#22)
+
+### Pokken
++ Profile saving added (loading TBA)
++ Use external STUN server for matching by default
+ + Matching still not working
+
## 2023042300
### Wacca
+ Time free now works properly
diff --git a/core/aimedb.py b/core/aimedb.py
index 64bac8d..39d6373 100644
--- a/core/aimedb.py
+++ b/core/aimedb.py
@@ -63,7 +63,7 @@ class AimedbProtocol(Protocol):
try:
decrypted = cipher.decrypt(data)
- except:
+ except Exception:
self.logger.error(f"Failed to decrypt {data.hex()}")
return None
diff --git a/core/allnet.py b/core/allnet.py
index 119f0ae..9ad5949 100644
--- a/core/allnet.py
+++ b/core/allnet.py
@@ -1,4 +1,4 @@
-from typing import Dict, List, Any, Optional, Tuple
+from typing import Dict, List, Any, Optional, Tuple, Union
import logging, coloredlogs
from logging.handlers import TimedRotatingFileHandler
from twisted.web.http import Request
@@ -11,6 +11,7 @@ from Crypto.Hash import SHA
from Crypto.Signature import PKCS1_v1_5
from time import strptime
from os import path
+import urllib.parse
from core.config import CoreConfig
from core.utils import Utils
@@ -79,7 +80,7 @@ class AllnetServlet:
req = AllnetPowerOnRequest(req_dict[0])
# Validate the request. Currently we only validate the fields we plan on using
- if not req.game_id or not req.ver or not req.serial or not req.ip:
+ if not req.game_id or not req.ver or not req.serial or not req.ip or not req.firm_ver or not req.boot_ver:
raise AllnetRequestException(
f"Bad auth request params from {request_ip} - {vars(req)}"
)
@@ -89,12 +90,14 @@ class AllnetServlet:
self.logger.error(e)
return b""
- if req.format_ver == "3":
+ if req.format_ver == 3:
resp = AllnetPowerOnResponse3(req.token)
- else:
+ elif req.format_ver == 2:
resp = AllnetPowerOnResponse2()
+ else:
+ resp = AllnetPowerOnResponse()
- self.logger.debug(f"Allnet request: {vars(req)}")
+ self.logger.debug(f"Allnet request: {vars(req)}")
if req.game_id not in self.uri_registry:
if not self.config.server.is_develop:
msg = f"Unrecognised game {req.game_id} attempted allnet auth from {request_ip}."
@@ -103,8 +106,9 @@ class AllnetServlet:
)
self.logger.warn(msg)
- resp.stat = 0
- return self.dict_to_http_form_string([vars(resp)])
+ resp.stat = -1
+ resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
+ return (urllib.parse.unquote(urllib.parse.urlencode(resp_dict)) + "\n").encode("utf-8")
else:
self.logger.info(
@@ -112,11 +116,16 @@ class AllnetServlet:
)
resp.uri = f"http://{self.config.title.hostname}:{self.config.title.port}/{req.game_id}/{req.ver.replace('.', '')}/"
resp.host = f"{self.config.title.hostname}:{self.config.title.port}"
- return self.dict_to_http_form_string([vars(resp)])
+
+ resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
+ resp_str = urllib.parse.unquote(urllib.parse.urlencode(resp_dict))
+
+ self.logger.debug(f"Allnet response: {resp_str}")
+ return (resp_str + "\n").encode("utf-8")
resp.uri, resp.host = self.uri_registry[req.game_id]
- machine = self.data.arcade.get_machine(req.serial)
+ machine = self.data.arcade.get_machine(req.serial)
if machine is None and not self.config.server.allow_unregistered_serials:
msg = f"Unrecognised serial {req.serial} attempted allnet auth from {request_ip}."
self.data.base.log_event(
@@ -124,8 +133,9 @@ class AllnetServlet:
)
self.logger.warn(msg)
- resp.stat = 0
- return self.dict_to_http_form_string([vars(resp)])
+ resp.stat = -2
+ resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
+ return (urllib.parse.unquote(urllib.parse.urlencode(resp_dict)) + "\n").encode("utf-8")
if machine is not None:
arcade = self.data.arcade.get_arcade(machine["arcade"])
@@ -167,9 +177,13 @@ class AllnetServlet:
msg = f"{req.serial} authenticated from {request_ip}: {req.game_id} v{req.ver}"
self.data.base.log_event("allnet", "ALLNET_AUTH_SUCCESS", logging.INFO, msg)
self.logger.info(msg)
- self.logger.debug(f"Allnet response: {vars(resp)}")
- return self.dict_to_http_form_string([vars(resp)]).encode("utf-8")
+ resp_dict = {k: v for k, v in vars(resp).items() if v is not None}
+ resp_str = urllib.parse.unquote(urllib.parse.urlencode(resp_dict))
+ self.logger.debug(f"Allnet response: {resp_dict}")
+ resp_str += "\n"
+
+ return resp_str.encode("utf-8")
def handle_dlorder(self, request: Request, _: Dict):
request_ip = Utils.get_ip_addr(request)
@@ -194,27 +208,29 @@ class AllnetServlet:
self.logger.info(
f"DownloadOrder from {request_ip} -> {req.game_id} v{req.ver} serial {req.serial}"
)
- resp = AllnetDownloadOrderResponse()
+ resp = AllnetDownloadOrderResponse(serial=req.serial)
if (
not self.config.allnet.allow_online_updates
or not self.config.allnet.update_cfg_folder
):
- return self.dict_to_http_form_string([vars(resp)])
+ return urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\n"
else: # TODO: Keychip check
if path.exists(
- f"{self.config.allnet.update_cfg_folder}/{req.game_id}-{req.ver}-app.ini"
+ f"{self.config.allnet.update_cfg_folder}/{req.game_id}-{req.ver.replace('.', '')}-app.ini"
):
resp.uri = f"http://{self.config.title.hostname}:{self.config.title.port}/dl/ini/{req.game_id}-{req.ver.replace('.', '')}-app.ini"
if path.exists(
- f"{self.config.allnet.update_cfg_folder}/{req.game_id}-{req.ver}-opt.ini"
+ f"{self.config.allnet.update_cfg_folder}/{req.game_id}-{req.ver.replace('.', '')}-opt.ini"
):
resp.uri += f"|http://{self.config.title.hostname}:{self.config.title.port}/dl/ini/{req.game_id}-{req.ver.replace('.', '')}-opt.ini"
self.logger.debug(f"Sending download uri {resp.uri}")
- return self.dict_to_http_form_string([vars(resp)])
+ self.data.base.log_event("allnet", "DLORDER_REQ_SUCCESS", logging.INFO, f"{Utils.get_ip_addr(request)} requested DL Order for {req.serial} {req.game_id} v{req.ver}")
+
+ return urllib.parse.unquote(urllib.parse.urlencode(vars(resp))) + "\n"
def handle_dlorder_ini(self, request: Request, match: Dict) -> bytes:
if "file" not in match:
@@ -223,6 +239,8 @@ class AllnetServlet:
req_file = match["file"].replace("%0A", "")
if path.exists(f"{self.config.allnet.update_cfg_folder}/{req_file}"):
+ self.logger.info(f"Request for DL INI file {req_file} from {Utils.get_ip_addr(request)} successful")
+ self.data.base.log_event("allnet", "DLORDER_INI_SENT", logging.INFO, f"{Utils.get_ip_addr(request)} successfully recieved {req_file}")
return open(
f"{self.config.allnet.update_cfg_folder}/{req_file}", "rb"
).read()
@@ -236,6 +254,27 @@ class AllnetServlet:
)
return b""
+ def handle_loaderstaterecorder(self, request: Request, match: Dict) -> bytes:
+ req_data = request.content.getvalue()
+ sections = req_data.decode("utf-8").split("\r\n")
+
+ req_dict = dict(urllib.parse.parse_qsl(sections[0]))
+
+ serial: Union[str, None] = req_dict.get("serial", None)
+ num_files_to_dl: Union[str, None] = req_dict.get("nb_ftd", None)
+ num_files_dld: Union[str, None] = req_dict.get("nb_dld", None)
+ dl_state: Union[str, None] = req_dict.get("dld_st", None)
+ ip = Utils.get_ip_addr(request)
+
+ if serial is None or num_files_dld is None or num_files_to_dl is None or dl_state is None:
+ return "NG".encode()
+
+ self.logger.info(f"LoaderStateRecorder Request from {ip} {serial}: {num_files_dld}/{num_files_to_dl} Files download (State: {dl_state})")
+ return "OK".encode()
+
+ def handle_alive(self, request: Request, match: Dict) -> bytes:
+ return "OK".encode()
+
def handle_billing_request(self, request: Request, _: Dict):
req_dict = self.billing_req_to_dict(request.content.getvalue())
request_ip = Utils.get_ip_addr(request)
@@ -249,14 +288,18 @@ class AllnetServlet:
signer = PKCS1_v1_5.new(rsa)
digest = SHA.new()
- kc_playlimit = int(req_dict[0]["playlimit"])
- kc_nearfull = int(req_dict[0]["nearfull"])
- kc_billigtype = int(req_dict[0]["billingtype"])
- kc_playcount = int(req_dict[0]["playcnt"])
- kc_serial: str = req_dict[0]["keychipid"]
- kc_game: str = req_dict[0]["gameid"]
- kc_date = strptime(req_dict[0]["date"], "%Y%m%d%H%M%S")
- kc_serial_bytes = kc_serial.encode()
+ try:
+ kc_playlimit = int(req_dict[0]["playlimit"])
+ kc_nearfull = int(req_dict[0]["nearfull"])
+ kc_billigtype = int(req_dict[0]["billingtype"])
+ kc_playcount = int(req_dict[0]["playcnt"])
+ kc_serial: str = req_dict[0]["keychipid"]
+ kc_game: str = req_dict[0]["gameid"]
+ kc_date = strptime(req_dict[0]["date"], "%Y%m%d%H%M%S")
+ kc_serial_bytes = kc_serial.encode()
+
+ except KeyError as e:
+ return f"result=5&linelimit=&message={e} field is missing".encode()
machine = self.data.arcade.get_machine(kc_serial)
if machine is None and not self.config.server.allow_unregistered_serials:
@@ -295,7 +338,7 @@ class AllnetServlet:
resp = BillingResponse(playlimit, playlimit_sig, nearfull, nearfull_sig)
- resp_str = self.dict_to_http_form_string([vars(resp)], True)
+ resp_str = self.dict_to_http_form_string([vars(resp)])
if resp_str is None:
self.logger.error(f"Failed to parse response {vars(resp)}")
@@ -306,21 +349,6 @@ class AllnetServlet:
self.logger.info(f"Ping from {Utils.get_ip_addr(request)}")
return b"naomi ok"
- def kvp_to_dict(self, kvp: List[str]) -> List[Dict[str, Any]]:
- ret: List[Dict[str, Any]] = []
- for x in kvp:
- items = x.split("&")
- tmp = {}
-
- for item in items:
- kvp = item.split("=")
- if len(kvp) == 2:
- tmp[kvp[0]] = kvp[1]
-
- ret.append(tmp)
-
- return ret
-
def billing_req_to_dict(self, data: bytes):
"""
Parses an billing request string into a python dictionary
@@ -330,7 +358,10 @@ class AllnetServlet:
unzipped = decomp.decompress(data)
sections = unzipped.decode("ascii").split("\r\n")
- return self.kvp_to_dict(sections)
+ ret = []
+ for x in sections:
+ ret.append(dict(urllib.parse.parse_qsl(x)))
+ return ret
except Exception as e:
self.logger.error(f"billing_req_to_dict: {e} while parsing {data}")
@@ -345,7 +376,10 @@ class AllnetServlet:
unzipped = zlib.decompress(zipped)
sections = unzipped.decode("utf-8").split("\r\n")
- return self.kvp_to_dict(sections)
+ ret = []
+ for x in sections:
+ ret.append(dict(urllib.parse.parse_qsl(x)))
+ return ret
except Exception as e:
self.logger.error(f"allnet_req_to_dict: {e} while parsing {data}")
@@ -354,7 +388,7 @@ class AllnetServlet:
def dict_to_http_form_string(
self,
data: List[Dict[str, Any]],
- crlf: bool = False,
+ crlf: bool = True,
trailing_newline: bool = True,
) -> Optional[str]:
"""
@@ -364,21 +398,19 @@ class AllnetServlet:
urlencode = ""
for item in data:
for k, v in item.items():
+ if k is None or v is None:
+ continue
urlencode += f"{k}={v}&"
-
if crlf:
urlencode = urlencode[:-1] + "\r\n"
else:
urlencode = urlencode[:-1] + "\n"
-
if not trailing_newline:
if crlf:
urlencode = urlencode[:-2]
else:
urlencode = urlencode[:-1]
-
return urlencode
-
except Exception as e:
self.logger.error(f"dict_to_http_form_string: {e} while parsing {data}")
return None
@@ -388,64 +420,68 @@ class AllnetPowerOnRequest:
def __init__(self, req: Dict) -> None:
if req is None:
raise AllnetRequestException("Request processing failed")
- self.game_id: str = req.get("game_id", "")
- self.ver: str = req.get("ver", "")
- self.serial: str = req.get("serial", "")
- self.ip: str = req.get("ip", "")
- self.firm_ver: str = req.get("firm_ver", "")
- self.boot_ver: str = req.get("boot_ver", "")
- self.encode: str = req.get("encode", "")
- self.hops = int(req.get("hops", "0"))
- self.format_ver = req.get("format_ver", "2")
- self.token = int(req.get("token", "0"))
+ self.game_id: str = req.get("game_id", None)
+ self.ver: str = req.get("ver", None)
+ self.serial: str = req.get("serial", None)
+ self.ip: str = req.get("ip", None)
+ self.firm_ver: str = req.get("firm_ver", None)
+ self.boot_ver: str = req.get("boot_ver", None)
+ self.encode: str = req.get("encode", "EUC-JP")
+ self.hops = int(req.get("hops", "-1"))
+ self.format_ver = float(req.get("format_ver", "1.00"))
+ self.token: str = req.get("token", "0")
-
-class AllnetPowerOnResponse3:
- def __init__(self, token) -> None:
- self.stat = 1
- self.uri = ""
- self.host = ""
- self.place_id = "123"
- self.name = ""
- self.nickname = ""
- self.region0 = "1"
- self.region_name0 = "W"
- self.region_name1 = ""
- self.region_name2 = ""
- self.region_name3 = ""
- self.country = "JPN"
- self.allnet_id = "123"
- self.client_timezone = "+0900"
- self.utc_time = datetime.now(tz=pytz.timezone("UTC")).strftime(
- "%Y-%m-%dT%H:%M:%SZ"
- )
- self.setting = "1"
- self.res_ver = "3"
- self.token = str(token)
-
-
-class AllnetPowerOnResponse2:
+class AllnetPowerOnResponse:
def __init__(self) -> None:
self.stat = 1
self.uri = ""
self.host = ""
self.place_id = "123"
- self.name = "Test"
- self.nickname = "Test123"
+ self.name = "ARTEMiS"
+ self.nickname = "ARTEMiS"
self.region0 = "1"
self.region_name0 = "W"
- self.region_name1 = "X"
- self.region_name2 = "Y"
- self.region_name3 = "Z"
- self.country = "JPN"
+ self.region_name1 = ""
+ self.region_name2 = ""
+ self.region_name3 = ""
+ self.setting = "1"
self.year = datetime.now().year
self.month = datetime.now().month
self.day = datetime.now().day
self.hour = datetime.now().hour
self.minute = datetime.now().minute
self.second = datetime.now().second
- self.setting = "1"
- self.timezone = "+0900"
+
+class AllnetPowerOnResponse3(AllnetPowerOnResponse):
+ def __init__(self, token) -> None:
+ super().__init__()
+
+ # Added in v3
+ self.country = "JPN"
+ self.allnet_id = "123"
+ self.client_timezone = "+0900"
+ self.utc_time = datetime.now(tz=pytz.timezone("UTC")).strftime(
+ "%Y-%m-%dT%H:%M:%SZ"
+ )
+ self.res_ver = "3"
+ self.token = token
+
+ # Removed in v3
+ self.year = None
+ self.month = None
+ self.day = None
+ self.hour = None
+ self.minute = None
+ self.second = None
+
+
+class AllnetPowerOnResponse2(AllnetPowerOnResponse):
+ def __init__(self) -> None:
+ super().__init__()
+
+ # Added in v2
+ self.country = "JPN"
+ self.timezone = "+09:00"
self.res_class = "PowerOnResponseV2"
diff --git a/core/config.py b/core/config.py
index 3fb0dbe..8b85353 100644
--- a/core/config.py
+++ b/core/config.py
@@ -36,6 +36,12 @@ class ServerConfig:
self.__config, "core", "server", "is_develop", default=True
)
+ @property
+ def threading(self) -> bool:
+ return CoreConfig.get_config_field(
+ self.__config, "core", "server", "threading", default=False
+ )
+
@property
def log_dir(self) -> str:
return CoreConfig.get_config_field(
diff --git a/core/data/database.py b/core/data/database.py
index 719d05e..9fb2606 100644
--- a/core/data/database.py
+++ b/core/data/database.py
@@ -15,31 +15,48 @@ from core.utils import Utils
class Data:
+ current_schema_version = 4
+ engine = None
+ session = None
+ user = None
+ arcade = None
+ card = None
+ base = None
def __init__(self, cfg: CoreConfig) -> None:
self.config = cfg
if self.config.database.sha2_password:
passwd = sha256(self.config.database.password.encode()).digest()
- self.__url = f"{self.config.database.protocol}://{self.config.database.username}:{passwd.hex()}@{self.config.database.host}/{self.config.database.name}?charset=utf8mb4"
+ self.__url = f"{self.config.database.protocol}://{self.config.database.username}:{passwd.hex()}@{self.config.database.host}:{self.config.database.port}/{self.config.database.name}?charset=utf8mb4"
else:
- self.__url = f"{self.config.database.protocol}://{self.config.database.username}:{self.config.database.password}@{self.config.database.host}/{self.config.database.name}?charset=utf8mb4"
+ self.__url = f"{self.config.database.protocol}://{self.config.database.username}:{self.config.database.password}@{self.config.database.host}:{self.config.database.port}/{self.config.database.name}?charset=utf8mb4"
- self.__engine = create_engine(self.__url, pool_recycle=3600)
- session = sessionmaker(bind=self.__engine, autoflush=True, autocommit=True)
- self.session = scoped_session(session)
+ if Data.engine is None:
+ Data.engine = create_engine(self.__url, pool_recycle=3600)
+ self.__engine = Data.engine
- self.user = UserData(self.config, self.session)
- self.arcade = ArcadeData(self.config, self.session)
- self.card = CardData(self.config, self.session)
- self.base = BaseData(self.config, self.session)
- self.current_schema_version = 4
+ if Data.session is None:
+ s = sessionmaker(bind=Data.engine, autoflush=True, autocommit=True)
+ Data.session = scoped_session(s)
+
+ if Data.user is None:
+ Data.user = UserData(self.config, self.session)
+
+ if Data.arcade is None:
+ Data.arcade = ArcadeData(self.config, self.session)
+
+ if Data.card is None:
+ Data.card = CardData(self.config, self.session)
+
+ if Data.base is None:
+ Data.base = BaseData(self.config, self.session)
- log_fmt_str = "[%(asctime)s] %(levelname)s | Database | %(message)s"
- log_fmt = logging.Formatter(log_fmt_str)
self.logger = logging.getLogger("database")
# Prevent the logger from adding handlers multiple times
- if not getattr(self.logger, "handler_set", None):
+ if not getattr(self.logger, "handler_set", None):
+ log_fmt_str = "[%(asctime)s] %(levelname)s | Database | %(message)s"
+ log_fmt = logging.Formatter(log_fmt_str)
fileHandler = TimedRotatingFileHandler(
"{0}/{1}.log".format(self.config.server.log_dir, "db"),
encoding="utf-8",
@@ -77,7 +94,7 @@ class Data:
game_mod.database(self.config)
metadata.create_all(self.__engine.connect())
- self.base.set_schema_ver(
+ self.base.touch_schema_ver(
game_mod.current_schema_version, game_mod.game_codes[0]
)
@@ -333,3 +350,8 @@ class Data:
if not failed:
self.base.set_schema_ver(latest_ver, game)
+
+ def show_versions(self) -> None:
+ all_game_versions = self.base.get_all_schema_vers()
+ for ver in all_game_versions:
+ self.logger.info(f"{ver['game']} -> v{ver['version']}")
diff --git a/core/data/schema/base.py b/core/data/schema/base.py
index 7957301..a53392f 100644
--- a/core/data/schema/base.py
+++ b/core/data/schema/base.py
@@ -58,7 +58,7 @@ class BaseData:
self.logger.error(f"UnicodeEncodeError error {e}")
return None
- except:
+ except Exception:
try:
res = self.conn.execute(sql, opts)
@@ -70,7 +70,7 @@ class BaseData:
self.logger.error(f"UnicodeEncodeError error {e}")
return None
- except:
+ except Exception:
self.logger.error(f"Unknown error")
raise
@@ -102,6 +102,18 @@ class BaseData:
return None
return row["version"]
+
+ def touch_schema_ver(self, ver: int, game: str = "CORE") -> Optional[int]:
+ sql = insert(schema_ver).values(game=game, version=ver)
+ conflict = sql.on_duplicate_key_update(version=schema_ver.c.version)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"Failed to update schema version for game {game} (v{ver})"
+ )
+ return None
+ return result.lastrowid
def set_schema_ver(self, ver: int, game: str = "CORE") -> Optional[int]:
sql = insert(schema_ver).values(game=game, version=ver)
diff --git a/core/data/schema/user.py b/core/data/schema/user.py
index 98663d1..6a95005 100644
--- a/core/data/schema/user.py
+++ b/core/data/schema/user.py
@@ -79,6 +79,9 @@ class UserData(BaseData):
if usr["password"] is None:
return False
+
+ if passwd is None or not passwd:
+ return False
return bcrypt.checkpw(passwd, usr["password"].encode())
diff --git a/core/data/schema/versions/SBZV_4_rollback.sql b/core/data/schema/versions/SBZV_4_rollback.sql
new file mode 100644
index 0000000..f56327e
--- /dev/null
+++ b/core/data/schema/versions/SBZV_4_rollback.sql
@@ -0,0 +1,9 @@
+ALTER TABLE diva_profile
+ DROP cnp_cid,
+ DROP cnp_val,
+ DROP cnp_rr,
+ DROP cnp_sp,
+ DROP btn_se_eqp,
+ DROP sld_se_eqp,
+ DROP chn_sld_se_eqp,
+ DROP sldr_tch_se_eqp;
\ No newline at end of file
diff --git a/core/data/schema/versions/SBZV_5_upgrade.sql b/core/data/schema/versions/SBZV_5_upgrade.sql
new file mode 100644
index 0000000..7e29f7b
--- /dev/null
+++ b/core/data/schema/versions/SBZV_5_upgrade.sql
@@ -0,0 +1,9 @@
+ALTER TABLE diva_profile
+ ADD cnp_cid INT NOT NULL DEFAULT -1,
+ ADD cnp_val INT NOT NULL DEFAULT -1,
+ ADD cnp_rr INT NOT NULL DEFAULT -1,
+ ADD cnp_sp VARCHAR(255) NOT NULL DEFAULT "",
+ ADD btn_se_eqp INT NOT NULL DEFAULT -1,
+ ADD sld_se_eqp INT NOT NULL DEFAULT -1,
+ ADD chn_sld_se_eqp INT NOT NULL DEFAULT -1,
+ ADD sldr_tch_se_eqp INT NOT NULL DEFAULT -1;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDBT_3_rollback.sql b/core/data/schema/versions/SDBT_3_rollback.sql
new file mode 100644
index 0000000..ff78c54
--- /dev/null
+++ b/core/data/schema/versions/SDBT_3_rollback.sql
@@ -0,0 +1,30 @@
+SET FOREIGN_KEY_CHECKS = 0;
+
+ALTER TABLE chuni_score_playlog
+ DROP COLUMN regionId,
+ DROP COLUMN machineType;
+
+ALTER TABLE chuni_static_events
+ DROP COLUMN startDate;
+
+ALTER TABLE chuni_profile_data
+ DROP COLUMN rankUpChallengeResults;
+
+ALTER TABLE chuni_static_login_bonus
+ DROP FOREIGN KEY chuni_static_login_bonus_ibfk_1;
+
+ALTER TABLE chuni_static_login_bonus_preset
+ DROP PRIMARY KEY;
+
+ALTER TABLE chuni_static_login_bonus_preset
+ CHANGE COLUMN presetId id INT NOT NULL;
+ALTER TABLE chuni_static_login_bonus_preset
+ ADD PRIMARY KEY(id);
+ALTER TABLE chuni_static_login_bonus_preset
+ ADD CONSTRAINT chuni_static_login_bonus_preset_uk UNIQUE(id, version);
+
+ALTER TABLE chuni_static_login_bonus
+ ADD CONSTRAINT chuni_static_login_bonus_ibfk_1 FOREIGN KEY(presetId)
+ REFERENCES chuni_static_login_bonus_preset(id) ON UPDATE CASCADE ON DELETE CASCADE;
+
+SET FOREIGN_KEY_CHECKS = 1;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDBT_4_upgrade.sql b/core/data/schema/versions/SDBT_4_upgrade.sql
new file mode 100644
index 0000000..984447e
--- /dev/null
+++ b/core/data/schema/versions/SDBT_4_upgrade.sql
@@ -0,0 +1,29 @@
+SET FOREIGN_KEY_CHECKS = 0;
+
+ALTER TABLE chuni_score_playlog
+ ADD COLUMN regionId INT,
+ ADD COLUMN machineType INT;
+
+ALTER TABLE chuni_static_events
+ ADD COLUMN startDate TIMESTAMP NOT NULL DEFAULT current_timestamp();
+
+ALTER TABLE chuni_profile_data
+ ADD COLUMN rankUpChallengeResults JSON;
+
+ALTER TABLE chuni_static_login_bonus
+ DROP FOREIGN KEY chuni_static_login_bonus_ibfk_1;
+
+ALTER TABLE chuni_static_login_bonus_preset
+ CHANGE COLUMN id presetId INT NOT NULL;
+ALTER TABLE chuni_static_login_bonus_preset
+ DROP PRIMARY KEY;
+ALTER TABLE chuni_static_login_bonus_preset
+ DROP INDEX chuni_static_login_bonus_preset_uk;
+ALTER TABLE chuni_static_login_bonus_preset
+ ADD CONSTRAINT chuni_static_login_bonus_preset_pk PRIMARY KEY (presetId, version);
+
+ALTER TABLE chuni_static_login_bonus
+ ADD CONSTRAINT chuni_static_login_bonus_ibfk_1 FOREIGN KEY (presetId, version)
+ REFERENCES chuni_static_login_bonus_preset(presetId, version) ON UPDATE CASCADE ON DELETE CASCADE;
+
+SET FOREIGN_KEY_CHECKS = 1;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDDT_4_rollback.sql b/core/data/schema/versions/SDDT_4_rollback.sql
new file mode 100644
index 0000000..fdd369b
--- /dev/null
+++ b/core/data/schema/versions/SDDT_4_rollback.sql
@@ -0,0 +1,2 @@
+ALTER TABLE ongeki_static_events
+DROP COLUMN startDate;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDDT_5_upgrade.sql b/core/data/schema/versions/SDDT_5_upgrade.sql
new file mode 100644
index 0000000..6d4b421
--- /dev/null
+++ b/core/data/schema/versions/SDDT_5_upgrade.sql
@@ -0,0 +1,2 @@
+ALTER TABLE ongeki_static_events
+ADD COLUMN startDate TIMESTAMP NOT NULL DEFAULT current_timestamp();
\ No newline at end of file
diff --git a/core/data/schema/versions/SDEZ_4_rollback.sql b/core/data/schema/versions/SDEZ_4_rollback.sql
new file mode 100644
index 0000000..b8be7b3
--- /dev/null
+++ b/core/data/schema/versions/SDEZ_4_rollback.sql
@@ -0,0 +1,3 @@
+ALTER TABLE mai2_item_card
+ CHANGE COLUMN startDate startDate TIMESTAMP DEFAULT "2018-01-01 00:00:00.0",
+ CHANGE COLUMN endDate endDate TIMESTAMP DEFAULT "2038-01-01 00:00:00.0";
\ No newline at end of file
diff --git a/core/data/schema/versions/SDEZ_5_rollback.sql b/core/data/schema/versions/SDEZ_5_rollback.sql
new file mode 100644
index 0000000..2b66afe
--- /dev/null
+++ b/core/data/schema/versions/SDEZ_5_rollback.sql
@@ -0,0 +1,78 @@
+DELETE FROM mai2_static_event WHERE version < 13;
+UPDATE mai2_static_event SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_static_music WHERE version < 13;
+UPDATE mai2_static_music SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_static_ticket WHERE version < 13;
+UPDATE mai2_static_ticket SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_static_cards WHERE version < 13;
+UPDATE mai2_static_cards SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_profile_detail WHERE version < 13;
+UPDATE mai2_profile_detail SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_profile_extend WHERE version < 13;
+UPDATE mai2_profile_extend SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_profile_option WHERE version < 13;
+UPDATE mai2_profile_option SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_profile_ghost WHERE version < 13;
+UPDATE mai2_profile_ghost SET version = version - 13 WHERE version >= 13;
+
+DELETE FROM mai2_profile_rating WHERE version < 13;
+UPDATE mai2_profile_rating SET version = version - 13 WHERE version >= 13;
+
+DROP TABLE maimai_score_best;
+DROP TABLE maimai_playlog;
+DROP TABLE maimai_profile_detail;
+DROP TABLE maimai_profile_option;
+DROP TABLE maimai_profile_web_option;
+DROP TABLE maimai_profile_grade_status;
+
+ALTER TABLE mai2_item_character DROP COLUMN point;
+
+ALTER TABLE mai2_item_card MODIFY COLUMN cardId int(11) NOT NULL;
+ALTER TABLE mai2_item_card MODIFY COLUMN cardTypeId int(11) NOT NULL;
+ALTER TABLE mai2_item_card MODIFY COLUMN charaId int(11) NOT NULL;
+ALTER TABLE mai2_item_card MODIFY COLUMN mapId int(11) NOT NULL;
+
+ALTER TABLE mai2_item_character MODIFY COLUMN characterId int(11) NOT NULL;
+ALTER TABLE mai2_item_character MODIFY COLUMN level int(11) NOT NULL;
+ALTER TABLE mai2_item_character MODIFY COLUMN awakening int(11) NOT NULL;
+ALTER TABLE mai2_item_character MODIFY COLUMN useCount int(11) NOT NULL;
+
+ALTER TABLE mai2_item_charge MODIFY COLUMN chargeId int(11) NOT NULL;
+ALTER TABLE mai2_item_charge MODIFY COLUMN stock int(11) NOT NULL;
+
+ALTER TABLE mai2_item_favorite MODIFY COLUMN itemKind int(11) NOT NULL;
+
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN seasonId int(11) NOT NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN point int(11) NOT NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN `rank` int(11) NOT NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN rewardGet tinyint(1) NOT NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN userName varchar(8) NOT NULL;
+
+ALTER TABLE mai2_item_item MODIFY COLUMN itemId int(11) NOT NULL;
+ALTER TABLE mai2_item_item MODIFY COLUMN itemKind int(11) NOT NULL;
+ALTER TABLE mai2_item_item MODIFY COLUMN stock int(11) NOT NULL;
+ALTER TABLE mai2_item_item MODIFY COLUMN isValid tinyint(1) NOT NULL;
+
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN bonusId int(11) NOT NULL;
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN point int(11) NOT NULL;
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN isCurrent tinyint(1) NOT NULL;
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN isComplete tinyint(1) NOT NULL;
+
+ALTER TABLE mai2_item_map MODIFY COLUMN mapId int(11) NOT NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN distance int(11) NOT NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN isLock tinyint(1) NOT NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN isClear tinyint(1) NOT NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN isComplete tinyint(1) NOT NULL;
+
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN printDate timestamp DEFAULT current_timestamp() NOT NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN serialId varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN placeId int(11) NOT NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN clientId varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN printerSerialId varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDEZ_5_upgrade.sql b/core/data/schema/versions/SDEZ_5_upgrade.sql
new file mode 100644
index 0000000..cc4912f
--- /dev/null
+++ b/core/data/schema/versions/SDEZ_5_upgrade.sql
@@ -0,0 +1,3 @@
+ALTER TABLE mai2_item_card
+ CHANGE COLUMN startDate startDate TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+ CHANGE COLUMN endDate endDate TIMESTAMP NOT NULL;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDEZ_6_rollback.sql b/core/data/schema/versions/SDEZ_6_rollback.sql
new file mode 100644
index 0000000..0ca7036
--- /dev/null
+++ b/core/data/schema/versions/SDEZ_6_rollback.sql
@@ -0,0 +1 @@
+DROP TABLE aime.mai2_profile_consec_logins;
diff --git a/core/data/schema/versions/SDEZ_6_upgrade.sql b/core/data/schema/versions/SDEZ_6_upgrade.sql
new file mode 100644
index 0000000..472747d
--- /dev/null
+++ b/core/data/schema/versions/SDEZ_6_upgrade.sql
@@ -0,0 +1,62 @@
+UPDATE mai2_static_event SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_static_music SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_static_ticket SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_static_cards SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_profile_detail SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_profile_extend SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_profile_option SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_profile_ghost SET version = version + 13 WHERE version < 1000;
+
+UPDATE mai2_profile_rating SET version = version + 13 WHERE version < 1000;
+
+ALTER TABLE mai2_item_character ADD point int(11) NULL;
+
+ALTER TABLE mai2_item_card MODIFY COLUMN cardId int(11) NULL;
+ALTER TABLE mai2_item_card MODIFY COLUMN cardTypeId int(11) NULL;
+ALTER TABLE mai2_item_card MODIFY COLUMN charaId int(11) NULL;
+ALTER TABLE mai2_item_card MODIFY COLUMN mapId int(11) NULL;
+
+ALTER TABLE mai2_item_character MODIFY COLUMN characterId int(11) NULL;
+ALTER TABLE mai2_item_character MODIFY COLUMN level int(11) NULL;
+ALTER TABLE mai2_item_character MODIFY COLUMN awakening int(11) NULL;
+ALTER TABLE mai2_item_character MODIFY COLUMN useCount int(11) NULL;
+
+ALTER TABLE mai2_item_charge MODIFY COLUMN chargeId int(11) NULL;
+ALTER TABLE mai2_item_charge MODIFY COLUMN stock int(11) NULL;
+
+ALTER TABLE mai2_item_favorite MODIFY COLUMN itemKind int(11) NULL;
+
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN seasonId int(11) NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN point int(11) NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN `rank` int(11) NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN rewardGet tinyint(1) NULL;
+ALTER TABLE mai2_item_friend_season_ranking MODIFY COLUMN userName varchar(8) NULL;
+
+ALTER TABLE mai2_item_item MODIFY COLUMN itemId int(11) NULL;
+ALTER TABLE mai2_item_item MODIFY COLUMN itemKind int(11) NULL;
+ALTER TABLE mai2_item_item MODIFY COLUMN stock int(11) NULL;
+ALTER TABLE mai2_item_item MODIFY COLUMN isValid tinyint(1) NULL;
+
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN bonusId int(11) NULL;
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN point int(11) NULL;
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN isCurrent tinyint(1) NULL;
+ALTER TABLE mai2_item_login_bonus MODIFY COLUMN isComplete tinyint(1) NULL;
+
+ALTER TABLE mai2_item_map MODIFY COLUMN mapId int(11) NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN distance int(11) NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN isLock tinyint(1) NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN isClear tinyint(1) NULL;
+ALTER TABLE mai2_item_map MODIFY COLUMN isComplete tinyint(1) NULL;
+
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN printDate timestamp DEFAULT current_timestamp() NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN serialId varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN placeId int(11) NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN clientId varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
+ALTER TABLE mai2_item_print_detail MODIFY COLUMN printerSerialId varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL;
\ No newline at end of file
diff --git a/core/data/schema/versions/SDEZ_7_upgrade.sql b/core/data/schema/versions/SDEZ_7_upgrade.sql
new file mode 100644
index 0000000..20f3c70
--- /dev/null
+++ b/core/data/schema/versions/SDEZ_7_upgrade.sql
@@ -0,0 +1,9 @@
+CREATE TABLE `mai2_profile_consec_logins` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `user` int(11) NOT NULL,
+ `version` int(11) NOT NULL,
+ `logins` int(11) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `mai2_profile_consec_logins_uk` (`user`,`version`),
+ CONSTRAINT `mai2_profile_consec_logins_ibfk_1` FOREIGN KEY (`user`) REFERENCES `aime_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
\ No newline at end of file
diff --git a/core/frontend.py b/core/frontend.py
index c992e76..f01be50 100644
--- a/core/frontend.py
+++ b/core/frontend.py
@@ -130,7 +130,7 @@ class FE_Gate(FE_Base):
if b"e" in request.args:
try:
err = int(request.args[b"e"][0].decode())
- except:
+ except Exception:
err = 0
else:
@@ -182,7 +182,7 @@ class FE_Gate(FE_Base):
access_code: str = request.args[b"access_code"][0].decode()
username: str = request.args[b"username"][0]
email: str = request.args[b"email"][0].decode()
- passwd: str = request.args[b"passwd"][0]
+ passwd: bytes = request.args[b"passwd"][0]
uid = self.data.card.get_user_id_from_card(access_code)
if uid is None:
@@ -197,7 +197,7 @@ class FE_Gate(FE_Base):
if result is None:
return redirectTo(b"/gate?e=3", request)
- if not self.data.user.check_password(uid, passwd.encode()):
+ if not self.data.user.check_password(uid, passwd):
return redirectTo(b"/gate", request)
return redirectTo(b"/user", request)
@@ -227,9 +227,22 @@ class FE_User(FE_Base):
usr_sesh = IUserSession(sesh)
if usr_sesh.userId == 0:
return redirectTo(b"/gate", request)
+
+ cards = self.data.card.get_user_cards(usr_sesh.userId)
+ user = self.data.user.get_user(usr_sesh.userId)
+ card_data = []
+ for c in cards:
+ if c['is_locked']:
+ status = 'Locked'
+ elif c['is_banned']:
+ status = 'Banned'
+ else:
+ status = 'Active'
+
+ card_data.append({'access_code': c['access_code'], 'status': status})
return template.render(
- title=f"{self.core_config.server.name} | Account", sesh=vars(usr_sesh)
+ title=f"{self.core_config.server.name} | Account", sesh=vars(usr_sesh), cards=card_data, username=user['username']
).encode("utf-16")
diff --git a/core/frontend/user/index.jinja b/core/frontend/user/index.jinja
index eabdd18..2911e67 100644
--- a/core/frontend/user/index.jinja
+++ b/core/frontend/user/index.jinja
@@ -1,4 +1,31 @@
{% extends "core/frontend/index.jinja" %}
{% block content %}
-
testing
+Management for {{ username }}
+Cards Add
+
+{% for c in cards %}
+{{ c.access_code }}: {{ c.status }} Delete
+{% endfor %}
+
+
+
+
+
+
+ HOW TO:
+ Scan your card on any networked game and press the "View Access Code" button (varies by game) and enter the 20 digit code below.
+ !!FOR AMUSEIC CARDS: DO NOT ENTER THE CODE SHOWN ON THE BACK OF THE CARD ITSELF OR IT WILL NOT WORK!!
+
Access Code:
+
+
+
+
+
+
{% endblock content %}
\ No newline at end of file
diff --git a/core/frontend/widgets/topbar.jinja b/core/frontend/widgets/topbar.jinja
index d196361..fb63ebe 100644
--- a/core/frontend/widgets/topbar.jinja
+++ b/core/frontend/widgets/topbar.jinja
@@ -4,7 +4,7 @@
diff --git a/core/mucha.py b/core/mucha.py
index a90ab53..8d9dd8e 100644
--- a/core/mucha.py
+++ b/core/mucha.py
@@ -4,6 +4,7 @@ from logging.handlers import TimedRotatingFileHandler
from twisted.web import resource
from twisted.web.http import Request
from datetime import datetime
+from Crypto.Cipher import Blowfish
import pytz
from core import CoreConfig
@@ -33,8 +34,8 @@ class MuchaServlet:
self.logger.addHandler(fileHandler)
self.logger.addHandler(consoleHandler)
- self.logger.setLevel(logging.INFO)
- coloredlogs.install(level=logging.INFO, logger=self.logger, fmt=log_fmt_str)
+ self.logger.setLevel(cfg.mucha.loglevel)
+ coloredlogs.install(level=cfg.mucha.loglevel, logger=self.logger, fmt=log_fmt_str)
all_titles = Utils.get_all_titles()
@@ -56,17 +57,24 @@ class MuchaServlet:
self.logger.error(
f"Error processing mucha request {request.content.getvalue()}"
)
- return b""
+ return b"RESULTS=000"
req = MuchaAuthRequest(req_dict)
+ self.logger.info(f"Boardauth request from {client_ip} for {req.gameVer}")
self.logger.debug(f"Mucha request {vars(req)}")
- self.logger.info(f"Boardauth request from {client_ip} for {req.gameVer}")
if req.gameCd not in self.mucha_registry:
self.logger.warn(f"Unknown gameCd {req.gameCd}")
- return b""
+ return b"RESULTS=000"
# TODO: Decrypt S/N
+ b_key = b""
+ for x in range(8):
+ b_key += req.sendDate[(x - 1) & 7].encode()
+
+ cipher = Blowfish.new(b_key, Blowfish.MODE_ECB)
+ sn_decrypt = cipher.decrypt(bytes.fromhex(req.serialNum))
+ self.logger.debug(f"Decrypt SN to {sn_decrypt.hex()}")
resp = MuchaAuthResponse(
f"{self.config.mucha.hostname}{':' + str(self.config.allnet.port) if self.config.server.is_develop else ''}"
@@ -84,22 +92,37 @@ class MuchaServlet:
self.logger.error(
f"Error processing mucha request {request.content.getvalue()}"
)
- return b""
+ return b"RESULTS=000"
req = MuchaUpdateRequest(req_dict)
+ self.logger.info(f"Updatecheck request from {client_ip} for {req.gameVer}")
self.logger.debug(f"Mucha request {vars(req)}")
- self.logger.info(f"Updatecheck request from {client_ip} for {req.gameVer}")
if req.gameCd not in self.mucha_registry:
self.logger.warn(f"Unknown gameCd {req.gameCd}")
- return b""
+ return b"RESULTS=000"
- resp = MuchaUpdateResponseStub(req.gameVer)
+ resp = MuchaUpdateResponse(req.gameVer, f"{self.config.mucha.hostname}{':' + str(self.config.allnet.port) if self.config.server.is_develop else ''}")
self.logger.debug(f"Mucha response {vars(resp)}")
return self.mucha_postprocess(vars(resp))
+ def handle_dlstate(self, request: Request, _: Dict) -> bytes:
+ req_dict = self.mucha_preprocess(request.content.getvalue())
+ client_ip = Utils.get_ip_addr(request)
+
+ if req_dict is None:
+ self.logger.error(
+ f"Error processing mucha request {request.content.getvalue()}"
+ )
+ return b""
+
+ req = MuchaDownloadStateRequest(req_dict)
+ self.logger.info(f"DownloadState request from {client_ip} for {req.gameCd} -> {req.updateVer}")
+ self.logger.debug(f"request {vars(req)}")
+ return b"RESULTS=001"
+
def mucha_preprocess(self, data: bytes) -> Optional[Dict]:
try:
ret: Dict[str, Any] = {}
@@ -111,7 +134,7 @@ class MuchaServlet:
return ret
- except:
+ except Exception:
self.logger.error(f"Error processing mucha request {data}")
return None
@@ -123,7 +146,7 @@ class MuchaServlet:
return urlencode.encode()
- except:
+ except Exception:
self.logger.error("Error processing mucha response")
return None
@@ -202,22 +225,57 @@ class MuchaUpdateRequest:
class MuchaUpdateResponse:
def __init__(self, game_ver: str, mucha_url: str) -> None:
- self.RESULTS = "001"
+ self.RESULTS = "001"
+ self.EXE_VER = game_ver
+
self.UPDATE_VER_1 = game_ver
- self.UPDATE_URL_1 = f"https://{mucha_url}/updUrl1/"
- self.UPDATE_SIZE_1 = "0"
- self.UPDATE_CRC_1 = "0000000000000000"
- self.CHECK_URL_1 = f"https://{mucha_url}/checkUrl/"
- self.EXE_VER_1 = game_ver
+ self.UPDATE_URL_1 = f"http://{mucha_url}/updUrl1/"
+ self.UPDATE_SIZE_1 = "20"
+
+ self.CHECK_CRC_1 = "0000000000000000"
+ self.CHECK_URL_1 = f"http://{mucha_url}/checkUrl/"
+ self.CHECK_SIZE_1 = "20"
+
self.INFO_SIZE_1 = "0"
self.COM_SIZE_1 = "0"
self.COM_TIME_1 = "0"
self.LAN_INFO_SIZE_1 = "0"
+
self.USER_ID = ""
self.PASSWORD = ""
+"""
+RESULTS
+EXE_VER
+UPDATE_VER_%d
+UPDATE_URL_%d
+UPDATE_SIZE_%d
+
+CHECK_CRC_%d
+CHECK_URL_%d
+CHECK_SIZE_%d
+
+INFO_SIZE_1
+COM_SIZE_1
+COM_TIME_1
+LAN_INFO_SIZE_1
+
+USER_ID
+PASSWORD
+"""
class MuchaUpdateResponseStub:
def __init__(self, game_ver: str) -> None:
self.RESULTS = "001"
self.UPDATE_VER_1 = game_ver
+
+class MuchaDownloadStateRequest:
+ def __init__(self, request: Dict) -> None:
+ self.gameCd = request.get("gameCd", "")
+ self.updateVer = request.get("updateVer", "")
+ self.serialNum = request.get("serialNum", "")
+ self.fileSize = request.get("fileSize", "")
+ self.compFileSize = request.get("compFileSize", "")
+ self.boardId = request.get("boardId", "")
+ self.placeId = request.get("placeId", "")
+ self.storeRouterIp = request.get("storeRouterIp", "")
diff --git a/core/title.py b/core/title.py
index 7a0a99b..ab53773 100644
--- a/core/title.py
+++ b/core/title.py
@@ -84,7 +84,7 @@ class TitleServlet:
request.setResponseCode(405)
return b""
- return index.render_GET(request, endpoints["version"], endpoints["endpoint"])
+ return index.render_GET(request, int(endpoints["version"]), endpoints["endpoint"])
def render_POST(self, request: Request, endpoints: dict) -> bytes:
code = endpoints["game"]
diff --git a/dbutils.py b/dbutils.py
index d959232..caae9d8 100644
--- a/dbutils.py
+++ b/dbutils.py
@@ -84,5 +84,8 @@ if __name__ == "__main__":
elif args.action == "cleanup":
data.delete_hanging_users()
+
+ elif args.action == "version":
+ data.show_versions()
data.logger.info("Done")
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..c43b6e5
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,57 @@
+version: "3.9"
+services:
+ app:
+ hostname: ma.app
+ build: .
+ volumes:
+ - ./aime:/app/aime
+
+ environment:
+ CFG_DEV: 1
+ CFG_CORE_SERVER_HOSTNAME: 0.0.0.0
+ CFG_CORE_DATABASE_HOST: ma.db
+ CFG_CORE_MEMCACHED_HOSTNAME: ma.memcached
+ CFG_CORE_AIMEDB_KEY: keyhere
+ CFG_CHUNI_SERVER_LOGLEVEL: debug
+
+ ports:
+ - "80:80"
+ - "8443:8443"
+ - "22345:22345"
+
+ - "8080:8080"
+ - "8090:8090"
+
+ depends_on:
+ db:
+ condition: service_healthy
+
+ db:
+ hostname: ma.db
+ image: mysql:8.0.31-debian
+ environment:
+ MYSQL_DATABASE: aime
+ MYSQL_USER: aime
+ MYSQL_PASSWORD: aime
+ MYSQL_ROOT_PASSWORD: AimeRootPassword
+ healthcheck:
+ test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
+ timeout: 5s
+ retries: 5
+
+
+ memcached:
+ hostname: ma.memcached
+ image: memcached:1.6.17-bullseye
+
+ phpmyadmin:
+ hostname: ma.phpmyadmin
+ image: phpmyadmin:latest
+ environment:
+ PMA_HOSTS: ma.db
+ PMA_USER: root
+ PMA_PASSWORD: AimeRootPassword
+ APACHE_PORT: 8080
+ ports:
+ - "8080:8080"
+
diff --git a/docs/config.md b/docs/config.md
index 3e4ba8a..18f90eb 100644
--- a/docs/config.md
+++ b/docs/config.md
@@ -5,6 +5,7 @@
- `allow_unregistered_serials`: Allows games that do not have registered keychips to connect and authenticate. Disable to restrict who can connect to your server. Recomended to disable for production setups. Default `True`
- `name`: Name for the server, used by some games in their default MOTDs. Default `ARTEMiS`
- `is_develop`: Flags that the server is a development instance without a proxy standing in front of it. Setting to `False` tells the server not to listen for SSL, because the proxy should be handling all SSL-related things, among other things. Default `True`
+- `threading`: Flags that `reactor.run` should be called via the `Thread` standard library. May provide a speed boost, but removes the ability to kill the server via `Ctrl + C`. Default: `False`
- `log_dir`: Directory to store logs. Server MUST have read and write permissions to this directory or you will have issues. Default `logs`
## Title
- `loglevel`: Logging level for the title server. Default `info`
diff --git a/docs/game_specific_info.md b/docs/game_specific_info.md
index f1b334e..e2a8296 100644
--- a/docs/game_specific_info.md
+++ b/docs/game_specific_info.md
@@ -9,42 +9,44 @@ using the megaime database. Clean installations always create the latest databas
# Table of content
- [Supported Games](#supported-games)
- - [Chunithm](#chunithm)
+ - [CHUNITHM](#chunithm)
- [crossbeats REV.](#crossbeats-rev)
- [maimai DX](#maimai-dx)
- [O.N.G.E.K.I.](#o-n-g-e-k-i)
- [Card Maker](#card-maker)
- [WACCA](#wacca)
+ - [Sword Art Online Arcade](#sao)
# Supported Games
Games listed below have been tested and confirmed working.
-## Chunithm
+## CHUNITHM
### SDBT
-| Version ID | Version Name |
-|------------|--------------------|
-| 0 | Chunithm |
-| 1 | Chunithm+ |
-| 2 | Chunithm Air |
-| 3 | Chunithm Air + |
-| 4 | Chunithm Star |
-| 5 | Chunithm Star + |
-| 6 | Chunithm Amazon |
-| 7 | Chunithm Amazon + |
-| 8 | Chunithm Crystal |
-| 9 | Chunithm Crystal + |
-| 10 | Chunithm Paradise |
+| Version ID | Version Name |
+|------------|-----------------------|
+| 0 | CHUNITHM |
+| 1 | CHUNITHM PLUS |
+| 2 | CHUNITHM AIR |
+| 3 | CHUNITHM AIR PLUS |
+| 4 | CHUNITHM STAR |
+| 5 | CHUNITHM STAR PLUS |
+| 6 | CHUNITHM AMAZON |
+| 7 | CHUNITHM AMAZON PLUS |
+| 8 | CHUNITHM CRYSTAL |
+| 9 | CHUNITHM CRYSTAL PLUS |
+| 10 | CHUNITHM PARADISE |
### SDHD/SDBT
-| Version ID | Version Name |
-|------------|-----------------|
-| 11 | Chunithm New!! |
-| 12 | Chunithm New!!+ |
+| Version ID | Version Name |
+|------------|---------------------|
+| 11 | CHUNITHM NEW!! |
+| 12 | CHUNITHM NEW PLUS!! |
+| 13 | CHUNITHM SUN |
### Importer
@@ -60,13 +62,33 @@ The importer for Chunithm will import: Events, Music, Charge Items and Avatar Ac
### Database upgrade
Always make sure your database (tables) are up-to-date, to do so go to the `core/data/schema/versions` folder and see
-which version is the latest, f.e. `SDBT_3_upgrade.sql`. In order to upgrade to version 3 in this case you need to
+which version is the latest, f.e. `SDBT_4_upgrade.sql`. In order to upgrade to version 4 in this case you need to
perform all previous updates as well:
```shell
python dbutils.py --game SDBT upgrade
```
+### Online Battle
+
+**Only matchmaking (with your imaginary friends) is supported! Online Battle does not (yet?) work!**
+
+The first person to start the Online Battle (now called host) will create a "matching room" with a given `roomId`, after that max 3 other people can join the created room.
+Non used slots during the matchmaking will be filled with CPUs after the timer runs out.
+As soon as a new member will join the room the timer will jump back to 60 secs again.
+Sending those 4 messages to all other users is also working properly.
+In order to use the Online Battle every user needs the same ICF, same rom version and same data version!
+If a room is full a new room will be created if another user starts an Online Battle.
+After a failed Online Battle the room will be deleted. The host is used for the timer countdown, so if the connection failes to the host the timer will stop and could create a "frozen" state.
+
+#### Information/Problems:
+
+- Online Battle uses UDP hole punching and opens port 50201?
+- `reflectorUri` seems related to that?
+- Timer countdown should be handled globally and not by one user
+- Game can freeze or can crash if someone (especially the host) leaves the matchmaking
+
+
## crossbeats REV.
### SDCA
@@ -105,28 +127,50 @@ Config file is located in `config/cxb.yaml`.
### SDEZ
-| Version ID | Version Name |
-|------------|-------------------------|
-| 0 | maimai DX |
-| 1 | maimai DX PLUS |
-| 2 | maimai DX Splash |
-| 3 | maimai DX Splash PLUS |
-| 4 | maimai DX Universe |
-| 5 | maimai DX Universe PLUS |
-| 6 | maimai DX Festival |
+| Game Code | Version ID | Version Name |
+|-----------|------------|-------------------------|
+
+
+For versions pre-dx
+| Game Code | Version ID | Version Name |
+|-----------|------------|-------------------------|
+| SBXL | 0 | maimai |
+| SBXL | 1 | maimai PLUS |
+| SBZF | 2 | maimai GreeN |
+| SBZF | 3 | maimai GreeN PLUS |
+| SDBM | 4 | maimai ORANGE |
+| SDBM | 5 | maimai ORANGE PLUS |
+| SDCQ | 6 | maimai PiNK |
+| SDCQ | 7 | maimai PiNK PLUS |
+| SDDK | 8 | maimai MURASAKI |
+| SDDK | 9 | maimai MURASAKI PLUS |
+| SDDZ | 10 | maimai MILK |
+| SDDZ | 11 | maimai MILK PLUS |
+| SDEY | 12 | maimai FiNALE |
+| SDEZ | 13 | maimai DX |
+| SDEZ | 14 | maimai DX PLUS |
+| SDEZ | 15 | maimai DX Splash |
+| SDEZ | 16 | maimai DX Splash PLUS |
+| SDEZ | 17 | maimai DX Universe |
+| SDEZ | 18 | maimai DX Universe PLUS |
+| SDEZ | 19 | maimai DX Festival |
### Importer
In order to use the importer locate your game installation folder and execute:
-
+DX:
```shell
-python read.py --series SDEZ --version --binfolder /path/to/game/folder --optfolder /path/to/game/option/folder
+python read.py --series --version --binfolder /path/to/StreamingAssets --optfolder /path/to/game/option/folder
+```
+Pre-DX:
+```shell
+python read.py --series --version --binfolder /path/to/data --optfolder /path/to/patch/data
```
-
The importer for maimai DX will import Events, Music and Tickets.
-**NOTE: It is required to use the importer because the game will
-crash without Events!**
+The importer for maimai Pre-DX will import Events and Music. Not all games will have patch data. Milk - Finale have file encryption, and need an AES key. That key is not provided by the developers. For games that do use encryption, provide the key, as a hex string, with the `--extra` flag. Ex `--extra 00112233445566778899AABBCCDDEEFF`
+
+**Important: It is required to use the importer because some games may not function properly or even crash without Events!**
### Database upgrade
@@ -135,6 +179,7 @@ Always make sure your database (tables) are up-to-date, to do so go to the `core
```shell
python dbutils.py --game SDEZ upgrade
```
+Pre-Dx uses the same database as DX, so only upgrade using the SDEZ game code!
## Hatsune Miku Project Diva
@@ -185,12 +230,12 @@ python dbutils.py --game SBZV upgrade
|------------|----------------------------|
| 0 | O.N.G.E.K.I. |
| 1 | O.N.G.E.K.I. + |
-| 2 | O.N.G.E.K.I. Summer |
-| 3 | O.N.G.E.K.I. Summer + |
-| 4 | O.N.G.E.K.I. Red |
-| 5 | O.N.G.E.K.I. Red + |
-| 6 | O.N.G.E.K.I. Bright |
-| 7 | O.N.G.E.K.I. Bright Memory |
+| 2 | O.N.G.E.K.I. SUMMER |
+| 3 | O.N.G.E.K.I. SUMMER + |
+| 4 | O.N.G.E.K.I. R.E.D. |
+| 5 | O.N.G.E.K.I. R.E.D. + |
+| 6 | O.N.G.E.K.I. bright |
+| 7 | O.N.G.E.K.I. bright MEMORY |
### Importer
@@ -231,21 +276,21 @@ python dbutils.py --game SDDT upgrade
| Version ID | Version Name |
|------------|-----------------|
-| 0 | Card Maker 1.34 |
+| 0 | Card Maker 1.30 |
| 1 | Card Maker 1.35 |
### Support status
-* Card Maker 1.34:
- * Chunithm New!!: Yes
- * maimai DX Universe: Yes
- * O.N.G.E.K.I. Bright: Yes
+* Card Maker 1.30:
+ * CHUNITHM NEW!!: Yes
+ * maimai DX UNiVERSE: Yes
+ * O.N.G.E.K.I. bright: Yes
* Card Maker 1.35:
- * Chunithm New!!+: Yes
- * maimai DX Universe PLUS: Yes
- * O.N.G.E.K.I. Bright Memory: Yes
+ * CHUNITHM SUN: Yes (NEW PLUS!! up to A032)
+ * maimai DX FESTiVAL: Yes (up to A035) (UNiVERSE PLUS up to A031)
+ * O.N.G.E.K.I. bright MEMORY: Yes
### Importer
@@ -263,19 +308,54 @@ python read.py --series SDED --version --binfolder titles/cm/cm_dat
python read.py --series SDDT --version --binfolder /path/to/game/folder --optfolder /path/to/game/option/folder
```
-Also make sure to import all maimai and Chunithm data as well:
+Also make sure to import all maimai DX and CHUNITHM data as well:
```shell
python read.py --series SDED --version --binfolder /path/to/cardmaker/CardMaker_Data
```
-The importer for Card Maker will import all required Gachas (Banners) and cards (for maimai/Chunithm) and the hardcoded
+The importer for Card Maker will import all required Gachas (Banners) and cards (for maimai DX/CHUNITHM) and the hardcoded
Cards for each Gacha (O.N.G.E.K.I. only).
**NOTE: Without executing the importer Card Maker WILL NOT work!**
-### O.N.G.E.K.I. Gachas
+### Config setup
+
+Make sure to update your `config/cardmaker.yaml` with the correct version for each game. To get the current version required to run a specific game, open every opt (Axxx) folder descending until you find all three folders:
+
+- `MU3`: O.N.G.E.K.I.
+- `MAI`: maimai DX
+- `CHU`: CHUNITHM
+
+Inside each folder is a `DataConfig.xml` file, for example:
+
+`MU3/DataConfig.xml`:
+```xml
+
+ 1
+ 35
+ 3
+
+```
+
+Now update your `config/cardmaker.yaml` with the correct version number, for example:
+
+```yaml
+version:
+ 1: # Card Maker 1.35
+ ongeki: 1.35.03
+```
+
+For now you also need to update your `config/ongeki.yaml` with the correct version number, for example:
+
+```yaml
+version:
+ 7: # O.N.G.E.K.I. bright MEMORY
+ card_maker: 1.35.03
+```
+
+### O.N.G.E.K.I.
Gacha "無料ガチャ" can only pull from the free cards with the following probabilities: 94%: R, 5% SR and 1% chance of
getting an SSR card
@@ -288,20 +368,24 @@ and 3% chance of getting an SSR card
All other (limited) gachas can pull from every card added to ongeki_static_cards but with the promoted cards
(click on the green button under the banner) having a 10 times higher chance to get pulled
-### Chunithm Gachas
+### CHUNITHM
-All cards in Chunithm (basically just the characters) have the same rarity to it just pulls randomly from all cards
+All cards in CHUNITHM (basically just the characters) have the same rarity to it just pulls randomly from all cards
from a given gacha but made sure you cannot pull the same card twice in the same 5 times gacha roll.
+### maimai DX
+
+Printed maimai DX cards: Freedom (`cardTypeId=6`) or Gold Pass (`cardTypeId=4`) can now be selected during the login process. You can only have ONE Freedom and ONE Gold Pass active at a given time. The cards will expire after 15 days.
+
+Thanks GetzeAvenue for the `selectedCardList` rarity hint!
+
### Notes
-Card Maker 1.34 will only load an O.N.G.E.K.I. Bright profile (1.30). Card Maker 1.35 will only load an O.N.G.E.K.I.
+Card Maker 1.30-1.34 will only load an O.N.G.E.K.I. Bright profile (1.30). Card Maker 1.35+ will only load an O.N.G.E.K.I.
Bright Memory profile (1.35).
-The gachas inside the `ongeki.yaml` will make sure only the right gacha ids for the right CM version will be loaded.
+The gachas inside the `config/ongeki.yaml` will make sure only the right gacha ids for the right CM version will be loaded.
Gacha IDs up to 1140 will be loaded for CM 1.34 and all gachas will be loaded for CM 1.35.
-**NOTE: There is currently no way to load/use the (printed) maimai DX cards!**
-
## WACCA
### SDFE
@@ -344,3 +428,89 @@ Always make sure your database (tables) are up-to-date, to do so go to the `core
```shell
python dbutils.py --game SDFE upgrade
```
+
+### VIP Rewards
+Below is a list of VIP rewards. Currently, VIP is not implemented, and thus these are not obtainable. These 23 rewards were distributed once per month for VIP users on the real network.
+
+ Plates:
+ 211004 リッチ
+ 211018 特盛えりざべす
+ 211025 イースター
+ 211026 特盛りりぃ
+ 311004 ファンシー
+ 311005 インカンテーション
+ 311014 夜明け
+ 311015 ネイビー
+ 311016 特盛るーん
+
+ Ring Colors:
+ 203002 Gold Rushイエロー
+ 203009 トロピカル
+ 303005 ネイチャー
+
+ Icons:
+ 202020 どらみんぐ
+ 202063 ユニコーン
+ 202086 ゴリラ
+ 302014 ローズ
+ 302015 ファラオ
+ 302045 肉球
+ 302046 WACCA
+ 302047 WACCA Lily
+ 302048 WACCA Reverse
+
+ Note Sound Effect:
+ 205002 テニス
+ 205008 シャワー
+ 305003 タンバリンMk-Ⅱ
+
+## SAO
+
+### SDEW
+
+| Version ID | Version Name |
+|------------|---------------|
+| 0 | SAO |
+
+
+### Importer
+
+In order to use the importer locate your game installation folder and execute:
+
+```shell
+python read.py --series SDEW --version --binfolder /path/to/game/extractedassets
+```
+
+The importer for SAO will import all items, heroes, support skills and titles data.
+
+### Config
+
+Config file is located in `config/sao.yaml`.
+
+| Option | Info |
+|--------------------|-----------------------------------------------------------------------------|
+| `hostname` | Changes the server listening address for Mucha |
+| `port` | Changes the listing port |
+| `auto_register` | Allows the game to handle the automatic registration of new cards |
+
+
+### Database upgrade
+
+Always make sure your database (tables) are up-to-date, to do so go to the `core/data/schema/versions` folder and see which version is the latest, f.e. `SDEW_1_upgrade.sql`. In order to upgrade to version 3 in this case you need to perform all previous updates as well:
+
+```shell
+python dbutils.py --game SDEW upgrade
+```
+
+### Notes
+- Defrag Match will crash at loading
+- Co-Op Online is not supported
+- Shop is not functionnal
+- Player title is currently static and cannot be changed in-game
+- QR Card Scanning currently only load a static hero
+
+### Credits for SAO support:
+
+- Midorica - Limited Network Support
+- Dniel97 - Helping with network base
+- tungnotpunk - Source
\ No newline at end of file
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100644
index 0000000..aa95ca8
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+if [[ -z "${CFG_DEV}" ]]; then
+ echo Production mode
+ python3 index.py
+else
+ echo Development mode
+ python3 dbutils.py create
+ nodemon -w aime --legacy-watch index.py
+fi
+
diff --git a/example_config/cardmaker.yaml b/example_config/cardmaker.yaml
index a04dda5..fb17756 100644
--- a/example_config/cardmaker.yaml
+++ b/example_config/cardmaker.yaml
@@ -1,3 +1,13 @@
server:
enable: True
loglevel: "info"
+
+version:
+ 0:
+ ongeki: 1.30.01
+ chuni: 2.00.00
+ maimai: 1.20.00
+ 1:
+ ongeki: 1.35.03
+ chuni: 2.10.00
+ maimai: 1.30.00
\ No newline at end of file
diff --git a/example_config/chuni.yaml b/example_config/chuni.yaml
index bbac976..59db51e 100644
--- a/example_config/chuni.yaml
+++ b/example_config/chuni.yaml
@@ -15,6 +15,9 @@ version:
12:
rom: 2.05.00
data: 2.05.00
+ 13:
+ rom: 2.10.00
+ data: 2.10.00
crypto:
encrypted_only: False
\ No newline at end of file
diff --git a/example_config/core.yaml b/example_config/core.yaml
index 382c51b..ebf99f1 100644
--- a/example_config/core.yaml
+++ b/example_config/core.yaml
@@ -4,6 +4,7 @@ server:
allow_unregistered_serials: True
name: "ARTEMiS"
is_develop: True
+ threading: False
log_dir: "logs"
title:
diff --git a/example_config/mai2.yaml b/example_config/mai2.yaml
index a04dda5..8557151 100644
--- a/example_config/mai2.yaml
+++ b/example_config/mai2.yaml
@@ -1,3 +1,14 @@
server:
enable: True
loglevel: "info"
+
+deliver:
+ enable: False
+ udbdl_enable: False
+ content_folder: ""
+
+uploads:
+ photos: False
+ photos_dir: ""
+ movies: False
+ movies_dir: ""
diff --git a/example_config/ongeki.yaml b/example_config/ongeki.yaml
index 3db7098..90233b3 100644
--- a/example_config/ongeki.yaml
+++ b/example_config/ongeki.yaml
@@ -29,3 +29,9 @@ gachas:
- 1156
- 1163
- 1164
+
+version:
+ 6:
+ card_maker: 1.30.01
+ 7:
+ card_maker: 1.35.03
diff --git a/example_config/pokken.yaml b/example_config/pokken.yaml
index 225e980..423d9d3 100644
--- a/example_config/pokken.yaml
+++ b/example_config/pokken.yaml
@@ -2,8 +2,11 @@ server:
hostname: "localhost"
enable: True
loglevel: "info"
- port: 9000
- port_stun: 9001
- port_turn: 9002
- port_admission: 9003
- auto_register: True
\ No newline at end of file
+ auto_register: True
+ enable_matching: False
+ stun_server_host: "stunserver.stunprotocol.org"
+ stun_server_port: 3478
+
+ports:
+ game: 9000
+ admission: 9001
diff --git a/example_config/sao.yaml b/example_config/sao.yaml
new file mode 100644
index 0000000..7e3ecf2
--- /dev/null
+++ b/example_config/sao.yaml
@@ -0,0 +1,6 @@
+server:
+ hostname: "localhost"
+ enable: True
+ loglevel: "info"
+ port: 9000
+ auto_register: True
\ No newline at end of file
diff --git a/index.py b/index.py
index 11fad94..2ff7c04 100644
--- a/index.py
+++ b/index.py
@@ -11,7 +11,7 @@ from twisted.web import server, resource
from twisted.internet import reactor, endpoints
from twisted.web.http import Request
from routes import Mapper
-
+from threading import Thread
class HttpDispatcher(resource.Resource):
def __init__(self, cfg: CoreConfig, config_dir: str):
@@ -42,7 +42,7 @@ class HttpDispatcher(resource.Resource):
conditions=dict(method=["POST"]),
)
- self.map_post.connect(
+ self.map_get.connect(
"allnet_ping",
"/naomitest.html",
controller="allnet",
@@ -63,6 +63,27 @@ class HttpDispatcher(resource.Resource):
action="handle_dlorder",
conditions=dict(method=["POST"]),
)
+ self.map_post.connect(
+ "allnet_loaderstaterecorder",
+ "/sys/servlet/LoaderStateRecorder",
+ controller="allnet",
+ action="handle_loaderstaterecorder",
+ conditions=dict(method=["POST"]),
+ )
+ self.map_post.connect(
+ "allnet_alive",
+ "/sys/servlet/Alive",
+ controller="allnet",
+ action="handle_alive",
+ conditions=dict(method=["POST"]),
+ )
+ self.map_get.connect(
+ "allnet_alive",
+ "/sys/servlet/Alive",
+ controller="allnet",
+ action="handle_alive",
+ conditions=dict(method=["GET"]),
+ )
self.map_post.connect(
"allnet_billing",
"/request",
@@ -92,6 +113,13 @@ class HttpDispatcher(resource.Resource):
action="handle_updatecheck",
conditions=dict(method=["POST"]),
)
+ self.map_post.connect(
+ "mucha_dlstate",
+ "/mucha/downloadstate.do",
+ controller="mucha",
+ action="handle_dlstate",
+ conditions=dict(method=["POST"]),
+ )
self.map_get.connect(
"title_get",
@@ -111,7 +139,6 @@ class HttpDispatcher(resource.Resource):
)
def render_GET(self, request: Request) -> bytes:
- self.logger.debug(request.uri)
test = self.map_get.match(request.uri.decode())
client_ip = Utils.get_ip_addr(request)
@@ -161,9 +188,16 @@ class HttpDispatcher(resource.Resource):
if type(ret) == str:
return ret.encode()
- elif type(ret) == bytes:
+
+ elif type(ret) == bytes or type(ret) == tuple: # allow for bytes or tuple (data, response code) responses
return ret
+
+ elif ret is None:
+ self.logger.warn(f"None returned by controller for {request.uri.decode()} endpoint")
+ return b""
+
else:
+ self.logger.warn(f"Unknown data type returned by controller for {request.uri.decode()} endpoint")
return b""
@@ -256,4 +290,7 @@ if __name__ == "__main__":
server.Site(dispatcher)
)
- reactor.run() # type: ignore
+ if cfg.server.threading:
+ Thread(target=reactor.run, args=(False,)).start()
+ else:
+ reactor.run()
diff --git a/readme.md b/readme.md
index ec25191..2c49faa 100644
--- a/readme.md
+++ b/readme.md
@@ -3,32 +3,36 @@ A network service emulator for games running SEGA'S ALL.NET service, and similar
# Supported games
Games listed below have been tested and confirmed working. Only game versions older then the version currently active in arcades, or games versions that have not recieved a major update in over one year, are supported.
-+ Chunithm
- + All versions up to New!! Plus
-+ Crossbeats Rev
++ CHUNITHM
+ + All versions up to SUN
+
++ crossbeats REV.
+ All versions + omnimix
+ maimai DX
- + All versions up to Festival
+ + All versions up to FESTiVAL
-+ Hatsune Miku Arcade
++ Hatsune Miku: Project DIVA Arcade
+ All versions
+ Card Maker
- + 1.34.xx
- + 1.35.xx
+ + 1.30
+ + 1.35
-+ Ongeki
- + All versions up to Bright Memory
++ O.N.G.E.K.I.
+ + All versions up to bright MEMORY
-+ Wacca
++ WACCA
+ Lily R
+ Reverse
-+ Pokken
++ POKKÉN TOURNAMENT
+ Final Online
++ Sword Art Online Arcade (partial support)
+ + Final
+
## Requirements
- python 3 (tested working with 3.9 and 3.10, other versions YMMV)
- pip
diff --git a/requirements.txt b/requirements.txt
index ebb17c9..53d867a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -16,3 +16,5 @@ Routes
bcrypt
jinja2
protobuf
+autobahn
+pillow
diff --git a/titles/chuni/__init__.py b/titles/chuni/__init__.py
index 89cd4f5..0c3cc79 100644
--- a/titles/chuni/__init__.py
+++ b/titles/chuni/__init__.py
@@ -7,4 +7,4 @@ index = ChuniServlet
database = ChuniData
reader = ChuniReader
game_codes = [ChuniConstants.GAME_CODE, ChuniConstants.GAME_CODE_NEW]
-current_schema_version = 3
+current_schema_version = 4
diff --git a/titles/chuni/base.py b/titles/chuni/base.py
index 0eaabff..4c4361c 100644
--- a/titles/chuni/base.py
+++ b/titles/chuni/base.py
@@ -4,7 +4,7 @@ from datetime import datetime, timedelta
from time import strftime
import pytz
-from typing import Dict, Any
+from typing import Dict, Any, List
from core.config import CoreConfig
from titles.chuni.const import ChuniConstants
@@ -44,13 +44,15 @@ class ChuniBase:
# check if a user already has some pogress and if not add the
# login bonus entry
user_login_bonus = self.data.item.get_login_bonus(
- user_id, self.version, preset["id"]
+ user_id, self.version, preset["presetId"]
)
if user_login_bonus is None:
- self.data.item.put_login_bonus(user_id, self.version, preset["id"])
+ self.data.item.put_login_bonus(
+ user_id, self.version, preset["presetId"]
+ )
# yeah i'm lazy
user_login_bonus = self.data.item.get_login_bonus(
- user_id, self.version, preset["id"]
+ user_id, self.version, preset["presetId"]
)
# skip the login bonus entirely if its already finished
@@ -66,13 +68,13 @@ class ChuniBase:
last_update_date = datetime.now()
all_login_boni = self.data.static.get_login_bonus(
- self.version, preset["id"]
+ self.version, preset["presetId"]
)
# skip the current bonus preset if no boni were found
if all_login_boni is None or len(all_login_boni) < 1:
self.logger.warn(
- f"No bonus entries found for bonus preset {preset['id']}"
+ f"No bonus entries found for bonus preset {preset['presetId']}"
)
continue
@@ -83,14 +85,14 @@ class ChuniBase:
if bonus_count > max_needed_days:
# assume that all login preset ids under 3000 needs to be
# looped, like 30 and 40 are looped, 40 does not work?
- if preset["id"] < 3000:
+ if preset["presetId"] < 3000:
bonus_count = 1
else:
is_finished = True
# grab the item for the corresponding day
login_item = self.data.static.get_login_bonus_by_required_days(
- self.version, preset["id"], bonus_count
+ self.version, preset["presetId"], bonus_count
)
if login_item is not None:
# now add the present to the database so the
@@ -108,7 +110,7 @@ class ChuniBase:
self.data.item.put_login_bonus(
user_id,
self.version,
- preset["id"],
+ preset["presetId"],
bonusCount=bonus_count,
lastUpdateDate=last_update_date,
isWatched=False,
@@ -156,12 +158,18 @@ class ChuniBase:
event_list = []
for evt_row in game_events:
- tmp = {}
- tmp["id"] = evt_row["eventId"]
- tmp["type"] = evt_row["type"]
- tmp["startDate"] = "2017-12-05 07:00:00.0"
- tmp["endDate"] = "2099-12-31 00:00:00.0"
- event_list.append(tmp)
+ event_list.append(
+ {
+ "id": evt_row["eventId"],
+ "type": evt_row["type"],
+ # actually use the startDate from the import so it
+ # properly shows all the events when new ones are imported
+ "startDate": datetime.strftime(
+ evt_row["startDate"], "%Y-%m-%d %H:%M:%S"
+ ),
+ "endDate": "2099-12-31 00:00:00",
+ }
+ )
return {
"type": data["type"],
@@ -228,29 +236,36 @@ class ChuniBase:
def handle_get_user_character_api_request(self, data: Dict) -> Dict:
characters = self.data.item.get_characters(data["userId"])
if characters is None:
- return {}
- next_idx = -1
+ return {
+ "userId": data["userId"],
+ "length": 0,
+ "nextIndex": -1,
+ "userCharacterList": [],
+ }
- characterList = []
- for x in range(int(data["nextIndex"]), len(characters)):
+ character_list = []
+ next_idx = int(data["nextIndex"])
+ max_ct = int(data["maxCount"])
+
+ for x in range(next_idx, len(characters)):
tmp = characters[x]._asdict()
tmp.pop("user")
tmp.pop("id")
- characterList.append(tmp)
+ character_list.append(tmp)
- if len(characterList) >= int(data["maxCount"]):
+ if len(character_list) >= max_ct:
break
- if len(characterList) >= int(data["maxCount"]) and len(characters) > int(
- data["maxCount"]
- ) + int(data["nextIndex"]):
- next_idx = int(data["maxCount"]) + int(data["nextIndex"]) + 1
+ if len(characters) >= next_idx + max_ct:
+ next_idx += max_ct
+ else:
+ next_idx = -1
return {
"userId": data["userId"],
- "length": len(characterList),
+ "length": len(character_list),
"nextIndex": next_idx,
- "userCharacterList": characterList,
+ "userCharacterList": character_list,
}
def handle_get_user_charge_api_request(self, data: Dict) -> Dict:
@@ -292,8 +307,8 @@ class ChuniBase:
if len(user_course_list) >= max_ct:
break
- if len(user_course_list) >= max_ct:
- next_idx = next_idx + max_ct
+ if len(user_course_list) >= next_idx + max_ct:
+ next_idx += max_ct
else:
next_idx = -1
@@ -347,12 +362,23 @@ class ChuniBase:
}
def handle_get_user_favorite_item_api_request(self, data: Dict) -> Dict:
+ user_fav_item_list = []
+
+ # still needs to be implemented on WebUI
+ # 1: Music, 3: Character
+ fav_list = self.data.item.get_all_favorites(
+ data["userId"], self.version, fav_kind=int(data["kind"])
+ )
+ if fav_list is not None:
+ for fav in fav_list:
+ user_fav_item_list.append({"id": fav["favId"]})
+
return {
"userId": data["userId"],
- "length": 0,
+ "length": len(user_fav_item_list),
"kind": data["kind"],
"nextIndex": -1,
- "userFavoriteItemList": [],
+ "userFavoriteItemList": user_fav_item_list,
}
def handle_get_user_favorite_music_api_request(self, data: Dict) -> Dict:
@@ -375,7 +401,7 @@ class ChuniBase:
"userItemList": [],
}
- items: list[Dict[str, Any]] = []
+ items: List[Dict[str, Any]] = []
for i in range(next_idx, len(user_item_list)):
tmp = user_item_list[i]._asdict()
tmp.pop("user")
@@ -387,13 +413,13 @@ class ChuniBase:
xout = kind * 10000000000 + next_idx + len(items)
if len(items) < int(data["maxCount"]):
- nextIndex = 0
+ next_idx = 0
else:
- nextIndex = xout
+ next_idx = xout
return {
"userId": data["userId"],
- "nextIndex": nextIndex,
+ "nextIndex": next_idx,
"itemKind": kind,
"length": len(items),
"userItemList": items,
@@ -452,6 +478,7 @@ class ChuniBase:
"nextIndex": -1,
"userMusicList": [], # 240
}
+
song_list = []
next_idx = int(data["nextIndex"])
max_ct = int(data["maxCount"])
@@ -474,10 +501,10 @@ class ChuniBase:
if len(song_list) >= max_ct:
break
- if len(song_list) >= max_ct:
+ if len(song_list) >= next_idx + max_ct:
next_idx += max_ct
else:
- next_idx = 0
+ next_idx = -1
return {
"userId": data["userId"],
@@ -617,18 +644,21 @@ class ChuniBase:
upsert["userData"][0]["userName"] = self.read_wtf8(
upsert["userData"][0]["userName"]
)
- except:
+ except Exception:
pass
self.data.profile.put_profile_data(
user_id, self.version, upsert["userData"][0]
)
+
if "userDataEx" in upsert:
self.data.profile.put_profile_data_ex(
user_id, self.version, upsert["userDataEx"][0]
)
+
if "userGameOption" in upsert:
self.data.profile.put_profile_option(user_id, upsert["userGameOption"][0])
+
if "userGameOptionEx" in upsert:
self.data.profile.put_profile_option_ex(
user_id, upsert["userGameOptionEx"][0]
@@ -672,6 +702,10 @@ class ChuniBase:
if "userPlaylogList" in upsert:
for playlog in upsert["userPlaylogList"]:
+ # convert the player names to utf-8
+ playlog["playedUserName1"] = self.read_wtf8(playlog["playedUserName1"])
+ playlog["playedUserName2"] = self.read_wtf8(playlog["playedUserName2"])
+ playlog["playedUserName3"] = self.read_wtf8(playlog["playedUserName3"])
self.data.score.put_playlog(user_id, playlog)
if "userTeamPoint" in upsert:
diff --git a/titles/chuni/const.py b/titles/chuni/const.py
index 6ab3cc3..b3a4cb5 100644
--- a/titles/chuni/const.py
+++ b/titles/chuni/const.py
@@ -17,21 +17,23 @@ class ChuniConstants:
VER_CHUNITHM_PARADISE = 10
VER_CHUNITHM_NEW = 11
VER_CHUNITHM_NEW_PLUS = 12
+ VER_CHUNITHM_SUN = 13
VERSION_NAMES = [
- "Chunithm",
- "Chunithm+",
- "Chunithm Air",
- "Chunithm Air+",
- "Chunithm Star",
- "Chunithm Star+",
- "Chunithm Amazon",
- "Chunithm Amazon+",
- "Chunithm Crystal",
- "Chunithm Crystal+",
- "Chunithm Paradise",
- "Chunithm New!!",
- "Chunithm New!!+",
+ "CHUNITHM",
+ "CHUNITHM PLUS",
+ "CHUNITHM AIR",
+ "CHUNITHM AIR PLUS",
+ "CHUNITHM STAR",
+ "CHUNITHM STAR PLUS",
+ "CHUNITHM AMAZON",
+ "CHUNITHM AMAZON PLUS",
+ "CHUNITHM CRYSTAL",
+ "CHUNITHM CRYSTAL PLUS",
+ "CHUNITHM PARADISE",
+ "CHUNITHM NEW!!",
+ "CHUNITHM NEW PLUS!!",
+ "CHUNITHM SUN"
]
@classmethod
diff --git a/titles/chuni/index.py b/titles/chuni/index.py
index a7545ba..5d185e9 100644
--- a/titles/chuni/index.py
+++ b/titles/chuni/index.py
@@ -29,6 +29,7 @@ from titles.chuni.crystalplus import ChuniCrystalPlus
from titles.chuni.paradise import ChuniParadise
from titles.chuni.new import ChuniNew
from titles.chuni.newplus import ChuniNewPlus
+from titles.chuni.sun import ChuniSun
class ChuniServlet:
@@ -55,6 +56,7 @@ class ChuniServlet:
ChuniParadise,
ChuniNew,
ChuniNewPlus,
+ ChuniSun,
]
self.logger = logging.getLogger("chuni")
@@ -96,15 +98,18 @@ class ChuniServlet:
]
for method in method_list:
method_fixed = inflection.camelize(method)[6:-7]
+ # number of iterations was changed to 70 in SUN
+ iter_count = 70 if version >= ChuniConstants.VER_CHUNITHM_SUN else 44
hash = PBKDF2(
method_fixed,
bytes.fromhex(keys[2]),
128,
- count=44,
+ count=iter_count,
hmac_hash_module=SHA1,
)
- self.hash_table[version][hash.hex()] = method_fixed
+ hashed_name = hash.hex()[:32] # truncate unused bytes like the game does
+ self.hash_table[version][hashed_name] = method_fixed
self.logger.debug(
f"Hashed v{version} method {method_fixed} with {bytes.fromhex(keys[2])} to get {hash.hex()}"
@@ -145,30 +150,32 @@ class ChuniServlet:
if version < 105: # 1.0
internal_ver = ChuniConstants.VER_CHUNITHM
- elif version >= 105 and version < 110: # Plus
+ elif version >= 105 and version < 110: # PLUS
internal_ver = ChuniConstants.VER_CHUNITHM_PLUS
- elif version >= 110 and version < 115: # Air
+ elif version >= 110 and version < 115: # AIR
internal_ver = ChuniConstants.VER_CHUNITHM_AIR
- elif version >= 115 and version < 120: # Air Plus
+ elif version >= 115 and version < 120: # AIR PLUS
internal_ver = ChuniConstants.VER_CHUNITHM_AIR_PLUS
- elif version >= 120 and version < 125: # Star
+ elif version >= 120 and version < 125: # STAR
internal_ver = ChuniConstants.VER_CHUNITHM_STAR
- elif version >= 125 and version < 130: # Star Plus
+ elif version >= 125 and version < 130: # STAR PLUS
internal_ver = ChuniConstants.VER_CHUNITHM_STAR_PLUS
- elif version >= 130 and version < 135: # Amazon
+ elif version >= 130 and version < 135: # AMAZON
internal_ver = ChuniConstants.VER_CHUNITHM_AMAZON
- elif version >= 135 and version < 140: # Amazon Plus
+ elif version >= 135 and version < 140: # AMAZON PLUS
internal_ver = ChuniConstants.VER_CHUNITHM_AMAZON_PLUS
- elif version >= 140 and version < 145: # Crystal
+ elif version >= 140 and version < 145: # CRYSTAL
internal_ver = ChuniConstants.VER_CHUNITHM_CRYSTAL
- elif version >= 145 and version < 150: # Crystal Plus
+ elif version >= 145 and version < 150: # CRYSTAL PLUS
internal_ver = ChuniConstants.VER_CHUNITHM_CRYSTAL_PLUS
- elif version >= 150 and version < 200: # Paradise
+ elif version >= 150 and version < 200: # PARADISE
internal_ver = ChuniConstants.VER_CHUNITHM_PARADISE
- elif version >= 200 and version < 205: # New
+ elif version >= 200 and version < 205: # NEW!!
internal_ver = ChuniConstants.VER_CHUNITHM_NEW
- elif version >= 205 and version < 210: # New Plus
+ elif version >= 205 and version < 210: # NEW PLUS!!
internal_ver = ChuniConstants.VER_CHUNITHM_NEW_PLUS
+ elif version >= 210: # SUN
+ internal_ver = ChuniConstants.VER_CHUNITHM_SUN
if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32:
# If we get a 32 character long hex string, it's a hash and we're
diff --git a/titles/chuni/new.py b/titles/chuni/new.py
index 67b6fcc..40dee9b 100644
--- a/titles/chuni/new.py
+++ b/titles/chuni/new.py
@@ -23,41 +23,44 @@ class ChuniNew(ChuniBase):
self.version = ChuniConstants.VER_CHUNITHM_NEW
def handle_get_game_setting_api_request(self, data: Dict) -> Dict:
+ # use UTC time and convert it to JST time by adding +9
+ # matching therefore starts one hour before and lasts for 8 hours
match_start = datetime.strftime(
- datetime.now() - timedelta(hours=10), self.date_time_format
+ datetime.utcnow() + timedelta(hours=8), self.date_time_format
)
match_end = datetime.strftime(
- datetime.now() + timedelta(hours=10), self.date_time_format
+ datetime.utcnow() + timedelta(hours=16), self.date_time_format
)
reboot_start = datetime.strftime(
- datetime.now() - timedelta(hours=11), self.date_time_format
+ datetime.utcnow() + timedelta(hours=6), self.date_time_format
)
reboot_end = datetime.strftime(
- datetime.now() - timedelta(hours=10), self.date_time_format
+ datetime.utcnow() + timedelta(hours=7), self.date_time_format
)
return {
"gameSetting": {
- "isMaintenance": "false",
+ "isMaintenance": False,
"requestInterval": 10,
"rebootStartTime": reboot_start,
"rebootEndTime": reboot_end,
- "isBackgroundDistribute": "false",
+ "isBackgroundDistribute": False,
"maxCountCharacter": 300,
"maxCountItem": 300,
"maxCountMusic": 300,
"matchStartTime": match_start,
"matchEndTime": match_end,
- "matchTimeLimit": 99,
+ "matchTimeLimit": 60,
"matchErrorLimit": 9999,
"romVersion": self.game_cfg.version.version(self.version)["rom"],
"dataVersion": self.game_cfg.version.version(self.version)["data"],
"matchingUri": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/",
"matchingUriX": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/",
+ # might be really important for online battle to connect the cabs via UDP port 50201
"udpHolePunchUri": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/",
"reflectorUri": f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/200/ChuniServlet/",
},
- "isDumpUpload": "false",
- "isAou": "false",
+ "isDumpUpload": False,
+ "isAou": False,
}
def handle_remove_token_api_request(self, data: Dict) -> Dict:
@@ -468,3 +471,162 @@ class ChuniNew(ChuniBase):
self.data.item.put_user_print_state(user_id, id=order_id, hasCompleted=True)
return {"returnCode": "1", "apiName": "CMUpsertUserPrintCancelApi"}
+
+ def handle_ping_request(self, data: Dict) -> Dict:
+ # matchmaking ping request
+ return {"returnCode": "1"}
+
+ def handle_begin_matching_api_request(self, data: Dict) -> Dict:
+ room_id = 1
+ # check if there is a free matching room
+ matching_room = self.data.item.get_oldest_free_matching(self.version)
+
+ if matching_room is None:
+ # grab the latest roomId and add 1 for the new room
+ newest_matching = self.data.item.get_newest_matching(self.version)
+ if newest_matching is not None:
+ room_id = newest_matching["roomId"] + 1
+
+ # fix userName WTF8
+ new_member = data["matchingMemberInfo"]
+ new_member["userName"] = self.read_wtf8(new_member["userName"])
+
+ # create the new room with room_id and the current user id (host)
+ # user id is required for the countdown later on
+ self.data.item.put_matching(
+ self.version, room_id, [new_member], user_id=new_member["userId"]
+ )
+
+ # get the newly created matching room
+ matching_room = self.data.item.get_matching(self.version, room_id)
+ else:
+ # a room already exists, so just add the new member to it
+ matching_member_list = matching_room["matchingMemberInfoList"]
+ # fix userName WTF8
+ new_member = data["matchingMemberInfo"]
+ new_member["userName"] = self.read_wtf8(new_member["userName"])
+ matching_member_list.append(new_member)
+
+ # add the updated room to the database, make sure to set isFull correctly!
+ self.data.item.put_matching(
+ self.version,
+ matching_room["roomId"],
+ matching_member_list,
+ user_id=matching_room["user"],
+ is_full=True if len(matching_member_list) >= 4 else False,
+ )
+
+ matching_wait = {
+ "isFinish": False,
+ "restMSec": matching_room["restMSec"], # in sec
+ "pollingInterval": 1, # in sec
+ "matchingMemberInfoList": matching_room["matchingMemberInfoList"],
+ }
+
+ return {"roomId": 1, "matchingWaitState": matching_wait}
+
+ def handle_end_matching_api_request(self, data: Dict) -> Dict:
+ matching_room = self.data.item.get_matching(self.version, data["roomId"])
+ members = matching_room["matchingMemberInfoList"]
+
+ # only set the host user to role 1 every other to 0?
+ role_list = [
+ {"role": 1} if m["userId"] == matching_room["user"] else {"role": 0}
+ for m in members
+ ]
+
+ self.data.item.put_matching(
+ self.version,
+ matching_room["roomId"],
+ members,
+ user_id=matching_room["user"],
+ rest_sec=0, # make sure to always set 0
+ is_full=True, # and full, so no one can join
+ )
+
+ return {
+ "matchingResult": 1, # needs to be 1 for successful matching
+ "matchingMemberInfoList": members,
+ # no idea, maybe to differentiate between CPUs and real players?
+ "matchingMemberRoleList": role_list,
+ # TCP/UDP connection?
+ "reflectorUri": f"{self.core_cfg.title.hostname}",
+ }
+
+ def handle_remove_matching_member_api_request(self, data: Dict) -> Dict:
+ # get all matching rooms, because Chuni only returns the userId
+ # not the actual roomId
+ matching_rooms = self.data.item.get_all_matchings(self.version)
+ if matching_rooms is None:
+ return {"returnCode": "1"}
+
+ for room in matching_rooms:
+ old_members = room["matchingMemberInfoList"]
+ new_members = [m for m in old_members if m["userId"] != data["userId"]]
+
+ # if nothing changed go to the next room
+ if len(old_members) == len(new_members):
+ continue
+
+ # if the last user got removed, delete the matching room
+ if len(new_members) <= 0:
+ self.data.item.delete_matching(self.version, room["roomId"])
+ else:
+ # remove the user from the room
+ self.data.item.put_matching(
+ self.version,
+ room["roomId"],
+ new_members,
+ user_id=room["user"],
+ rest_sec=room["restMSec"],
+ )
+
+ return {"returnCode": "1"}
+
+ def handle_get_matching_state_api_request(self, data: Dict) -> Dict:
+ polling_interval = 1
+ # get the current active room
+ matching_room = self.data.item.get_matching(self.version, data["roomId"])
+ members = matching_room["matchingMemberInfoList"]
+ rest_sec = matching_room["restMSec"]
+
+ # grab the current member
+ current_member = data["matchingMemberInfo"]
+
+ # only the host user can decrease the countdown
+ if matching_room["user"] == int(current_member["userId"]):
+ # cap the restMSec to 0
+ if rest_sec > 0:
+ rest_sec -= polling_interval
+ else:
+ rest_sec = 0
+
+ # update the members in order to recieve messages
+ for i, member in enumerate(members):
+ if member["userId"] == current_member["userId"]:
+ # replace the old user data with the current user data,
+ # also parse WTF-8 everytime
+ current_member["userName"] = self.read_wtf8(current_member["userName"])
+ members[i] = current_member
+
+ self.data.item.put_matching(
+ self.version,
+ data["roomId"],
+ members,
+ rest_sec=rest_sec,
+ user_id=matching_room["user"],
+ )
+
+ # only add the other members to the list
+ diff_members = [m for m in members if m["userId"] != current_member["userId"]]
+
+ matching_wait = {
+ # makes no difference? Always use False?
+ "isFinish": True if rest_sec == 0 else False,
+ "restMSec": rest_sec,
+ "pollingInterval": polling_interval,
+ # the current user needs to be the first one?
+ "matchingMemberInfoList": [current_member] + diff_members,
+ }
+
+ return {"matchingWaitState": matching_wait}
diff --git a/titles/chuni/newplus.py b/titles/chuni/newplus.py
index 4faf47a..bbe1419 100644
--- a/titles/chuni/newplus.py
+++ b/titles/chuni/newplus.py
@@ -36,6 +36,6 @@ class ChuniNewPlus(ChuniNew):
def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict:
user_data = super().handle_cm_get_user_preview_api_request(data)
- # hardcode lastDataVersion for CardMaker 1.35
+ # hardcode lastDataVersion for CardMaker 1.35 A028
user_data["lastDataVersion"] = "2.05.00"
return user_data
diff --git a/titles/chuni/schema/item.py b/titles/chuni/schema/item.py
index 4ffcf93..47ff633 100644
--- a/titles/chuni/schema/item.py
+++ b/titles/chuni/schema/item.py
@@ -1,5 +1,12 @@
from typing import Dict, List, Optional
-from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_
+from sqlalchemy import (
+ Table,
+ Column,
+ UniqueConstraint,
+ PrimaryKeyConstraint,
+ and_,
+ delete,
+)
from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON
from sqlalchemy.engine.base import Connection
from sqlalchemy.schema import ForeignKey
@@ -203,8 +210,141 @@ login_bonus = Table(
mysql_charset="utf8mb4",
)
+favorite = Table(
+ "chuni_item_favorite",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("version", Integer, nullable=False),
+ Column("favId", Integer, nullable=False),
+ Column("favKind", Integer, nullable=False, server_default="1"),
+ UniqueConstraint("version", "user", "favId", name="chuni_item_favorite_uk"),
+ mysql_charset="utf8mb4",
+)
+
+matching = Table(
+ "chuni_item_matching",
+ metadata,
+ Column("roomId", Integer, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("version", Integer, nullable=False),
+ Column("restMSec", Integer, nullable=False, server_default="60"),
+ Column("isFull", Boolean, nullable=False, server_default="0"),
+ PrimaryKeyConstraint("roomId", "version", name="chuni_item_matching_pk"),
+ Column("matchingMemberInfoList", JSON, nullable=False),
+ mysql_charset="utf8mb4",
+)
+
class ChuniItemData(BaseData):
+ def get_oldest_free_matching(self, version: int) -> Optional[Row]:
+ sql = matching.select(
+ and_(
+ matching.c.version == version,
+ matching.c.isFull == False
+ )
+ ).order_by(matching.c.roomId.asc())
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_newest_matching(self, version: int) -> Optional[Row]:
+ sql = matching.select(
+ and_(
+ matching.c.version == version
+ )
+ ).order_by(matching.c.roomId.desc())
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_all_matchings(self, version: int) -> Optional[List[Row]]:
+ sql = matching.select(
+ and_(
+ matching.c.version == version
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
+ def get_matching(self, version: int, room_id: int) -> Optional[Row]:
+ sql = matching.select(
+ and_(matching.c.version == version, matching.c.roomId == room_id)
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def put_matching(
+ self,
+ version: int,
+ room_id: int,
+ matching_member_info_list: List,
+ user_id: int = None,
+ rest_sec: int = 60,
+ is_full: bool = False
+ ) -> Optional[int]:
+ sql = insert(matching).values(
+ roomId=room_id,
+ version=version,
+ restMSec=rest_sec,
+ user=user_id,
+ isFull=is_full,
+ matchingMemberInfoList=matching_member_info_list,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ restMSec=rest_sec, matchingMemberInfoList=matching_member_info_list
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def delete_matching(self, version: int, room_id: int):
+ sql = delete(matching).where(
+ and_(matching.c.roomId == room_id, matching.c.version == version)
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def get_all_favorites(
+ self, user_id: int, version: int, fav_kind: int = 1
+ ) -> Optional[List[Row]]:
+ sql = favorite.select(
+ and_(
+ favorite.c.version == version,
+ favorite.c.user == user_id,
+ favorite.c.favKind == fav_kind,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
def put_login_bonus(
self, user_id: int, version: int, preset_id: int, **login_bonus_data
) -> Optional[int]:
diff --git a/titles/chuni/schema/profile.py b/titles/chuni/schema/profile.py
index e35769c..f8edc33 100644
--- a/titles/chuni/schema/profile.py
+++ b/titles/chuni/schema/profile.py
@@ -89,8 +89,6 @@ profile = Table(
Integer,
ForeignKey("chuni_profile_team.id", ondelete="SET NULL", onupdate="SET NULL"),
),
- Column("avatarBack", Integer, server_default="0"),
- Column("avatarFace", Integer, server_default="0"),
Column("eliteRankPoint", Integer, server_default="0"),
Column("stockedGridCount", Integer, server_default="0"),
Column("netBattleLoseCount", Integer, server_default="0"),
@@ -98,10 +96,8 @@ profile = Table(
Column("netBattle4thCount", Integer, server_default="0"),
Column("overPowerRate", Integer, server_default="0"),
Column("battleRewardStatus", Integer, server_default="0"),
- Column("avatarPoint", Integer, server_default="0"),
Column("netBattle1stCount", Integer, server_default="0"),
Column("charaIllustId", Integer, server_default="0"),
- Column("avatarItem", Integer, server_default="0"),
Column("userNameEx", String(8), server_default=""),
Column("netBattleWinCount", Integer, server_default="0"),
Column("netBattleCorrection", Integer, server_default="0"),
@@ -112,7 +108,6 @@ profile = Table(
Column("netBattle3rdCount", Integer, server_default="0"),
Column("netBattleConsecutiveWinCount", Integer, server_default="0"),
Column("overPowerLowerRank", Integer, server_default="0"),
- Column("avatarWear", Integer, server_default="0"),
Column("classEmblemBase", Integer, server_default="0"),
Column("battleRankPoint", Integer, server_default="0"),
Column("netBattle2ndCount", Integer, server_default="0"),
@@ -120,13 +115,19 @@ profile = Table(
Column("skillId", Integer, server_default="0"),
Column("lastCountryCode", String(5), server_default="JPN"),
Column("isNetBattleHost", Boolean, server_default="0"),
- Column("avatarFront", Integer, server_default="0"),
- Column("avatarSkin", Integer, server_default="0"),
Column("battleRewardCount", Integer, server_default="0"),
Column("battleRewardIndex", Integer, server_default="0"),
Column("netBattlePlayCount", Integer, server_default="0"),
Column("exMapLoopCount", Integer, server_default="0"),
Column("netBattleEndState", Integer, server_default="0"),
+ Column("rankUpChallengeResults", JSON),
+ Column("avatarBack", Integer, server_default="0"),
+ Column("avatarFace", Integer, server_default="0"),
+ Column("avatarPoint", Integer, server_default="0"),
+ Column("avatarItem", Integer, server_default="0"),
+ Column("avatarWear", Integer, server_default="0"),
+ Column("avatarFront", Integer, server_default="0"),
+ Column("avatarSkin", Integer, server_default="0"),
Column("avatarHead", Integer, server_default="0"),
UniqueConstraint("user", "version", name="chuni_profile_profile_uk"),
mysql_charset="utf8mb4",
@@ -417,8 +418,8 @@ class ChuniProfileData(BaseData):
sql = (
select([profile, option])
.join(option, profile.c.user == option.c.user)
- .filter(and_(profile.c.user == aime_id, profile.c.version == version))
- )
+ .filter(and_(profile.c.user == aime_id, profile.c.version <= version))
+ ).order_by(profile.c.version.desc())
result = self.execute(sql)
if result is None:
@@ -429,9 +430,9 @@ class ChuniProfileData(BaseData):
sql = select(profile).where(
and_(
profile.c.user == aime_id,
- profile.c.version == version,
+ profile.c.version <= version,
)
- )
+ ).order_by(profile.c.version.desc())
result = self.execute(sql)
if result is None:
@@ -461,9 +462,9 @@ class ChuniProfileData(BaseData):
sql = select(profile_ex).where(
and_(
profile_ex.c.user == aime_id,
- profile_ex.c.version == version,
+ profile_ex.c.version <= version,
)
- )
+ ).order_by(profile_ex.c.version.desc())
result = self.execute(sql)
if result is None:
diff --git a/titles/chuni/schema/score.py b/titles/chuni/schema/score.py
index 6a94813..203aa11 100644
--- a/titles/chuni/schema/score.py
+++ b/titles/chuni/schema/score.py
@@ -134,7 +134,9 @@ playlog = Table(
Column("charaIllustId", Integer),
Column("romVersion", String(255)),
Column("judgeHeaven", Integer),
- mysql_charset="utf8mb4",
+ Column("regionId", Integer),
+ Column("machineType", Integer),
+ mysql_charset="utf8mb4"
)
diff --git a/titles/chuni/schema/static.py b/titles/chuni/schema/static.py
index 4537518..85d0397 100644
--- a/titles/chuni/schema/static.py
+++ b/titles/chuni/schema/static.py
@@ -1,11 +1,19 @@
from typing import Dict, List, Optional
-from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_
+from sqlalchemy import (
+ ForeignKeyConstraint,
+ Table,
+ Column,
+ UniqueConstraint,
+ PrimaryKeyConstraint,
+ and_,
+)
from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON, Float
from sqlalchemy.engine.base import Connection
from sqlalchemy.engine import Row
from sqlalchemy.schema import ForeignKey
from sqlalchemy.sql import func, select
from sqlalchemy.dialects.mysql import insert
+from datetime import datetime
from core.data.schema import BaseData, metadata
@@ -17,6 +25,7 @@ events = Table(
Column("eventId", Integer),
Column("type", Integer),
Column("name", String(255)),
+ Column("startDate", TIMESTAMP, server_default=func.now()),
Column("enabled", Boolean, server_default="1"),
UniqueConstraint("version", "eventId", name="chuni_static_events_uk"),
mysql_charset="utf8mb4",
@@ -125,11 +134,13 @@ gacha_cards = Table(
login_bonus_preset = Table(
"chuni_static_login_bonus_preset",
metadata,
- Column("id", Integer, primary_key=True, nullable=False),
+ Column("presetId", Integer, nullable=False),
Column("version", Integer, nullable=False),
Column("presetName", String(255), nullable=False),
Column("isEnabled", Boolean, server_default="1"),
- UniqueConstraint("version", "id", name="chuni_static_login_bonus_preset_uk"),
+ PrimaryKeyConstraint(
+ "presetId", "version", name="chuni_static_login_bonus_preset_pk"
+ ),
mysql_charset="utf8mb4",
)
@@ -138,15 +149,7 @@ login_bonus = Table(
metadata,
Column("id", Integer, primary_key=True, nullable=False),
Column("version", Integer, nullable=False),
- Column(
- "presetId",
- ForeignKey(
- "chuni_static_login_bonus_preset.id",
- ondelete="cascade",
- onupdate="cascade",
- ),
- nullable=False,
- ),
+ Column("presetId", Integer, nullable=False),
Column("loginBonusId", Integer, nullable=False),
Column("loginBonusName", String(255), nullable=False),
Column("presentId", Integer, nullable=False),
@@ -157,6 +160,16 @@ login_bonus = Table(
UniqueConstraint(
"version", "presetId", "loginBonusId", name="chuni_static_login_bonus_uk"
),
+ ForeignKeyConstraint(
+ ["presetId", "version"],
+ [
+ "chuni_static_login_bonus_preset.presetId",
+ "chuni_static_login_bonus_preset.version",
+ ],
+ onupdate="CASCADE",
+ ondelete="CASCADE",
+ name="chuni_static_login_bonus_ibfk_1",
+ ),
mysql_charset="utf8mb4",
)
@@ -236,7 +249,7 @@ class ChuniStaticData(BaseData):
self, version: int, preset_id: int, preset_name: str, is_enabled: bool
) -> Optional[int]:
sql = insert(login_bonus_preset).values(
- id=preset_id,
+ presetId=preset_id,
version=version,
presetName=preset_name,
isEnabled=is_enabled,
@@ -416,6 +429,14 @@ class ChuniStaticData(BaseData):
return None
return result.fetchall()
+ def get_music(self, version: int) -> Optional[List[Row]]:
+ sql = music.select(music.c.version <= version)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
def get_music_chart(
self, version: int, song_id: int, chart_id: int
) -> Optional[List[Row]]:
diff --git a/titles/chuni/sun.py b/titles/chuni/sun.py
new file mode 100644
index 0000000..b56fa29
--- /dev/null
+++ b/titles/chuni/sun.py
@@ -0,0 +1,37 @@
+from typing import Dict, Any
+
+from core.config import CoreConfig
+from titles.chuni.newplus import ChuniNewPlus
+from titles.chuni.const import ChuniConstants
+from titles.chuni.config import ChuniConfig
+
+
+class ChuniSun(ChuniNewPlus):
+ def __init__(self, core_cfg: CoreConfig, game_cfg: ChuniConfig) -> None:
+ super().__init__(core_cfg, game_cfg)
+ self.version = ChuniConstants.VER_CHUNITHM_SUN
+
+ def handle_get_game_setting_api_request(self, data: Dict) -> Dict:
+ ret = super().handle_get_game_setting_api_request(data)
+ ret["gameSetting"]["romVersion"] = self.game_cfg.version.version(self.version)["rom"]
+ ret["gameSetting"]["dataVersion"] = self.game_cfg.version.version(self.version)["data"]
+ ret["gameSetting"][
+ "matchingUri"
+ ] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
+ ret["gameSetting"][
+ "matchingUriX"
+ ] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
+ ret["gameSetting"][
+ "udpHolePunchUri"
+ ] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
+ ret["gameSetting"][
+ "reflectorUri"
+ ] = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}/SDHD/210/ChuniServlet/"
+ return ret
+
+ def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict:
+ user_data = super().handle_cm_get_user_preview_api_request(data)
+
+ # hardcode lastDataVersion for CardMaker 1.35 A032
+ user_data["lastDataVersion"] = "2.10.00"
+ return user_data
diff --git a/titles/cm/base.py b/titles/cm/base.py
index ff38489..dae6ecb 100644
--- a/titles/cm/base.py
+++ b/titles/cm/base.py
@@ -23,19 +23,40 @@ class CardMakerBase:
self.game = CardMakerConstants.GAME_CODE
self.version = CardMakerConstants.VER_CARD_MAKER
+ @staticmethod
+ def _parse_int_ver(version: str) -> str:
+ return version.replace(".", "")[:3]
+
def handle_get_game_connect_api_request(self, data: Dict) -> Dict:
if self.core_cfg.server.is_develop:
uri = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}"
else:
uri = f"http://{self.core_cfg.title.hostname}"
- # CHUNITHM = 0, maimai = 1, ONGEKI = 2
+ # grab the dict with all games version numbers from user config
+ games_ver = self.game_cfg.version.version(self.version)
+
return {
"length": 3,
"gameConnectList": [
- {"modelKind": 0, "type": 1, "titleUri": f"{uri}/SDHD/200/"},
- {"modelKind": 1, "type": 1, "titleUri": f"{uri}/SDEZ/120/"},
- {"modelKind": 2, "type": 1, "titleUri": f"{uri}/SDDT/130/"},
+ # CHUNITHM
+ {
+ "modelKind": 0,
+ "type": 1,
+ "titleUri": f"{uri}/SDHD/{self._parse_int_ver(games_ver['chuni'])}/",
+ },
+ # maimai DX
+ {
+ "modelKind": 1,
+ "type": 1,
+ "titleUri": f"{uri}/SDEZ/{self._parse_int_ver(games_ver['maimai'])}/",
+ },
+ # ONGEKI
+ {
+ "modelKind": 2,
+ "type": 1,
+ "titleUri": f"{uri}/SDDT/{self._parse_int_ver(games_ver['ongeki'])}/",
+ },
],
}
@@ -47,12 +68,15 @@ class CardMakerBase:
datetime.now() + timedelta(hours=4), self.date_time_format
)
+ # grab the dict with all games version numbers from user config
+ games_ver = self.game_cfg.version.version(self.version)
+
return {
"gameSetting": {
"dataVersion": "1.30.00",
- "ongekiCmVersion": "1.30.01",
- "chuniCmVersion": "2.00.00",
- "maimaiCmVersion": "1.20.00",
+ "ongekiCmVersion": games_ver["ongeki"],
+ "chuniCmVersion": games_ver["chuni"],
+ "maimaiCmVersion": games_ver["maimai"],
"requestInterval": 10,
"rebootStartTime": reboot_start,
"rebootEndTime": reboot_end,
diff --git a/titles/cm/cm135.py b/titles/cm/cm135.py
index 782f07a..e134974 100644
--- a/titles/cm/cm135.py
+++ b/titles/cm/cm135.py
@@ -1,8 +1,4 @@
-from datetime import date, datetime, timedelta
-from typing import Any, Dict, List
-import json
-import logging
-from enum import Enum
+from typing import Dict
from core.config import CoreConfig
from core.data.cache import cached
@@ -16,23 +12,7 @@ class CardMaker135(CardMakerBase):
super().__init__(core_cfg, game_cfg)
self.version = CardMakerConstants.VER_CARD_MAKER_135
- def handle_get_game_connect_api_request(self, data: Dict) -> Dict:
- ret = super().handle_get_game_connect_api_request(data)
- if self.core_cfg.server.is_develop:
- uri = f"http://{self.core_cfg.title.hostname}:{self.core_cfg.title.port}"
- else:
- uri = f"http://{self.core_cfg.title.hostname}"
-
- ret["gameConnectList"][0]["titleUri"] = f"{uri}/SDHD/205/"
- ret["gameConnectList"][1]["titleUri"] = f"{uri}/SDEZ/125/"
- ret["gameConnectList"][2]["titleUri"] = f"{uri}/SDDT/135/"
-
- return ret
-
def handle_get_game_setting_api_request(self, data: Dict) -> Dict:
ret = super().handle_get_game_setting_api_request(data)
ret["gameSetting"]["dataVersion"] = "1.35.00"
- ret["gameSetting"]["ongekiCmVersion"] = "1.35.03"
- ret["gameSetting"]["chuniCmVersion"] = "2.05.00"
- ret["gameSetting"]["maimaiCmVersion"] = "1.25.00"
return ret
diff --git a/titles/cm/config.py b/titles/cm/config.py
index ea96ca1..8bb23ec 100644
--- a/titles/cm/config.py
+++ b/titles/cm/config.py
@@ -1,3 +1,4 @@
+from typing import Dict
from core.config import CoreConfig
@@ -20,6 +21,21 @@ class CardMakerServerConfig:
)
+class CardMakerVersionConfig:
+ def __init__(self, parent_config: "CardMakerConfig") -> None:
+ self.__config = parent_config
+
+ def version(self, version: int) -> Dict:
+ """
+ in the form of:
+ 1: {"ongeki": 1.30.01, "chuni": 2.00.00, "maimai": 1.20.00}
+ """
+ return CoreConfig.get_config_field(
+ self.__config, "cardmaker", "version", default={}
+ )[version]
+
+
class CardMakerConfig(dict):
def __init__(self) -> None:
self.server = CardMakerServerConfig(self)
+ self.version = CardMakerVersionConfig(self)
diff --git a/titles/cm/const.py b/titles/cm/const.py
index 09f289e..5bb6d1f 100644
--- a/titles/cm/const.py
+++ b/titles/cm/const.py
@@ -6,7 +6,7 @@ class CardMakerConstants:
VER_CARD_MAKER = 0
VER_CARD_MAKER_135 = 1
- VERSION_NAMES = ("Card Maker 1.34", "Card Maker 1.35")
+ VERSION_NAMES = ("Card Maker 1.30", "Card Maker 1.35")
@classmethod
def game_ver_to_string(cls, ver: int):
diff --git a/titles/cm/index.py b/titles/cm/index.py
index 74d3a0d..348ec4f 100644
--- a/titles/cm/index.py
+++ b/titles/cm/index.py
@@ -30,7 +30,7 @@ class CardMakerServlet:
self.versions = [
CardMakerBase(core_cfg, self.game_cfg),
- CardMaker135(core_cfg, self.game_cfg),
+ CardMaker135(core_cfg, self.game_cfg)
]
self.logger = logging.getLogger("cardmaker")
@@ -89,7 +89,7 @@ class CardMakerServlet:
if version >= 130 and version < 135: # Card Maker
internal_ver = CardMakerConstants.VER_CARD_MAKER
- elif version >= 135 and version < 136: # Card Maker 1.35
+ elif version >= 135 and version < 140: # Card Maker 1.35
internal_ver = CardMakerConstants.VER_CARD_MAKER_135
if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32:
@@ -129,6 +129,6 @@ class CardMakerServlet:
if resp is None:
resp = {"returnCode": 1}
- self.logger.info(f"Response {resp}")
+ self.logger.debug(f"Response {resp}")
return zlib.compress(json.dumps(resp, ensure_ascii=False).encode("utf-8"))
diff --git a/titles/cm/read.py b/titles/cm/read.py
index 109483c..a26f35e 100644
--- a/titles/cm/read.py
+++ b/titles/cm/read.py
@@ -89,8 +89,7 @@ class CardMakerReader(BaseReader):
version_ids = {
"v2_00": ChuniConstants.VER_CHUNITHM_NEW,
"v2_05": ChuniConstants.VER_CHUNITHM_NEW_PLUS,
- # Chunithm SUN, ignore for now
- "v2_10": ChuniConstants.VER_CHUNITHM_NEW_PLUS + 1,
+ "v2_10": ChuniConstants.VER_CHUNITHM_SUN,
}
for root, dirs, files in os.walk(base_dir):
@@ -138,8 +137,7 @@ class CardMakerReader(BaseReader):
version_ids = {
"v2_00": ChuniConstants.VER_CHUNITHM_NEW,
"v2_05": ChuniConstants.VER_CHUNITHM_NEW_PLUS,
- # Chunithm SUN, ignore for now
- "v2_10": ChuniConstants.VER_CHUNITHM_NEW_PLUS + 1,
+ "v2_10": ChuniConstants.VER_CHUNITHM_SUN,
}
for root, dirs, files in os.walk(base_dir):
@@ -226,6 +224,12 @@ class CardMakerReader(BaseReader):
True if troot.find("disable").text == "false" else False
)
+ # check if a date is part of the name and disable the
+ # card if it is
+ enabled = (
+ False if re.search(r"\d{2}/\d{2}/\d{2}", name) else enabled
+ )
+
self.mai2_data.static.put_card(
version, card_id, name, enabled=enabled
)
diff --git a/titles/cxb/base.py b/titles/cxb/base.py
index 6b6a5d5..89e9cc3 100644
--- a/titles/cxb/base.py
+++ b/titles/cxb/base.py
@@ -2,7 +2,7 @@ import logging
import json
from decimal import Decimal
from base64 import b64encode
-from typing import Any, Dict
+from typing import Any, Dict, List
from hashlib import md5
from datetime import datetime
@@ -11,6 +11,7 @@ from titles.cxb.config import CxbConfig
from titles.cxb.const import CxbConstants
from titles.cxb.database import CxbData
+from threading import Thread
class CxbBase:
def __init__(self, cfg: CoreConfig, game_cfg: CxbConfig) -> None:
@@ -54,6 +55,151 @@ class CxbBase:
self.logger.warn(f"User {data['login']['authid']} does not have a profile")
return {}
+ def task_generateCoupon(index, data1):
+ # Coupons
+ for i in range(500, 510):
+ index.append(str(i))
+ couponid = int(i) - 500
+ dataValue = [
+ {
+ "couponId": str(couponid),
+ "couponNum": "1",
+ "couponLog": [],
+ }
+ ]
+ data1.append(
+ b64encode(
+ bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
+ ).decode("utf-8")
+ )
+
+ def task_generateShopListTitle(index, data1):
+ # ShopList_Title
+ for i in range(200000, 201451):
+ index.append(str(i))
+ shopid = int(i) - 200000
+ dataValue = [
+ {
+ "shopId": shopid,
+ "shopState": "2",
+ "isDisable": "t",
+ "isDeleted": "f",
+ "isSpecialFlag": "f",
+ }
+ ]
+ data1.append(
+ b64encode(
+ bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
+ ).decode("utf-8")
+ )
+
+ def task_generateShopListIcon(index, data1):
+ # ShopList_Icon
+ for i in range(202000, 202264):
+ index.append(str(i))
+ shopid = int(i) - 200000
+ dataValue = [
+ {
+ "shopId": shopid,
+ "shopState": "2",
+ "isDisable": "t",
+ "isDeleted": "f",
+ "isSpecialFlag": "f",
+ }
+ ]
+ data1.append(
+ b64encode(
+ bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
+ ).decode("utf-8")
+ )
+
+ def task_generateStories(index, data1):
+ # Stories
+ for i in range(900000, 900003):
+ index.append(str(i))
+ storyid = int(i) - 900000
+ dataValue = [
+ {
+ "storyId": storyid,
+ "unlockState1": ["t"] * 10,
+ "unlockState2": ["t"] * 10,
+ "unlockState3": ["t"] * 10,
+ "unlockState4": ["t"] * 10,
+ "unlockState5": ["t"] * 10,
+ "unlockState6": ["t"] * 10,
+ "unlockState7": ["t"] * 10,
+ "unlockState8": ["t"] * 10,
+ "unlockState9": ["t"] * 10,
+ "unlockState10": ["t"] * 10,
+ "unlockState11": ["t"] * 10,
+ "unlockState12": ["t"] * 10,
+ "unlockState13": ["t"] * 10,
+ "unlockState14": ["t"] * 10,
+ "unlockState15": ["t"] * 10,
+ "unlockState16": ["t"] * 10,
+ }
+ ]
+ data1.append(
+ b64encode(
+ bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
+ ).decode("utf-8")
+ )
+
+ def task_generateScoreData(song, index, data1):
+ song_data = song["data"]
+ songCode = []
+
+ songCode.append(
+ {
+ "mcode": song_data["mcode"],
+ "musicState": song_data["musicState"],
+ "playCount": song_data["playCount"],
+ "totalScore": song_data["totalScore"],
+ "highScore": song_data["highScore"],
+ "everHighScore": song_data["everHighScore"]
+ if "everHighScore" in song_data
+ else ["0", "0", "0", "0", "0"],
+ "clearRate": song_data["clearRate"],
+ "rankPoint": song_data["rankPoint"],
+ "normalCR": song_data["normalCR"]
+ if "normalCR" in song_data
+ else ["0", "0", "0", "0", "0"],
+ "survivalCR": song_data["survivalCR"]
+ if "survivalCR" in song_data
+ else ["0", "0", "0", "0", "0"],
+ "ultimateCR": song_data["ultimateCR"]
+ if "ultimateCR" in song_data
+ else ["0", "0", "0", "0", "0"],
+ "nohopeCR": song_data["nohopeCR"]
+ if "nohopeCR" in song_data
+ else ["0", "0", "0", "0", "0"],
+ "combo": song_data["combo"],
+ "coupleUserId": song_data["coupleUserId"],
+ "difficulty": song_data["difficulty"],
+ "isFullCombo": song_data["isFullCombo"],
+ "clearGaugeType": song_data["clearGaugeType"],
+ "fieldType": song_data["fieldType"],
+ "gameType": song_data["gameType"],
+ "grade": song_data["grade"],
+ "unlockState": song_data["unlockState"],
+ "extraState": song_data["extraState"],
+ }
+ )
+ index.append(song_data["index"])
+ data1.append(
+ b64encode(
+ bytes(json.dumps(songCode[0], separators=(",", ":")), "utf-8")
+ ).decode("utf-8")
+ )
+
+ def task_generateIndexData(versionindex):
+ try:
+ v_profile = self.data.profile.get_profile_index(0, uid, self.version)
+ v_profile_data = v_profile["data"]
+ versionindex.append(int(v_profile_data["appVersion"]))
+ except Exception:
+ versionindex.append("10400")
+
def handle_action_loadrange_request(self, data: Dict) -> Dict:
range_start = data["loadrange"]["range"][0]
range_end = data["loadrange"]["range"][1]
@@ -107,146 +253,29 @@ class CxbBase:
900000 = Stories
"""
- # Coupons
- for i in range(500, 510):
- index.append(str(i))
- couponid = int(i) - 500
- dataValue = [
- {
- "couponId": str(couponid),
- "couponNum": "1",
- "couponLog": [],
- }
- ]
- data1.append(
- b64encode(
- bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
- ).decode("utf-8")
- )
+ # Async threads to generate the response
+ thread_Coupon = Thread(target=CxbBase.task_generateCoupon(index, data1))
+ thread_ShopListTitle = Thread(target=CxbBase.task_generateShopListTitle(index, data1))
+ thread_ShopListIcon = Thread(target=CxbBase.task_generateShopListIcon(index, data1))
+ thread_Stories = Thread(target=CxbBase.task_generateStories(index, data1))
- # ShopList_Title
- for i in range(200000, 201451):
- index.append(str(i))
- shopid = int(i) - 200000
- dataValue = [
- {
- "shopId": shopid,
- "shopState": "2",
- "isDisable": "t",
- "isDeleted": "f",
- "isSpecialFlag": "f",
- }
- ]
- data1.append(
- b64encode(
- bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
- ).decode("utf-8")
- )
+ thread_Coupon.start()
+ thread_ShopListTitle.start()
+ thread_ShopListIcon.start()
+ thread_Stories.start()
- # ShopList_Icon
- for i in range(202000, 202264):
- index.append(str(i))
- shopid = int(i) - 200000
- dataValue = [
- {
- "shopId": shopid,
- "shopState": "2",
- "isDisable": "t",
- "isDeleted": "f",
- "isSpecialFlag": "f",
- }
- ]
- data1.append(
- b64encode(
- bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
- ).decode("utf-8")
- )
-
- # Stories
- for i in range(900000, 900003):
- index.append(str(i))
- storyid = int(i) - 900000
- dataValue = [
- {
- "storyId": storyid,
- "unlockState1": ["t"] * 10,
- "unlockState2": ["t"] * 10,
- "unlockState3": ["t"] * 10,
- "unlockState4": ["t"] * 10,
- "unlockState5": ["t"] * 10,
- "unlockState6": ["t"] * 10,
- "unlockState7": ["t"] * 10,
- "unlockState8": ["t"] * 10,
- "unlockState9": ["t"] * 10,
- "unlockState10": ["t"] * 10,
- "unlockState11": ["t"] * 10,
- "unlockState12": ["t"] * 10,
- "unlockState13": ["t"] * 10,
- "unlockState14": ["t"] * 10,
- "unlockState15": ["t"] * 10,
- "unlockState16": ["t"] * 10,
- }
- ]
- data1.append(
- b64encode(
- bytes(json.dumps(dataValue[0], separators=(",", ":")), "utf-8")
- ).decode("utf-8")
- )
+ thread_Coupon.join()
+ thread_ShopListTitle.join()
+ thread_ShopListIcon.join()
+ thread_Stories.join()
for song in songs:
- song_data = song["data"]
- songCode = []
-
- songCode.append(
- {
- "mcode": song_data["mcode"],
- "musicState": song_data["musicState"],
- "playCount": song_data["playCount"],
- "totalScore": song_data["totalScore"],
- "highScore": song_data["highScore"],
- "everHighScore": song_data["everHighScore"]
- if "everHighScore" in song_data
- else ["0", "0", "0", "0", "0"],
- "clearRate": song_data["clearRate"],
- "rankPoint": song_data["rankPoint"],
- "normalCR": song_data["normalCR"]
- if "normalCR" in song_data
- else ["0", "0", "0", "0", "0"],
- "survivalCR": song_data["survivalCR"]
- if "survivalCR" in song_data
- else ["0", "0", "0", "0", "0"],
- "ultimateCR": song_data["ultimateCR"]
- if "ultimateCR" in song_data
- else ["0", "0", "0", "0", "0"],
- "nohopeCR": song_data["nohopeCR"]
- if "nohopeCR" in song_data
- else ["0", "0", "0", "0", "0"],
- "combo": song_data["combo"],
- "coupleUserId": song_data["coupleUserId"],
- "difficulty": song_data["difficulty"],
- "isFullCombo": song_data["isFullCombo"],
- "clearGaugeType": song_data["clearGaugeType"],
- "fieldType": song_data["fieldType"],
- "gameType": song_data["gameType"],
- "grade": song_data["grade"],
- "unlockState": song_data["unlockState"],
- "extraState": song_data["extraState"],
- }
- )
- index.append(song_data["index"])
- data1.append(
- b64encode(
- bytes(json.dumps(songCode[0], separators=(",", ":")), "utf-8")
- ).decode("utf-8")
- )
+ thread_ScoreData = Thread(target=CxbBase.task_generateScoreData(song, index, data1))
+ thread_ScoreData.start()
for v in index:
- try:
- v_profile = self.data.profile.get_profile_index(0, uid, self.version)
- v_profile_data = v_profile["data"]
- versionindex.append(int(v_profile_data["appVersion"]))
- except:
- versionindex.append("10400")
+ thread_IndexData = Thread(target=CxbBase.task_generateIndexData(versionindex))
+ thread_IndexData.start()
return {"index": index, "data": data1, "version": versionindex}
@@ -257,7 +286,7 @@ class CxbBase:
# REV Omnimix Version Fetcher
gameversion = data["saveindex"]["data"][0][2]
self.logger.warning(f"Game Version is {gameversion}")
- except:
+ except Exception:
pass
if "10205" in gameversion:
@@ -319,7 +348,7 @@ class CxbBase:
# Sunrise
try:
profileIndex = save_data["index"].index("0")
- except:
+ except Exception:
return {"data": ""} # Maybe
profile = json.loads(save_data["data"][profileIndex])
@@ -416,7 +445,7 @@ class CxbBase:
self.logger.info(f"Get best rankings for {uid}")
p = self.data.score.get_best_rankings(uid)
- rankList: list[Dict[str, Any]] = []
+ rankList: List[Dict[str, Any]] = []
for rank in p:
if rank["song_id"] is not None:
@@ -467,7 +496,7 @@ class CxbBase:
score=int(rid["sc"][0]),
clear=rid["clear"],
)
- except:
+ except Exception:
self.data.score.put_ranking(
user_id=uid,
rev_id=int(rid["rid"]),
@@ -485,7 +514,7 @@ class CxbBase:
score=int(rid["sc"][0]),
clear=0,
)
- except:
+ except Exception:
self.data.score.put_ranking(
user_id=uid,
rev_id=int(rid["rid"]),
@@ -544,4 +573,4 @@ class CxbBase:
def handle_action_stampreq_request(self, data: Dict) -> Dict:
self.logger.info(data)
- return {"stampreq": ""}
+ return {"stampreq": ""}
\ No newline at end of file
diff --git a/titles/cxb/index.py b/titles/cxb/index.py
index 0c38d55..0ef8667 100644
--- a/titles/cxb/index.py
+++ b/titles/cxb/index.py
@@ -103,7 +103,7 @@ class CxbServlet(resource.Resource):
else:
self.logger.info(f"Ready on port {self.game_cfg.server.port}")
- def render_POST(self, request: Request):
+ def render_POST(self, request: Request, version: int, endpoint: str):
version = 0
internal_ver = 0
func_to_find = ""
diff --git a/titles/cxb/read.py b/titles/cxb/read.py
index cf2d8e1..06a171f 100644
--- a/titles/cxb/read.py
+++ b/titles/cxb/read.py
@@ -123,5 +123,5 @@ class CxbReader(BaseReader):
genre,
int(row["easy"].replace("Easy ", "").replace("N/A", "0")),
)
- except:
+ except Exception:
self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
diff --git a/titles/diva/__init__.py b/titles/diva/__init__.py
index 3f193db..46ea090 100644
--- a/titles/diva/__init__.py
+++ b/titles/diva/__init__.py
@@ -7,4 +7,4 @@ index = DivaServlet
database = DivaData
reader = DivaReader
game_codes = [DivaConstants.GAME_CODE]
-current_schema_version = 4
+current_schema_version = 5
diff --git a/titles/diva/base.py b/titles/diva/base.py
index 9e58269..d7303e7 100644
--- a/titles/diva/base.py
+++ b/titles/diva/base.py
@@ -266,16 +266,17 @@ class DivaBase:
def handle_festa_info_request(self, data: Dict) -> Dict:
encoded = "&"
params = {
- "fi_id": "1,-1",
- "fi_name": f"{self.core_cfg.server.name} Opening,xxx",
- "fi_kind": "0,0",
+ "fi_id": "1,2",
+ "fi_name": f"{self.core_cfg.server.name} Opening,Project DIVA Festa",
+ # 0=PINK, 1=GREEN
+ "fi_kind": "1,0",
"fi_difficulty": "-1,-1",
"fi_pv_id_lst": "ALL,ALL",
"fi_attr": "7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
- "fi_add_vp": "20,0",
- "fi_mul_vp": "1,1",
- "fi_st": "2022-06-17 17:00:00.0,2014-07-08 18:10:11.0",
- "fi_et": "2029-01-01 10:00:00.0,2014-07-08 18:10:11.0",
+ "fi_add_vp": "20,5",
+ "fi_mul_vp": "1,2",
+ "fi_st": "2019-01-01 00:00:00.0,2019-01-01 00:00:00.0",
+ "fi_et": "2029-01-01 00:00:00.0,2029-01-01 00:00:00.0",
"fi_lut": "{self.time_lut}",
}
@@ -401,10 +402,10 @@ class DivaBase:
response += f"&lv_pnt={profile['lv_pnt']}"
response += f"&vcld_pts={profile['vcld_pts']}"
response += f"&skn_eqp={profile['use_pv_skn_eqp']}"
- response += f"&btn_se_eqp={profile['use_pv_btn_se_eqp']}"
- response += f"&sld_se_eqp={profile['use_pv_sld_se_eqp']}"
- response += f"&chn_sld_se_eqp={profile['use_pv_chn_sld_se_eqp']}"
- response += f"&sldr_tch_se_eqp={profile['use_pv_sldr_tch_se_eqp']}"
+ response += f"&btn_se_eqp={profile['btn_se_eqp']}"
+ response += f"&sld_se_eqp={profile['sld_se_eqp']}"
+ response += f"&chn_sld_se_eqp={profile['chn_sld_se_eqp']}"
+ response += f"&sldr_tch_se_eqp={profile['sldr_tch_se_eqp']}"
response += f"&passwd_stat={profile['passwd_stat']}"
# Store stuff to add to rework
@@ -478,6 +479,21 @@ class DivaBase:
response += f"&dsp_clr_sts={profile['dsp_clr_sts']}"
response += f"&rgo_sts={profile['rgo_sts']}"
+ # Contest progress
+ response += f"&cv_cid=-1,-1,-1,-1"
+ response += f"&cv_sc=-1,-1,-1,-1"
+ response += f"&cv_bv=-1,-1,-1,-1"
+ response += f"&cv_bv=-1,-1,-1,-1"
+ response += f"&cv_bf=-1,-1,-1,-1"
+
+ # Contest now playing id, return -1 if no current playing contest
+ response += f"&cnp_cid={profile['cnp_cid']}"
+ response += f"&cnp_val={profile['cnp_val']}"
+ # border can be 0=bronzem 1=silver, 2=gold
+ response += f"&cnp_rr={profile['cnp_rr']}"
+ # only show contest specifier if it is not empty
+ response += f"&cnp_sp={profile['cnp_sp']}" if profile["cnp_sp"] != "" else ""
+
# To be fully fixed
if "my_qst_id" not in profile:
response += f"&my_qst_id=-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
@@ -488,7 +504,63 @@ class DivaBase:
response += f"&my_qst_prgrs=0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1"
response += f"&my_qst_et=2022-06-19%2010%3A28%3A52.0,2022-06-19%2010%3A28%3A52.0,2022-06-19%2010%3A28%3A52.0,2100-01-01%2008%3A59%3A59.0,2100-01-01%2008%3A59%3A59.0,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx,xxx"
- response += f"&clr_sts=0,0,0,0,0,0,0,0,56,52,35,6,6,3,1,0,0,0,0,0"
+
+ # define a helper class to store all counts for clear, great,
+ # excellent and perfect
+ class ClearSet:
+ def __init__(self):
+ self.clear = 0
+ self.great = 0
+ self.excellent = 0
+ self.perfect = 0
+
+ # create a dict to store the ClearSets per difficulty
+ clear_set_dict = {
+ 0: ClearSet(), # easy
+ 1: ClearSet(), # normal
+ 2: ClearSet(), # hard
+ 3: ClearSet(), # extreme
+ 4: ClearSet(), # exExtreme
+ }
+
+ # get clear status from user scores
+ pv_records = self.data.score.get_best_scores(data["pd_id"])
+ clear_status = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"
+
+ if pv_records is not None:
+ for score in pv_records:
+ if score["edition"] == 0:
+ # cheap and standard both count to "clear"
+ if score["clr_kind"] in {1, 2}:
+ clear_set_dict[score["difficulty"]].clear += 1
+ elif score["clr_kind"] == 3:
+ clear_set_dict[score["difficulty"]].great += 1
+ elif score["clr_kind"] == 4:
+ clear_set_dict[score["difficulty"]].excellent += 1
+ elif score["clr_kind"] == 5:
+ clear_set_dict[score["difficulty"]].perfect += 1
+ else:
+ # 4=ExExtreme
+ if score["clr_kind"] in {1, 2}:
+ clear_set_dict[4].clear += 1
+ elif score["clr_kind"] == 3:
+ clear_set_dict[4].great += 1
+ elif score["clr_kind"] == 4:
+ clear_set_dict[4].excellent += 1
+ elif score["clr_kind"] == 5:
+ clear_set_dict[4].perfect += 1
+
+ # now add all values to a list
+ clear_list = []
+ for clear_set in clear_set_dict.values():
+ clear_list.append(clear_set.clear)
+ clear_list.append(clear_set.great)
+ clear_list.append(clear_set.excellent)
+ clear_list.append(clear_set.perfect)
+
+ clear_status = ",".join(map(str, clear_list))
+
+ response += f"&clr_sts={clear_status}"
# Store stuff to add to rework
response += f"&mdl_eqp_tm={self.time_lut}"
diff --git a/titles/diva/schema/profile.py b/titles/diva/schema/profile.py
index 1a498e2..7107068 100644
--- a/titles/diva/schema/profile.py
+++ b/titles/diva/schema/profile.py
@@ -34,9 +34,17 @@ profile = Table(
Column("use_pv_sld_se_eqp", Boolean, nullable=False, server_default="0"),
Column("use_pv_chn_sld_se_eqp", Boolean, nullable=False, server_default="0"),
Column("use_pv_sldr_tch_se_eqp", Boolean, nullable=False, server_default="0"),
+ Column("btn_se_eqp", Integer, nullable=False, server_default="-1"),
+ Column("sld_se_eqp", Integer, nullable=False, server_default="-1"),
+ Column("chn_sld_se_eqp", Integer, nullable=False, server_default="-1"),
+ Column("sldr_tch_se_eqp", Integer, nullable=False, server_default="-1"),
Column("nxt_pv_id", Integer, nullable=False, server_default="708"),
Column("nxt_dffclty", Integer, nullable=False, server_default="2"),
Column("nxt_edtn", Integer, nullable=False, server_default="0"),
+ Column("cnp_cid", Integer, nullable=False, server_default="-1"),
+ Column("cnp_val", Integer, nullable=False, server_default="-1"),
+ Column("cnp_rr", Integer, nullable=False, server_default="-1"),
+ Column("cnp_sp", String(255), nullable=False, server_default=""),
Column("dsp_clr_brdr", Integer, nullable=False, server_default="7"),
Column("dsp_intrm_rnk", Integer, nullable=False, server_default="1"),
Column("dsp_clr_sts", Integer, nullable=False, server_default="1"),
diff --git a/titles/diva/schema/score.py b/titles/diva/schema/score.py
index 2d86925..2171659 100644
--- a/titles/diva/schema/score.py
+++ b/titles/diva/schema/score.py
@@ -3,6 +3,7 @@ from sqlalchemy.types import Integer, String, TIMESTAMP, JSON, Boolean
from sqlalchemy.schema import ForeignKey
from sqlalchemy.sql import func, select
from sqlalchemy.dialects.mysql import insert
+from sqlalchemy.engine import Row
from typing import Optional, List, Dict, Any
from core.data.schema import BaseData, metadata
@@ -167,7 +168,7 @@ class DivaScoreData(BaseData):
def get_best_user_score(
self, user_id: int, pv_id: int, difficulty: int, edition: int
- ) -> Optional[Dict]:
+ ) -> Optional[Row]:
sql = score.select(
and_(
score.c.user == user_id,
@@ -184,7 +185,7 @@ class DivaScoreData(BaseData):
def get_top3_scores(
self, pv_id: int, difficulty: int, edition: int
- ) -> Optional[List[Dict]]:
+ ) -> Optional[List[Row]]:
sql = (
score.select(
and_(
@@ -204,7 +205,7 @@ class DivaScoreData(BaseData):
def get_global_ranking(
self, user_id: int, pv_id: int, difficulty: int, edition: int
- ) -> Optional[List]:
+ ) -> Optional[List[Row]]:
# get the subquery max score of a user with pv_id, difficulty and
# edition
sql_sub = (
@@ -231,7 +232,7 @@ class DivaScoreData(BaseData):
return None
return result.fetchone()
- def get_best_scores(self, user_id: int) -> Optional[List]:
+ def get_best_scores(self, user_id: int) -> Optional[List[Row]]:
sql = score.select(score.c.user == user_id)
result = self.execute(sql)
diff --git a/titles/idz/userdb.py b/titles/idz/userdb.py
index 2f70ba4..2ac765e 100644
--- a/titles/idz/userdb.py
+++ b/titles/idz/userdb.py
@@ -83,7 +83,13 @@ class IDZUserDBProtocol(Protocol):
def dataReceived(self, data: bytes) -> None:
self.logger.debug(f"Receive data {data.hex()}")
crypt = AES.new(self.static_key, AES.MODE_ECB)
- data_dec = crypt.decrypt(data)
+
+ try:
+ data_dec = crypt.decrypt(data)
+
+ except Exception as e:
+ self.logger.error(f"Failed to decrypt UserDB request from {self.transport.getPeer().host} because {e} - {data.hex()}")
+
self.logger.debug(f"Decrypt data {data_dec.hex()}")
magic = struct.unpack_from(" None:
self.core_config = cfg
self.game_config = game_cfg
- self.game = Mai2Constants.GAME_CODE
- self.version = Mai2Constants.VER_MAIMAI_DX
+ self.version = Mai2Constants.VER_MAIMAI
self.data = Mai2Data(cfg)
self.logger = logging.getLogger("mai2")
+ self.can_deliver = False
+ self.can_usbdl = False
+ self.old_server = ""
+
+ if self.core_config.server.is_develop and self.core_config.title.port > 0:
+ self.old_server = f"http://{self.core_config.title.hostname}:{self.core_config.title.port}/SDEY/197/"
+
+ else:
+ self.old_server = f"http://{self.core_config.title.hostname}/SDEY/197/"
def handle_get_game_setting_api_request(self, data: Dict):
- reboot_start = date.strftime(
- datetime.now() + timedelta(hours=3), Mai2Constants.DATE_TIME_FORMAT
- )
- reboot_end = date.strftime(
- datetime.now() + timedelta(hours=4), Mai2Constants.DATE_TIME_FORMAT
- )
- return {
+ return {
+ "isDevelop": False,
+ "isAouAccession": False,
"gameSetting": {
- "isMaintenance": "false",
- "requestInterval": 10,
- "rebootStartTime": reboot_start,
- "rebootEndTime": reboot_end,
- "movieUploadLimit": 10000,
- "movieStatus": 0,
- "movieServerUri": "",
- "deliverServerUri": "",
- "oldServerUri": "",
- "usbDlServerUri": "",
- "rebootInterval": 0,
+ "isMaintenance": False,
+ "requestInterval": 1800,
+ "rebootStartTime": "2020-01-01 07:00:00.0",
+ "rebootEndTime": "2020-01-01 07:59:59.0",
+ "movieUploadLimit": 100,
+ "movieStatus": 1,
+ "movieServerUri": self.old_server + "api/movie" if self.game_config.uploads.movies else "movie",
+ "deliverServerUri": self.old_server + "deliver/" if self.can_deliver and self.game_config.deliver.enable else "",
+ "oldServerUri": self.old_server + "old",
+ "usbDlServerUri": self.old_server + "usbdl/" if self.can_deliver and self.game_config.deliver.udbdl_enable else "",
},
- "isAouAccession": "true",
}
def handle_get_game_ranking_api_request(self, data: Dict) -> Dict:
@@ -51,7 +56,7 @@ class Mai2Base:
def handle_get_game_event_api_request(self, data: Dict) -> Dict:
events = self.data.static.get_enabled_events(self.version)
events_lst = []
- if events is None:
+ if events is None or not events:
self.logger.warn("No enabled events, did you run the reader?")
return {"type": data["type"], "length": 0, "gameEventList": []}
@@ -87,7 +92,7 @@ class Mai2Base:
for i, charge in enumerate(game_charge_list):
charge_list.append(
{
- "orderId": i,
+ "orderId": i + 1,
"chargeId": charge["ticketId"],
"price": charge["price"],
"startDate": "2017-12-05 07:00:00.0",
@@ -110,43 +115,35 @@ class Mai2Base:
return {"returnCode": 1, "apiName": "UpsertClientTestmodeApi"}
def handle_get_user_preview_api_request(self, data: Dict) -> Dict:
- p = self.data.profile.get_profile_detail(data["userId"], self.version)
- o = self.data.profile.get_profile_option(data["userId"], self.version)
- if p is None or o is None:
+ p = self.data.profile.get_profile_detail(data["userId"], self.version, False)
+ w = self.data.profile.get_web_option(data["userId"], self.version)
+ if p is None or w is None:
return {} # Register
profile = p._asdict()
- option = o._asdict()
+ web_opt = w._asdict()
return {
"userId": data["userId"],
"userName": profile["userName"],
"isLogin": False,
- "lastGameId": profile["lastGameId"],
"lastDataVersion": profile["lastDataVersion"],
- "lastRomVersion": profile["lastRomVersion"],
- "lastLoginDate": profile["lastLoginDate"],
+ "lastLoginDate": profile["lastPlayDate"],
"lastPlayDate": profile["lastPlayDate"],
"playerRating": profile["playerRating"],
- "nameplateId": 0, # Unused
- "iconId": profile["iconId"],
- "trophyId": 0, # Unused
- "partnerId": profile["partnerId"],
+ "nameplateId": profile["nameplateId"],
"frameId": profile["frameId"],
- "dispRate": option[
- "dispRate"
- ], # 0: all/begin, 1: disprate, 2: dispDan, 3: hide, 4: end
- "totalAwake": profile["totalAwake"],
- "isNetMember": profile["isNetMember"],
- "dailyBonusDate": profile["dailyBonusDate"],
- "headPhoneVolume": option["headPhoneVolume"],
- "isInherit": False, # Not sure what this is or does??
- "banState": profile["banState"]
- if profile["banState"] is not None
- else 0, # New with uni+
+ "iconId": profile["iconId"],
+ "trophyId": profile["trophyId"],
+ "dispRate": web_opt["dispRate"], # 0: all, 1: dispRate, 2: dispDan, 3: hide
+ "dispRank": web_opt["dispRank"],
+ "dispHomeRanker": web_opt["dispHomeRanker"],
+ "dispTotalLv": web_opt["dispTotalLv"],
+ "totalLv": profile["totalLv"],
}
def handle_user_login_api_request(self, data: Dict) -> Dict:
profile = self.data.profile.get_profile_detail(data["userId"], self.version)
+ consec = self.data.profile.get_consec_login(data["userId"], self.version)
if profile is not None:
lastLoginDate = profile["lastLoginDate"]
@@ -157,13 +154,32 @@ class Mai2Base:
else:
loginCt = 0
lastLoginDate = "2017-12-05 07:00:00.0"
+
+ if consec is None or not consec:
+ consec_ct = 1
+
+ else:
+ lastlogindate_ = datetime.strptime(profile["lastLoginDate"], "%Y-%m-%d %H:%M:%S.%f").timestamp()
+ today_midnight = datetime.now().replace(hour=0, minute=0, second=0, microsecond=0).timestamp()
+ yesterday_midnight = today_midnight - 86400
+
+ if lastlogindate_ < today_midnight:
+ consec_ct = consec['logins'] + 1
+ self.data.profile.add_consec_login(data["userId"], self.version)
+
+ elif lastlogindate_ < yesterday_midnight:
+ consec_ct = 1
+ self.data.profile.reset_consec_login(data["userId"], self.version)
+
+ else:
+ consec_ct = consec['logins']
+
return {
"returnCode": 1,
"lastLoginDate": lastLoginDate,
"loginCount": loginCt,
- "consecutiveLoginCount": 0, # We don't really have a way to track this...
- "loginId": loginCt, # Used with the playlog!
+ "consecutiveLoginCount": consec_ct, # Number of consecutive days we've logged in.
}
def handle_upload_user_playlog_api_request(self, data: Dict) -> Dict:
@@ -195,11 +211,34 @@ class Mai2Base:
upsert = data["upsertUserAll"]
if "userData" in upsert and len(upsert["userData"]) > 0:
- upsert["userData"][0]["isNetMember"] = 1
upsert["userData"][0].pop("accessCode")
+ upsert["userData"][0].pop("userId")
+
self.data.profile.put_profile_detail(
- user_id, self.version, upsert["userData"][0]
+ user_id, self.version, upsert["userData"][0], False
)
+
+ if "userWebOption" in upsert and len(upsert["userWebOption"]) > 0:
+ upsert["userWebOption"][0]["isNetMember"] = True
+ self.data.profile.put_web_option(
+ user_id, self.version, upsert["userWebOption"][0]
+ )
+
+ if "userGradeStatusList" in upsert and len(upsert["userGradeStatusList"]) > 0:
+ self.data.profile.put_grade_status(
+ user_id, upsert["userGradeStatusList"][0]
+ )
+
+ if "userBossList" in upsert and len(upsert["userBossList"]) > 0:
+ self.data.profile.put_boss_list(
+ user_id, upsert["userBossList"][0]
+ )
+
+ if "userPlaylogList" in upsert and len(upsert["userPlaylogList"]) > 0:
+ for playlog in upsert["userPlaylogList"]:
+ self.data.score.put_playlog(
+ user_id, playlog, False
+ )
if "userExtend" in upsert and len(upsert["userExtend"]) > 0:
self.data.profile.put_profile_extend(
@@ -208,11 +247,15 @@ class Mai2Base:
if "userGhost" in upsert:
for ghost in upsert["userGhost"]:
- self.data.profile.put_profile_extend(user_id, self.version, ghost)
+ self.data.profile.put_profile_ghost(user_id, self.version, ghost)
+
+ if "userRecentRatingList" in upsert:
+ self.data.profile.put_recent_rating(user_id, upsert["userRecentRatingList"])
if "userOption" in upsert and len(upsert["userOption"]) > 0:
+ upsert["userOption"][0].pop("userId")
self.data.profile.put_profile_option(
- user_id, self.version, upsert["userOption"][0]
+ user_id, self.version, upsert["userOption"][0], False
)
if "userRatingList" in upsert and len(upsert["userRatingList"]) > 0:
@@ -221,9 +264,8 @@ class Mai2Base:
)
if "userActivityList" in upsert and len(upsert["userActivityList"]) > 0:
- for k, v in upsert["userActivityList"][0].items():
- for act in v:
- self.data.profile.put_profile_activity(user_id, act)
+ for act in upsert["userActivityList"]:
+ self.data.profile.put_profile_activity(user_id, act)
if "userChargeList" in upsert and len(upsert["userChargeList"]) > 0:
for charge in upsert["userChargeList"]:
@@ -243,12 +285,9 @@ class Mai2Base:
if "userCharacterList" in upsert and len(upsert["userCharacterList"]) > 0:
for char in upsert["userCharacterList"]:
- self.data.item.put_character(
+ self.data.item.put_character_(
user_id,
- char["characterId"],
- char["level"],
- char["awakening"],
- char["useCount"],
+ char
)
if "userItemList" in upsert and len(upsert["userItemList"]) > 0:
@@ -258,7 +297,7 @@ class Mai2Base:
int(item["itemKind"]),
item["itemId"],
item["stock"],
- item["isValid"],
+ True
)
if "userLoginBonusList" in upsert and len(upsert["userLoginBonusList"]) > 0:
@@ -284,7 +323,7 @@ class Mai2Base:
if "userMusicDetailList" in upsert and len(upsert["userMusicDetailList"]) > 0:
for music in upsert["userMusicDetailList"]:
- self.data.score.put_best_score(user_id, music)
+ self.data.score.put_best_score(user_id, music, False)
if "userCourseList" in upsert and len(upsert["userCourseList"]) > 0:
for course in upsert["userCourseList"]:
@@ -312,7 +351,7 @@ class Mai2Base:
return {"returnCode": 1}
def handle_get_user_data_api_request(self, data: Dict) -> Dict:
- profile = self.data.profile.get_profile_detail(data["userId"], self.version)
+ profile = self.data.profile.get_profile_detail(data["userId"], self.version, False)
if profile is None:
return
@@ -336,7 +375,7 @@ class Mai2Base:
return {"userId": data["userId"], "userExtend": extend_dict}
def handle_get_user_option_api_request(self, data: Dict) -> Dict:
- options = self.data.profile.get_profile_option(data["userId"], self.version)
+ options = self.data.profile.get_profile_option(data["userId"], self.version, False)
if options is None:
return
@@ -406,12 +445,31 @@ class Mai2Base:
"userChargeList": user_charge_list,
}
+ def handle_get_user_present_api_request(self, data: Dict) -> Dict:
+ return { "userId": data.get("userId", 0), "length": 0, "userPresentList": []}
+
+ def handle_get_transfer_friend_api_request(self, data: Dict) -> Dict:
+ return {}
+
+ def handle_get_user_present_event_api_request(self, data: Dict) -> Dict:
+ return { "userId": data.get("userId", 0), "length": 0, "userPresentEventList": []}
+
+ def handle_get_user_boss_api_request(self, data: Dict) -> Dict:
+ b = self.data.profile.get_boss_list(data["userId"])
+ if b is None:
+ return { "userId": data.get("userId", 0), "userBossData": {}}
+ boss_lst = b._asdict()
+ boss_lst.pop("id")
+ boss_lst.pop("user")
+
+ return { "userId": data.get("userId", 0), "userBossData": boss_lst}
+
def handle_get_user_item_api_request(self, data: Dict) -> Dict:
kind = int(data["nextIndex"] / 10000000000)
next_idx = int(data["nextIndex"] % 10000000000)
user_item_list = self.data.item.get_items(data["userId"], kind)
- items: list[Dict[str, Any]] = []
+ items: List[Dict[str, Any]] = []
for i in range(next_idx, len(user_item_list)):
tmp = user_item_list[i]._asdict()
tmp.pop("user")
@@ -442,6 +500,8 @@ class Mai2Base:
tmp = chara._asdict()
tmp.pop("id")
tmp.pop("user")
+ tmp.pop("awakening")
+ tmp.pop("useCount")
chara_list.append(tmp)
return {"userId": data["userId"], "userCharacterList": chara_list}
@@ -475,6 +535,16 @@ class Mai2Base:
return {"userId": data["userId"], "userGhost": ghost_dict}
+ def handle_get_user_recent_rating_api_request(self, data: Dict) -> Dict:
+ rating = self.data.profile.get_recent_rating(data["userId"])
+ if rating is None:
+ return
+
+ r = rating._asdict()
+ lst = r.get("userRecentRatingList", [])
+
+ return {"userId": data["userId"], "length": len(lst), "userRecentRatingList": lst}
+
def handle_get_user_rating_api_request(self, data: Dict) -> Dict:
rating = self.data.profile.get_profile_rating(data["userId"], self.version)
if rating is None:
@@ -637,25 +707,158 @@ class Mai2Base:
def handle_get_user_region_api_request(self, data: Dict) -> Dict:
return {"userId": data["userId"], "length": 0, "userRegionList": []}
+
+ def handle_get_user_web_option_api_request(self, data: Dict) -> Dict:
+ w = self.data.profile.get_web_option(data["userId"], self.version)
+ if w is None:
+ return {"userId": data["userId"], "userWebOption": {}}
+
+ web_opt = w._asdict()
+ web_opt.pop("id")
+ web_opt.pop("user")
+ web_opt.pop("version")
+
+ return {"userId": data["userId"], "userWebOption": web_opt}
+
+ def handle_get_user_survival_api_request(self, data: Dict) -> Dict:
+ return {"userId": data["userId"], "length": 0, "userSurvivalList": []}
+
+ def handle_get_user_grade_api_request(self, data: Dict) -> Dict:
+ g = self.data.profile.get_grade_status(data["userId"])
+ if g is None:
+ return {"userId": data["userId"], "userGradeStatus": {}, "length": 0, "userGradeList": []}
+ grade_stat = g._asdict()
+ grade_stat.pop("id")
+ grade_stat.pop("user")
+
+ return {"userId": data["userId"], "userGradeStatus": grade_stat, "length": 0, "userGradeList": []}
def handle_get_user_music_api_request(self, data: Dict) -> Dict:
- songs = self.data.score.get_best_scores(data["userId"])
+ user_id = data.get("userId", 0)
+ next_index = data.get("nextIndex", 0)
+ max_ct = data.get("maxCount", 50)
+ upper_lim = next_index + max_ct
music_detail_list = []
- next_index = 0
- if songs is not None:
- for song in songs:
- tmp = song._asdict()
- tmp.pop("id")
- tmp.pop("user")
- music_detail_list.append(tmp)
+ if user_id <= 0:
+ self.logger.warn("handle_get_user_music_api_request: Could not find userid in data, or userId is 0")
+ return {}
+
+ songs = self.data.score.get_best_scores(user_id, is_dx=False)
+ if songs is None:
+ self.logger.debug("handle_get_user_music_api_request: get_best_scores returned None!")
+ return {
+ "userId": data["userId"],
+ "nextIndex": 0,
+ "userMusicList": [],
+ }
- if len(music_detail_list) == data["maxCount"]:
- next_index = data["maxCount"] + data["nextIndex"]
- break
+ num_user_songs = len(songs)
+ for x in range(next_index, upper_lim):
+ if num_user_songs <= x:
+ break
+
+ tmp = songs[x]._asdict()
+ tmp.pop("id")
+ tmp.pop("user")
+ music_detail_list.append(tmp)
+
+ next_index = 0 if len(music_detail_list) < max_ct or num_user_songs == upper_lim else upper_lim
+ self.logger.info(f"Send songs {next_index}-{upper_lim} ({len(music_detail_list)}) out of {num_user_songs} for user {user_id} (next idx {next_index})")
return {
"userId": data["userId"],
"nextIndex": next_index,
"userMusicList": [{"userMusicDetailList": music_detail_list}],
}
+
+ def handle_upload_user_portrait_api_request(self, data: Dict) -> Dict:
+ self.logger.debug(data)
+
+ def handle_upload_user_photo_api_request(self, data: Dict) -> Dict:
+ if not self.game_config.uploads.photos or not self.game_config.uploads.photos_dir:
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ photo = data.get("userPhoto", {})
+
+ if photo is None or not photo:
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ order_id = int(photo.get("orderId", -1))
+ user_id = int(photo.get("userId", -1))
+ div_num = int(photo.get("divNumber", -1))
+ div_len = int(photo.get("divLength", -1))
+ div_data = photo.get("divData", "")
+ playlog_id = int(photo.get("playlogId", -1))
+ track_num = int(photo.get("trackNo", -1))
+ upload_date = photo.get("uploadDate", "")
+
+ if order_id < 0 or user_id <= 0 or div_num < 0 or div_len <= 0 or not div_data or playlog_id < 0 or track_num <= 0 or not upload_date:
+ self.logger.warn(f"Malformed photo upload request")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ if order_id == 0 and div_num > 0:
+ self.logger.warn(f"Failed to set orderId properly (still 0 after first chunk)")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ if div_num == 0 and order_id > 0:
+ self.logger.warn(f"First chuck re-send, Ignore")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ if div_num >= div_len:
+ self.logger.warn(f"Sent extra chunks ({div_num} >= {div_len})")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ if div_len >= 100:
+ self.logger.warn(f"Photo too large ({div_len} * 10240 = {div_len * 10240} bytes)")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ ret_code = order_id + 1
+ photo_chunk = b64decode(div_data)
+
+ if len(photo_chunk) > 10240 or (len(photo_chunk) < 10240 and div_num + 1 != div_len):
+ self.logger.warn(f"Incorrect data size after decoding (Expected 10240, got {len(photo_chunk)})")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ out_name = f"{self.game_config.uploads.photos_dir}/{user_id}_{playlog_id}_{track_num}"
+
+ if not path.exists(f"{out_name}.bin") and div_num != 0:
+ self.logger.warn(f"Out of order photo upload (div_num {div_num})")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ if path.exists(f"{out_name}.bin") and div_num == 0:
+ self.logger.warn(f"Duplicate file upload")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ elif path.exists(f"{out_name}.bin"):
+ fstats = stat(f"{out_name}.bin")
+ if fstats.st_size != 10240 * div_num:
+ self.logger.warn(f"Out of order photo upload (trying to upload div {div_num}, expected div {fstats.st_size / 10240} for file sized {fstats.st_size} bytes)")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ try:
+ with open(f"{out_name}.bin", "ab") as f:
+ f.write(photo_chunk)
+
+ except Exception:
+ self.logger.error(f"Failed writing to {out_name}.bin")
+ return {'returnCode': 0, 'apiName': 'UploadUserPhotoApi'}
+
+ if div_num + 1 == div_len and path.exists(f"{out_name}.bin"):
+ try:
+ p = ImageFile.Parser()
+ with open(f"{out_name}.bin", "rb") as f:
+ p.feed(f.read())
+
+ im = p.close()
+ im.save(f"{out_name}.jpeg")
+ except Exception:
+ self.logger.error(f"File {out_name}.bin failed image validation")
+
+ try:
+ remove(f"{out_name}.bin")
+
+ except Exception:
+ self.logger.error(f"Failed to delete {out_name}.bin, please remove it manually")
+
+ return {'returnCode': ret_code, 'apiName': 'UploadUserPhotoApi'}
diff --git a/titles/mai2/config.py b/titles/mai2/config.py
index 3a20065..d63c0b2 100644
--- a/titles/mai2/config.py
+++ b/titles/mai2/config.py
@@ -19,7 +19,59 @@ class Mai2ServerConfig:
)
)
+class Mai2DeliverConfig:
+ def __init__(self, parent: "Mai2Config") -> None:
+ self.__config = parent
+
+ @property
+ def enable(self) -> bool:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "deliver", "enable", default=False
+ )
+
+ @property
+ def udbdl_enable(self) -> bool:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "deliver", "udbdl_enable", default=False
+ )
+
+ @property
+ def content_folder(self) -> int:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "server", "content_folder", default=""
+ )
+
+class Mai2UploadsConfig:
+ def __init__(self, parent: "Mai2Config") -> None:
+ self.__config = parent
+
+ @property
+ def photos(self) -> bool:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "uploads", "photos", default=False
+ )
+
+ @property
+ def photos_dir(self) -> str:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "uploads", "photos_dir", default=""
+ )
+
+ @property
+ def movies(self) -> bool:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "uploads", "movies", default=False
+ )
+
+ @property
+ def movies_dir(self) -> str:
+ return CoreConfig.get_config_field(
+ self.__config, "mai2", "uploads", "movies_dir", default=""
+ )
+
class Mai2Config(dict):
def __init__(self) -> None:
self.server = Mai2ServerConfig(self)
+ self.deliver = Mai2DeliverConfig(self)
+ self.uploads = Mai2UploadsConfig(self)
diff --git a/titles/mai2/const.py b/titles/mai2/const.py
index dcc7e29..6e9a070 100644
--- a/titles/mai2/const.py
+++ b/titles/mai2/const.py
@@ -20,26 +20,60 @@ class Mai2Constants:
DATE_TIME_FORMAT = "%Y-%m-%d %H:%M:%S"
- GAME_CODE = "SDEZ"
+ GAME_CODE = "SBXL"
+ GAME_CODE_GREEN = "SBZF"
+ GAME_CODE_ORANGE = "SDBM"
+ GAME_CODE_PINK = "SDCQ"
+ GAME_CODE_MURASAKI = "SDDK"
+ GAME_CODE_MILK = "SDDZ"
+ GAME_CODE_FINALE = "SDEY"
+ GAME_CODE_DX = "SDEZ"
CONFIG_NAME = "mai2.yaml"
- VER_MAIMAI_DX = 0
- VER_MAIMAI_DX_PLUS = 1
- VER_MAIMAI_DX_SPLASH = 2
- VER_MAIMAI_DX_SPLASH_PLUS = 3
- VER_MAIMAI_DX_UNIVERSE = 4
- VER_MAIMAI_DX_UNIVERSE_PLUS = 5
- VER_MAIMAI_DX_FESTIVAL = 6
+ VER_MAIMAI = 0
+ VER_MAIMAI_PLUS = 1
+ VER_MAIMAI_GREEN = 2
+ VER_MAIMAI_GREEN_PLUS = 3
+ VER_MAIMAI_ORANGE = 4
+ VER_MAIMAI_ORANGE_PLUS = 5
+ VER_MAIMAI_PINK = 6
+ VER_MAIMAI_PINK_PLUS = 7
+ VER_MAIMAI_MURASAKI = 8
+ VER_MAIMAI_MURASAKI_PLUS = 9
+ VER_MAIMAI_MILK = 10
+ VER_MAIMAI_MILK_PLUS = 11
+ VER_MAIMAI_FINALE = 12
+
+ VER_MAIMAI_DX = 13
+ VER_MAIMAI_DX_PLUS = 14
+ VER_MAIMAI_DX_SPLASH = 15
+ VER_MAIMAI_DX_SPLASH_PLUS = 16
+ VER_MAIMAI_DX_UNIVERSE = 17
+ VER_MAIMAI_DX_UNIVERSE_PLUS = 18
+ VER_MAIMAI_DX_FESTIVAL = 19
VERSION_STRING = (
+ "maimai",
+ "maimai PLUS",
+ "maimai GreeN",
+ "maimai GreeN PLUS",
+ "maimai ORANGE",
+ "maimai ORANGE PLUS",
+ "maimai PiNK",
+ "maimai PiNK PLUS",
+ "maimai MURASAKi",
+ "maimai MURASAKi PLUS",
+ "maimai MiLK",
+ "maimai MiLK PLUS",
+ "maimai FiNALE",
"maimai DX",
"maimai DX PLUS",
"maimai DX Splash",
"maimai DX Splash PLUS",
- "maimai DX Universe",
- "maimai DX Universe PLUS",
- "maimai DX Festival",
+ "maimai DX UNiVERSE",
+ "maimai DX UNiVERSE PLUS",
+ "maimai DX FESTiVAL",
)
@classmethod
diff --git a/titles/mai2/dx.py b/titles/mai2/dx.py
new file mode 100644
index 0000000..fba092a
--- /dev/null
+++ b/titles/mai2/dx.py
@@ -0,0 +1,574 @@
+from typing import Any, List, Dict
+from datetime import datetime, timedelta
+import pytz
+import json
+from random import randint
+
+from core.config import CoreConfig
+from titles.mai2.base import Mai2Base
+from titles.mai2.config import Mai2Config
+from titles.mai2.const import Mai2Constants
+
+
+class Mai2DX(Mai2Base):
+ def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
+ super().__init__(cfg, game_cfg)
+ self.version = Mai2Constants.VER_MAIMAI_DX
+
+ if self.core_config.server.is_develop and self.core_config.title.port > 0:
+ self.old_server = f"http://{self.core_config.title.hostname}:{self.core_config.title.port}/SDEZ/100/"
+
+ else:
+ self.old_server = f"http://{self.core_config.title.hostname}/SDEZ/100/"
+
+ def handle_get_game_setting_api_request(self, data: Dict):
+ return {
+ "gameSetting": {
+ "isMaintenance": False,
+ "requestInterval": 1800,
+ "rebootStartTime": "2020-01-01 07:00:00.0",
+ "rebootEndTime": "2020-01-01 07:59:59.0",
+ "movieUploadLimit": 100,
+ "movieStatus": 1,
+ "movieServerUri": self.old_server + "movie/",
+ "deliverServerUri": self.old_server + "deliver/" if self.can_deliver and self.game_config.deliver.enable else "",
+ "oldServerUri": self.old_server + "old",
+ "usbDlServerUri": self.old_server + "usbdl/" if self.can_deliver and self.game_config.deliver.udbdl_enable else "",
+ "rebootInterval": 0,
+ },
+ "isAouAccession": False,
+ }
+
+ def handle_get_user_preview_api_request(self, data: Dict) -> Dict:
+ p = self.data.profile.get_profile_detail(data["userId"], self.version)
+ o = self.data.profile.get_profile_option(data["userId"], self.version)
+ if p is None or o is None:
+ return {} # Register
+ profile = p._asdict()
+ option = o._asdict()
+
+ return {
+ "userId": data["userId"],
+ "userName": profile["userName"],
+ "isLogin": False,
+ "lastGameId": profile["lastGameId"],
+ "lastDataVersion": profile["lastDataVersion"],
+ "lastRomVersion": profile["lastRomVersion"],
+ "lastLoginDate": profile["lastLoginDate"],
+ "lastPlayDate": profile["lastPlayDate"],
+ "playerRating": profile["playerRating"],
+ "nameplateId": 0, # Unused
+ "iconId": profile["iconId"],
+ "trophyId": 0, # Unused
+ "partnerId": profile["partnerId"],
+ "frameId": profile["frameId"],
+ "dispRate": option[
+ "dispRate"
+ ], # 0: all/begin, 1: disprate, 2: dispDan, 3: hide, 4: end
+ "totalAwake": profile["totalAwake"],
+ "isNetMember": profile["isNetMember"],
+ "dailyBonusDate": profile["dailyBonusDate"],
+ "headPhoneVolume": option["headPhoneVolume"],
+ "isInherit": False, # Not sure what this is or does??
+ "banState": profile["banState"]
+ if profile["banState"] is not None
+ else 0, # New with uni+
+ }
+
+ def handle_upload_user_playlog_api_request(self, data: Dict) -> Dict:
+ user_id = data["userId"]
+ playlog = data["userPlaylog"]
+
+ self.data.score.put_playlog(user_id, playlog)
+
+ return {"returnCode": 1, "apiName": "UploadUserPlaylogApi"}
+
+ def handle_upsert_user_chargelog_api_request(self, data: Dict) -> Dict:
+ user_id = data["userId"]
+ charge = data["userCharge"]
+
+ # remove the ".0" from the date string, festival only?
+ charge["purchaseDate"] = charge["purchaseDate"].replace(".0", "")
+ self.data.item.put_charge(
+ user_id,
+ charge["chargeId"],
+ charge["stock"],
+ datetime.strptime(charge["purchaseDate"], Mai2Constants.DATE_TIME_FORMAT),
+ datetime.strptime(charge["validDate"], Mai2Constants.DATE_TIME_FORMAT),
+ )
+
+ return {"returnCode": 1, "apiName": "UpsertUserChargelogApi"}
+
+ def handle_upsert_user_all_api_request(self, data: Dict) -> Dict:
+ user_id = data["userId"]
+ upsert = data["upsertUserAll"]
+
+ if "userData" in upsert and len(upsert["userData"]) > 0:
+ upsert["userData"][0]["isNetMember"] = 1
+ upsert["userData"][0].pop("accessCode")
+ self.data.profile.put_profile_detail(
+ user_id, self.version, upsert["userData"][0]
+ )
+
+ if "userExtend" in upsert and len(upsert["userExtend"]) > 0:
+ self.data.profile.put_profile_extend(
+ user_id, self.version, upsert["userExtend"][0]
+ )
+
+ if "userGhost" in upsert:
+ for ghost in upsert["userGhost"]:
+ self.data.profile.put_profile_ghost(user_id, self.version, ghost)
+
+ if "userOption" in upsert and len(upsert["userOption"]) > 0:
+ self.data.profile.put_profile_option(
+ user_id, self.version, upsert["userOption"][0]
+ )
+
+ if "userRatingList" in upsert and len(upsert["userRatingList"]) > 0:
+ self.data.profile.put_profile_rating(
+ user_id, self.version, upsert["userRatingList"][0]
+ )
+
+ if "userActivityList" in upsert and len(upsert["userActivityList"]) > 0:
+ for k, v in upsert["userActivityList"][0].items():
+ for act in v:
+ self.data.profile.put_profile_activity(user_id, act)
+
+ if "userChargeList" in upsert and len(upsert["userChargeList"]) > 0:
+ for charge in upsert["userChargeList"]:
+ # remove the ".0" from the date string, festival only?
+ charge["purchaseDate"] = charge["purchaseDate"].replace(".0", "")
+ self.data.item.put_charge(
+ user_id,
+ charge["chargeId"],
+ charge["stock"],
+ datetime.strptime(
+ charge["purchaseDate"], Mai2Constants.DATE_TIME_FORMAT
+ ),
+ datetime.strptime(
+ charge["validDate"], Mai2Constants.DATE_TIME_FORMAT
+ ),
+ )
+
+ if "userCharacterList" in upsert and len(upsert["userCharacterList"]) > 0:
+ for char in upsert["userCharacterList"]:
+ self.data.item.put_character(
+ user_id,
+ char["characterId"],
+ char["level"],
+ char["awakening"],
+ char["useCount"],
+ )
+
+ if "userItemList" in upsert and len(upsert["userItemList"]) > 0:
+ for item in upsert["userItemList"]:
+ self.data.item.put_item(
+ user_id,
+ int(item["itemKind"]),
+ item["itemId"],
+ item["stock"],
+ item["isValid"],
+ )
+
+ if "userLoginBonusList" in upsert and len(upsert["userLoginBonusList"]) > 0:
+ for login_bonus in upsert["userLoginBonusList"]:
+ self.data.item.put_login_bonus(
+ user_id,
+ login_bonus["bonusId"],
+ login_bonus["point"],
+ login_bonus["isCurrent"],
+ login_bonus["isComplete"],
+ )
+
+ if "userMapList" in upsert and len(upsert["userMapList"]) > 0:
+ for map in upsert["userMapList"]:
+ self.data.item.put_map(
+ user_id,
+ map["mapId"],
+ map["distance"],
+ map["isLock"],
+ map["isClear"],
+ map["isComplete"],
+ )
+
+ if "userMusicDetailList" in upsert and len(upsert["userMusicDetailList"]) > 0:
+ for music in upsert["userMusicDetailList"]:
+ self.data.score.put_best_score(user_id, music)
+
+ if "userCourseList" in upsert and len(upsert["userCourseList"]) > 0:
+ for course in upsert["userCourseList"]:
+ self.data.score.put_course(user_id, course)
+
+ if "userFavoriteList" in upsert and len(upsert["userFavoriteList"]) > 0:
+ for fav in upsert["userFavoriteList"]:
+ self.data.item.put_favorite(user_id, fav["kind"], fav["itemIdList"])
+
+ if (
+ "userFriendSeasonRankingList" in upsert
+ and len(upsert["userFriendSeasonRankingList"]) > 0
+ ):
+ for fsr in upsert["userFriendSeasonRankingList"]:
+ fsr["recordDate"] = (
+ datetime.strptime(
+ fsr["recordDate"], f"{Mai2Constants.DATE_TIME_FORMAT}.0"
+ ),
+ )
+ self.data.item.put_friend_season_ranking(user_id, fsr)
+
+ return {"returnCode": 1, "apiName": "UpsertUserAllApi"}
+
+ def handle_get_user_data_api_request(self, data: Dict) -> Dict:
+ profile = self.data.profile.get_profile_detail(data["userId"], self.version)
+ if profile is None:
+ return
+
+ profile_dict = profile._asdict()
+ profile_dict.pop("id")
+ profile_dict.pop("user")
+ profile_dict.pop("version")
+
+ return {"userId": data["userId"], "userData": profile_dict}
+
+ def handle_get_user_extend_api_request(self, data: Dict) -> Dict:
+ extend = self.data.profile.get_profile_extend(data["userId"], self.version)
+ if extend is None:
+ return
+
+ extend_dict = extend._asdict()
+ extend_dict.pop("id")
+ extend_dict.pop("user")
+ extend_dict.pop("version")
+
+ return {"userId": data["userId"], "userExtend": extend_dict}
+
+ def handle_get_user_option_api_request(self, data: Dict) -> Dict:
+ options = self.data.profile.get_profile_option(data["userId"], self.version)
+ if options is None:
+ return
+
+ options_dict = options._asdict()
+ options_dict.pop("id")
+ options_dict.pop("user")
+ options_dict.pop("version")
+
+ return {"userId": data["userId"], "userOption": options_dict}
+
+ def handle_get_user_card_api_request(self, data: Dict) -> Dict:
+ user_cards = self.data.item.get_cards(data["userId"])
+ if user_cards is None:
+ return {"userId": data["userId"], "nextIndex": 0, "userCardList": []}
+
+ max_ct = data["maxCount"]
+ next_idx = data["nextIndex"]
+ start_idx = next_idx
+ end_idx = max_ct + start_idx
+
+ if len(user_cards[start_idx:]) > max_ct:
+ next_idx += max_ct
+ else:
+ next_idx = 0
+
+ card_list = []
+ for card in user_cards:
+ tmp = card._asdict()
+ tmp.pop("id")
+ tmp.pop("user")
+ tmp["startDate"] = datetime.strftime(
+ tmp["startDate"], Mai2Constants.DATE_TIME_FORMAT
+ )
+ tmp["endDate"] = datetime.strftime(
+ tmp["endDate"], Mai2Constants.DATE_TIME_FORMAT
+ )
+ card_list.append(tmp)
+
+ return {
+ "userId": data["userId"],
+ "nextIndex": next_idx,
+ "userCardList": card_list[start_idx:end_idx],
+ }
+
+ def handle_get_user_charge_api_request(self, data: Dict) -> Dict:
+ user_charges = self.data.item.get_charges(data["userId"])
+ if user_charges is None:
+ return {"userId": data["userId"], "length": 0, "userChargeList": []}
+
+ user_charge_list = []
+ for charge in user_charges:
+ tmp = charge._asdict()
+ tmp.pop("id")
+ tmp.pop("user")
+ tmp["purchaseDate"] = datetime.strftime(
+ tmp["purchaseDate"], Mai2Constants.DATE_TIME_FORMAT
+ )
+ tmp["validDate"] = datetime.strftime(
+ tmp["validDate"], Mai2Constants.DATE_TIME_FORMAT
+ )
+
+ user_charge_list.append(tmp)
+
+ return {
+ "userId": data["userId"],
+ "length": len(user_charge_list),
+ "userChargeList": user_charge_list,
+ }
+
+ def handle_get_user_item_api_request(self, data: Dict) -> Dict:
+ kind = int(data["nextIndex"] / 10000000000)
+ next_idx = int(data["nextIndex"] % 10000000000)
+ user_item_list = self.data.item.get_items(data["userId"], kind)
+
+ items: List[Dict[str, Any]] = []
+ for i in range(next_idx, len(user_item_list)):
+ tmp = user_item_list[i]._asdict()
+ tmp.pop("user")
+ tmp.pop("id")
+ items.append(tmp)
+ if len(items) >= int(data["maxCount"]):
+ break
+
+ xout = kind * 10000000000 + next_idx + len(items)
+
+ if len(items) < int(data["maxCount"]):
+ next_idx = 0
+ else:
+ next_idx = xout
+
+ return {
+ "userId": data["userId"],
+ "nextIndex": next_idx,
+ "itemKind": kind,
+ "userItemList": items,
+ }
+
+ def handle_get_user_character_api_request(self, data: Dict) -> Dict:
+ characters = self.data.item.get_characters(data["userId"])
+
+ chara_list = []
+ for chara in characters:
+ tmp = chara._asdict()
+ tmp.pop("id")
+ tmp.pop("user")
+ chara_list.append(tmp)
+
+ return {"userId": data["userId"], "userCharacterList": chara_list}
+
+ def handle_get_user_favorite_api_request(self, data: Dict) -> Dict:
+ favorites = self.data.item.get_favorites(data["userId"], data["itemKind"])
+ if favorites is None:
+ return
+
+ userFavs = []
+ for fav in favorites:
+ userFavs.append(
+ {
+ "userId": data["userId"],
+ "itemKind": fav["itemKind"],
+ "itemIdList": fav["itemIdList"],
+ }
+ )
+
+ return {"userId": data["userId"], "userFavoriteData": userFavs}
+
+ def handle_get_user_ghost_api_request(self, data: Dict) -> Dict:
+ ghost = self.data.profile.get_profile_ghost(data["userId"], self.version)
+ if ghost is None:
+ return
+
+ ghost_dict = ghost._asdict()
+ ghost_dict.pop("user")
+ ghost_dict.pop("id")
+ ghost_dict.pop("version_int")
+
+ return {"userId": data["userId"], "userGhost": ghost_dict}
+
+ def handle_get_user_rating_api_request(self, data: Dict) -> Dict:
+ rating = self.data.profile.get_profile_rating(data["userId"], self.version)
+ if rating is None:
+ return
+
+ rating_dict = rating._asdict()
+ rating_dict.pop("user")
+ rating_dict.pop("id")
+ rating_dict.pop("version")
+
+ return {"userId": data["userId"], "userRating": rating_dict}
+
+ def handle_get_user_activity_api_request(self, data: Dict) -> Dict:
+ """
+ kind 1 is playlist, kind 2 is music list
+ """
+ playlist = self.data.profile.get_profile_activity(data["userId"], 1)
+ musiclist = self.data.profile.get_profile_activity(data["userId"], 2)
+ if playlist is None or musiclist is None:
+ return
+
+ plst = []
+ mlst = []
+
+ for play in playlist:
+ tmp = play._asdict()
+ tmp["id"] = tmp["activityId"]
+ tmp.pop("activityId")
+ tmp.pop("user")
+ plst.append(tmp)
+
+ for music in musiclist:
+ tmp = music._asdict()
+ tmp["id"] = tmp["activityId"]
+ tmp.pop("activityId")
+ tmp.pop("user")
+ mlst.append(tmp)
+
+ return {"userActivity": {"playList": plst, "musicList": mlst}}
+
+ def handle_get_user_course_api_request(self, data: Dict) -> Dict:
+ user_courses = self.data.score.get_courses(data["userId"])
+ if user_courses is None:
+ return {"userId": data["userId"], "nextIndex": 0, "userCourseList": []}
+
+ course_list = []
+ for course in user_courses:
+ tmp = course._asdict()
+ tmp.pop("user")
+ tmp.pop("id")
+ course_list.append(tmp)
+
+ return {"userId": data["userId"], "nextIndex": 0, "userCourseList": course_list}
+
+ def handle_get_user_portrait_api_request(self, data: Dict) -> Dict:
+ # No support for custom pfps
+ return {"length": 0, "userPortraitList": []}
+
+ def handle_get_user_friend_season_ranking_api_request(self, data: Dict) -> Dict:
+ friend_season_ranking = self.data.item.get_friend_season_ranking(data["userId"])
+ if friend_season_ranking is None:
+ return {
+ "userId": data["userId"],
+ "nextIndex": 0,
+ "userFriendSeasonRankingList": [],
+ }
+
+ friend_season_ranking_list = []
+ next_idx = int(data["nextIndex"])
+ max_ct = int(data["maxCount"])
+
+ for x in range(next_idx, len(friend_season_ranking)):
+ tmp = friend_season_ranking[x]._asdict()
+ tmp.pop("user")
+ tmp.pop("id")
+ tmp["recordDate"] = datetime.strftime(
+ tmp["recordDate"], f"{Mai2Constants.DATE_TIME_FORMAT}.0"
+ )
+ friend_season_ranking_list.append(tmp)
+
+ if len(friend_season_ranking_list) >= max_ct:
+ break
+
+ if len(friend_season_ranking) >= next_idx + max_ct:
+ next_idx += max_ct
+ else:
+ next_idx = 0
+
+ return {
+ "userId": data["userId"],
+ "nextIndex": next_idx,
+ "userFriendSeasonRankingList": friend_season_ranking_list,
+ }
+
+ def handle_get_user_map_api_request(self, data: Dict) -> Dict:
+ maps = self.data.item.get_maps(data["userId"])
+ if maps is None:
+ return {
+ "userId": data["userId"],
+ "nextIndex": 0,
+ "userMapList": [],
+ }
+
+ map_list = []
+ next_idx = int(data["nextIndex"])
+ max_ct = int(data["maxCount"])
+
+ for x in range(next_idx, len(maps)):
+ tmp = maps[x]._asdict()
+ tmp.pop("user")
+ tmp.pop("id")
+ map_list.append(tmp)
+
+ if len(map_list) >= max_ct:
+ break
+
+ if len(maps) >= next_idx + max_ct:
+ next_idx += max_ct
+ else:
+ next_idx = 0
+
+ return {
+ "userId": data["userId"],
+ "nextIndex": next_idx,
+ "userMapList": map_list,
+ }
+
+ def handle_get_user_login_bonus_api_request(self, data: Dict) -> Dict:
+ login_bonuses = self.data.item.get_login_bonuses(data["userId"])
+ if login_bonuses is None:
+ return {
+ "userId": data["userId"],
+ "nextIndex": 0,
+ "userLoginBonusList": [],
+ }
+
+ login_bonus_list = []
+ next_idx = int(data["nextIndex"])
+ max_ct = int(data["maxCount"])
+
+ for x in range(next_idx, len(login_bonuses)):
+ tmp = login_bonuses[x]._asdict()
+ tmp.pop("user")
+ tmp.pop("id")
+ login_bonus_list.append(tmp)
+
+ if len(login_bonus_list) >= max_ct:
+ break
+
+ if len(login_bonuses) >= next_idx + max_ct:
+ next_idx += max_ct
+ else:
+ next_idx = 0
+
+ return {
+ "userId": data["userId"],
+ "nextIndex": next_idx,
+ "userLoginBonusList": login_bonus_list,
+ }
+
+ def handle_get_user_region_api_request(self, data: Dict) -> Dict:
+ return {"userId": data["userId"], "length": 0, "userRegionList": []}
+
+ def handle_get_user_music_api_request(self, data: Dict) -> Dict:
+ songs = self.data.score.get_best_scores(data["userId"])
+ music_detail_list = []
+ next_index = 0
+
+ if songs is not None:
+ for song in songs:
+ tmp = song._asdict()
+ tmp.pop("id")
+ tmp.pop("user")
+ music_detail_list.append(tmp)
+
+ if len(music_detail_list) == data["maxCount"]:
+ next_index = data["maxCount"] + data["nextIndex"]
+ break
+
+ return {
+ "userId": data["userId"],
+ "nextIndex": next_index,
+ "userMusicList": [{"userMusicDetailList": music_detail_list}],
+ }
+
+ def handle_user_login_api_request(self, data: Dict) -> Dict:
+ ret = super().handle_user_login_api_request(data)
+ if ret is None or not ret:
+ return ret
+ ret['loginId'] = ret.get('loginCount', 0)
+ return ret
diff --git a/titles/mai2/plus.py b/titles/mai2/dxplus.py
similarity index 85%
rename from titles/mai2/plus.py
rename to titles/mai2/dxplus.py
index a3c9288..9062ff5 100644
--- a/titles/mai2/plus.py
+++ b/titles/mai2/dxplus.py
@@ -4,12 +4,12 @@ import pytz
import json
from core.config import CoreConfig
-from titles.mai2.base import Mai2Base
+from titles.mai2.dx import Mai2DX
from titles.mai2.config import Mai2Config
from titles.mai2.const import Mai2Constants
-class Mai2Plus(Mai2Base):
+class Mai2DXPlus(Mai2DX):
def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
super().__init__(cfg, game_cfg)
self.version = Mai2Constants.VER_MAIMAI_DX_PLUS
diff --git a/titles/mai2/festival.py b/titles/mai2/festival.py
index 4e51619..fcdd4ed 100644
--- a/titles/mai2/festival.py
+++ b/titles/mai2/festival.py
@@ -14,7 +14,7 @@ class Mai2Festival(Mai2UniversePlus):
def handle_cm_get_user_preview_api_request(self, data: Dict) -> Dict:
user_data = super().handle_cm_get_user_preview_api_request(data)
- # hardcode lastDataVersion for CardMaker 1.36
+ # hardcode lastDataVersion for CardMaker 1.35
user_data["lastDataVersion"] = "1.30.00"
return user_data
diff --git a/titles/mai2/finale.py b/titles/mai2/finale.py
new file mode 100644
index 0000000..e29196f
--- /dev/null
+++ b/titles/mai2/finale.py
@@ -0,0 +1,23 @@
+from typing import Any, List, Dict
+from datetime import datetime, timedelta
+import pytz
+import json
+
+from core.config import CoreConfig
+from titles.mai2.base import Mai2Base
+from titles.mai2.config import Mai2Config
+from titles.mai2.const import Mai2Constants
+
+
+class Mai2Finale(Mai2Base):
+ def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
+ super().__init__(cfg, game_cfg)
+ self.version = Mai2Constants.VER_MAIMAI_FINALE
+ self.can_deliver = True
+ self.can_usbdl = True
+
+ if self.core_config.server.is_develop and self.core_config.title.port > 0:
+ self.old_server = f"http://{self.core_config.title.hostname}:{self.core_config.title.port}/SDEY/197/"
+
+ else:
+ self.old_server = f"http://{self.core_config.title.hostname}/SDEY/197/"
diff --git a/titles/mai2/index.py b/titles/mai2/index.py
index 1b92842..9652fc8 100644
--- a/titles/mai2/index.py
+++ b/titles/mai2/index.py
@@ -1,4 +1,5 @@
from twisted.web.http import Request
+from twisted.web.server import NOT_DONE_YET
import json
import inflection
import yaml
@@ -6,7 +7,7 @@ import string
import logging, coloredlogs
import zlib
from logging.handlers import TimedRotatingFileHandler
-from os import path
+from os import path, mkdir
from typing import Tuple
from core.config import CoreConfig
@@ -14,7 +15,9 @@ from core.utils import Utils
from titles.mai2.config import Mai2Config
from titles.mai2.const import Mai2Constants
from titles.mai2.base import Mai2Base
-from titles.mai2.plus import Mai2Plus
+from titles.mai2.finale import Mai2Finale
+from titles.mai2.dx import Mai2DX
+from titles.mai2.dxplus import Mai2DXPlus
from titles.mai2.splash import Mai2Splash
from titles.mai2.splashplus import Mai2SplashPlus
from titles.mai2.universe import Mai2Universe
@@ -33,7 +36,20 @@ class Mai2Servlet:
self.versions = [
Mai2Base,
- Mai2Plus,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ None,
+ Mai2Finale,
+ Mai2DX,
+ Mai2DXPlus,
Mai2Splash,
Mai2SplashPlus,
Mai2Universe,
@@ -42,27 +58,29 @@ class Mai2Servlet:
]
self.logger = logging.getLogger("mai2")
- log_fmt_str = "[%(asctime)s] Mai2 | %(levelname)s | %(message)s"
- log_fmt = logging.Formatter(log_fmt_str)
- fileHandler = TimedRotatingFileHandler(
- "{0}/{1}.log".format(self.core_cfg.server.log_dir, "mai2"),
- encoding="utf8",
- when="d",
- backupCount=10,
- )
+ if not hasattr(self.logger, "initted"):
+ log_fmt_str = "[%(asctime)s] Mai2 | %(levelname)s | %(message)s"
+ log_fmt = logging.Formatter(log_fmt_str)
+ fileHandler = TimedRotatingFileHandler(
+ "{0}/{1}.log".format(self.core_cfg.server.log_dir, "mai2"),
+ encoding="utf8",
+ when="d",
+ backupCount=10,
+ )
- fileHandler.setFormatter(log_fmt)
+ fileHandler.setFormatter(log_fmt)
- consoleHandler = logging.StreamHandler()
- consoleHandler.setFormatter(log_fmt)
+ consoleHandler = logging.StreamHandler()
+ consoleHandler.setFormatter(log_fmt)
- self.logger.addHandler(fileHandler)
- self.logger.addHandler(consoleHandler)
+ self.logger.addHandler(fileHandler)
+ self.logger.addHandler(consoleHandler)
- self.logger.setLevel(self.game_cfg.server.loglevel)
- coloredlogs.install(
- level=self.game_cfg.server.loglevel, logger=self.logger, fmt=log_fmt_str
- )
+ self.logger.setLevel(self.game_cfg.server.loglevel)
+ coloredlogs.install(
+ level=self.game_cfg.server.loglevel, logger=self.logger, fmt=log_fmt_str
+ )
+ self.logger.initted = True
@classmethod
def get_allnet_info(
@@ -82,18 +100,35 @@ class Mai2Servlet:
return (
True,
f"http://{core_cfg.title.hostname}:{core_cfg.title.port}/{game_code}/$v/",
- f"{core_cfg.title.hostname}:{core_cfg.title.port}/",
+ f"{core_cfg.title.hostname}",
)
return (
True,
f"http://{core_cfg.title.hostname}/{game_code}/$v/",
- f"{core_cfg.title.hostname}/",
+ f"{core_cfg.title.hostname}",
)
+ def setup(self):
+ if self.game_cfg.uploads.photos and self.game_cfg.uploads.photos_dir and not path.exists(self.game_cfg.uploads.photos_dir):
+ try:
+ mkdir(self.game_cfg.uploads.photos_dir)
+ except Exception:
+ self.logger.error(f"Failed to make photo upload directory at {self.game_cfg.uploads.photos_dir}")
+
+ if self.game_cfg.uploads.movies and self.game_cfg.uploads.movies_dir and not path.exists(self.game_cfg.uploads.movies_dir):
+ try:
+ mkdir(self.game_cfg.uploads.movies_dir)
+ except Exception:
+ self.logger.error(f"Failed to make movie upload directory at {self.game_cfg.uploads.movies_dir}")
+
def render_POST(self, request: Request, version: int, url_path: str) -> bytes:
if url_path.lower() == "ping":
return zlib.compress(b'{"returnCode": "1"}')
+
+ elif url_path.startswith("api/movie/"):
+ self.logger.info(f"Movie data: {url_path} - {request.content.getvalue()}")
+ return b""
req_raw = request.content.getvalue()
url = request.uri.decode()
@@ -102,21 +137,50 @@ class Mai2Servlet:
endpoint = url_split[len(url_split) - 1]
client_ip = Utils.get_ip_addr(request)
- if version < 105: # 1.0
- internal_ver = Mai2Constants.VER_MAIMAI_DX
- elif version >= 105 and version < 110: # Plus
- internal_ver = Mai2Constants.VER_MAIMAI_DX_PLUS
- elif version >= 110 and version < 115: # Splash
- internal_ver = Mai2Constants.VER_MAIMAI_DX_SPLASH
- elif version >= 115 and version < 120: # Splash Plus
- internal_ver = Mai2Constants.VER_MAIMAI_DX_SPLASH_PLUS
- elif version >= 120 and version < 125: # Universe
- internal_ver = Mai2Constants.VER_MAIMAI_DX_UNIVERSE
- elif version >= 125 and version < 130: # Universe Plus
- internal_ver = Mai2Constants.VER_MAIMAI_DX_UNIVERSE_PLUS
- elif version >= 130: # Festival
- internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL
+ if request.uri.startswith(b"/SDEZ"):
+ if version < 105: # 1.0
+ internal_ver = Mai2Constants.VER_MAIMAI_DX
+ elif version >= 105 and version < 110: # Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_DX_PLUS
+ elif version >= 110 and version < 115: # Splash
+ internal_ver = Mai2Constants.VER_MAIMAI_DX_SPLASH
+ elif version >= 115 and version < 120: # Splash Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_DX_SPLASH_PLUS
+ elif version >= 120 and version < 125: # Universe
+ internal_ver = Mai2Constants.VER_MAIMAI_DX_UNIVERSE
+ elif version >= 125 and version < 130: # Universe Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_DX_UNIVERSE_PLUS
+ elif version >= 130: # Festival
+ internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL
+ else:
+ if version < 110: # 1.0
+ internal_ver = Mai2Constants.VER_MAIMAI
+ elif version >= 110 and version < 120: # Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_PLUS
+ elif version >= 120 and version < 130: # Green
+ internal_ver = Mai2Constants.VER_MAIMAI_GREEN
+ elif version >= 130 and version < 140: # Green Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_GREEN_PLUS
+ elif version >= 140 and version < 150: # Orange
+ internal_ver = Mai2Constants.VER_MAIMAI_ORANGE
+ elif version >= 150 and version < 160: # Orange Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_ORANGE_PLUS
+ elif version >= 160 and version < 170: # Pink
+ internal_ver = Mai2Constants.VER_MAIMAI_PINK
+ elif version >= 170 and version < 180: # Pink Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_PINK_PLUS
+ elif version >= 180 and version < 185: # Murasaki
+ internal_ver = Mai2Constants.VER_MAIMAI_MURASAKI
+ elif version >= 185 and version < 190: # Murasaki Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_MURASAKI_PLUS
+ elif version >= 190 and version < 195: # Milk
+ internal_ver = Mai2Constants.VER_MAIMAI_MILK
+ elif version >= 195 and version < 197: # Milk Plus
+ internal_ver = Mai2Constants.VER_MAIMAI_MILK_PLUS
+ elif version >= 197: # Finale
+ internal_ver = Mai2Constants.VER_MAIMAI_FINALE
+
if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32:
# If we get a 32 character long hex string, it's a hash and we're
# doing encrypted. The likelyhood of false positives is low but
@@ -159,3 +223,39 @@ class Mai2Servlet:
self.logger.debug(f"Response {resp}")
return zlib.compress(json.dumps(resp, ensure_ascii=False).encode("utf-8"))
+
+ def render_GET(self, request: Request, version: int, url_path: str) -> bytes:
+ self.logger.info(f"v{version} GET {url_path}")
+ url_split = url_path.split("/")
+
+ if (url_split[0] == "api" and url_split[1] == "movie") or url_split[0] == "movie":
+ if url_split[2] == "moviestart":
+ return json.dumps({"moviestart":{"status":"OK"}}).encode()
+
+ if url_split[0] == "old":
+ if url_split[1] == "ping":
+ self.logger.info(f"v{version} old server ping")
+ return zlib.compress(b"ok")
+
+ elif url_split[1].startswith("userdata"):
+ self.logger.info(f"v{version} old server userdata inquire")
+ return zlib.compress(b"{}")
+
+ elif url_split[1].startswith("friend"):
+ self.logger.info(f"v{version} old server friend inquire")
+ return zlib.compress(b"{}")
+
+ elif url_split[0] == "usbdl":
+ if url_split[1] == "CONNECTIONTEST":
+ self.logger.info(f"v{version} usbdl server test")
+ return zlib.compress(b"ok")
+
+ elif url_split[0] == "deliver":
+ file = url_split[len(url_split) - 1]
+ self.logger.info(f"v{version} {file} deliver inquire")
+
+ if not self.game_cfg.deliver.enable or not path.exists(f"{self.game_cfg.deliver.content_folder}/{file}"):
+ return zlib.compress(b"")
+
+ else:
+ return zlib.compress(b"{}")
diff --git a/titles/mai2/read.py b/titles/mai2/read.py
index 5809464..4ff401d 100644
--- a/titles/mai2/read.py
+++ b/titles/mai2/read.py
@@ -4,6 +4,9 @@ import os
import re
import xml.etree.ElementTree as ET
from typing import Any, Dict, List, Optional
+from Crypto.Cipher import AES
+import zlib
+import codecs
from core.config import CoreConfig
from core.data import Data
@@ -34,18 +37,147 @@ class Mai2Reader(BaseReader):
def read(self) -> None:
data_dirs = []
- if self.bin_dir is not None:
- data_dirs += self.get_data_directories(self.bin_dir)
+ if self.version >= Mai2Constants.VER_MAIMAI_DX:
+ if self.bin_dir is not None:
+ data_dirs += self.get_data_directories(self.bin_dir)
- if self.opt_dir is not None:
- data_dirs += self.get_data_directories(self.opt_dir)
+ if self.opt_dir is not None:
+ data_dirs += self.get_data_directories(self.opt_dir)
- for dir in data_dirs:
- self.logger.info(f"Read from {dir}")
- self.get_events(f"{dir}/event")
- self.disable_events(f"{dir}/information", f"{dir}/scoreRanking")
- self.read_music(f"{dir}/music")
- self.read_tickets(f"{dir}/ticket")
+ for dir in data_dirs:
+ self.logger.info(f"Read from {dir}")
+ self.get_events(f"{dir}/event")
+ self.disable_events(f"{dir}/information", f"{dir}/scoreRanking")
+ self.read_music(f"{dir}/music")
+ self.read_tickets(f"{dir}/ticket")
+
+ else:
+ if not os.path.exists(f"{self.bin_dir}/tables"):
+ self.logger.error(f"tables directory not found in {self.bin_dir}")
+ return
+
+ if self.version >= Mai2Constants.VER_MAIMAI_MILK:
+ if self.extra is None:
+ self.logger.error("Milk - Finale requre an AES key via a hex string send as the --extra flag")
+ return
+
+ key = bytes.fromhex(self.extra)
+
+ else:
+ key = None
+
+ evt_table = self.load_table_raw(f"{self.bin_dir}/tables", "mmEvent.bin", key)
+ txt_table = self.load_table_raw(f"{self.bin_dir}/tables", "mmtextout_jp.bin", key)
+ score_table = self.load_table_raw(f"{self.bin_dir}/tables", "mmScore.bin", key)
+
+ self.read_old_events(evt_table)
+ self.read_old_music(score_table, txt_table)
+
+ if self.opt_dir is not None:
+ evt_table = self.load_table_raw(f"{self.opt_dir}/tables", "mmEvent.bin", key)
+ txt_table = self.load_table_raw(f"{self.opt_dir}/tables", "mmtextout_jp.bin", key)
+ score_table = self.load_table_raw(f"{self.opt_dir}/tables", "mmScore.bin", key)
+
+ self.read_old_events(evt_table)
+ self.read_old_music(score_table, txt_table)
+
+ return
+
+ def load_table_raw(self, dir: str, file: str, key: Optional[bytes]) -> Optional[List[Dict[str, str]]]:
+ if not os.path.exists(f"{dir}/{file}"):
+ self.logger.warn(f"file {file} does not exist in directory {dir}, skipping")
+ return
+
+ self.logger.info(f"Load table {file} from {dir}")
+ if key is not None:
+ cipher = AES.new(key, AES.MODE_CBC)
+ with open(f"{dir}/{file}", "rb") as f:
+ f_encrypted = f.read()
+ f_data = cipher.decrypt(f_encrypted)[0x10:]
+
+ else:
+ with open(f"{dir}/{file}", "rb") as f:
+ f_data = f.read()[0x10:]
+
+ if f_data is None or not f_data:
+ self.logger.warn(f"file {dir} could not be read, skipping")
+ return
+
+ f_data_deflate = zlib.decompress(f_data, wbits = zlib.MAX_WBITS | 16)[0x12:] # lop off the junk at the beginning
+ f_decoded = codecs.utf_16_le_decode(f_data_deflate)[0]
+ f_split = f_decoded.splitlines()
+
+ has_struct_def = "struct " in f_decoded
+ is_struct = False
+ struct_def = []
+ tbl_content = []
+
+ if has_struct_def:
+ for x in f_split:
+ if x.startswith("struct "):
+ is_struct = True
+ struct_name = x[7:-1]
+ continue
+
+ if x.startswith("};"):
+ is_struct = False
+ break
+
+ if is_struct:
+ try:
+ struct_def.append(x[x.rindex(" ") + 2: -1])
+ except ValueError:
+ self.logger.warn(f"rindex failed on line {x}")
+
+ if is_struct:
+ self.logger.warn("Struct not formatted properly")
+
+ if not struct_def:
+ self.logger.warn("Struct def not found")
+
+ name = file[:file.index(".")]
+ if "_" in name:
+ name = name[:file.index("_")]
+
+ for x in f_split:
+ if not x.startswith(name.upper()):
+ continue
+
+ line_match = re.match(r"(\w+)\((.*?)\)([ ]+\/{3}<[ ]+(.*))?", x)
+ if line_match is None:
+ continue
+
+ if not line_match.group(1) == name.upper():
+ self.logger.warn(f"Strange regex match for line {x} -> {line_match}")
+ continue
+
+ vals = line_match.group(2)
+ comment = line_match.group(4)
+ line_dict = {}
+
+ vals_split = vals.split(",")
+ for y in range(len(vals_split)):
+ stripped = vals_split[y].strip().lstrip("L\"").lstrip("\"").rstrip("\"")
+ if not stripped or stripped is None:
+ continue
+
+ if has_struct_def and len(struct_def) > y:
+ line_dict[struct_def[y]] = stripped
+
+ else:
+ line_dict[f'item_{y}'] = stripped
+
+ if comment:
+ line_dict['comment'] = comment
+
+ tbl_content.append(line_dict)
+
+ if tbl_content:
+ return tbl_content
+
+ else:
+ self.logger.warning("Failed load table content, skipping")
+ return
def get_events(self, base_dir: str) -> None:
self.logger.info(f"Reading events from {base_dir}...")
@@ -188,3 +320,24 @@ class Mai2Reader(BaseReader):
self.version, id, ticket_type, price, name
)
self.logger.info(f"Added ticket {id}...")
+
+ def read_old_events(self, events: Optional[List[Dict[str, str]]]) -> None:
+ if events is None:
+ return
+
+ for event in events:
+ evt_id = int(event.get('イベントID', '0'))
+ evt_expire_time = float(event.get('オフ時強制時期', '0.0'))
+ is_exp = bool(int(event.get('海外許可', '0')))
+ is_aou = bool(int(event.get('AOU許可', '0')))
+ name = event.get('comment', f'evt_{evt_id}')
+
+ self.data.static.put_game_event(self.version, 0, evt_id, name)
+
+ if not (is_exp or is_aou):
+ self.data.static.toggle_game_event(self.version, evt_id, False)
+
+ def read_old_music(self, scores: Optional[List[Dict[str, str]]], text: Optional[List[Dict[str, str]]]) -> None:
+ if scores is None or text is None:
+ return
+ # TODO
diff --git a/titles/mai2/schema/item.py b/titles/mai2/schema/item.py
index 6280bbb..284365f 100644
--- a/titles/mai2/schema/item.py
+++ b/titles/mai2/schema/item.py
@@ -18,10 +18,11 @@ character = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("characterId", Integer, nullable=False),
- Column("level", Integer, nullable=False, server_default="1"),
- Column("awakening", Integer, nullable=False, server_default="0"),
- Column("useCount", Integer, nullable=False, server_default="0"),
+ Column("characterId", Integer),
+ Column("level", Integer),
+ Column("awakening", Integer),
+ Column("useCount", Integer),
+ Column("point", Integer),
UniqueConstraint("user", "characterId", name="mai2_item_character_uk"),
mysql_charset="utf8mb4",
)
@@ -35,12 +36,12 @@ card = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("cardId", Integer, nullable=False),
- Column("cardTypeId", Integer, nullable=False),
- Column("charaId", Integer, nullable=False),
- Column("mapId", Integer, nullable=False),
- Column("startDate", TIMESTAMP, server_default="2018-01-01 00:00:00.0"),
- Column("endDate", TIMESTAMP, server_default="2038-01-01 00:00:00.0"),
+ Column("cardId", Integer),
+ Column("cardTypeId", Integer),
+ Column("charaId", Integer),
+ Column("mapId", Integer),
+ Column("startDate", TIMESTAMP, server_default=func.now()),
+ Column("endDate", TIMESTAMP),
UniqueConstraint("user", "cardId", "cardTypeId", name="mai2_item_card_uk"),
mysql_charset="utf8mb4",
)
@@ -54,10 +55,10 @@ item = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("itemId", Integer, nullable=False),
- Column("itemKind", Integer, nullable=False),
- Column("stock", Integer, nullable=False, server_default="1"),
- Column("isValid", Boolean, nullable=False, server_default="1"),
+ Column("itemId", Integer),
+ Column("itemKind", Integer),
+ Column("stock", Integer),
+ Column("isValid", Boolean),
UniqueConstraint("user", "itemId", "itemKind", name="mai2_item_item_uk"),
mysql_charset="utf8mb4",
)
@@ -71,11 +72,11 @@ map = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("mapId", Integer, nullable=False),
- Column("distance", Integer, nullable=False),
- Column("isLock", Boolean, nullable=False, server_default="0"),
- Column("isClear", Boolean, nullable=False, server_default="0"),
- Column("isComplete", Boolean, nullable=False, server_default="0"),
+ Column("mapId", Integer),
+ Column("distance", Integer),
+ Column("isLock", Boolean),
+ Column("isClear", Boolean),
+ Column("isComplete", Boolean),
UniqueConstraint("user", "mapId", name="mai2_item_map_uk"),
mysql_charset="utf8mb4",
)
@@ -89,10 +90,10 @@ login_bonus = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("bonusId", Integer, nullable=False),
- Column("point", Integer, nullable=False),
- Column("isCurrent", Boolean, nullable=False, server_default="0"),
- Column("isComplete", Boolean, nullable=False, server_default="0"),
+ Column("bonusId", Integer),
+ Column("point", Integer),
+ Column("isCurrent", Boolean),
+ Column("isComplete", Boolean),
UniqueConstraint("user", "bonusId", name="mai2_item_login_bonus_uk"),
mysql_charset="utf8mb4",
)
@@ -106,12 +107,12 @@ friend_season_ranking = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("seasonId", Integer, nullable=False),
- Column("point", Integer, nullable=False),
- Column("rank", Integer, nullable=False),
- Column("rewardGet", Boolean, nullable=False),
- Column("userName", String(8), nullable=False),
- Column("recordDate", TIMESTAMP, nullable=False),
+ Column("seasonId", Integer),
+ Column("point", Integer),
+ Column("rank", Integer),
+ Column("rewardGet", Boolean),
+ Column("userName", String(8)),
+ Column("recordDate", TIMESTAMP),
UniqueConstraint(
"user", "seasonId", "userName", name="mai2_item_friend_season_ranking_uk"
),
@@ -127,7 +128,7 @@ favorite = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("itemKind", Integer, nullable=False),
+ Column("itemKind", Integer),
Column("itemIdList", JSON),
UniqueConstraint("user", "itemKind", name="mai2_item_favorite_uk"),
mysql_charset="utf8mb4",
@@ -142,10 +143,10 @@ charge = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("chargeId", Integer, nullable=False),
- Column("stock", Integer, nullable=False),
- Column("purchaseDate", String(255), nullable=False),
- Column("validDate", String(255), nullable=False),
+ Column("chargeId", Integer),
+ Column("stock", Integer),
+ Column("purchaseDate", String(255)),
+ Column("validDate", String(255)),
UniqueConstraint("user", "chargeId", name="mai2_item_charge_uk"),
mysql_charset="utf8mb4",
)
@@ -161,11 +162,11 @@ print_detail = Table(
),
Column("orderId", Integer),
Column("printNumber", Integer),
- Column("printDate", TIMESTAMP, nullable=False, server_default=func.now()),
- Column("serialId", String(20), nullable=False),
- Column("placeId", Integer, nullable=False),
- Column("clientId", String(11), nullable=False),
- Column("printerSerialId", String(20), nullable=False),
+ Column("printDate", TIMESTAMP, server_default=func.now()),
+ Column("serialId", String(20)),
+ Column("placeId", Integer),
+ Column("clientId", String(11)),
+ Column("printerSerialId", String(20)),
Column("cardRomVersion", Integer),
Column("isHolograph", Boolean, server_default="1"),
Column("printOption1", Boolean, server_default="0"),
@@ -332,6 +333,19 @@ class Mai2ItemData(BaseData):
if result is None:
return None
return result.fetchone()
+
+ def put_character_(self, user_id: int, char_data: Dict) -> Optional[int]:
+ char_data["user"] = user_id
+ sql = insert(character).values(**char_data)
+
+ conflict = sql.on_duplicate_key_update(**char_data)
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.warn(
+ f"put_character_: failed to insert item! user_id: {user_id}"
+ )
+ return None
+ return result.lastrowid
def put_character(
self,
@@ -444,6 +458,8 @@ class Mai2ItemData(BaseData):
card_kind: int,
chara_id: int,
map_id: int,
+ start_date: datetime,
+ end_date: datetime,
) -> Optional[Row]:
sql = insert(card).values(
user=user_id,
@@ -451,9 +467,13 @@ class Mai2ItemData(BaseData):
cardTypeId=card_kind,
charaId=chara_id,
mapId=map_id,
+ startDate=start_date,
+ endDate=end_date,
)
- conflict = sql.on_duplicate_key_update(charaId=chara_id, mapId=map_id)
+ conflict = sql.on_duplicate_key_update(
+ charaId=chara_id, mapId=map_id, startDate=start_date, endDate=end_date
+ )
result = self.execute(conflict)
if result is None:
diff --git a/titles/mai2/schema/profile.py b/titles/mai2/schema/profile.py
index 3cb42d1..916be20 100644
--- a/titles/mai2/schema/profile.py
+++ b/titles/mai2/schema/profile.py
@@ -99,6 +99,68 @@ detail = Table(
mysql_charset="utf8mb4",
)
+detail_old = Table(
+ "maimai_profile_detail",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("version", Integer, nullable=False),
+ Column("lastDataVersion", Integer),
+ Column("userName", String(8)),
+ Column("point", Integer),
+ Column("totalPoint", Integer),
+ Column("iconId", Integer),
+ Column("nameplateId", Integer),
+ Column("frameId", Integer),
+ Column("trophyId", Integer),
+ Column("playCount", Integer),
+ Column("playVsCount", Integer),
+ Column("playSyncCount", Integer),
+ Column("winCount", Integer),
+ Column("helpCount", Integer),
+ Column("comboCount", Integer),
+ Column("feverCount", Integer),
+ Column("totalHiScore", Integer),
+ Column("totalEasyHighScore", Integer),
+ Column("totalBasicHighScore", Integer),
+ Column("totalAdvancedHighScore", Integer),
+ Column("totalExpertHighScore", Integer),
+ Column("totalMasterHighScore", Integer),
+ Column("totalReMasterHighScore", Integer),
+ Column("totalHighSync", Integer),
+ Column("totalEasySync", Integer),
+ Column("totalBasicSync", Integer),
+ Column("totalAdvancedSync", Integer),
+ Column("totalExpertSync", Integer),
+ Column("totalMasterSync", Integer),
+ Column("totalReMasterSync", Integer),
+ Column("playerRating", Integer),
+ Column("highestRating", Integer),
+ Column("rankAuthTailId", Integer),
+ Column("eventWatchedDate", String(255)),
+ Column("webLimitDate", String(255)),
+ Column("challengeTrackPhase", Integer),
+ Column("firstPlayBits", Integer),
+ Column("lastPlayDate", String(255)),
+ Column("lastPlaceId", Integer),
+ Column("lastPlaceName", String(255)),
+ Column("lastRegionId", Integer),
+ Column("lastRegionName", String(255)),
+ Column("lastClientId", String(255)),
+ Column("lastCountryCode", String(255)),
+ Column("eventPoint", Integer),
+ Column("totalLv", Integer),
+ Column("lastLoginBonusDay", Integer),
+ Column("lastSurvivalBonusDay", Integer),
+ Column("loginBonusLv", Integer),
+ UniqueConstraint("user", "version", name="maimai_profile_detail_uk"),
+ mysql_charset="utf8mb4",
+)
+
ghost = Table(
"mai2_profile_ghost",
metadata,
@@ -223,6 +285,99 @@ option = Table(
mysql_charset="utf8mb4",
)
+option_old = Table(
+ "maimai_profile_option",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("version", Integer, nullable=False),
+ Column("soudEffect", Integer),
+ Column("mirrorMode", Integer),
+ Column("guideSpeed", Integer),
+ Column("bgInfo", Integer),
+ Column("brightness", Integer),
+ Column("isStarRot", Integer),
+ Column("breakSe", Integer),
+ Column("slideSe", Integer),
+ Column("hardJudge", Integer),
+ Column("isTagJump", Integer),
+ Column("breakSeVol", Integer),
+ Column("slideSeVol", Integer),
+ Column("isUpperDisp", Integer),
+ Column("trackSkip", Integer),
+ Column("optionMode", Integer),
+ Column("simpleOptionParam", Integer),
+ Column("adjustTiming", Integer),
+ Column("dispTiming", Integer),
+ Column("timingPos", Integer),
+ Column("ansVol", Integer),
+ Column("noteVol", Integer),
+ Column("dmgVol", Integer),
+ Column("appealFlame", Integer),
+ Column("isFeverDisp", Integer),
+ Column("dispJudge", Integer),
+ Column("judgePos", Integer),
+ Column("ratingGuard", Integer),
+ Column("selectChara", Integer),
+ Column("sortType", Integer),
+ Column("filterGenre", Integer),
+ Column("filterLevel", Integer),
+ Column("filterRank", Integer),
+ Column("filterVersion", Integer),
+ Column("filterRec", Integer),
+ Column("filterFullCombo", Integer),
+ Column("filterAllPerfect", Integer),
+ Column("filterDifficulty", Integer),
+ Column("filterFullSync", Integer),
+ Column("filterReMaster", Integer),
+ Column("filterMaxFever", Integer),
+ Column("finalSelectId", Integer),
+ Column("finalSelectCategory", Integer),
+ UniqueConstraint("user", "version", name="maimai_profile_option_uk"),
+ mysql_charset="utf8mb4",
+)
+
+web_opt = Table(
+ "maimai_profile_web_option",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("version", Integer, nullable=False),
+ Column("isNetMember", Boolean),
+ Column("dispRate", Integer),
+ Column("dispJudgeStyle", Integer),
+ Column("dispRank", Integer),
+ Column("dispHomeRanker", Integer),
+ Column("dispTotalLv", Integer),
+ UniqueConstraint("user", "version", name="maimai_profile_web_option_uk"),
+ mysql_charset="utf8mb4",
+)
+
+grade_status = Table(
+ "maimai_profile_grade_status",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("gradeVersion", Integer),
+ Column("gradeLevel", Integer),
+ Column("gradeSubLevel", Integer),
+ Column("gradeMaxId", Integer),
+ UniqueConstraint("user", "gradeVersion", name="maimai_profile_grade_status_uk"),
+ mysql_charset="utf8mb4",
+)
+
rating = Table(
"mai2_profile_rating",
metadata,
@@ -268,42 +423,91 @@ activity = Table(
ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
nullable=False,
),
- Column("kind", Integer, nullable=False),
- Column("activityId", Integer, nullable=False),
- Column("param1", Integer, nullable=False),
- Column("param2", Integer, nullable=False),
- Column("param3", Integer, nullable=False),
- Column("param4", Integer, nullable=False),
- Column("sortNumber", Integer, nullable=False),
+ Column("kind", Integer),
+ Column("activityId", Integer),
+ Column("param1", Integer),
+ Column("param2", Integer),
+ Column("param3", Integer),
+ Column("param4", Integer),
+ Column("sortNumber", Integer),
UniqueConstraint("user", "kind", "activityId", name="mai2_profile_activity_uk"),
mysql_charset="utf8mb4",
)
+boss = Table(
+ "maimai_profile_boss",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("user", ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"), nullable=False),
+ Column("pandoraFlagList0", Integer),
+ Column("pandoraFlagList1", Integer),
+ Column("pandoraFlagList2", Integer),
+ Column("pandoraFlagList3", Integer),
+ Column("pandoraFlagList4", Integer),
+ Column("pandoraFlagList5", Integer),
+ Column("pandoraFlagList6", Integer),
+ Column("emblemFlagList", Integer),
+ UniqueConstraint("user", name="mai2_profile_boss_uk"),
+ mysql_charset="utf8mb4",
+)
+
+recent_rating = Table(
+ "maimai_profile_recent_rating",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("user", ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"), nullable=False),
+ Column("userRecentRatingList", JSON),
+ UniqueConstraint("user", name="mai2_profile_recent_rating_uk"),
+ mysql_charset="utf8mb4",
+)
+
+consec_logins = Table(
+ "mai2_profile_consec_logins",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("user", ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"), nullable=False),
+ Column("version", Integer, nullable=False),
+ Column("logins", Integer),
+ UniqueConstraint("user", "version", name="mai2_profile_consec_logins_uk"),
+ mysql_charset="utf8mb4",
+)
class Mai2ProfileData(BaseData):
def put_profile_detail(
- self, user_id: int, version: int, detail_data: Dict
+ self, user_id: int, version: int, detail_data: Dict, is_dx: bool = True
) -> Optional[Row]:
detail_data["user"] = user_id
detail_data["version"] = version
- sql = insert(detail).values(**detail_data)
+
+ if is_dx:
+ sql = insert(detail).values(**detail_data)
+ else:
+ sql = insert(detail_old).values(**detail_data)
conflict = sql.on_duplicate_key_update(**detail_data)
result = self.execute(conflict)
if result is None:
self.logger.warn(
- f"put_profile: Failed to create profile! user_id {user_id}"
+ f"put_profile: Failed to create profile! user_id {user_id} is_dx {is_dx}"
)
return None
return result.lastrowid
- def get_profile_detail(self, user_id: int, version: int) -> Optional[Row]:
- sql = (
- select(detail)
- .where(and_(detail.c.user == user_id, detail.c.version <= version))
- .order_by(detail.c.version.desc())
- )
+ def get_profile_detail(self, user_id: int, version: int, is_dx: bool = True) -> Optional[Row]:
+ if is_dx:
+ sql = (
+ select(detail)
+ .where(and_(detail.c.user == user_id, detail.c.version <= version))
+ .order_by(detail.c.version.desc())
+ )
+
+ else:
+ sql = (
+ select(detail_old)
+ .where(and_(detail_old.c.user == user_id, detail_old.c.version <= version))
+ .order_by(detail_old.c.version.desc())
+ )
result = self.execute(sql)
if result is None:
@@ -365,26 +569,36 @@ class Mai2ProfileData(BaseData):
return result.fetchone()
def put_profile_option(
- self, user_id: int, version: int, option_data: Dict
+ self, user_id: int, version: int, option_data: Dict, is_dx: bool = True
) -> Optional[int]:
option_data["user"] = user_id
option_data["version"] = version
- sql = insert(option).values(**option_data)
+ if is_dx:
+ sql = insert(option).values(**option_data)
+ else:
+ sql = insert(option_old).values(**option_data)
conflict = sql.on_duplicate_key_update(**option_data)
result = self.execute(conflict)
if result is None:
- self.logger.warn(f"put_profile_option: failed to update! {user_id}")
+ self.logger.warn(f"put_profile_option: failed to update! {user_id} is_dx {is_dx}")
return None
return result.lastrowid
- def get_profile_option(self, user_id: int, version: int) -> Optional[Row]:
- sql = (
- select(option)
- .where(and_(option.c.user == user_id, option.c.version <= version))
- .order_by(option.c.version.desc())
- )
+ def get_profile_option(self, user_id: int, version: int, is_dx: bool = True) -> Optional[Row]:
+ if is_dx:
+ sql = (
+ select(option)
+ .where(and_(option.c.user == user_id, option.c.version <= version))
+ .order_by(option.c.version.desc())
+ )
+ else:
+ sql = (
+ select(option_old)
+ .where(and_(option_old.c.user == user_id, option_old.c.version <= version))
+ .order_by(option_old.c.version.desc())
+ )
result = self.execute(sql)
if result is None:
@@ -474,3 +688,130 @@ class Mai2ProfileData(BaseData):
if result is None:
return None
return result.fetchall()
+
+ def put_web_option(self, user_id: int, version: int, web_opts: Dict) -> Optional[int]:
+ web_opts["user"] = user_id
+ web_opts["version"] = version
+ sql = insert(web_opt).values(**web_opts)
+
+ conflict = sql.on_duplicate_key_update(**web_opts)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.warn(
+ f"put_web_option: failed to update! user_id: {user_id}"
+ )
+ return None
+ return result.lastrowid
+
+ def get_web_option(self, user_id: int, version: int) -> Optional[Row]:
+ sql = web_opt.select(and_(web_opt.c.user == user_id, web_opt.c.version == version))
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def put_grade_status(self, user_id: int, grade_stat: Dict) -> Optional[int]:
+ grade_stat["user"] = user_id
+ sql = insert(grade_status).values(**grade_stat)
+
+ conflict = sql.on_duplicate_key_update(**grade_stat)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.warn(
+ f"put_grade_status: failed to update! user_id: {user_id}"
+ )
+ return None
+ return result.lastrowid
+
+ def get_grade_status(self, user_id: int) -> Optional[Row]:
+ sql = grade_status.select(grade_status.c.user == user_id)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def put_boss_list(self, user_id: int, boss_stat: Dict) -> Optional[int]:
+ boss_stat["user"] = user_id
+ sql = insert(boss).values(**boss_stat)
+
+ conflict = sql.on_duplicate_key_update(**boss_stat)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.warn(
+ f"put_boss_list: failed to update! user_id: {user_id}"
+ )
+ return None
+ return result.lastrowid
+
+ def get_boss_list(self, user_id: int) -> Optional[Row]:
+ sql = boss.select(boss.c.user == user_id)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def put_recent_rating(self, user_id: int, rr: Dict) -> Optional[int]:
+ sql = insert(recent_rating).values(user=user_id, userRecentRatingList=rr)
+
+ conflict = sql.on_duplicate_key_update({'userRecentRatingList': rr})
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.warn(
+ f"put_recent_rating: failed to update! user_id: {user_id}"
+ )
+ return None
+ return result.lastrowid
+
+ def get_recent_rating(self, user_id: int) -> Optional[Row]:
+ sql = recent_rating.select(recent_rating.c.user == user_id)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def add_consec_login(self, user_id: int, version: int) -> None:
+ sql = insert(consec_logins).values(
+ user=user_id,
+ version=version,
+ logins=1
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ logins=consec_logins.c.logins + 1
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(f"Failed to update consecutive login count for user {user_id} version {version}")
+
+ def get_consec_login(self, user_id: int, version: int) -> Optional[Row]:
+ sql = select(consec_logins).where(and_(
+ consec_logins.c.user==user_id,
+ consec_logins.c.version==version,
+ ))
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def reset_consec_login(self, user_id: int, version: int) -> Optional[Row]:
+ sql = consec_logins.update(and_(
+ consec_logins.c.user==user_id,
+ consec_logins.c.version==version,
+ )).values(
+ logins=1
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
diff --git a/titles/mai2/schema/score.py b/titles/mai2/schema/score.py
index 0f7f239..181a895 100644
--- a/titles/mai2/schema/score.py
+++ b/titles/mai2/schema/score.py
@@ -7,6 +7,7 @@ from sqlalchemy.engine import Row
from sqlalchemy.dialects.mysql import insert
from core.data.schema import BaseData, metadata
+from core.data import cached
best_score = Table(
"mai2_score_best",
@@ -174,29 +175,137 @@ course = Table(
mysql_charset="utf8mb4",
)
+playlog_old = Table(
+ "maimai_playlog",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("version", Integer),
+ # Pop access code
+ Column("orderId", Integer),
+ Column("sortNumber", Integer),
+ Column("placeId", Integer),
+ Column("placeName", String(255)),
+ Column("country", String(255)),
+ Column("regionId", Integer),
+ Column("playDate", String(255)),
+ Column("userPlayDate", String(255)),
+ Column("musicId", Integer),
+ Column("level", Integer),
+ Column("gameMode", Integer),
+ Column("rivalNum", Integer),
+ Column("track", Integer),
+ Column("eventId", Integer),
+ Column("isFreeToPlay", Boolean),
+ Column("playerRating", Integer),
+ Column("playedUserId1", Integer),
+ Column("playedUserId2", Integer),
+ Column("playedUserId3", Integer),
+ Column("playedUserName1", String(255)),
+ Column("playedUserName2", String(255)),
+ Column("playedUserName3", String(255)),
+ Column("playedMusicLevel1", Integer),
+ Column("playedMusicLevel2", Integer),
+ Column("playedMusicLevel3", Integer),
+ Column("achievement", Integer),
+ Column("score", Integer),
+ Column("tapScore", Integer),
+ Column("holdScore", Integer),
+ Column("slideScore", Integer),
+ Column("breakScore", Integer),
+ Column("syncRate", Integer),
+ Column("vsWin", Integer),
+ Column("isAllPerfect", Boolean),
+ Column("fullCombo", Integer),
+ Column("maxFever", Integer),
+ Column("maxCombo", Integer),
+ Column("tapPerfect", Integer),
+ Column("tapGreat", Integer),
+ Column("tapGood", Integer),
+ Column("tapBad", Integer),
+ Column("holdPerfect", Integer),
+ Column("holdGreat", Integer),
+ Column("holdGood", Integer),
+ Column("holdBad", Integer),
+ Column("slidePerfect", Integer),
+ Column("slideGreat", Integer),
+ Column("slideGood", Integer),
+ Column("slideBad", Integer),
+ Column("breakPerfect", Integer),
+ Column("breakGreat", Integer),
+ Column("breakGood", Integer),
+ Column("breakBad", Integer),
+ Column("judgeStyle", Integer),
+ Column("isTrackSkip", Boolean),
+ Column("isHighScore", Boolean),
+ Column("isChallengeTrack", Boolean),
+ Column("challengeLife", Integer),
+ Column("challengeRemain", Integer),
+ Column("isAllPerfectPlus", Integer),
+ mysql_charset="utf8mb4",
+)
+
+best_score_old = Table(
+ "maimai_score_best",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("musicId", Integer),
+ Column("level", Integer),
+ Column("playCount", Integer),
+ Column("achievement", Integer),
+ Column("scoreMax", Integer),
+ Column("syncRateMax", Integer),
+ Column("isAllPerfect", Boolean),
+ Column("isAllPerfectPlus", Integer),
+ Column("fullCombo", Integer),
+ Column("maxFever", Integer),
+ UniqueConstraint("user", "musicId", "level", name="maimai_score_best_uk"),
+ mysql_charset="utf8mb4",
+)
class Mai2ScoreData(BaseData):
- def put_best_score(self, user_id: int, score_data: Dict) -> Optional[int]:
+ def put_best_score(self, user_id: int, score_data: Dict, is_dx: bool = True) -> Optional[int]:
score_data["user"] = user_id
- sql = insert(best_score).values(**score_data)
+ if is_dx:
+ sql = insert(best_score).values(**score_data)
+ else:
+ sql = insert(best_score_old).values(**score_data)
conflict = sql.on_duplicate_key_update(**score_data)
result = self.execute(conflict)
if result is None:
self.logger.error(
- f"put_best_score: Failed to insert best score! user_id {user_id}"
+ f"put_best_score: Failed to insert best score! user_id {user_id} is_dx {is_dx}"
)
return None
return result.lastrowid
- def get_best_scores(self, user_id: int, song_id: int = None) -> Optional[List[Row]]:
- sql = best_score.select(
- and_(
- best_score.c.user == user_id,
- (best_score.c.song_id == song_id) if song_id is not None else True,
+ @cached(2)
+ def get_best_scores(self, user_id: int, song_id: int = None, is_dx: bool = True) -> Optional[List[Row]]:
+ if is_dx:
+ sql = best_score.select(
+ and_(
+ best_score.c.user == user_id,
+ (best_score.c.song_id == song_id) if song_id is not None else True,
+ )
+ )
+ else:
+ sql = best_score_old.select(
+ and_(
+ best_score_old.c.user == user_id,
+ (best_score_old.c.song_id == song_id) if song_id is not None else True,
+ )
)
- )
result = self.execute(sql)
if result is None:
@@ -219,15 +328,19 @@ class Mai2ScoreData(BaseData):
return None
return result.fetchone()
- def put_playlog(self, user_id: int, playlog_data: Dict) -> Optional[int]:
+ def put_playlog(self, user_id: int, playlog_data: Dict, is_dx: bool = True) -> Optional[int]:
playlog_data["user"] = user_id
- sql = insert(playlog).values(**playlog_data)
+
+ if is_dx:
+ sql = insert(playlog).values(**playlog_data)
+ else:
+ sql = insert(playlog_old).values(**playlog_data)
conflict = sql.on_duplicate_key_update(**playlog_data)
result = self.execute(conflict)
if result is None:
- self.logger.error(f"put_playlog: Failed to insert! user_id {user_id}")
+ self.logger.error(f"put_playlog: Failed to insert! user_id {user_id} is_dx {is_dx}")
return None
return result.lastrowid
@@ -249,4 +362,4 @@ class Mai2ScoreData(BaseData):
result = self.execute(sql)
if result is None:
return None
- return result.fetchone()
+ return result.fetchall()
diff --git a/titles/mai2/splash.py b/titles/mai2/splash.py
index ad31695..026e3ae 100644
--- a/titles/mai2/splash.py
+++ b/titles/mai2/splash.py
@@ -4,12 +4,12 @@ import pytz
import json
from core.config import CoreConfig
-from titles.mai2.base import Mai2Base
+from titles.mai2.dxplus import Mai2DXPlus
from titles.mai2.config import Mai2Config
from titles.mai2.const import Mai2Constants
-class Mai2Splash(Mai2Base):
+class Mai2Splash(Mai2DXPlus):
def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
super().__init__(cfg, game_cfg)
self.version = Mai2Constants.VER_MAIMAI_DX_SPLASH
diff --git a/titles/mai2/splashplus.py b/titles/mai2/splashplus.py
index 54431c9..438941f 100644
--- a/titles/mai2/splashplus.py
+++ b/titles/mai2/splashplus.py
@@ -4,12 +4,12 @@ import pytz
import json
from core.config import CoreConfig
-from titles.mai2.base import Mai2Base
+from titles.mai2.splash import Mai2Splash
from titles.mai2.config import Mai2Config
from titles.mai2.const import Mai2Constants
-class Mai2SplashPlus(Mai2Base):
+class Mai2SplashPlus(Mai2Splash):
def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
super().__init__(cfg, game_cfg)
self.version = Mai2Constants.VER_MAIMAI_DX_SPLASH_PLUS
diff --git a/titles/mai2/universe.py b/titles/mai2/universe.py
index 56b3e8f..c17f899 100644
--- a/titles/mai2/universe.py
+++ b/titles/mai2/universe.py
@@ -5,12 +5,12 @@ import pytz
import json
from core.config import CoreConfig
-from titles.mai2.base import Mai2Base
+from titles.mai2.splashplus import Mai2SplashPlus
from titles.mai2.const import Mai2Constants
from titles.mai2.config import Mai2Config
-class Mai2Universe(Mai2Base):
+class Mai2Universe(Mai2SplashPlus):
def __init__(self, cfg: CoreConfig, game_cfg: Mai2Config) -> None:
super().__init__(cfg, game_cfg)
self.version = Mai2Constants.VER_MAIMAI_DX_UNIVERSE
@@ -70,13 +70,13 @@ class Mai2Universe(Mai2Base):
tmp.pop("cardName")
tmp.pop("enabled")
- tmp["startDate"] = datetime.strftime(tmp["startDate"], "%Y-%m-%d %H:%M:%S")
- tmp["endDate"] = datetime.strftime(tmp["endDate"], "%Y-%m-%d %H:%M:%S")
+ tmp["startDate"] = datetime.strftime(tmp["startDate"], Mai2Constants.DATE_TIME_FORMAT)
+ tmp["endDate"] = datetime.strftime(tmp["endDate"], Mai2Constants.DATE_TIME_FORMAT)
tmp["noticeStartDate"] = datetime.strftime(
- tmp["noticeStartDate"], "%Y-%m-%d %H:%M:%S"
+ tmp["noticeStartDate"], Mai2Constants.DATE_TIME_FORMAT
)
tmp["noticeEndDate"] = datetime.strftime(
- tmp["noticeEndDate"], "%Y-%m-%d %H:%M:%S"
+ tmp["noticeEndDate"], Mai2Constants.DATE_TIME_FORMAT
)
selling_card_list.append(tmp)
@@ -104,8 +104,12 @@ class Mai2Universe(Mai2Base):
tmp.pop("id")
tmp.pop("user")
- tmp["startDate"] = datetime.strftime(tmp["startDate"], "%Y-%m-%d %H:%M:%S")
- tmp["endDate"] = datetime.strftime(tmp["endDate"], "%Y-%m-%d %H:%M:%S")
+ tmp["startDate"] = datetime.strftime(
+ tmp["startDate"], Mai2Constants.DATE_TIME_FORMAT
+ )
+ tmp["endDate"] = datetime.strftime(
+ tmp["endDate"], Mai2Constants.DATE_TIME_FORMAT
+ )
card_list.append(tmp)
return {
@@ -154,6 +158,10 @@ class Mai2Universe(Mai2Base):
# set a random card serial number
serial_id = "".join([str(randint(0, 9)) for _ in range(20)])
+ # calculate start and end date of the card
+ start_date = datetime.utcnow()
+ end_date = datetime.utcnow() + timedelta(days=15)
+
user_card = upsert["userCard"]
self.data.item.put_card(
user_id,
@@ -161,8 +169,26 @@ class Mai2Universe(Mai2Base):
user_card["cardTypeId"],
user_card["charaId"],
user_card["mapId"],
+ # add the correct start date and also the end date in 15 days
+ start_date,
+ end_date,
)
+ # get the profile extend to save the new bought card
+ extend = self.data.profile.get_profile_extend(user_id, self.version)
+ if extend:
+ extend = extend._asdict()
+ # parse the selectedCardList
+ # 6 = Freedom Pass, 4 = Gold Pass (cardTypeId)
+ selected_cards: List = extend["selectedCardList"]
+
+ # if no pass is already added, add the corresponding pass
+ if not user_card["cardTypeId"] in selected_cards:
+ selected_cards.insert(0, user_card["cardTypeId"])
+
+ extend["selectedCardList"] = selected_cards
+ self.data.profile.put_profile_extend(user_id, self.version, extend)
+
# properly format userPrintDetail for the database
upsert.pop("userCard")
upsert.pop("serialId")
@@ -174,8 +200,8 @@ class Mai2Universe(Mai2Base):
"returnCode": 1,
"orderId": 0,
"serialId": serial_id,
- "startDate": "2018-01-01 00:00:00",
- "endDate": "2038-01-01 00:00:00",
+ "startDate": datetime.strftime(start_date, Mai2Constants.DATE_TIME_FORMAT),
+ "endDate": datetime.strftime(end_date, Mai2Constants.DATE_TIME_FORMAT),
}
def handle_cm_upsert_user_printlog_api_request(self, data: Dict) -> Dict:
diff --git a/titles/ongeki/__init__.py b/titles/ongeki/__init__.py
index 1ba901b..b887ba6 100644
--- a/titles/ongeki/__init__.py
+++ b/titles/ongeki/__init__.py
@@ -7,4 +7,4 @@ index = OngekiServlet
database = OngekiData
reader = OngekiReader
game_codes = [OngekiConstants.GAME_CODE]
-current_schema_version = 4
+current_schema_version = 5
diff --git a/titles/ongeki/base.py b/titles/ongeki/base.py
index 4f7619c..ace1d12 100644
--- a/titles/ongeki/base.py
+++ b/titles/ongeki/base.py
@@ -142,7 +142,7 @@ class OngekiBase:
def handle_get_game_point_api_request(self, data: Dict) -> Dict:
"""
- Sets the GP ammount for A and B sets for 1 - 3 crdits
+ Sets the GP amount for A and B sets for 1 - 3 credits
"""
return {
"length": 6,
@@ -155,13 +155,13 @@ class OngekiBase:
},
{
"type": 1,
- "cost": 200,
+ "cost": 230,
"startDate": "2000-01-01 05:00:00.0",
"endDate": "2099-01-01 05:00:00.0",
},
{
"type": 2,
- "cost": 300,
+ "cost": 370,
"startDate": "2000-01-01 05:00:00.0",
"endDate": "2099-01-01 05:00:00.0",
},
@@ -256,7 +256,11 @@ class OngekiBase:
{
"type": event["type"],
"id": event["eventId"],
- "startDate": "2017-12-05 07:00:00.0",
+ # actually use the startDate from the import so it
+ # properly shows all the events when new ones are imported
+ "startDate": datetime.strftime(
+ event["startDate"], "%Y-%m-%d %H:%M:%S.0"
+ ),
"endDate": "2099-12-31 00:00:00.0",
}
)
@@ -268,7 +272,7 @@ class OngekiBase:
}
def handle_get_game_id_list_api_request(self, data: Dict) -> Dict:
- game_idlist: list[str, Any] = [] # 1 to 230 & 8000 to 8050
+ game_idlist: List[str, Any] = [] # 1 to 230 & 8000 to 8050
if data["type"] == 1:
for i in range(1, 231):
@@ -443,7 +447,7 @@ class OngekiBase:
"userItemList": [],
}
- items: list[Dict[str, Any]] = []
+ items: List[Dict[str, Any]] = []
for i in range(data["nextIndex"] % 10000000000, len(p)):
if len(items) > data["maxCount"]:
break
@@ -560,7 +564,11 @@ class OngekiBase:
def handle_get_user_recent_rating_api_request(self, data: Dict) -> Dict:
recent_rating = self.data.profile.get_profile_recent_rating(data["userId"])
if recent_rating is None:
- return {}
+ return {
+ "userId": data["userId"],
+ "length": 0,
+ "userRecentRatingList": [],
+ }
userRecentRatingList = recent_rating["recentRating"]
diff --git a/titles/ongeki/bright.py b/titles/ongeki/bright.py
index 06155a1..49d6216 100644
--- a/titles/ongeki/bright.py
+++ b/titles/ongeki/bright.py
@@ -43,15 +43,15 @@ class OngekiBright(OngekiBase):
user_data.pop("user")
user_data.pop("version")
- # TODO: replace datetime objects with strings
-
# add access code that we don't store
user_data["accessCode"] = cards[0]["access_code"]
- # hardcode Card Maker version for now
- # Card Maker 1.34.00 = 1.30.01
- # Card Maker 1.36.00 = 1.35.04
- user_data["compatibleCmVersion"] = "1.30.01"
+ # add the compatible card maker version from config
+ card_maker_ver = self.game_cfg.version.version(self.version)
+ if card_maker_ver and card_maker_ver.get("card_maker"):
+ # Card Maker 1.30 = 1.30.01+
+ # Card Maker 1.35 = 1.35.03+
+ user_data["compatibleCmVersion"] = card_maker_ver.get("card_maker")
return {"userId": data["userId"], "userData": user_data}
@@ -333,6 +333,8 @@ class OngekiBright(OngekiBase):
select_point = data["selectPoint"]
total_gacha_count, ceiling_gacha_count = 0, 0
+ # 0 = can still use Gacha Select, 1 = already used Gacha Select
+ use_select_point = 0
daily_gacha_cnt, five_gacha_cnt, eleven_gacha_cnt = 0, 0, 0
daily_gacha_date = datetime.strptime("2000-01-01", "%Y-%m-%d")
@@ -344,6 +346,9 @@ class OngekiBright(OngekiBase):
daily_gacha_cnt = user_gacha["dailyGachaCnt"]
five_gacha_cnt = user_gacha["fiveGachaCnt"]
eleven_gacha_cnt = user_gacha["elevenGachaCnt"]
+ # if the Gacha Select has been used, make sure to keep it
+ if user_gacha["useSelectPoint"] == 1:
+ use_select_point = 1
# parse just the year, month and date
daily_gacha_date = user_gacha["dailyGachaDate"]
@@ -359,7 +364,7 @@ class OngekiBright(OngekiBase):
totalGachaCnt=total_gacha_count + gacha_count,
ceilingGachaCnt=ceiling_gacha_count + gacha_count,
selectPoint=select_point,
- useSelectPoint=0,
+ useSelectPoint=use_select_point,
dailyGachaCnt=daily_gacha_cnt + gacha_count,
fiveGachaCnt=five_gacha_cnt + 1 if gacha_count == 5 else five_gacha_cnt,
elevenGachaCnt=eleven_gacha_cnt + 1
diff --git a/titles/ongeki/brightmemory.py b/titles/ongeki/brightmemory.py
index 6e2548b..d7103a3 100644
--- a/titles/ongeki/brightmemory.py
+++ b/titles/ongeki/brightmemory.py
@@ -136,14 +136,3 @@ class OngekiBrightMemory(OngekiBright):
def handle_get_game_music_release_state_api_request(self, data: Dict) -> Dict:
return {"techScore": 0, "cardNum": 0}
-
- def handle_cm_get_user_data_api_request(self, data: Dict) -> Dict:
- # check for a bright memory profile
- user_data = super().handle_cm_get_user_data_api_request(data)
-
- # hardcode Card Maker version for now
- # Card Maker 1.34 = 1.30.01
- # Card Maker 1.35 = 1.35.03
- user_data["userData"]["compatibleCmVersion"] = "1.35.03"
-
- return user_data
diff --git a/titles/ongeki/config.py b/titles/ongeki/config.py
index 1117b39..c20b1ed 100644
--- a/titles/ongeki/config.py
+++ b/titles/ongeki/config.py
@@ -1,3 +1,4 @@
+from ast import Dict
from typing import List
from core.config import CoreConfig
@@ -33,7 +34,23 @@ class OngekiGachaConfig:
)
+class OngekiCardMakerVersionConfig:
+ def __init__(self, parent_config: "OngekiConfig") -> None:
+ self.__config = parent_config
+
+ def version(self, version: int) -> Dict:
+ """
+ in the form of:
+ : {"card_maker": }
+ 6: {"card_maker": 1.30.01}
+ """
+ return CoreConfig.get_config_field(
+ self.__config, "ongeki", "version", default={}
+ ).get(version)
+
+
class OngekiConfig(dict):
def __init__(self) -> None:
self.server = OngekiServerConfig(self)
self.gachas = OngekiGachaConfig(self)
+ self.version = OngekiCardMakerVersionConfig(self)
diff --git a/titles/ongeki/const.py b/titles/ongeki/const.py
index ceef317..8d4c4ab 100644
--- a/titles/ongeki/const.py
+++ b/titles/ongeki/const.py
@@ -66,13 +66,13 @@ class OngekiConstants:
VERSION_NAMES = (
"ONGEKI",
- "ONGEKI+",
- "ONGEKI Summer",
- "ONGEKI Summer+",
- "ONGEKI Red",
- "ONGEKI Red+",
- "ONGEKI Bright",
- "ONGEKI Bright Memory",
+ "ONGEKI +",
+ "ONGEKI SUMMER",
+ "ONGEKI SUMMER +",
+ "ONGEKI R.E.D.",
+ "ONGEKI R.E.D. +",
+ "ONGEKI bright",
+ "ONGEKI bright MEMORY",
)
@classmethod
diff --git a/titles/ongeki/index.py b/titles/ongeki/index.py
index 7927d84..af206e9 100644
--- a/titles/ongeki/index.py
+++ b/titles/ongeki/index.py
@@ -11,6 +11,7 @@ from os import path
from typing import Tuple
from core.config import CoreConfig
+from core.utils import Utils
from titles.ongeki.config import OngekiConfig
from titles.ongeki.const import OngekiConstants
from titles.ongeki.base import OngekiBase
@@ -101,6 +102,7 @@ class OngekiServlet:
url_split = url_path.split("/")
internal_ver = 0
endpoint = url_split[len(url_split) - 1]
+ client_ip = Utils.get_ip_addr(request)
if version < 105: # 1.0
internal_ver = OngekiConstants.VER_ONGEKI
@@ -137,7 +139,10 @@ class OngekiServlet:
req_data = json.loads(unzip)
- self.logger.info(f"v{version} {endpoint} request - {req_data}")
+ self.logger.info(
+ f"v{version} {endpoint} request from {client_ip}"
+ )
+ self.logger.debug(req_data)
func_to_find = "handle_" + inflection.underscore(endpoint) + "_request"
@@ -156,6 +161,6 @@ class OngekiServlet:
if resp == None:
resp = {"returnCode": 1}
- self.logger.info(f"Response {resp}")
+ self.logger.debug(f"Response {resp}")
return zlib.compress(json.dumps(resp, ensure_ascii=False).encode("utf-8"))
diff --git a/titles/ongeki/schema/profile.py b/titles/ongeki/schema/profile.py
index a112bf2..374503e 100644
--- a/titles/ongeki/schema/profile.py
+++ b/titles/ongeki/schema/profile.py
@@ -316,7 +316,7 @@ class OngekiProfileData(BaseData):
return result.fetchone()
def get_profile_rating_log(self, aime_id: int) -> Optional[List[Row]]:
- sql = select(rating_log).where(recent_rating.c.user == aime_id)
+ sql = select(rating_log).where(rating_log.c.user == aime_id)
result = self.execute(sql)
if result is None:
diff --git a/titles/ongeki/schema/static.py b/titles/ongeki/schema/static.py
index ed81ebf..b34802d 100644
--- a/titles/ongeki/schema/static.py
+++ b/titles/ongeki/schema/static.py
@@ -16,6 +16,7 @@ events = Table(
Column("eventId", Integer),
Column("type", Integer),
Column("name", String(255)),
+ Column("startDate", TIMESTAMP, server_default=func.now()),
Column("enabled", Boolean, server_default="1"),
UniqueConstraint("version", "eventId", "type", name="ongeki_static_events_uk"),
mysql_charset="utf8mb4",
diff --git a/titles/pokken/base.py b/titles/pokken/base.py
index 40e6444..0b849b3 100644
--- a/titles/pokken/base.py
+++ b/titles/pokken/base.py
@@ -1,6 +1,6 @@
from datetime import datetime, timedelta
import json, logging
-from typing import Any, Dict
+from typing import Any, Dict, List
import random
from core.data import Data
@@ -8,6 +8,7 @@ from core import CoreConfig
from .config import PokkenConfig
from .proto import jackal_pb2
from .database import PokkenData
+from .const import PokkenConstants
class PokkenBase:
@@ -44,19 +45,19 @@ class PokkenBase:
biwa_setting = {
"MatchingServer": {
"host": f"https://{self.game_cfg.server.hostname}",
- "port": self.game_cfg.server.port,
+ "port": self.game_cfg.ports.game,
"url": "/SDAK/100/matching",
},
"StunServer": {
- "addr": self.game_cfg.server.hostname,
- "port": self.game_cfg.server.port_stun,
+ "addr": self.game_cfg.server.stun_server_host,
+ "port": self.game_cfg.server.stun_server_port,
},
"TurnServer": {
- "addr": self.game_cfg.server.hostname,
- "port": self.game_cfg.server.port_turn,
+ "addr": self.game_cfg.server.stun_server_host,
+ "port": self.game_cfg.server.stun_server_port,
},
- "AdmissionUrl": f"ws://{self.game_cfg.server.hostname}:{self.game_cfg.server.port_admission}",
- "locationId": 123,
+ "AdmissionUrl": f"ws://{self.game_cfg.server.hostname}:{self.game_cfg.ports.admission}",
+ "locationId": 123, # FIXME: Get arcade's ID from the database
"logfilename": "JackalMatchingLibrary.log",
"biwalogfilename": "./biwa.log",
}
@@ -94,6 +95,7 @@ class PokkenBase:
res.type = jackal_pb2.MessageType.LOAD_CLIENT_SETTINGS
settings = jackal_pb2.LoadClientSettingsResponseData()
+ # TODO: Make configurable
settings.money_magnification = 1
settings.continue_bonus_exp = 100
settings.continue_fight_money = 100
@@ -274,6 +276,100 @@ class PokkenBase:
res.result = 1
res.type = jackal_pb2.MessageType.SAVE_USER
+ req = request.save_user
+ user_id = req.banapass_id
+
+ tut_flgs: List[int] = []
+ ach_flgs: List[int] = []
+ evt_flgs: List[int] = []
+ evt_params: List[int] = []
+
+ get_rank_pts: int = req.get_trainer_rank_point if req.get_trainer_rank_point else 0
+ get_money: int = req.get_money
+ get_score_pts: int = req.get_score_point if req.get_score_point else 0
+ grade_max: int = req.grade_max_num
+ extra_counter: int = req.extra_counter
+ evt_reward_get_flg: int = req.event_reward_get_flag
+ num_continues: int = req.continue_num
+ total_play_days: int = req.total_play_days
+ awake_num: int = req.awake_num # ?
+ use_support_ct: int = req.use_support_num
+ beat_num: int = req.beat_num # ?
+ evt_state: int = req.event_state
+ aid_skill: int = req.aid_skill
+ last_evt: int = req.last_play_event_id
+
+ battle = req.battle_data
+ mon = req.pokemon_data
+
+ p = self.data.profile.touch_profile(user_id)
+ if p is None or not p:
+ self.data.profile.create_profile(user_id)
+
+ if req.trainer_name_pending is not None and req.trainer_name_pending: # we're saving for the first time
+ self.data.profile.set_profile_name(user_id, req.trainer_name_pending, req.avatar_gender if req.avatar_gender else None)
+
+ for tut_flg in req.tutorial_progress_flag:
+ tut_flgs.append(tut_flg)
+
+ self.data.profile.update_profile_tutorial_flags(user_id, tut_flgs)
+
+ for ach_flg in req.achievement_flag:
+ ach_flgs.append(ach_flg)
+
+ self.data.profile.update_profile_tutorial_flags(user_id, ach_flg)
+
+ for evt_flg in req.event_achievement_flag:
+ evt_flgs.append(evt_flg)
+
+ for evt_param in req.event_achievement_param:
+ evt_params.append(evt_param)
+
+ self.data.profile.update_profile_event(user_id, evt_state, evt_flgs, evt_params, )
+
+ for reward in req.reward_data:
+ self.data.item.add_reward(user_id, reward.get_category_id, reward.get_content_id, reward.get_type_id)
+
+ self.data.profile.add_profile_points(user_id, get_rank_pts, get_money, get_score_pts, grade_max)
+
+ self.data.profile.update_support_team(user_id, 1, req.support_set_1[0], req.support_set_1[1])
+ self.data.profile.update_support_team(user_id, 2, req.support_set_2[0], req.support_set_2[1])
+ self.data.profile.update_support_team(user_id, 3, req.support_set_3[0], req.support_set_3[1])
+
+ self.data.profile.put_pokemon(user_id, mon.char_id, mon.illustration_book_no, mon.bp_point_atk, mon.bp_point_res, mon.bp_point_def, mon.bp_point_sp)
+ self.data.profile.add_pokemon_xp(user_id, mon.char_id, mon.get_pokemon_exp)
+
+ for x in range(len(battle.play_mode)):
+ self.data.profile.put_pokemon_battle_result(
+ user_id,
+ mon.char_id,
+ PokkenConstants.BATTLE_TYPE(battle.play_mode[x]),
+ PokkenConstants.BATTLE_RESULT(battle.result[x])
+ )
+
+ self.data.profile.put_stats(
+ user_id,
+ battle.ex_ko_num,
+ battle.wko_num,
+ battle.timeup_win_num,
+ battle.cool_ko_num,
+ battle.perfect_ko_num,
+ num_continues
+ )
+
+ self.data.profile.put_extra(
+ user_id,
+ extra_counter,
+ evt_reward_get_flg,
+ total_play_days,
+ awake_num,
+ use_support_ct,
+ beat_num,
+ aid_skill,
+ last_evt
+ )
+
+
return res.SerializeToString()
def handle_save_ingame_log(self, data: jackal_pb2.Request) -> bytes:
@@ -302,16 +398,35 @@ class PokkenBase:
self, data: Dict = {}, client_ip: str = "127.0.0.1"
) -> Dict:
"""
- "sessionId":"12345678",
+ "sessionId":"12345678",
+ "A":{
+ "pcb_id": data["data"]["must"]["pcb_id"],
+ "gip": client_ip
+ },
+ """
+ return {
+ "data": {
+ "sessionId":"12345678",
"A":{
"pcb_id": data["data"]["must"]["pcb_id"],
"gip": client_ip
},
"list":[]
- """
- return {}
+ }
+ }
def handle_matching_stop_matching(
self, data: Dict = {}, client_ip: str = "127.0.0.1"
) -> Dict:
return {}
+
+ def handle_admission_noop(self, data: Dict, req_ip: str = "127.0.0.1") -> Dict:
+ return {}
+
+ def handle_admission_joinsession(self, data: Dict, req_ip: str = "127.0.0.1") -> Dict:
+ self.logger.info(f"Admission: JoinSession from {req_ip}")
+ return {
+ 'data': {
+ "id": 12345678
+ }
+ }
diff --git a/titles/pokken/config.py b/titles/pokken/config.py
index 84da8d2..d3741af 100644
--- a/titles/pokken/config.py
+++ b/titles/pokken/config.py
@@ -25,30 +25,6 @@ class PokkenServerConfig:
)
)
- @property
- def port(self) -> int:
- return CoreConfig.get_config_field(
- self.__config, "pokken", "server", "port", default=9000
- )
-
- @property
- def port_stun(self) -> int:
- return CoreConfig.get_config_field(
- self.__config, "pokken", "server", "port_stun", default=9001
- )
-
- @property
- def port_turn(self) -> int:
- return CoreConfig.get_config_field(
- self.__config, "pokken", "server", "port_turn", default=9002
- )
-
- @property
- def port_admission(self) -> int:
- return CoreConfig.get_config_field(
- self.__config, "pokken", "server", "port_admission", default=9003
- )
-
@property
def auto_register(self) -> bool:
"""
@@ -59,7 +35,51 @@ class PokkenServerConfig:
self.__config, "pokken", "server", "auto_register", default=True
)
+ @property
+ def enable_matching(self) -> bool:
+ """
+ If global matching should happen
+ """
+ return CoreConfig.get_config_field(
+ self.__config, "pokken", "server", "enable_matching", default=False
+ )
+
+ @property
+ def stun_server_host(self) -> str:
+ """
+ Hostname of the EXTERNAL stun server the game should connect to. This is not handled by artemis.
+ """
+ return CoreConfig.get_config_field(
+ self.__config, "pokken", "server", "stun_server_host", default="stunserver.stunprotocol.org"
+ )
+
+ @property
+ def stun_server_port(self) -> int:
+ """
+ Port of the EXTERNAL stun server the game should connect to. This is not handled by artemis.
+ """
+ return CoreConfig.get_config_field(
+ self.__config, "pokken", "server", "stun_server_port", default=3478
+ )
+
+class PokkenPortsConfig:
+ def __init__(self, parent_config: "PokkenConfig"):
+ self.__config = parent_config
+
+ @property
+ def game(self) -> int:
+ return CoreConfig.get_config_field(
+ self.__config, "pokken", "ports", "game", default=9000
+ )
+
+ @property
+ def admission(self) -> int:
+ return CoreConfig.get_config_field(
+ self.__config, "pokken", "ports", "admission", default=9001
+ )
+
class PokkenConfig(dict):
def __init__(self) -> None:
self.server = PokkenServerConfig(self)
+ self.ports = PokkenPortsConfig(self)
diff --git a/titles/pokken/const.py b/titles/pokken/const.py
index 2eb5357..e7ffdd8 100644
--- a/titles/pokken/const.py
+++ b/titles/pokken/const.py
@@ -11,14 +11,14 @@ class PokkenConstants:
VERSION_NAMES = "Pokken Tournament"
class BATTLE_TYPE(Enum):
- BATTLE_TYPE_TUTORIAL = 1
- BATTLE_TYPE_AI = 2
- BATTLE_TYPE_LAN = 3
- BATTLE_TYPE_WAN = 4
+ TUTORIAL = 1
+ AI = 2
+ LAN = 3
+ WAN = 4
class BATTLE_RESULT(Enum):
- BATTLE_RESULT_WIN = 1
- BATTLE_RESULT_LOSS = 2
+ WIN = 1
+ LOSS = 2
@classmethod
def game_ver_to_string(cls, ver: int):
diff --git a/titles/pokken/frontend.py b/titles/pokken/frontend.py
index e4e8947..af344dc 100644
--- a/titles/pokken/frontend.py
+++ b/titles/pokken/frontend.py
@@ -2,8 +2,9 @@ import yaml
import jinja2
from twisted.web.http import Request
from os import path
+from twisted.web.server import Session
-from core.frontend import FE_Base
+from core.frontend import FE_Base, IUserSession
from core.config import CoreConfig
from .database import PokkenData
from .config import PokkenConfig
@@ -27,7 +28,12 @@ class PokkenFrontend(FE_Base):
template = self.environment.get_template(
"titles/pokken/frontend/pokken_index.jinja"
)
+
+ sesh: Session = request.getSession()
+ usr_sesh = IUserSession(sesh)
+
return template.render(
title=f"{self.core_config.server.name} | {self.nav_name}",
game_list=self.environment.globals["game_list"],
+ sesh=vars(usr_sesh)
).encode("utf-16")
diff --git a/titles/pokken/index.py b/titles/pokken/index.py
index bccdcaf..3ccb3fc 100644
--- a/titles/pokken/index.py
+++ b/titles/pokken/index.py
@@ -1,6 +1,7 @@
from typing import Tuple
from twisted.web.http import Request
from twisted.web import resource
+from twisted.internet import reactor
import json, ast
from datetime import datetime
import yaml
@@ -11,10 +12,11 @@ from os import path
from google.protobuf.message import DecodeError
from core import CoreConfig, Utils
-from titles.pokken.config import PokkenConfig
-from titles.pokken.base import PokkenBase
-from titles.pokken.const import PokkenConstants
-from titles.pokken.proto import jackal_pb2
+from .config import PokkenConfig
+from .base import PokkenBase
+from .const import PokkenConstants
+from .proto import jackal_pb2
+from .services import PokkenAdmissionFactory
class PokkenServlet(resource.Resource):
@@ -69,7 +71,7 @@ class PokkenServlet(resource.Resource):
return (
True,
- f"https://{game_cfg.server.hostname}:{game_cfg.server.port}/{game_code}/$v/",
+ f"https://{game_cfg.server.hostname}:{game_cfg.ports.game}/{game_code}/$v/",
f"{game_cfg.server.hostname}/SDAK/$v/",
)
@@ -90,8 +92,10 @@ class PokkenServlet(resource.Resource):
return (True, "PKF1")
def setup(self) -> None:
- # TODO: Setup stun, turn (UDP) and admission (WSS) servers
- pass
+ if self.game_cfg.server.enable_matching:
+ reactor.listenTCP(
+ self.game_cfg.ports.admission, PokkenAdmissionFactory(self.core_cfg, self.game_cfg)
+ )
def render_POST(
self, request: Request, version: int = 0, endpoints: str = ""
@@ -128,6 +132,9 @@ class PokkenServlet(resource.Resource):
return ret
def handle_matching(self, request: Request) -> bytes:
+ if not self.game_cfg.server.enable_matching:
+ return b""
+
content = request.content.getvalue()
client_ip = Utils.get_ip_addr(request)
diff --git a/titles/pokken/schema/item.py b/titles/pokken/schema/item.py
index 4919ea0..32bff2a 100644
--- a/titles/pokken/schema/item.py
+++ b/titles/pokken/schema/item.py
@@ -31,4 +31,16 @@ class PokkenItemData(BaseData):
Items obtained as rewards
"""
- pass
+ def add_reward(self, user_id: int, category: int, content: int, item_type: int) -> Optional[int]:
+ sql = insert(item).values(
+ user=user_id,
+ category=category,
+ content=content,
+ type=item_type,
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.warn(f"Failed to insert reward for user {user_id}: {category}-{content}-{item_type}")
+ return None
+ return result.lastrowid
diff --git a/titles/pokken/schema/profile.py b/titles/pokken/schema/profile.py
index 8e536f1..812964d 100644
--- a/titles/pokken/schema/profile.py
+++ b/titles/pokken/schema/profile.py
@@ -1,4 +1,4 @@
-from typing import Optional, Dict, List
+from typing import Optional, Dict, List, Union
from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_, case
from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON
from sqlalchemy.schema import ForeignKey
@@ -125,7 +125,7 @@ pokemon_data = Table(
Column("win_vs_lan", Integer),
Column("battle_num_vs_cpu", Integer), # 2
Column("win_cpu", Integer),
- Column("battle_all_num_tutorial", Integer),
+ Column("battle_all_num_tutorial", Integer), # ???
Column("battle_num_tutorial", Integer), # 1?
Column("bp_point_atk", Integer),
Column("bp_point_res", Integer),
@@ -137,6 +137,14 @@ pokemon_data = Table(
class PokkenProfileData(BaseData):
+ def touch_profile(self, user_id: int) -> Optional[int]:
+ sql = select([profile.c.id]).where(profile.c.user == user_id)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()['id']
+
def create_profile(self, user_id: int) -> Optional[int]:
sql = insert(profile).values(user=user_id)
conflict = sql.on_duplicate_key_update(user=user_id)
@@ -147,11 +155,10 @@ class PokkenProfileData(BaseData):
return None
return result.lastrowid
- def set_profile_name(self, user_id: int, new_name: str) -> None:
- sql = (
- update(profile)
- .where(profile.c.user == user_id)
- .values(trainer_name=new_name)
+ def set_profile_name(self, user_id: int, new_name: str, gender: Union[int, None] = None) -> None:
+ sql = update(profile).where(profile.c.user == user_id).values(
+ trainer_name=new_name,
+ avatar_gender=gender if gender is not None else profile.c.avatar_gender
)
result = self.execute(sql)
if result is None:
@@ -159,13 +166,75 @@ class PokkenProfileData(BaseData):
f"Failed to update pokken profile name for user {user_id}!"
)
- def update_profile_tutorial_flags(self, user_id: int, tutorial_flags: Dict) -> None:
- pass
+ def put_extra(
+ self,
+ user_id: int,
+ extra_counter: int,
+ evt_reward_get_flg: int,
+ total_play_days: int,
+ awake_num: int,
+ use_support_ct: int,
+ beat_num: int,
+ aid_skill: int,
+ last_evt: int
+ ) -> None:
+ sql = update(profile).where(profile.c.user == user_id).values(
+ extra_counter=extra_counter,
+ event_reward_get_flag=evt_reward_get_flg,
+ total_play_days=total_play_days,
+ awake_num=awake_num,
+ use_support_num=use_support_ct,
+ beat_num=beat_num,
+ aid_skill=aid_skill,
+ last_play_event_id=last_evt
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(f"Failed to put extra data for user {user_id}")
+
+ def update_profile_tutorial_flags(self, user_id: int, tutorial_flags: List) -> None:
+ sql = update(profile).where(profile.c.user == user_id).values(
+ tutorial_progress_flag=tutorial_flags,
+ )
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(
+ f"Failed to update pokken profile tutorial flags for user {user_id}!"
+ )
+
+ def update_profile_achievement_flags(self, user_id: int, achievement_flags: List) -> None:
+ sql = update(profile).where(profile.c.user == user_id).values(
+ achievement_flag=achievement_flags,
+ )
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(
+ f"Failed to update pokken profile achievement flags for user {user_id}!"
+ )
+
+ def update_profile_event(self, user_id: int, event_state: List, event_flags: List[int], event_param: List[int], last_evt: int = None) -> None:
+ sql = update(profile).where(profile.c.user == user_id).values(
+ event_state=event_state,
+ event_achievement_flag=event_flags,
+ event_achievement_param=event_param,
+ last_play_event_id=last_evt if last_evt is not None else profile.c.last_play_event_id,
+ )
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(
+ f"Failed to update pokken profile event state for user {user_id}!"
+ )
def add_profile_points(
- self, user_id: int, rank_pts: int, money: int, score_pts: int
+ self, user_id: int, rank_pts: int, money: int, score_pts: int, grade_max: int
) -> None:
- pass
+ sql = update(profile).where(profile.c.user == user_id).values(
+ trainer_rank_point = profile.c.trainer_rank_point + rank_pts,
+ fight_money = profile.c.fight_money + money,
+ score_point = profile.c.score_point + score_pts,
+ grade_max_num = grade_max
+ )
def get_profile(self, user_id: int) -> Optional[Row]:
sql = profile.select(profile.c.user == user_id)
@@ -174,18 +243,53 @@ class PokkenProfileData(BaseData):
return None
return result.fetchone()
- def put_pokemon_data(
+ def put_pokemon(
self,
user_id: int,
pokemon_id: int,
illust_no: int,
- get_exp: int,
atk: int,
res: int,
defe: int,
- sp: int,
+ sp: int
) -> Optional[int]:
- pass
+ sql = insert(pokemon_data).values(
+ user=user_id,
+ char_id=pokemon_id,
+ illustration_book_no=illust_no,
+ bp_point_atk=atk,
+ bp_point_res=res,
+ bp_point_defe=defe,
+ bp_point_sp=sp,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ illustration_book_no=illust_no,
+ bp_point_atk=atk,
+ bp_point_res=res,
+ bp_point_defe=defe,
+ bp_point_sp=sp,
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.warn(f"Failed to insert pokemon ID {pokemon_id} for user {user_id}")
+ return None
+ return result.lastrowid
+
+ def add_pokemon_xp(
+ self,
+ user_id: int,
+ pokemon_id: int,
+ xp: int
+ ) -> None:
+ sql = update(pokemon_data).where(and_(pokemon_data.c.user==user_id, pokemon_data.c.char_id==pokemon_id)).values(
+ pokemon_exp=pokemon_data.c.pokemon_exp + xp
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.warn(f"Failed to add {xp} XP to pokemon ID {pokemon_id} for user {user_id}")
def get_pokemon_data(self, user_id: int, pokemon_id: int) -> Optional[Row]:
pass
@@ -193,13 +297,29 @@ class PokkenProfileData(BaseData):
def get_all_pokemon_data(self, user_id: int) -> Optional[List[Row]]:
pass
- def put_results(
- self, user_id: int, pokemon_id: int, match_type: int, match_result: int
+ def put_pokemon_battle_result(
+ self, user_id: int, pokemon_id: int, match_type: PokkenConstants.BATTLE_TYPE, match_result: PokkenConstants.BATTLE_RESULT
) -> None:
"""
Records the match stats (type and win/loss) for the pokemon and profile
"""
- pass
+ sql = update(pokemon_data).where(and_(pokemon_data.c.user==user_id, pokemon_data.c.char_id==pokemon_id)).values(
+ battle_num_tutorial=pokemon_data.c.battle_num_tutorial + 1 if match_type==PokkenConstants.BATTLE_TYPE.TUTORIAL else pokemon_data.c.battle_num_tutorial,
+ battle_all_num_tutorial=pokemon_data.c.battle_all_num_tutorial + 1 if match_type==PokkenConstants.BATTLE_TYPE.TUTORIAL else pokemon_data.c.battle_all_num_tutorial,
+
+ battle_num_vs_cpu=pokemon_data.c.battle_num_vs_cpu + 1 if match_type==PokkenConstants.BATTLE_TYPE.AI else pokemon_data.c.battle_num_vs_cpu,
+ win_cpu=pokemon_data.c.win_cpu + 1 if match_type==PokkenConstants.BATTLE_TYPE.AI and match_result==PokkenConstants.BATTLE_RESULT.WIN else pokemon_data.c.win_cpu,
+
+ battle_num_vs_lan=pokemon_data.c.battle_num_vs_lan + 1 if match_type==PokkenConstants.BATTLE_TYPE.LAN else pokemon_data.c.battle_num_vs_lan,
+ win_vs_lan=pokemon_data.c.win_vs_lan + 1 if match_type==PokkenConstants.BATTLE_TYPE.LAN and match_result==PokkenConstants.BATTLE_RESULT.WIN else pokemon_data.c.win_vs_lan,
+
+ battle_num_vs_wan=pokemon_data.c.battle_num_vs_wan + 1 if match_type==PokkenConstants.BATTLE_TYPE.WAN else pokemon_data.c.battle_num_vs_wan,
+ win_vs_wan=pokemon_data.c.win_vs_wan + 1 if match_type==PokkenConstants.BATTLE_TYPE.WAN and match_result==PokkenConstants.BATTLE_RESULT.WIN else pokemon_data.c.win_vs_wan,
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.warn(f"Failed to record match stats for user {user_id}'s pokemon {pokemon_id} (type {match_type.name} | result {match_result.name})")
def put_stats(
self,
@@ -214,4 +334,29 @@ class PokkenProfileData(BaseData):
"""
Records profile stats
"""
- pass
+ sql = update(profile).where(profile.c.user==user_id).values(
+ ex_ko_num=profile.c.ex_ko_num + exkos,
+ wko_num=profile.c.wko_num + wkos,
+ timeup_win_num=profile.c.timeup_win_num + timeout_wins,
+ cool_ko_num=profile.c.cool_ko_num + cool_kos,
+ perfect_ko_num=profile.c.perfect_ko_num + perfects,
+ continue_num=continues,
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.warn(f"Failed to update stats for user {user_id}")
+
+ def update_support_team(self, user_id: int, support_id: int, support1: int = 4294967295, support2: int = 4294967295) -> None:
+ sql = update(profile).where(profile.c.user==user_id).values(
+ support_set_1_1=support1 if support_id == 1 else profile.c.support_set_1_1,
+ support_set_1_2=support2 if support_id == 1 else profile.c.support_set_1_2,
+ support_set_2_1=support1 if support_id == 2 else profile.c.support_set_2_1,
+ support_set_2_2=support2 if support_id == 2 else profile.c.support_set_2_2,
+ support_set_3_1=support1 if support_id == 3 else profile.c.support_set_3_1,
+ support_set_3_2=support2 if support_id == 3 else profile.c.support_set_3_2,
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.warn(f"Failed to update support team {support_id} for user {user_id}")
diff --git a/titles/pokken/services.py b/titles/pokken/services.py
new file mode 100644
index 0000000..952c232
--- /dev/null
+++ b/titles/pokken/services.py
@@ -0,0 +1,66 @@
+from twisted.internet.interfaces import IAddress
+from twisted.internet.protocol import Protocol
+from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory
+from autobahn.websocket.types import ConnectionRequest
+from typing import Dict
+import logging
+import json
+
+from core.config import CoreConfig
+from .config import PokkenConfig
+from .base import PokkenBase
+
+class PokkenAdmissionProtocol(WebSocketServerProtocol):
+ def __init__(self, cfg: CoreConfig, game_cfg: PokkenConfig):
+ super().__init__()
+ self.core_config = cfg
+ self.game_config = game_cfg
+ self.logger = logging.getLogger("pokken")
+
+ self.base = PokkenBase(cfg, game_cfg)
+
+ def onConnect(self, request: ConnectionRequest) -> None:
+ self.logger.debug(f"Admission: Connection from {request.peer}")
+
+ def onClose(self, wasClean: bool, code: int, reason: str) -> None:
+ self.logger.debug(f"Admission: Connection with {self.transport.getPeer().host} closed {'cleanly ' if wasClean else ''}with code {code} - {reason}")
+
+ def onMessage(self, payload, isBinary: bool) -> None:
+ msg: Dict = json.loads(payload)
+ self.logger.debug(f"Admission: Message from {self.transport.getPeer().host}:{self.transport.getPeer().port} - {msg}")
+
+ api = msg.get("api", "noop")
+ handler = getattr(self.base, f"handle_admission_{api.lower()}")
+ resp = handler(msg, self.transport.getPeer().host)
+
+ if resp is None:
+ resp = {}
+
+ if "type" not in resp:
+ resp['type'] = "res"
+ if "data" not in resp:
+ resp['data'] = {}
+ if "api" not in resp:
+ resp['api'] = api
+ if "result" not in resp:
+ resp['result'] = 'true'
+
+ self.logger.debug(f"Websocket response: {resp}")
+ self.sendMessage(json.dumps(resp).encode(), isBinary)
+
+class PokkenAdmissionFactory(WebSocketServerFactory):
+ protocol = PokkenAdmissionProtocol
+
+ def __init__(
+ self,
+ cfg: CoreConfig,
+ game_cfg: PokkenConfig
+ ) -> None:
+ self.core_config = cfg
+ self.game_config = game_cfg
+ super().__init__(f"ws://{self.game_config.server.hostname}:{self.game_config.ports.admission}")
+
+ def buildProtocol(self, addr: IAddress) -> Protocol:
+ p = self.protocol(self.core_config, self.game_config)
+ p.factory = self
+ return p
diff --git a/titles/sao/__init__.py b/titles/sao/__init__.py
new file mode 100644
index 0000000..15a46f9
--- /dev/null
+++ b/titles/sao/__init__.py
@@ -0,0 +1,10 @@
+from .index import SaoServlet
+from .const import SaoConstants
+from .database import SaoData
+from .read import SaoReader
+
+index = SaoServlet
+database = SaoData
+reader = SaoReader
+game_codes = [SaoConstants.GAME_CODE]
+current_schema_version = 1
diff --git a/titles/sao/base.py b/titles/sao/base.py
new file mode 100644
index 0000000..3c4aade
--- /dev/null
+++ b/titles/sao/base.py
@@ -0,0 +1,1244 @@
+from datetime import datetime, timedelta
+import json, logging
+from typing import Any, Dict
+import random
+import struct
+from csv import *
+from random import choice
+import random as rand
+
+from core.data import Data
+from core import CoreConfig
+from .config import SaoConfig
+from .database import SaoData
+from titles.sao.handlers.base import *
+
+class SaoBase:
+ def __init__(self, core_cfg: CoreConfig, game_cfg: SaoConfig) -> None:
+ self.core_cfg = core_cfg
+ self.game_cfg = game_cfg
+ self.core_data = Data(core_cfg)
+ self.game_data = SaoData(core_cfg)
+ self.version = 0
+ self.logger = logging.getLogger("sao")
+
+ def handle_noop(self, request: Any) -> bytes:
+ sao_request = request
+
+ sao_id = int(sao_request[:4],16) + 1
+
+ ret = struct.pack("!HHIIIIIIb", sao_id, 0, 0, 5, 1, 1, 5, 0x01000000, 0).hex()
+ return bytes.fromhex(ret)
+
+ def handle_c122(self, request: Any) -> bytes:
+ #common/get_maintenance_info
+ resp = SaoGetMaintResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c12e(self, request: Any) -> bytes:
+ #common/ac_cabinet_boot_notification
+ resp = SaoCommonAcCabinetBootNotificationResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c100(self, request: Any) -> bytes:
+ #common/get_app_versions
+ resp = SaoCommonGetAppVersionsRequest(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c102(self, request: Any) -> bytes:
+ #common/master_data_version_check
+ resp = SaoMasterDataVersionCheckResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c10a(self, request: Any) -> bytes:
+ #common/paying_play_start
+ resp = SaoCommonPayingPlayStartRequest(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_ca02(self, request: Any) -> bytes:
+ #quest_multi_play_room/get_quest_scene_multi_play_photon_server
+ resp = SaoGetQuestSceneMultiPlayPhotonServerResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c11e(self, request: Any) -> bytes:
+ #common/get_auth_card_data
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "cabinet_type" / Int8ub, # cabinet_type is a byte
+ "auth_type" / Int8ub, # auth_type is a byte
+ "store_id_size" / Rebuild(Int32ub, len_(this.store_id) * 2), # calculates the length of the store_id
+ "store_id" / PaddedString(this.store_id_size, "utf_16_le"), # store_id is a (zero) padded string
+ "serial_no_size" / Rebuild(Int32ub, len_(this.serial_no) * 2), # calculates the length of the serial_no
+ "serial_no" / PaddedString(this.serial_no_size, "utf_16_le"), # serial_no is a (zero) padded string
+ "access_code_size" / Rebuild(Int32ub, len_(this.access_code) * 2), # calculates the length of the access_code
+ "access_code" / PaddedString(this.access_code_size, "utf_16_le"), # access_code is a (zero) padded string
+ "chip_id_size" / Rebuild(Int32ub, len_(this.chip_id) * 2), # calculates the length of the chip_id
+ "chip_id" / PaddedString(this.chip_id_size, "utf_16_le"), # chip_id is a (zero) padded string
+ )
+
+ req_data = req_struct.parse(req)
+ access_code = req_data.access_code
+
+ #Check authentication
+ user_id = self.core_data.card.get_user_id_from_card( access_code )
+
+ if not user_id:
+ user_id = self.core_data.user.create_user() #works
+ card_id = self.core_data.card.create_card(user_id, access_code)
+
+ if card_id is None:
+ user_id = -1
+ self.logger.error("Failed to register card!")
+
+ # Create profile with 3 basic heroes
+ profile_id = self.game_data.profile.create_profile(user_id)
+ self.game_data.item.put_hero_log(user_id, 101000010, 1, 0, 101000016, 0, 30086, 1001, 1002, 1003, 1005)
+ self.game_data.item.put_hero_log(user_id, 102000010, 1, 0, 103000006, 0, 30086, 1001, 1002, 1003, 1005)
+ self.game_data.item.put_hero_log(user_id, 103000010, 1, 0, 112000009, 0, 30086, 1001, 1002, 1003, 1005)
+ self.game_data.item.put_hero_party(user_id, 0, 101000010, 102000010, 103000010)
+ self.game_data.item.put_equipment_data(user_id, 101000016, 1, 200, 0, 0, 0)
+ self.game_data.item.put_equipment_data(user_id, 103000006, 1, 200, 0, 0, 0)
+ self.game_data.item.put_equipment_data(user_id, 112000009, 1, 200, 0, 0, 0)
+ self.game_data.item.put_player_quest(user_id, 1001, True, 300, 0, 0, 1)
+
+ # Force the tutorial stage to be completed due to potential crash in-game
+
+
+ self.logger.info(f"User Authenticated: { access_code } | { user_id }")
+
+ #Grab values from profile
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ if user_id and not profile_data:
+ profile_id = self.game_data.profile.create_profile(user_id)
+ self.game_data.item.put_hero_log(user_id, 101000010, 1, 0, 101000016, 0, 30086, 1001, 1002, 1003, 1005)
+ self.game_data.item.put_hero_log(user_id, 102000010, 1, 0, 103000006, 0, 30086, 1001, 1002, 1003, 1005)
+ self.game_data.item.put_hero_log(user_id, 103000010, 1, 0, 112000009, 0, 30086, 1001, 1002, 1003, 1005)
+ self.game_data.item.put_hero_party(user_id, 0, 101000010, 102000010, 103000010)
+ self.game_data.item.put_equipment_data(user_id, 101000016, 1, 200, 0, 0, 0)
+ self.game_data.item.put_equipment_data(user_id, 103000006, 1, 200, 0, 0, 0)
+ self.game_data.item.put_equipment_data(user_id, 112000009, 1, 200, 0, 0, 0)
+ self.game_data.item.put_player_quest(user_id, 1001, True, 300, 0, 0, 1)
+
+ # Force the tutorial stage to be completed due to potential crash in-game
+
+
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ resp = SaoGetAuthCardDataResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, profile_data)
+ return resp.make()
+
+ def handle_c40c(self, request: Any) -> bytes:
+ #home/check_ac_login_bonus
+ resp = SaoHomeCheckAcLoginBonusResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c104(self, request: Any) -> bytes:
+ #common/login
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "cabinet_type" / Int8ub, # cabinet_type is a byte
+ "auth_type" / Int8ub, # auth_type is a byte
+ "store_id_size" / Rebuild(Int32ub, len_(this.store_id) * 2), # calculates the length of the store_id
+ "store_id" / PaddedString(this.store_id_size, "utf_16_le"), # store_id is a (zero) padded string
+ "store_name_size" / Rebuild(Int32ub, len_(this.store_name) * 2), # calculates the length of the store_name
+ "store_name" / PaddedString(this.store_name_size, "utf_16_le"), # store_name is a (zero) padded string
+ "serial_no_size" / Rebuild(Int32ub, len_(this.serial_no) * 2), # calculates the length of the serial_no
+ "serial_no" / PaddedString(this.serial_no_size, "utf_16_le"), # serial_no is a (zero) padded string
+ "access_code_size" / Rebuild(Int32ub, len_(this.access_code) * 2), # calculates the length of the access_code
+ "access_code" / PaddedString(this.access_code_size, "utf_16_le"), # access_code is a (zero) padded string
+ "chip_id_size" / Rebuild(Int32ub, len_(this.chip_id) * 2), # calculates the length of the chip_id
+ "chip_id" / PaddedString(this.chip_id_size, "utf_16_le"), # chip_id is a (zero) padded string
+ "free_ticket_distribution_target_flag" / Int8ub, # free_ticket_distribution_target_flag is a byte
+ )
+
+ req_data = req_struct.parse(req)
+ access_code = req_data.access_code
+
+ user_id = self.core_data.card.get_user_id_from_card( access_code )
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ resp = SaoCommonLoginResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, profile_data)
+ return resp.make()
+
+ def handle_c404(self, request: Any) -> bytes:
+ #home/check_comeback_event
+ resp = SaoCheckComebackEventRequest(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c000(self, request: Any) -> bytes:
+ #ticket/ticket
+ resp = SaoTicketResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c500(self, request: Any) -> bytes:
+ #user_info/get_user_basic_data
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ )
+
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ resp = SaoGetUserBasicDataResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, profile_data)
+ return resp.make()
+
+ def handle_c600(self, request: Any) -> bytes:
+ #have_object/get_hero_log_user_data_list
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+
+ )
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ hero_data = self.game_data.item.get_hero_logs(user_id)
+
+ resp = SaoGetHeroLogUserDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, hero_data)
+ return resp.make()
+
+ def handle_c602(self, request: Any) -> bytes:
+ #have_object/get_equipment_user_data_list
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+
+ )
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ equipment_data = self.game_data.item.get_user_equipments(user_id)
+
+ resp = SaoGetEquipmentUserDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, equipment_data)
+ return resp.make()
+
+ def handle_c604(self, request: Any) -> bytes:
+ #have_object/get_item_user_data_list
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+
+ )
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ item_data = self.game_data.item.get_user_items(user_id)
+
+ resp = SaoGetItemUserDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, item_data)
+ return resp.make()
+
+ def handle_c606(self, request: Any) -> bytes:
+ #have_object/get_support_log_user_data_list
+ supportIdsData = self.game_data.static.get_support_log_ids(0, True)
+
+ resp = SaoGetSupportLogUserDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, supportIdsData)
+ return resp.make()
+
+ def handle_c800(self, request: Any) -> bytes:
+ #custom/get_title_user_data_list
+ titleIdsData = self.game_data.static.get_title_ids(0, True)
+
+ resp = SaoGetTitleUserDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, titleIdsData)
+ return resp.make()
+
+ def handle_c608(self, request: Any) -> bytes:
+ #have_object/get_episode_append_data_list
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ )
+
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ resp = SaoGetEpisodeAppendDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, profile_data)
+ return resp.make()
+
+ def handle_c804(self, request: Any) -> bytes:
+ #custom/get_party_data_list
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+
+ )
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ hero_party = self.game_data.item.get_hero_party(user_id, 0)
+ hero1_data = self.game_data.item.get_hero_log(user_id, hero_party[3])
+ hero2_data = self.game_data.item.get_hero_log(user_id, hero_party[4])
+ hero3_data = self.game_data.item.get_hero_log(user_id, hero_party[5])
+
+ resp = SaoGetPartyDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, hero1_data, hero2_data, hero3_data)
+ return resp.make()
+
+ def handle_c902(self, request: Any) -> bytes: # for whatever reason, having all entries empty or filled changes nothing
+ #quest/get_quest_scene_prev_scan_profile_card
+ resp = SaoGetQuestScenePrevScanProfileCardResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c124(self, request: Any) -> bytes:
+ #common/get_resource_path_info
+ resp = SaoGetResourcePathInfoResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c900(self, request: Any) -> bytes:
+ #quest/get_quest_scene_user_data_list // QuestScene.csv
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+
+ )
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ quest_data = self.game_data.item.get_quest_logs(user_id)
+
+ resp = SaoGetQuestSceneUserDataListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, quest_data)
+ return resp.make()
+
+ def handle_c400(self, request: Any) -> bytes:
+ #home/check_yui_medal_get_condition
+ resp = SaoCheckYuiMedalGetConditionResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c402(self, request: Any) -> bytes:
+ #home/get_yui_medal_bonus_user_data
+ resp = SaoGetYuiMedalBonusUserDataResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c40a(self, request: Any) -> bytes:
+ #home/check_profile_card_used_reward
+ resp = SaoCheckProfileCardUsedRewardResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c814(self, request: Any) -> bytes:
+ #custom/synthesize_enhancement_hero_log
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(20),
+ "ticket_id" / Bytes(1), # needs to be parsed as an int
+ Padding(1),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ "origin_user_hero_log_id_size" / Rebuild(Int32ub, len_(this.origin_user_hero_log_id) * 2), # calculates the length of the origin_user_hero_log_id
+ "origin_user_hero_log_id" / PaddedString(this.origin_user_hero_log_id_size, "utf_16_le"), # origin_user_hero_log_id is a (zero) padded string
+ Padding(3),
+ "material_common_reward_user_data_list_length" / Rebuild(Int8ub, len_(this.material_common_reward_user_data_list)), # material_common_reward_user_data_list is a byte,
+ "material_common_reward_user_data_list" / Array(this.material_common_reward_user_data_list_length, Struct(
+ "common_reward_type" / Int16ub, # team_no is a byte
+ "user_common_reward_id_size" / Rebuild(Int32ub, len_(this.user_common_reward_id) * 2), # calculates the length of the user_common_reward_id
+ "user_common_reward_id" / PaddedString(this.user_common_reward_id_size, "utf_16_le"), # user_common_reward_id is a (zero) padded string
+ )),
+ )
+
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+ synthesize_hero_log_data = self.game_data.item.get_hero_log(req_data.user_id, req_data.origin_user_hero_log_id)
+
+ for i in range(0,req_data.material_common_reward_user_data_list_length):
+
+ itemList = self.game_data.static.get_item_id(req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ heroList = self.game_data.static.get_hero_id(req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ equipmentList = self.game_data.static.get_equipment_id(req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ if itemList:
+ hero_exp = 2000 + int(synthesize_hero_log_data["log_exp"])
+ self.game_data.item.remove_item(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ if equipmentList:
+ equipment_data = self.game_data.item.get_user_equipment(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ hero_exp = int(equipment_data["enhancement_exp"]) + int(synthesize_hero_log_data["log_exp"])
+ self.game_data.item.remove_equipment(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ if heroList:
+ hero_data = self.game_data.item.get_hero_log(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ hero_exp = int(hero_data["log_exp"]) + int(synthesize_hero_log_data["log_exp"])
+ self.game_data.item.remove_hero_log(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ self.game_data.item.put_hero_log(
+ user_id,
+ int(req_data.origin_user_hero_log_id),
+ synthesize_hero_log_data["log_level"],
+ hero_exp,
+ synthesize_hero_log_data["main_weapon"],
+ synthesize_hero_log_data["sub_equipment"],
+ synthesize_hero_log_data["skill_slot1_skill_id"],
+ synthesize_hero_log_data["skill_slot2_skill_id"],
+ synthesize_hero_log_data["skill_slot3_skill_id"],
+ synthesize_hero_log_data["skill_slot4_skill_id"],
+ synthesize_hero_log_data["skill_slot5_skill_id"]
+ )
+
+ profile = self.game_data.profile.get_profile(req_data.user_id)
+ new_col = int(profile["own_col"]) - 100
+
+ # Update profile
+
+ self.game_data.profile.put_profile(
+ req_data.user_id,
+ profile["user_type"],
+ profile["nick_name"],
+ profile["rank_num"],
+ profile["rank_exp"],
+ new_col,
+ profile["own_vp"],
+ profile["own_yui_medal"],
+ profile["setting_title_id"]
+ )
+
+ # Load the item again to push to the response handler
+ synthesize_hero_log_data = self.game_data.item.get_hero_log(req_data.user_id, req_data.origin_user_hero_log_id)
+
+ resp = SaoSynthesizeEnhancementHeroLogResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, synthesize_hero_log_data)
+ return resp.make()
+
+ def handle_c816(self, request: Any) -> bytes:
+ #custom/synthesize_enhancement_equipment
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(20),
+ "ticket_id" / Bytes(1), # needs to be parsed as an int
+ Padding(1),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ "origin_user_equipment_id_size" / Rebuild(Int32ub, len_(this.origin_user_equipment_id) * 2), # calculates the length of the origin_user_equipment_id
+ "origin_user_equipment_id" / PaddedString(this.origin_user_equipment_id_size, "utf_16_le"), # origin_user_equipment_id is a (zero) padded string
+ Padding(3),
+ "material_common_reward_user_data_list_length" / Rebuild(Int8ub, len_(this.material_common_reward_user_data_list)), # material_common_reward_user_data_list is a byte,
+ "material_common_reward_user_data_list" / Array(this.material_common_reward_user_data_list_length, Struct(
+ "common_reward_type" / Int16ub, # team_no is a byte
+ "user_common_reward_id_size" / Rebuild(Int32ub, len_(this.user_common_reward_id) * 2), # calculates the length of the user_common_reward_id
+ "user_common_reward_id" / PaddedString(this.user_common_reward_id_size, "utf_16_le"), # user_common_reward_id is a (zero) padded string
+ )),
+ )
+
+ req_data = req_struct.parse(req)
+
+ user_id = req_data.user_id
+ synthesize_equipment_data = self.game_data.item.get_user_equipment(req_data.user_id, req_data.origin_user_equipment_id)
+
+ for i in range(0,req_data.material_common_reward_user_data_list_length):
+
+ itemList = self.game_data.static.get_item_id(req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ heroList = self.game_data.static.get_hero_id(req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ equipmentList = self.game_data.static.get_equipment_id(req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ if itemList:
+ equipment_exp = 2000 + int(synthesize_equipment_data["enhancement_exp"])
+ self.game_data.item.remove_item(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ if equipmentList:
+ equipment_data = self.game_data.item.get_user_equipment(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ equipment_exp = int(equipment_data["enhancement_exp"]) + int(synthesize_equipment_data["enhancement_exp"])
+ self.game_data.item.remove_equipment(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ if heroList:
+ hero_data = self.game_data.item.get_hero_log(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+ equipment_exp = int(hero_data["log_exp"]) + int(synthesize_equipment_data["enhancement_exp"])
+ self.game_data.item.remove_hero_log(req_data.user_id, req_data.material_common_reward_user_data_list[i].user_common_reward_id)
+
+ self.game_data.item.put_equipment_data(req_data.user_id, int(req_data.origin_user_equipment_id), synthesize_equipment_data["enhancement_value"], equipment_exp, 0, 0, 0)
+
+ profile = self.game_data.profile.get_profile(req_data.user_id)
+ new_col = int(profile["own_col"]) - 100
+
+ # Update profile
+
+ self.game_data.profile.put_profile(
+ req_data.user_id,
+ profile["user_type"],
+ profile["nick_name"],
+ profile["rank_num"],
+ profile["rank_exp"],
+ new_col,
+ profile["own_vp"],
+ profile["own_yui_medal"],
+ profile["setting_title_id"]
+ )
+
+ # Load the item again to push to the response handler
+ synthesize_equipment_data = self.game_data.item.get_user_equipment(req_data.user_id, req_data.origin_user_equipment_id)
+
+ resp = SaoSynthesizeEnhancementEquipmentResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, synthesize_equipment_data)
+ return resp.make()
+
+ def handle_c806(self, request: Any) -> bytes:
+ #custom/change_party
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(20),
+ "ticket_id" / Bytes(1), # needs to be parsed as an int
+ Padding(1),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ "act_type" / Int8ub, # play_mode is a byte
+ Padding(3),
+ "party_data_list_length" / Rebuild(Int8ub, len_(this.party_data_list)), # party_data_list is a byte,
+ "party_data_list" / Array(this.party_data_list_length, Struct(
+ "user_party_id_size" / Rebuild(Int32ub, len_(this.user_party_id) * 2), # calculates the length of the user_party_id
+ "user_party_id" / PaddedString(this.user_party_id_size, "utf_16_le"), # user_party_id is a (zero) padded string
+ "team_no" / Int8ub, # team_no is a byte
+ Padding(3),
+ "party_team_data_list_length" / Rebuild(Int8ub, len_(this.party_team_data_list)), # party_team_data_list is a byte
+ "party_team_data_list" / Array(this.party_team_data_list_length, Struct(
+ "user_party_team_id_size" / Rebuild(Int32ub, len_(this.user_party_team_id) * 2), # calculates the length of the user_party_team_id
+ "user_party_team_id" / PaddedString(this.user_party_team_id_size, "utf_16_le"), # user_party_team_id is a (zero) padded string
+ "arrangement_num" / Int8ub, # arrangement_num is a byte
+ "user_hero_log_id_size" / Rebuild(Int32ub, len_(this.user_hero_log_id) * 2), # calculates the length of the user_hero_log_id
+ "user_hero_log_id" / PaddedString(this.user_hero_log_id_size, "utf_16_le"), # user_hero_log_id is a (zero) padded string
+ "main_weapon_user_equipment_id_size" / Rebuild(Int32ub, len_(this.main_weapon_user_equipment_id) * 2), # calculates the length of the main_weapon_user_equipment_id
+ "main_weapon_user_equipment_id" / PaddedString(this.main_weapon_user_equipment_id_size, "utf_16_le"), # main_weapon_user_equipment_id is a (zero) padded string
+ "sub_equipment_user_equipment_id_size" / Rebuild(Int32ub, len_(this.sub_equipment_user_equipment_id) * 2), # calculates the length of the sub_equipment_user_equipment_id
+ "sub_equipment_user_equipment_id" / PaddedString(this.sub_equipment_user_equipment_id_size, "utf_16_le"), # sub_equipment_user_equipment_id is a (zero) padded string
+ "skill_slot1_skill_id" / Int32ub, # skill_slot1_skill_id is a int,
+ "skill_slot2_skill_id" / Int32ub, # skill_slot1_skill_id is a int,
+ "skill_slot3_skill_id" / Int32ub, # skill_slot1_skill_id is a int,
+ "skill_slot4_skill_id" / Int32ub, # skill_slot1_skill_id is a int,
+ "skill_slot5_skill_id" / Int32ub, # skill_slot1_skill_id is a int,
+ )),
+ )),
+
+ )
+
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+ party_hero_list = []
+
+ for party_team in req_data.party_data_list[0].party_team_data_list:
+ hero_data = self.game_data.item.get_hero_log(user_id, party_team["user_hero_log_id"])
+ hero_level = 1
+ hero_exp = 0
+
+ if hero_data:
+ hero_level = hero_data["log_level"]
+ hero_exp = hero_data["log_exp"]
+
+ self.game_data.item.put_hero_log(
+ user_id,
+ party_team["user_hero_log_id"],
+ hero_level,
+ hero_exp,
+ party_team["main_weapon_user_equipment_id"],
+ party_team["sub_equipment_user_equipment_id"],
+ party_team["skill_slot1_skill_id"],
+ party_team["skill_slot2_skill_id"],
+ party_team["skill_slot3_skill_id"],
+ party_team["skill_slot4_skill_id"],
+ party_team["skill_slot5_skill_id"]
+ )
+
+ party_hero_list.append(party_team["user_hero_log_id"])
+
+ self.game_data.item.put_hero_party(user_id, req_data.party_data_list[0].party_team_data_list[0].user_party_team_id, party_hero_list[0], party_hero_list[1], party_hero_list[2])
+
+ resp = SaoNoopResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c904(self, request: Any) -> bytes:
+ #quest/episode_play_start
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(20),
+ "ticket_id" / Bytes(1), # needs to be parsed as an int
+ Padding(1),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ "episode_id" / Int32ub, # episode_id is a int,
+ "play_mode" / Int8ub, # play_mode is a byte
+ Padding(3),
+ "play_start_request_data_length" / Rebuild(Int8ub, len_(this.play_start_request_data)), # play_start_request_data_length is a byte,
+ "play_start_request_data" / Array(this.play_start_request_data_length, Struct(
+ "user_party_id_size" / Rebuild(Int32ub, len_(this.user_party_id) * 2), # calculates the length of the user_party_id
+ "user_party_id" / PaddedString(this.user_party_id_size, "utf_16_le"), # user_party_id is a (zero) padded string
+ "appoint_leader_resource_card_code_size" / Rebuild(Int32ub, len_(this.appoint_leader_resource_card_code) * 2), # calculates the length of the total_damage
+ "appoint_leader_resource_card_code" / PaddedString(this.appoint_leader_resource_card_code_size, "utf_16_le"), # total_damage is a (zero) padded string
+ "use_profile_card_code_size" / Rebuild(Int32ub, len_(this.use_profile_card_code) * 2), # calculates the length of the total_damage
+ "use_profile_card_code" / PaddedString(this.use_profile_card_code_size, "utf_16_le"), # use_profile_card_code is a (zero) padded string
+ "quest_drop_boost_apply_flag" / Int8ub, # quest_drop_boost_apply_flag is a byte
+ )),
+
+ )
+
+ req_data = req_struct.parse(req)
+
+ user_id = req_data.user_id
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ self.game_data.item.create_session(
+ user_id,
+ int(req_data.play_start_request_data[0].user_party_id),
+ req_data.episode_id,
+ req_data.play_mode,
+ req_data.play_start_request_data[0].quest_drop_boost_apply_flag
+ )
+
+ resp = SaoEpisodePlayStartResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, profile_data)
+ return resp.make()
+
+ def handle_c908(self, request: Any) -> bytes: # Level calculation missing for the profile and heroes
+ #quest/episode_play_end
+
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(20),
+ "ticket_id" / Bytes(1), # needs to be parsed as an int
+ Padding(1),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ Padding(2),
+ "episode_id" / Int16ub, # episode_id is a short,
+ Padding(3),
+ "play_end_request_data" / Int8ub, # play_end_request_data is a byte
+ Padding(1),
+ "play_result_flag" / Int8ub, # play_result_flag is a byte
+ Padding(2),
+ "base_get_data_length" / Rebuild(Int8ub, len_(this.base_get_data)), # base_get_data_length is a byte,
+ "base_get_data" / Array(this.base_get_data_length, Struct(
+ "get_hero_log_exp" / Int32ub, # get_hero_log_exp is an int
+ "get_col" / Int32ub, # get_num is a short
+ )),
+ Padding(3),
+ "get_player_trace_data_list_length" / Rebuild(Int8ub, len_(this.get_player_trace_data_list)), # get_player_trace_data_list_length is a byte
+ "get_player_trace_data_list" / Array(this.get_player_trace_data_list_length, Struct(
+ "user_quest_scene_player_trace_id" / Int32ub, # user_quest_scene_player_trace_id is an int
+ )),
+ Padding(3),
+ "get_rare_drop_data_list_length" / Rebuild(Int8ub, len_(this.get_rare_drop_data_list)), # get_rare_drop_data_list_length is a byte
+ "get_rare_drop_data_list" / Array(this.get_rare_drop_data_list_length, Struct(
+ "quest_rare_drop_id" / Int32ub, # quest_rare_drop_id is an int
+ )),
+ Padding(3),
+ "get_special_rare_drop_data_list_length" / Rebuild(Int8ub, len_(this.get_special_rare_drop_data_list)), # get_special_rare_drop_data_list_length is a byte
+ "get_special_rare_drop_data_list" / Array(this.get_special_rare_drop_data_list_length, Struct(
+ "quest_special_rare_drop_id" / Int32ub, # quest_special_rare_drop_id is an int
+ )),
+ Padding(3),
+ "get_unanalyzed_log_tmp_reward_data_list_length" / Rebuild(Int8ub, len_(this.get_unanalyzed_log_tmp_reward_data_list)), # get_unanalyzed_log_tmp_reward_data_list_length is a byte
+ "get_unanalyzed_log_tmp_reward_data_list" / Array(this.get_unanalyzed_log_tmp_reward_data_list_length, Struct(
+ "unanalyzed_log_grade_id" / Int32ub, # unanalyzed_log_grade_id is an int,
+ )),
+ Padding(3),
+ "get_event_item_data_list_length" / Rebuild(Int8ub, len_(this.get_event_item_data_list)), # get_event_item_data_list_length is a byte,
+ "get_event_item_data_list" / Array(this.get_event_item_data_list_length, Struct(
+ "event_item_id" / Int32ub, # event_item_id is an int
+ "get_num" / Int16ub, # get_num is a short
+ )),
+ Padding(3),
+ "discovery_enemy_data_list_length" / Rebuild(Int8ub, len_(this.discovery_enemy_data_list)), # discovery_enemy_data_list_length is a byte
+ "discovery_enemy_data_list" / Array(this.discovery_enemy_data_list_length, Struct(
+ "enemy_kind_id" / Int32ub, # enemy_kind_id is an int
+ "destroy_num" / Int16ub, # destroy_num is a short
+ )),
+ Padding(3),
+ "destroy_boss_data_list_length" / Rebuild(Int8ub, len_(this.destroy_boss_data_list)), # destroy_boss_data_list_length is a byte
+ "destroy_boss_data_list" / Array(this.destroy_boss_data_list_length, Struct(
+ "boss_type" / Int8ub, # boss_type is a byte
+ "enemy_kind_id" / Int32ub, # enemy_kind_id is an int
+ "destroy_num" / Int16ub, # destroy_num is a short
+ )),
+ Padding(3),
+ "mission_data_list_length" / Rebuild(Int8ub, len_(this.mission_data_list)), # mission_data_list_length is a byte
+ "mission_data_list" / Array(this.mission_data_list_length, Struct(
+ "mission_id" / Int32ub, # enemy_kind_id is an int
+ "clear_flag" / Int8ub, # boss_type is a byte
+ "mission_difficulty_id" / Int16ub, # destroy_num is a short
+ )),
+ Padding(3),
+ "score_data_length" / Rebuild(Int8ub, len_(this.score_data)), # score_data_length is a byte
+ "score_data" / Array(this.score_data_length, Struct(
+ "clear_time" / Int32ub, # clear_time is an int
+ "combo_num" / Int32ub, # boss_type is a int
+ "total_damage_size" / Rebuild(Int32ub, len_(this.total_damage) * 2), # calculates the length of the total_damage
+ "total_damage" / PaddedString(this.total_damage_size, "utf_16_le"), # total_damage is a (zero) padded string
+ "concurrent_destroying_num" / Int16ub, # concurrent_destroying_num is a short
+ "reaching_skill_level" / Int16ub, # reaching_skill_level is a short
+ "ko_chara_num" / Int8ub, # ko_chara_num is a byte
+ "acceleration_invocation_num" / Int16ub, # acceleration_invocation_num is a short
+ "boss_destroying_num" / Int16ub, # boss_destroying_num is a short
+ "synchro_skill_used_flag" / Int8ub, # synchro_skill_used_flag is a byte
+ "used_friend_skill_id" / Int32ub, # used_friend_skill_id is an int
+ "friend_skill_used_flag" / Int8ub, # friend_skill_used_flag is a byte
+ "continue_cnt" / Int16ub, # continue_cnt is a short
+ "total_loss_num" / Int16ub, # total_loss_num is a short
+ )),
+
+ )
+
+ req_data = req_struct.parse(req)
+
+ # Add stage progression to database
+ user_id = req_data.user_id
+ episode_id = req_data.episode_id
+ quest_clear_flag = bool(req_data.score_data[0].boss_destroying_num)
+ clear_time = req_data.score_data[0].clear_time
+ combo_num = req_data.score_data[0].combo_num
+ total_damage = req_data.score_data[0].total_damage
+ concurrent_destroying_num = req_data.score_data[0].concurrent_destroying_num
+
+ profile = self.game_data.profile.get_profile(user_id)
+ vp = int(profile["own_vp"])
+ exp = int(profile["rank_exp"]) + 100 #always 100 extra exp for some reason
+ col = int(profile["own_col"]) + int(req_data.base_get_data[0].get_col)
+
+ if quest_clear_flag is True:
+ # Save stage progression - to be revised to avoid saving worse score
+
+ # Reference Episode.csv but Chapter 2,3,4 and 5 reports id -1, match using /10 + last digits
+ if episode_id > 10000 and episode_id < 11000:
+ # Starts at 1001
+ episode_id = episode_id - 9000
+ elif episode_id > 20000:
+ # Starts at 2001
+ stage_id = str(episode_id)[-2:]
+ episode_id = episode_id / 10
+ episode_id = int(episode_id) + int(stage_id)
+
+ # Match episode_id with the questSceneId saved in the DB through sortNo
+ questId = self.game_data.static.get_quests_id(episode_id)
+ episode_id = questId[2]
+
+ self.game_data.item.put_player_quest(user_id, episode_id, quest_clear_flag, clear_time, combo_num, total_damage, concurrent_destroying_num)
+
+ vp = int(profile["own_vp"]) + 10 #always 10 VP per cleared stage
+
+
+ # Calculate level based off experience and the CSV list
+ with open(r'titles/sao/data/PlayerRank.csv') as csv_file:
+ csv_reader = csv.reader(csv_file, delimiter=',')
+ line_count = 0
+ data = []
+ rowf = False
+ for row in csv_reader:
+ if rowf==False:
+ rowf=True
+ else:
+ data.append(row)
+
+ for i in range(0,len(data)):
+ if exp>=int(data[i][1]) and exp=int(data[e][1]) and log_exp bytes:
+ #quest/trial_tower_play_start
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "ticket_id_size" / Rebuild(Int32ub, len_(this.ticket_id) * 2), # calculates the length of the ticket_id
+ "ticket_id" / PaddedString(this.ticket_id_size, "utf_16_le"), # ticket_id is a (zero) padded string
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ "trial_tower_id" / Int32ub, # trial_tower_id is an int
+ "play_mode" / Int8ub, # play_mode is a byte
+ Padding(3),
+ "play_start_request_data_length" / Rebuild(Int8ub, len_(this.play_start_request_data)), # play_start_request_data_length is a byte,
+ "play_start_request_data" / Array(this.play_start_request_data_length, Struct(
+ "user_party_id_size" / Rebuild(Int32ub, len_(this.user_party_id) * 2), # calculates the length of the user_party_id
+ "user_party_id" / PaddedString(this.user_party_id_size, "utf_16_le"), # user_party_id is a (zero) padded string
+ "appoint_leader_resource_card_code_size" / Rebuild(Int32ub, len_(this.appoint_leader_resource_card_code) * 2), # calculates the length of the total_damage
+ "appoint_leader_resource_card_code" / PaddedString(this.appoint_leader_resource_card_code_size, "utf_16_le"), # total_damage is a (zero) padded string
+ "use_profile_card_code_size" / Rebuild(Int32ub, len_(this.use_profile_card_code) * 2), # calculates the length of the total_damage
+ "use_profile_card_code" / PaddedString(this.use_profile_card_code_size, "utf_16_le"), # use_profile_card_code is a (zero) padded string
+ "quest_drop_boost_apply_flag" / Int8ub, # quest_drop_boost_apply_flag is a byte
+ )),
+ )
+
+ req_data = req_struct.parse(req)
+
+ user_id = req_data.user_id
+ floor_id = req_data.trial_tower_id
+ profile_data = self.game_data.profile.get_profile(user_id)
+
+ self.game_data.item.create_session(
+ user_id,
+ int(req_data.play_start_request_data[0].user_party_id),
+ req_data.trial_tower_id,
+ req_data.play_mode,
+ req_data.play_start_request_data[0].quest_drop_boost_apply_flag
+ )
+
+ resp = SaoEpisodePlayStartResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, profile_data)
+ return resp.make()
+
+ def handle_c918(self, request: Any) -> bytes:
+ #quest/trial_tower_play_end
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(20),
+ "ticket_id" / Bytes(1), # needs to be parsed as an int
+ Padding(1),
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ Padding(2),
+ "trial_tower_id" / Int16ub, # trial_tower_id is a short,
+ Padding(3),
+ "play_end_request_data" / Int8ub, # play_end_request_data is a byte
+ Padding(1),
+ "play_result_flag" / Int8ub, # play_result_flag is a byte
+ Padding(2),
+ "base_get_data_length" / Rebuild(Int8ub, len_(this.base_get_data)), # base_get_data_length is a byte,
+ "base_get_data" / Array(this.base_get_data_length, Struct(
+ "get_hero_log_exp" / Int32ub, # get_hero_log_exp is an int
+ "get_col" / Int32ub, # get_num is a short
+ )),
+ Padding(3),
+ "get_player_trace_data_list_length" / Rebuild(Int8ub, len_(this.get_player_trace_data_list)), # get_player_trace_data_list_length is a byte
+ "get_player_trace_data_list" / Array(this.get_player_trace_data_list_length, Struct(
+ "user_quest_scene_player_trace_id" / Int32ub, # user_quest_scene_player_trace_id is an int
+ )),
+ Padding(3),
+ "get_rare_drop_data_list_length" / Rebuild(Int8ub, len_(this.get_rare_drop_data_list)), # get_rare_drop_data_list_length is a byte
+ "get_rare_drop_data_list" / Array(this.get_rare_drop_data_list_length, Struct(
+ "quest_rare_drop_id" / Int32ub, # quest_rare_drop_id is an int
+ )),
+ Padding(3),
+ "get_special_rare_drop_data_list_length" / Rebuild(Int8ub, len_(this.get_special_rare_drop_data_list)), # get_special_rare_drop_data_list_length is a byte
+ "get_special_rare_drop_data_list" / Array(this.get_special_rare_drop_data_list_length, Struct(
+ "quest_special_rare_drop_id" / Int32ub, # quest_special_rare_drop_id is an int
+ )),
+ Padding(3),
+ "get_unanalyzed_log_tmp_reward_data_list_length" / Rebuild(Int8ub, len_(this.get_unanalyzed_log_tmp_reward_data_list)), # get_unanalyzed_log_tmp_reward_data_list_length is a byte
+ "get_unanalyzed_log_tmp_reward_data_list" / Array(this.get_unanalyzed_log_tmp_reward_data_list_length, Struct(
+ "unanalyzed_log_grade_id" / Int32ub, # unanalyzed_log_grade_id is an int,
+ )),
+ Padding(3),
+ "get_event_item_data_list_length" / Rebuild(Int8ub, len_(this.get_event_item_data_list)), # get_event_item_data_list_length is a byte,
+ "get_event_item_data_list" / Array(this.get_event_item_data_list_length, Struct(
+ "event_item_id" / Int32ub, # event_item_id is an int
+ "get_num" / Int16ub, # get_num is a short
+ )),
+ Padding(3),
+ "discovery_enemy_data_list_length" / Rebuild(Int8ub, len_(this.discovery_enemy_data_list)), # discovery_enemy_data_list_length is a byte
+ "discovery_enemy_data_list" / Array(this.discovery_enemy_data_list_length, Struct(
+ "enemy_kind_id" / Int32ub, # enemy_kind_id is an int
+ "destroy_num" / Int16ub, # destroy_num is a short
+ )),
+ Padding(3),
+ "destroy_boss_data_list_length" / Rebuild(Int8ub, len_(this.destroy_boss_data_list)), # destroy_boss_data_list_length is a byte
+ "destroy_boss_data_list" / Array(this.destroy_boss_data_list_length, Struct(
+ "boss_type" / Int8ub, # boss_type is a byte
+ "enemy_kind_id" / Int32ub, # enemy_kind_id is an int
+ "destroy_num" / Int16ub, # destroy_num is a short
+ )),
+ Padding(3),
+ "mission_data_list_length" / Rebuild(Int8ub, len_(this.mission_data_list)), # mission_data_list_length is a byte
+ "mission_data_list" / Array(this.mission_data_list_length, Struct(
+ "mission_id" / Int32ub, # enemy_kind_id is an int
+ "clear_flag" / Int8ub, # boss_type is a byte
+ "mission_difficulty_id" / Int16ub, # destroy_num is a short
+ )),
+ Padding(3),
+ "score_data_length" / Rebuild(Int8ub, len_(this.score_data)), # score_data_length is a byte
+ "score_data" / Array(this.score_data_length, Struct(
+ "clear_time" / Int32ub, # clear_time is an int
+ "combo_num" / Int32ub, # boss_type is a int
+ "total_damage_size" / Rebuild(Int32ub, len_(this.total_damage) * 2), # calculates the length of the total_damage
+ "total_damage" / PaddedString(this.total_damage_size, "utf_16_le"), # total_damage is a (zero) padded string
+ "concurrent_destroying_num" / Int16ub, # concurrent_destroying_num is a short
+ "reaching_skill_level" / Int16ub, # reaching_skill_level is a short
+ "ko_chara_num" / Int8ub, # ko_chara_num is a byte
+ "acceleration_invocation_num" / Int16ub, # acceleration_invocation_num is a short
+ "boss_destroying_num" / Int16ub, # boss_destroying_num is a short
+ "synchro_skill_used_flag" / Int8ub, # synchro_skill_used_flag is a byte
+ "used_friend_skill_id" / Int32ub, # used_friend_skill_id is an int
+ "friend_skill_used_flag" / Int8ub, # friend_skill_used_flag is a byte
+ "continue_cnt" / Int16ub, # continue_cnt is a short
+ "total_loss_num" / Int16ub, # total_loss_num is a short
+ )),
+
+ )
+
+ req_data = req_struct.parse(req)
+
+ # Add tower progression to database
+ user_id = req_data.user_id
+ trial_tower_id = req_data.trial_tower_id
+ next_tower_id = 0
+ quest_clear_flag = bool(req_data.score_data[0].boss_destroying_num)
+ clear_time = req_data.score_data[0].clear_time
+ combo_num = req_data.score_data[0].combo_num
+ total_damage = req_data.score_data[0].total_damage
+ concurrent_destroying_num = req_data.score_data[0].concurrent_destroying_num
+
+ if quest_clear_flag is True:
+ # Save tower progression - to be revised to avoid saving worse score
+ if trial_tower_id == 9:
+ next_tower_id = 10001
+ elif trial_tower_id == 10:
+ trial_tower_id = 10001
+ next_tower_id = 3011
+ elif trial_tower_id == 19:
+ next_tower_id = 10002
+ elif trial_tower_id == 20:
+ trial_tower_id = 10002
+ next_tower_id = 3021
+ elif trial_tower_id == 29:
+ next_tower_id = 10003
+ elif trial_tower_id == 30:
+ trial_tower_id = 10003
+ next_tower_id = 3031
+ elif trial_tower_id == 39:
+ next_tower_id = 10004
+ elif trial_tower_id == 40:
+ trial_tower_id = 10004
+ next_tower_id = 3041
+ elif trial_tower_id == 49:
+ next_tower_id = 10005
+ elif trial_tower_id == 50:
+ trial_tower_id = 10005
+ next_tower_id = 3051
+ else:
+ trial_tower_id = trial_tower_id + 3000
+ next_tower_id = trial_tower_id + 1
+
+ self.game_data.item.put_player_quest(user_id, trial_tower_id, quest_clear_flag, clear_time, combo_num, total_damage, concurrent_destroying_num)
+
+ # Check if next stage is already done
+ checkQuest = self.game_data.item.get_quest_log(user_id, next_tower_id)
+ if not checkQuest:
+ if next_tower_id != 3101:
+ self.game_data.item.put_player_quest(user_id, next_tower_id, 0, 0, 0, 0, 0)
+
+ # Update the profile
+ profile = self.game_data.profile.get_profile(user_id)
+
+ exp = int(profile["rank_exp"]) + 100 #always 100 extra exp for some reason
+ col = int(profile["own_col"]) + int(req_data.base_get_data[0].get_col)
+
+ # Calculate level based off experience and the CSV list
+ with open(r'titles/sao/data/PlayerRank.csv') as csv_file:
+ csv_reader = csv.reader(csv_file, delimiter=',')
+ line_count = 0
+ data = []
+ rowf = False
+ for row in csv_reader:
+ if rowf==False:
+ rowf=True
+ else:
+ data.append(row)
+
+ for i in range(0,len(data)):
+ if exp>=int(data[i][1]) and exp=int(data[e][1]) and log_exp bytes:
+ #quest/episode_play_end_unanalyzed_log_fixed
+
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "ticket_id_size" / Rebuild(Int32ub, len_(this.ticket_id) * 2), # calculates the length of the ticket_id
+ "ticket_id" / PaddedString(this.ticket_id_size, "utf_16_le"), # ticket_id is a (zero) padded string
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ )
+
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ end_session_data = self.game_data.item.get_end_session(user_id)
+
+ resp = SaoEpisodePlayEndUnanalyzedLogFixedResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, end_session_data[4])
+ return resp.make()
+
+ def handle_c91a(self, request: Any) -> bytes: # handler is identical to the episode
+ #quest/trial_tower_play_end_unanalyzed_log_fixed
+ req = bytes.fromhex(request)[24:]
+
+ req_struct = Struct(
+ Padding(16),
+ "ticket_id_size" / Rebuild(Int32ub, len_(this.ticket_id) * 2), # calculates the length of the ticket_id
+ "ticket_id" / PaddedString(this.ticket_id_size, "utf_16_le"), # ticket_id is a (zero) padded string
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ )
+
+ req_data = req_struct.parse(req)
+ user_id = req_data.user_id
+
+ end_session_data = self.game_data.item.get_end_session(user_id)
+
+ resp = SaoEpisodePlayEndUnanalyzedLogFixedResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1, end_session_data[4])
+ return resp.make()
+
+ def handle_cd00(self, request: Any) -> bytes:
+ #defrag_match/get_defrag_match_basic_data
+ resp = SaoGetDefragMatchBasicDataResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_cd02(self, request: Any) -> bytes:
+ #defrag_match/get_defrag_match_ranking_user_data
+ resp = SaoGetDefragMatchRankingUserDataResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_cd04(self, request: Any) -> bytes:
+ #defrag_match/get_defrag_match_league_point_ranking_list
+ resp = SaoGetDefragMatchLeaguePointRankingListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_cd06(self, request: Any) -> bytes:
+ #defrag_match/get_defrag_match_league_score_ranking_list
+ resp = SaoGetDefragMatchLeagueScoreRankingListResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_d404(self, request: Any) -> bytes:
+ #other/bnid_serial_code_check
+ resp = SaoBnidSerialCodeCheckResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
+
+ def handle_c306(self, request: Any) -> bytes:
+ #card/scan_qr_quest_profile_card
+ resp = SaoScanQrQuestProfileCardResponse(int.from_bytes(bytes.fromhex(request[:4]), "big")+1)
+ return resp.make()
\ No newline at end of file
diff --git a/titles/sao/config.py b/titles/sao/config.py
new file mode 100644
index 0000000..7b9a2d5
--- /dev/null
+++ b/titles/sao/config.py
@@ -0,0 +1,47 @@
+from core.config import CoreConfig
+
+
+class SaoServerConfig:
+ def __init__(self, parent_config: "SaoConfig"):
+ self.__config = parent_config
+
+ @property
+ def hostname(self) -> str:
+ return CoreConfig.get_config_field(
+ self.__config, "sao", "server", "hostname", default="localhost"
+ )
+
+ @property
+ def enable(self) -> bool:
+ return CoreConfig.get_config_field(
+ self.__config, "sao", "server", "enable", default=True
+ )
+
+ @property
+ def loglevel(self) -> int:
+ return CoreConfig.str_to_loglevel(
+ CoreConfig.get_config_field(
+ self.__config, "sao", "server", "loglevel", default="info"
+ )
+ )
+
+ @property
+ def port(self) -> int:
+ return CoreConfig.get_config_field(
+ self.__config, "sao", "server", "port", default=9000
+ )
+
+ @property
+ def auto_register(self) -> bool:
+ """
+ Automatically register users in `aime_user` on first carding in with sao
+ if they don't exist already. Set to false to display an error instead.
+ """
+ return CoreConfig.get_config_field(
+ self.__config, "sao", "server", "auto_register", default=True
+ )
+
+
+class SaoConfig(dict):
+ def __init__(self) -> None:
+ self.server = SaoServerConfig(self)
diff --git a/titles/sao/const.py b/titles/sao/const.py
new file mode 100644
index 0000000..8bdea0f
--- /dev/null
+++ b/titles/sao/const.py
@@ -0,0 +1,15 @@
+from enum import Enum
+
+
+class SaoConstants:
+ GAME_CODE = "SDEW"
+
+ CONFIG_NAME = "sao.yaml"
+
+ VER_SAO = 0
+
+ VERSION_NAMES = ("Sword Art Online Arcade")
+
+ @classmethod
+ def game_ver_to_string(cls, ver: int):
+ return cls.VERSION_NAMES[ver]
diff --git a/titles/sao/data/EquipmentLevel.csv b/titles/sao/data/EquipmentLevel.csv
new file mode 100644
index 0000000..803bf7e
--- /dev/null
+++ b/titles/sao/data/EquipmentLevel.csv
@@ -0,0 +1,121 @@
+EquipmentLevelId,RequireExp
+1,200,
+2,400,
+3,600,
+4,800,
+5,1000,
+6,1200,
+7,1400,
+8,1600,
+9,1800,
+10,2000,
+11,2200,
+12,2400,
+13,2600,
+14,2800,
+15,3000,
+16,3200,
+17,3400,
+18,3600,
+19,3800,
+20,4000,
+21,4200,
+22,4400,
+23,4600,
+24,4800,
+25,5000,
+26,5200,
+27,5400,
+28,5600,
+29,5800,
+30,6000,
+31,6200,
+32,6400,
+33,6600,
+34,6800,
+35,7000,
+36,7200,
+37,7400,
+38,7600,
+39,7800,
+40,8000,
+41,8200,
+42,8400,
+43,8600,
+44,8800,
+45,9000,
+46,9200,
+47,9400,
+48,9600,
+49,9800,
+50,10000,
+51,10200,
+52,10400,
+53,10600,
+54,10800,
+55,11000,
+56,11200,
+57,11400,
+58,11600,
+59,11800,
+60,12000,
+61,12200,
+62,12400,
+63,12600,
+64,12800,
+65,13000,
+66,13200,
+67,13400,
+68,13600,
+69,13800,
+70,14000,
+71,14200,
+72,14400,
+73,14600,
+74,14800,
+75,15000,
+76,15200,
+77,15400,
+78,15600,
+79,15800,
+80,16000,
+81,16200,
+82,16400,
+83,16600,
+84,16800,
+85,17000,
+86,17200,
+87,17400,
+88,17600,
+89,17800,
+90,18000,
+91,18200,
+92,18400,
+93,18600,
+94,18800,
+95,19000,
+96,19200,
+97,19400,
+98,19600,
+99,19800,
+100,100000,
+101,150000,
+102,200000,
+103,250000,
+104,300000,
+105,350000,
+106,400000,
+107,450000,
+108,500000,
+109,550000,
+110,600000,
+111,650000,
+112,700000,
+113,750000,
+114,800000,
+115,850000,
+116,900000,
+117,950000,
+118,1000000,
+119,1000000,
+120,1000000,
diff --git a/titles/sao/data/HeroLogLevel.csv b/titles/sao/data/HeroLogLevel.csv
new file mode 100644
index 0000000..36a53b9
--- /dev/null
+++ b/titles/sao/data/HeroLogLevel.csv
@@ -0,0 +1,121 @@
+HeroLogLevelId,RequireExp
+1,0,
+2,1000,
+3,1200,
+4,1400,
+5,1600,
+6,1900,
+7,2200,
+8,2500,
+9,2800,
+10,3100,
+11,3500,
+12,3900,
+13,4300,
+14,4700,
+15,5100,
+16,5550,
+17,6000,
+18,6450,
+19,6900,
+20,7350,
+21,7850,
+22,8350,
+23,8850,
+24,9350,
+25,9850,
+26,10450,
+27,11050,
+28,11650,
+29,12250,
+30,12850,
+31,13550,
+32,14250,
+33,14950,
+34,15650,
+35,16350,
+36,17150,
+37,17950,
+38,18750,
+39,19550,
+40,20350,
+41,21250,
+42,22150,
+43,23050,
+44,23950,
+45,24850,
+46,25850,
+47,26850,
+48,27850,
+49,28850,
+50,29850,
+51,30950,
+52,32050,
+53,33150,
+54,34250,
+55,35350,
+56,36550,
+57,37750,
+58,38950,
+59,40150,
+60,41350,
+61,42650,
+62,43950,
+63,45250,
+64,46550,
+65,47850,
+66,49250,
+67,50650,
+68,52050,
+69,53450,
+70,54850,
+71,56350,
+72,57850,
+73,59350,
+74,60850,
+75,62350,
+76,63950,
+77,65550,
+78,67150,
+79,68750,
+80,70350,
+81,72050,
+82,73750,
+83,75450,
+84,77150,
+85,78850,
+86,80650,
+87,82450,
+88,84250,
+89,86050,
+90,87850,
+91,89750,
+92,91650,
+93,93550,
+94,95450,
+95,97350,
+96,99350,
+97,101350,
+98,103350,
+99,105350,
+100,107350,
+101,200000,
+102,300000,
+103,450000,
+104,600000,
+105,800000,
+106,1000000,
+107,1250000,
+108,1500000,
+109,1800000,
+110,2100000,
+111,2100000,
+112,2100000,
+113,2100000,
+114,2100000,
+115,2100000,
+116,2100000,
+117,2100000,
+118,2100000,
+119,2100000,
+120,2100000,
diff --git a/titles/sao/data/PlayerRank.csv b/titles/sao/data/PlayerRank.csv
new file mode 100644
index 0000000..9031661
--- /dev/null
+++ b/titles/sao/data/PlayerRank.csv
@@ -0,0 +1,301 @@
+PlayerRankId,TotalExp,
+1,0,
+2,100,
+3,300,
+4,500,
+5,800,
+6,1100,
+7,1400,
+8,1800,
+9,2200,
+10,2600,,
+11,3000,,
+12,3500,,
+13,4000,,
+14,4500,,
+15,5000,,
+16,5500,,
+17,6100,,
+18,6700,,
+19,7300,,
+20,7900,,
+21,8500,,
+22,9100,,
+23,9800,,
+24,10500,
+25,11200,
+26,11900,
+27,12600,
+28,13300,
+29,14000,
+30,14800,
+31,15600,
+32,16400,
+33,17200,
+34,18000,
+35,18800,
+36,19600,
+37,20400,
+38,21300,
+39,22200,
+40,23100,
+41,24000,
+42,24900,
+43,25800,
+44,26700,
+45,27600,
+46,28500,
+47,29500,
+48,30600,
+49,31800,
+50,33100,
+51,34500,
+52,36000,
+53,37600,
+54,39300,
+55,41100,
+56,43000,
+57,45000,
+58,47100,
+59,49300,
+60,51600,
+61,54000,
+62,56500,
+63,59100,
+64,61800,
+65,64600,
+66,67500,
+67,70500,
+68,73600,
+69,76800,
+70,80100,
+71,83500,
+72,87000,
+73,90600,
+74,94300,
+75,98100,
+76,102000,
+77,106000,
+78,110100,
+79,114300,
+80,118600,
+81,123000,
+82,127500,
+83,132100,
+84,136800,
+85,141600,
+86,146500,
+87,151500,
+88,156600,
+89,161800,
+90,167100,
+91,172500,
+92,178000,
+93,183600,
+94,189300,
+95,195100,
+96,201000,
+97,207000,
+98,213100,
+99,219300,
+100,225600,
+101,232000,
+102,238500,
+103,245100,
+104,251800,
+105,258600,
+106,265500,
+107,272500,
+108,279600,
+109,286800,
+110,294100,
+111,301500,
+112,309000,
+113,316600,
+114,324300,
+115,332100,
+116,340000,
+117,348000,
+118,356100,
+119,364300,
+120,372600,
+121,381000,
+122,389500,
+123,398100,
+124,406800,
+125,415600,
+126,424500,
+127,433500,
+128,442600,
+129,451800,
+130,461100,
+131,470500,
+132,480000,
+133,489600,
+134,499300,
+135,509100,
+136,519000,
+137,529000,
+138,539100,
+139,549300,
+140,559600,
+141,570000,
+142,580500,
+143,591100,
+144,601800,
+145,612600,
+146,623500,
+147,634500,
+148,645600,
+149,656800,
+150,668100,
+151,679500,
+152,691000,
+153,702600,
+154,714300,
+155,726100,
+156,738000,
+157,750000,
+158,762100,
+159,774300,
+160,786600,
+161,799000,
+162,811500,
+163,824100,
+164,836800,
+165,849600,
+166,862500,
+167,875500,
+168,888600,
+169,901800,
+170,915100,
+171,928500,
+172,942000,
+173,955600,
+174,969300,
+175,983100,
+176,997000,
+177,1011000,
+178,1025100,
+179,1039300,
+180,1053600,
+181,1068000,
+182,1082500,
+183,1097100,
+184,1111800,
+185,1126600,
+186,1141500,
+187,1156500,
+188,1171600,
+189,1186800,
+190,1202100,
+191,1217500,
+192,1233000,
+193,1248600,
+194,1264300,
+195,1280100,
+196,1296000,
+197,1312000,
+198,1328100,
+199,1344300,
+200,1360600,
+201,1377000,
+202,1393500,
+203,1410100,
+204,1426800,
+205,1443600,
+206,1460500,
+207,1477500,
+208,1494600,
+209,1511800,
+210,1529100,
+211,1546500,
+212,1564000,
+213,1581600,
+214,1599300,
+215,1617100,
+216,1635000,
+217,1653000,
+218,1671100,
+219,1689300,
+220,1707600,
+221,1726000,
+222,1744500,
+223,1763100,
+224,1781800,
+225,1800600,
+226,1819500,
+227,1838500,
+228,1857600,
+229,1876800,
+230,1896100,
+231,1915500,
+232,1935000,
+233,1954600,
+234,1974300,
+235,1994100,
+236,2014000,
+237,2034000,
+238,2054100,
+239,2074300,
+240,2094600,
+241,2115000,
+242,2135500,
+243,2156100,
+244,2176800,
+245,2197600,
+246,2218500,
+247,2239500,
+248,2260600,
+249,2281800,
+250,2303100,
+251,2324500,
+252,2346000,
+253,2367600,
+254,2389300,
+255,2411100,
+256,2433000,
+257,2455000,
+258,2477100,
+259,2499300,
+260,2521600,
+261,2544000,
+262,2566500,
+263,2589100,
+264,2611800,
+265,2634600,
+266,2657500,
+267,2680500,
+268,2703600,
+269,2726800,
+270,2750100,
+271,2773500,
+272,2797000,
+273,2820600,
+274,2844300,
+275,2868100,
+276,2892000,
+277,2916000,
+278,2940100,
+279,2964300,
+280,2988600,
+281,3013000,
+282,3037500,
+283,3062100,
+284,3086800,
+285,3111600,
+286,3136500,
+287,3161500,
+288,3186600,
+289,3211800,
+290,3237100,
+291,3262500,
+292,3288000,
+293,3313600,
+294,3339300,
+295,3365100,
+296,3391000,
+297,3417000,
+298,3443100,
+299,3469300,
+300,3495600,
diff --git a/titles/sao/data/RewardTable.csv b/titles/sao/data/RewardTable.csv
new file mode 100644
index 0000000..929ff82
--- /dev/null
+++ b/titles/sao/data/RewardTable.csv
@@ -0,0 +1,17274 @@
+RewardTableId,UnanalyzedLogGradeId,CommonRewardId,CommonRewardType
+142,1,101000000,2
+143,2,101000001,2
+144,3,101000002,2
+145,4,101000008,2
+146,5,101000004,2
+147,1,102000000,2
+148,2,102000001,2
+149,3,102000002,2
+150,4,102000003,2
+151,5,102000004,2
+152,1,103000000,2
+153,2,103000001,2
+154,3,103000002,2
+155,4,103000003,2
+156,5,103000004,2
+157,1,105000000,2
+158,2,105000001,2
+159,3,105000002,2
+160,4,105000003,2
+161,5,105000004,2
+162,1,108000000,2
+163,2,108000001,2
+164,3,108000002,2
+165,4,108000003,2
+166,5,108000004,2
+167,1,109000000,2
+168,2,109000001,2
+169,3,109000002,2
+170,4,109000003,2
+171,5,109000004,2
+172,1,111000000,2
+173,2,111000001,2
+174,3,111000002,2
+175,4,111000003,2
+176,5,111000004,2
+177,1,112000000,2
+178,2,112000001,2
+179,3,112000002,2
+180,4,112000003,2
+181,5,112000004,2
+182,1,120000000,2
+183,2,120000001,2
+184,3,120000002,2
+185,4,120000003,2
+186,5,120000004,2
+187,1,101000010,1
+188,2,101000030,1
+189,3,101000040,1
+190,1,102000010,1
+191,2,102000030,1
+192,3,102000070,1
+193,1,103000010,1
+194,2,103000040,1
+195,3,103000070,1
+196,1,104000010,1
+197,2,104000030,1
+198,3,104000070,1
+199,1,105000010,1
+200,2,105000040,1
+201,3,105000070,1
+202,1,106000010,1
+203,2,106000030,1
+204,3,106000070,1
+205,1,107000010,1
+206,2,107000040,1
+207,3,107000070,1
+208,1,108000010,1
+209,2,108000030,1
+210,3,108000050,1
+212,1,101000000,2
+213,2,101000001,2
+214,3,101000002,2
+215,4,101000008,2
+216,5,101000004,2
+218,1,101000000,2
+219,2,101000001,2
+220,3,101000002,2
+221,4,101000008,2
+222,5,101000004,2
+223,1,102000000,2
+224,2,102000001,2
+225,3,102000002,2
+226,4,102000003,2
+227,5,102000004,2
+228,1,103000000,2
+229,2,103000001,2
+230,3,103000002,2
+231,4,103000003,2
+232,5,103000004,2
+233,1,105000000,2
+234,2,105000001,2
+235,3,105000002,2
+236,4,105000003,2
+237,5,105000004,2
+238,1,108000000,2
+239,2,108000001,2
+240,3,108000002,2
+241,4,108000003,2
+242,5,108000004,2
+243,1,109000000,2
+244,2,109000001,2
+245,3,109000002,2
+246,4,109000003,2
+247,5,109000004,2
+248,1,111000000,2
+249,2,111000001,2
+250,3,111000002,2
+251,4,111000003,2
+252,5,111000004,2
+253,1,112000000,2
+254,2,112000001,2
+255,3,112000002,2
+256,4,112000003,2
+257,5,112000004,2
+258,1,120000000,2
+259,2,120000001,2
+260,3,120000002,2
+261,4,120000003,2
+262,5,120000004,2
+263,1,101000010,1
+264,2,101000020,1
+265,2,101000030,1
+266,3,101000040,1
+267,3,101000050,1
+268,3,101000060,1
+269,3,101000070,1
+270,3,101000080,1
+271,1,102000010,1
+272,2,102000020,1
+273,2,102000030,1
+274,2,102000040,1
+275,3,102000050,1
+276,3,102000060,1
+277,3,102000070,1
+278,3,102000080,1
+279,1,103000010,1
+280,2,103000020,1
+281,2,103000030,1
+282,2,103000040,1
+283,3,103000050,1
+284,3,103000060,1
+285,3,103000070,1
+286,3,103000080,1
+287,1,104000010,1
+288,2,104000020,1
+289,2,104000030,1
+290,2,104000040,1
+291,3,104000050,1
+292,3,104000060,1
+293,3,104000070,1
+294,3,104000080,1
+295,1,105000010,1
+296,2,105000020,1
+297,2,105000030,1
+298,2,105000040,1
+299,3,105000050,1
+300,3,105000060,1
+301,3,105000070,1
+302,3,105000080,1
+303,1,106000010,1
+304,2,106000020,1
+305,2,106000030,1
+306,2,106000040,1
+307,3,106000050,1
+308,3,106000060,1
+309,3,106000070,1
+310,3,106000080,1
+311,1,107000010,1
+312,2,107000020,1
+313,2,107000030,1
+314,2,107000040,1
+315,3,107000050,1
+316,3,107000060,1
+317,3,107000070,1
+318,3,107000080,1
+319,1,108000010,1
+320,2,108000020,1
+321,2,108000030,1
+322,2,108000040,1
+323,3,108000050,1
+324,3,108000060,1
+325,3,108000070,1
+326,3,108000080,1
+327,2,180000,3
+329,1,101000000,2
+330,2,101000001,2
+331,3,101000002,2
+332,4,101000008,2
+333,5,101000004,2
+334,1,102000000,2
+335,2,102000001,2
+336,3,102000002,2
+337,4,102000003,2
+338,5,102000004,2
+339,1,103000000,2
+340,2,103000001,2
+341,3,103000002,2
+342,4,103000003,2
+343,5,103000004,2
+344,1,105000000,2
+345,2,105000001,2
+346,3,105000002,2
+347,4,105000003,2
+348,5,105000004,2
+349,1,108000000,2
+350,2,108000001,2
+351,3,108000002,2
+352,4,108000003,2
+353,5,108000004,2
+354,1,109000000,2
+355,2,109000001,2
+356,3,109000002,2
+357,4,109000003,2
+358,5,109000004,2
+359,1,111000000,2
+360,2,111000001,2
+361,3,111000002,2
+362,4,111000003,2
+363,5,111000004,2
+364,1,112000000,2
+365,2,112000001,2
+366,3,112000002,2
+367,4,112000003,2
+368,5,112000004,2
+369,1,120000000,2
+370,2,120000001,2
+371,3,120000002,2
+372,4,120000003,2
+373,5,120000004,2
+374,1,101000010,1
+375,2,101000020,1
+376,2,101000030,1
+377,3,101000040,1
+378,3,101000050,1
+379,3,101000060,1
+380,3,101000070,1
+381,3,101000080,1
+382,1,102000010,1
+383,2,102000020,1
+384,2,102000030,1
+385,2,102000040,1
+386,3,102000050,1
+387,3,102000060,1
+388,3,102000070,1
+389,3,102000080,1
+390,1,103000010,1
+391,2,103000020,1
+392,2,103000030,1
+393,2,103000040,1
+394,3,103000050,1
+395,3,103000060,1
+396,3,103000070,1
+397,3,103000080,1
+398,1,104000010,1
+399,2,104000020,1
+400,2,104000030,1
+401,2,104000040,1
+402,3,104000050,1
+403,3,104000060,1
+404,3,104000070,1
+405,3,104000080,1
+406,1,105000010,1
+407,2,105000020,1
+408,2,105000030,1
+409,2,105000040,1
+410,3,105000050,1
+411,3,105000060,1
+412,3,105000070,1
+413,3,105000080,1
+414,1,106000010,1
+415,2,106000020,1
+416,2,106000030,1
+417,2,106000040,1
+418,3,106000050,1
+419,3,106000060,1
+420,3,106000070,1
+421,3,106000080,1
+422,1,107000010,1
+423,2,107000020,1
+424,2,107000030,1
+425,2,107000040,1
+426,3,107000050,1
+427,3,107000060,1
+428,3,107000070,1
+429,3,107000080,1
+430,1,108000010,1
+431,2,108000020,1
+432,2,108000030,1
+433,2,108000040,1
+434,3,108000050,1
+435,3,108000060,1
+436,3,108000070,1
+437,3,108000080,1
+438,2,180000,3
+440,1,101000000,2
+441,2,101000001,2
+442,3,101000002,2
+443,4,101000008,2
+444,5,101000004,2
+446,1,102000000,2
+447,2,102000001,2
+448,3,102000002,2
+449,4,102000003,2
+450,5,102000004,2
+451,1,112000000,2
+452,2,112000001,2
+453,3,112000002,2
+454,4,112000003,2
+455,5,112000004,2
+457,1,101000000,2
+458,2,101000001,2
+459,3,101000002,2
+460,4,101000008,2
+461,5,101000004,2
+462,1,120000000,2
+463,2,120000001,2
+464,3,120000002,2
+465,4,120000003,2
+466,5,120000004,2
+468,1,111000000,2
+469,2,111000001,2
+470,3,111000002,2
+471,4,111000003,2
+472,5,111000004,2
+473,1,120000000,2
+474,2,120000001,2
+475,3,120000002,2
+476,4,120000003,2
+477,5,120000004,2
+479,1,109000000,2
+480,2,109000001,2
+481,3,109000002,2
+482,4,109000003,2
+483,5,109000004,2
+484,1,112000000,2
+485,2,112000001,2
+486,3,112000002,2
+487,4,112000003,2
+488,5,112000004,2
+490,1,103000000,2
+491,2,103000001,2
+492,3,103000002,2
+493,4,103000003,2
+494,5,103000004,2
+495,1,112000000,2
+496,2,112000001,2
+497,3,112000002,2
+498,4,112000003,2
+499,5,112000004,2
+501,1,105000000,2
+502,2,105000001,2
+503,3,105000002,2
+504,4,105000003,2
+505,5,105000004,2
+506,1,120000000,2
+507,2,120000001,2
+508,3,120000002,2
+509,4,120000003,2
+510,5,120000004,2
+512,1,108000000,2
+513,2,108000001,2
+514,3,108000002,2
+515,4,108000003,2
+516,5,108000004,2
+517,1,120000000,2
+518,2,120000001,2
+519,3,120000002,2
+520,4,120000003,2
+521,5,120000004,2
+523,1,101000010,1
+524,1,103000010,1
+525,2,103000030,1
+526,2,103000040,1
+527,2,107000020,1
+528,2,101000030,1
+529,3,101000050,1
+530,3,101000060,1
+531,3,101000080,1
+532,3,103000060,1
+533,3,103000070,1
+534,3,103000080,1
+535,3,101000040,1
+536,1,101000000,2
+537,2,101000001,2
+538,3,101000002,2
+539,4,101000008,2
+540,5,101000004,2
+541,1,112000000,2
+542,2,112000001,2
+543,3,112000002,2
+544,4,112000003,2
+545,5,112000004,2
+546,2,101000005,2
+547,2,112000005,2
+548,3,170000,3
+549,4,170001,3
+551,1,102000010,1
+552,2,102000030,1
+553,2,102000040,1
+554,2,104000020,1
+555,3,102000060,1
+556,3,102000070,1
+557,3,102000080,1
+558,3,103000050,1
+559,3,105000050,1
+560,1,102000000,2
+561,2,102000001,2
+562,3,102000002,2
+563,4,102000003,2
+564,5,102000004,2
+565,1,112000000,2
+566,2,112000001,2
+567,3,112000002,2
+568,4,112000003,2
+569,5,112000004,2
+570,3,170000,3
+571,4,170001,3
+573,1,106000010,1
+574,2,106000030,1
+575,2,106000040,1
+576,2,105000020,1
+577,3,106000060,1
+578,3,106000070,1
+579,3,106000080,1
+580,3,101000070,1
+581,1,103000000,2
+582,2,103000001,2
+583,3,103000002,2
+584,4,103000003,2
+585,5,103000004,2
+586,1,112000000,2
+587,2,112000001,2
+588,3,112000002,2
+589,4,112000003,2
+590,5,112000004,2
+591,3,170000,3
+592,4,170001,3
+594,1,104000010,1
+595,2,104000030,1
+596,2,104000040,1
+597,2,108000020,1
+598,3,104000060,1
+599,3,104000070,1
+600,3,104000080,1
+601,3,102000050,1
+602,1,111000000,2
+603,2,111000001,2
+604,3,111000002,2
+605,4,111000003,2
+606,5,111000004,2
+607,1,120000000,2
+608,2,120000001,2
+609,3,120000002,2
+610,4,120000003,2
+611,5,120000004,2
+612,1,110020,3
+613,1,110030,3
+614,1,110040,3
+615,1,110050,3
+616,3,110060,3
+617,3,110070,3
+618,3,110080,3
+619,3,110090,3
+620,3,110100,3
+621,3,110110,3
+622,3,110120,3
+623,3,110130,3
+624,3,110140,3
+625,3,110150,3
+626,3,110160,3
+627,3,110170,3
+628,3,110180,3
+629,3,110190,3
+630,3,110200,3
+631,3,110210,3
+632,3,110220,3
+633,3,110230,3
+634,3,110240,3
+635,3,110250,3
+636,3,110260,3
+637,3,110270,3
+639,1,107000010,1
+640,2,107000030,1
+641,2,107000040,1
+642,2,101000020,1
+643,3,107000060,1
+644,3,107000070,1
+645,3,107000080,1
+646,3,108000050,1
+647,1,105000000,2
+648,2,105000001,2
+649,3,105000002,2
+650,4,105000003,2
+651,5,105000004,2
+652,1,120000000,2
+653,2,120000001,2
+654,3,120000002,2
+655,4,120000003,2
+656,5,120000004,2
+657,3,180000,3
+658,4,180001,3
+660,1,105000010,1
+661,2,105000030,1
+662,2,105000040,1
+663,2,102000020,1
+664,2,103000020,1
+665,3,105000060,1
+666,3,105000070,1
+667,3,105000080,1
+668,3,104000050,1
+669,3,106000050,1
+670,1,109000000,2
+671,2,109000001,2
+672,3,109000002,2
+673,4,109000003,2
+674,5,109000004,2
+675,1,112000000,2
+676,2,112000001,2
+677,3,112000002,2
+678,4,112000003,2
+679,5,112000004,2
+680,1,120020,3
+681,1,120030,3
+682,1,120040,3
+683,1,120050,3
+684,3,120240,3
+685,3,120250,3
+686,3,120260,3
+687,3,120270,3
+688,3,120300,3
+689,3,120310,3
+690,3,120320,3
+691,3,120330,3
+692,3,120340,3
+693,3,120350,3
+694,3,120360,3
+695,3,120370,3
+696,3,120380,3
+697,3,120390,3
+698,3,120400,3
+699,3,120410,3
+700,3,120420,3
+701,3,120430,3
+702,3,120450,3
+703,3,120460,3
+705,1,108000010,1
+706,2,108000030,1
+707,2,108000040,1
+708,2,106000020,1
+709,3,108000060,1
+710,3,108000070,1
+711,3,108000080,1
+712,3,107000050,1
+713,1,108000000,2
+714,2,108000001,2
+715,3,108000002,2
+716,4,108000003,2
+717,5,108000004,2
+718,1,120000000,2
+719,2,120000001,2
+720,3,120000002,2
+721,4,120000003,2
+722,5,120000004,2
+723,1,130020,3
+724,1,130030,3
+725,1,130040,3
+726,1,130050,3
+727,3,130060,3
+728,3,130070,3
+729,3,130080,3
+730,3,130090,3
+731,3,130100,3
+732,3,130110,3
+733,3,130120,3
+734,3,130130,3
+735,3,130140,3
+736,3,130150,3
+737,3,130160,3
+738,3,130170,3
+739,3,130180,3
+740,3,130190,3
+741,3,130200,3
+742,3,130420,3
+743,3,130510,3
+744,3,130520,3
+745,3,130530,3
+746,3,130540,3
+748,1,105000010,1
+749,2,105000030,1
+750,2,105000040,1
+751,2,102000020,1
+752,2,103000020,1
+753,3,105000060,1
+754,3,105000070,1
+755,3,105000080,1
+756,3,104000050,1
+757,3,106000050,1
+758,1,109000000,2
+759,2,109000001,2
+760,3,109000002,2
+761,4,109000003,2
+762,5,109000004,2
+763,1,112000000,2
+764,2,112000001,2
+765,3,112000002,2
+766,4,112000003,2
+767,5,112000004,2
+768,3,170000,3
+769,4,170001,3
+771,1,104000010,1
+772,2,104000030,1
+773,2,104000040,1
+774,2,108000020,1
+775,3,104000060,1
+776,3,104000070,1
+777,3,104000080,1
+778,3,102000050,1
+779,1,111000000,2
+780,2,111000001,2
+781,3,111000002,2
+782,4,111000003,2
+783,5,111000004,2
+784,1,120000000,2
+785,2,120000001,2
+786,3,120000002,2
+787,4,120000003,2
+788,5,120000004,2
+789,1,110020,3
+790,1,110030,3
+791,1,110040,3
+792,1,110050,3
+793,3,110060,3
+794,3,110070,3
+795,3,110080,3
+796,3,110090,3
+797,3,110100,3
+798,3,110110,3
+799,3,110120,3
+800,3,110130,3
+801,3,110140,3
+802,3,110150,3
+803,3,110160,3
+804,3,110170,3
+805,3,110180,3
+806,3,110190,3
+807,3,110200,3
+808,3,110210,3
+809,3,110220,3
+810,3,110230,3
+811,3,110240,3
+812,3,110250,3
+813,3,110260,3
+814,3,110270,3
+816,1,102000010,1
+817,2,102000030,1
+818,2,102000040,1
+819,2,104000020,1
+820,3,102000060,1
+821,3,102000070,1
+822,3,102000080,1
+823,3,103000050,1
+824,3,105000050,1
+825,1,102000000,2
+826,2,102000001,2
+827,3,102000002,2
+828,4,102000003,2
+829,5,102000004,2
+830,1,112000000,2
+831,2,112000001,2
+832,3,112000002,2
+833,4,112000003,2
+834,5,112000004,2
+835,3,170001,3
+836,4,170002,3
+838,1,102000010,1
+839,2,102000030,1
+840,2,102000040,1
+841,2,104000020,1
+842,3,102000060,1
+843,3,102000070,1
+844,3,102000080,1
+845,3,103000050,1
+846,3,105000050,1
+847,1,102000000,2
+848,2,102000001,2
+849,3,102000002,2
+850,4,102000003,2
+851,5,102000004,2
+852,1,112000000,2
+853,2,112000001,2
+854,3,112000002,2
+855,4,112000003,2
+856,5,112000004,2
+857,1,110020,3
+858,1,110030,3
+859,1,110040,3
+860,1,110050,3
+861,2,110021,3
+862,2,110031,3
+863,2,110041,3
+864,2,110051,3
+865,3,110060,3
+866,3,110070,3
+867,3,110080,3
+868,3,110090,3
+869,3,110100,3
+870,3,110110,3
+871,3,110120,3
+872,3,110130,3
+873,3,110140,3
+874,3,110150,3
+875,3,110160,3
+876,3,110170,3
+877,3,110180,3
+878,3,110190,3
+879,3,110200,3
+880,3,110210,3
+881,3,110220,3
+882,3,110230,3
+883,3,110240,3
+884,3,110250,3
+885,3,110260,3
+886,3,110270,3
+887,4,140000,3
+889,1,101000010,1
+890,1,103000010,1
+891,2,103000030,1
+892,2,103000040,1
+893,2,107000020,1
+894,2,101000030,1
+895,3,101000050,1
+896,3,101000060,1
+897,3,101000080,1
+898,3,103000060,1
+899,3,103000070,1
+900,3,103000080,1
+901,3,101000040,1
+902,1,101000000,2
+903,2,101000001,2
+904,3,101000002,2
+905,4,101000008,2
+906,5,101000004,2
+907,1,112000000,2
+908,2,112000001,2
+909,3,112000002,2
+910,4,112000003,2
+911,5,112000004,2
+912,1,120020,3
+913,1,120030,3
+914,1,120040,3
+915,1,120050,3
+916,2,120021,3
+917,2,120031,3
+918,2,120041,3
+919,2,120051,3
+920,3,120240,3
+921,3,120250,3
+922,3,120260,3
+923,3,120270,3
+924,3,120300,3
+925,3,120310,3
+926,3,120320,3
+927,3,120330,3
+928,3,120340,3
+929,3,120350,3
+930,3,120360,3
+931,3,120370,3
+932,3,120380,3
+933,3,120390,3
+934,3,120400,3
+935,3,120410,3
+936,3,120420,3
+937,3,120430,3
+938,3,120450,3
+939,3,120460,3
+940,4,140000,3
+942,1,106000010,1
+943,2,106000030,1
+944,2,106000040,1
+945,2,105000020,1
+946,3,106000060,1
+947,3,106000070,1
+948,3,106000080,1
+949,3,101000070,1
+950,1,103000000,2
+951,2,103000001,2
+952,3,103000002,2
+953,4,103000003,2
+954,5,103000004,2
+955,1,112000000,2
+956,2,112000001,2
+957,3,112000002,2
+958,4,112000003,2
+959,5,112000004,2
+960,3,180001,3
+961,4,180002,3
+963,1,101000010,1
+964,1,103000010,1
+965,2,103000030,1
+966,2,103000040,1
+967,2,107000020,1
+968,2,101000030,1
+969,3,101000050,1
+970,3,101000060,1
+971,3,101000080,1
+972,3,103000060,1
+973,3,103000070,1
+974,3,103000080,1
+975,3,101000040,1
+976,1,101000000,2
+977,2,101000001,2
+978,3,101000002,2
+979,4,101000008,2
+980,5,101000004,2
+981,1,120000000,2
+982,2,120000001,2
+983,3,120000002,2
+984,4,120000003,2
+985,5,120000004,2
+986,3,170001,3
+987,4,170002,3
+989,1,105000010,1
+990,2,105000030,1
+991,2,105000040,1
+992,2,102000020,1
+993,2,103000020,1
+994,3,105000060,1
+995,3,105000070,1
+996,3,105000080,1
+997,3,104000050,1
+998,3,106000050,1
+999,1,109000000,2
+1000,2,109000001,2
+1001,3,109000002,2
+1002,4,109000003,2
+1003,5,109000004,2
+1004,1,112000000,2
+1005,2,112000001,2
+1006,3,112000002,2
+1007,4,112000003,2
+1008,5,112000004,2
+1009,1,130020,3
+1010,1,130030,3
+1011,1,130040,3
+1012,1,130050,3
+1013,2,130021,3
+1014,2,130031,3
+1015,2,130041,3
+1016,2,130051,3
+1017,3,130060,3
+1018,3,130070,3
+1019,3,130080,3
+1020,3,130090,3
+1021,3,130100,3
+1022,3,130110,3
+1023,3,130120,3
+1024,3,130130,3
+1025,3,130140,3
+1026,3,130150,3
+1027,3,130160,3
+1028,3,130170,3
+1029,3,130180,3
+1030,3,130190,3
+1031,3,130200,3
+1032,3,130420,3
+1033,3,130510,3
+1034,3,130520,3
+1035,3,130530,3
+1036,3,130540,3
+1037,4,140000,3
+1039,1,107000010,1
+1040,2,107000030,1
+1041,2,107000040,1
+1042,2,101000020,1
+1043,3,107000060,1
+1044,3,107000070,1
+1045,3,107000080,1
+1046,3,108000050,1
+1047,1,105000000,2
+1048,2,105000001,2
+1049,3,105000002,2
+1050,4,105000003,2
+1051,5,105000004,2
+1052,1,120000000,2
+1053,2,120000001,2
+1054,3,120000002,2
+1055,4,120000003,2
+1056,5,120000004,2
+1057,1,120020,3
+1058,1,120030,3
+1059,1,120040,3
+1060,1,120050,3
+1061,2,120021,3
+1062,2,120031,3
+1063,2,120041,3
+1064,2,120051,3
+1065,3,120240,3
+1066,3,120250,3
+1067,3,120260,3
+1068,3,120270,3
+1069,3,120300,3
+1070,3,120310,3
+1071,3,120320,3
+1072,3,120330,3
+1073,3,120340,3
+1074,3,120350,3
+1075,3,120360,3
+1076,3,120370,3
+1077,3,120380,3
+1078,3,120390,3
+1079,3,120400,3
+1080,3,120410,3
+1081,3,120420,3
+1082,3,120430,3
+1083,3,120450,3
+1084,3,120460,3
+1085,4,140000,3
+1087,1,108000010,1
+1088,2,108000030,1
+1089,2,108000040,1
+1090,2,106000020,1
+1091,3,108000060,1
+1092,3,108000070,1
+1093,3,108000080,1
+1094,3,107000050,1
+1095,1,108000000,2
+1096,2,108000001,2
+1097,3,108000002,2
+1098,4,108000003,2
+1099,5,108000004,2
+1100,1,120000000,2
+1101,2,120000001,2
+1102,3,120000002,2
+1103,4,120000003,2
+1104,5,120000004,2
+1105,3,170001,3
+1106,4,170002,3
+1108,1,101000010,1
+1109,1,103000010,1
+1110,2,103000030,1
+1111,2,103000040,1
+1112,2,107000020,1
+1113,2,101000030,1
+1114,3,101000050,1
+1115,3,101000060,1
+1116,3,101000080,1
+1117,3,103000060,1
+1118,3,103000070,1
+1119,3,103000080,1
+1120,3,101000040,1
+1121,1,101000000,2
+1122,2,101000001,2
+1123,3,101000002,2
+1124,4,101000008,2
+1125,5,101000004,2
+1126,1,112000000,2
+1127,2,112000001,2
+1128,3,112000002,2
+1129,4,112000003,2
+1130,5,112000004,2
+1131,2,101000005,2
+1132,2,112000005,2
+1133,3,170001,3
+1134,4,170002,3
+1136,1,102000010,1
+1137,2,102000030,1
+1138,2,102000040,1
+1139,2,104000020,1
+1140,3,102000060,1
+1141,3,102000070,1
+1142,3,102000080,1
+1143,3,103000050,1
+1144,3,105000050,1
+1145,1,102000000,2
+1146,2,102000001,2
+1147,3,102000002,2
+1148,4,102000003,2
+1149,5,102000004,2
+1150,1,112000000,2
+1151,2,112000001,2
+1152,3,112000002,2
+1153,4,112000003,2
+1154,5,112000004,2
+1155,1,120020,3
+1156,1,120030,3
+1157,1,120040,3
+1158,1,120050,3
+1159,2,120021,3
+1160,2,120031,3
+1161,2,120041,3
+1162,2,120051,3
+1163,3,120240,3
+1164,3,120250,3
+1165,3,120260,3
+1166,3,120270,3
+1167,3,120300,3
+1168,3,120310,3
+1169,3,120320,3
+1170,3,120330,3
+1171,3,120340,3
+1172,3,120350,3
+1173,3,120360,3
+1174,3,120370,3
+1175,3,120380,3
+1176,3,120390,3
+1177,3,120400,3
+1178,3,120410,3
+1179,3,120420,3
+1180,3,120430,3
+1181,3,120450,3
+1182,3,120460,3
+1183,4,140000,3
+1185,2,104000030,1
+1186,2,104000040,1
+1187,2,108000020,1
+1188,3,104000060,1
+1189,3,104000070,1
+1190,3,104000080,1
+1191,3,102000050,1
+1192,4,104000100,1
+1193,4,104000110,1
+1194,4,107000090,1
+1195,1,111000000,2
+1196,2,111000001,2
+1197,3,111000002,2
+1198,4,111000003,2
+1199,5,111000004,2
+1200,1,120000000,2
+1201,2,120000001,2
+1202,3,120000002,2
+1203,4,120000003,2
+1204,5,120000004,2
+1205,3,170002,3
+1206,4,170003,3
+1208,2,104000030,1
+1209,2,104000040,1
+1210,2,108000020,1
+1211,3,104000060,1
+1212,3,104000070,1
+1213,3,104000080,1
+1214,3,102000050,1
+1215,4,104000100,1
+1216,4,104000110,1
+1217,4,107000090,1
+1218,1,111000000,2
+1219,2,111000001,2
+1220,3,111000002,2
+1221,4,111000003,2
+1222,5,111000004,2
+1223,1,120000000,2
+1224,2,120000001,2
+1225,3,120000002,2
+1226,4,120000003,2
+1227,5,120000004,2
+1228,1,110020,3
+1229,1,110030,3
+1230,1,110040,3
+1231,1,110050,3
+1232,2,110021,3
+1233,2,110031,3
+1234,2,110041,3
+1235,2,110051,3
+1236,3,110022,3
+1237,3,110032,3
+1238,3,110042,3
+1239,3,110052,3
+1240,3,110060,3
+1241,3,110070,3
+1242,3,110080,3
+1243,3,110090,3
+1244,3,110100,3
+1245,3,110110,3
+1246,3,110120,3
+1247,3,110130,3
+1248,3,110140,3
+1249,3,110150,3
+1250,3,110160,3
+1251,3,110170,3
+1252,3,110180,3
+1253,3,110190,3
+1254,3,110200,3
+1255,3,110210,3
+1256,3,110220,3
+1257,3,110230,3
+1258,3,110240,3
+1259,3,110250,3
+1260,3,110260,3
+1261,3,110270,3
+1262,4,140000,3
+1264,2,105000030,1
+1265,2,105000040,1
+1266,2,102000020,1
+1267,2,103000020,1
+1268,3,105000060,1
+1269,3,105000070,1
+1270,3,105000080,1
+1271,3,104000050,1
+1272,3,106000050,1
+1273,4,105000100,1
+1274,4,105000110,1
+1275,4,108000090,1
+1276,1,109000000,2
+1277,2,109000001,2
+1278,3,109000002,2
+1279,4,109000003,2
+1280,5,109000004,2
+1281,1,112000000,2
+1282,2,112000001,2
+1283,3,112000002,2
+1284,4,112000003,2
+1285,5,112000004,2
+1286,3,170002,3
+1287,4,170003,3
+1289,2,106000030,1
+1290,2,106000040,1
+1291,2,105000020,1
+1292,3,106000060,1
+1293,3,106000070,1
+1294,3,106000080,1
+1295,3,101000070,1
+1296,4,106000100,1
+1297,4,106000110,1
+1298,4,104000090,1
+1299,1,103000000,2
+1300,2,103000001,2
+1301,3,103000002,2
+1302,4,103000003,2
+1303,5,103000004,2
+1304,1,112000000,2
+1305,2,112000001,2
+1306,3,112000002,2
+1307,4,112000003,2
+1308,5,112000004,2
+1309,1,130020,3
+1310,1,130030,3
+1311,1,130040,3
+1312,1,130050,3
+1313,2,130021,3
+1314,2,130031,3
+1315,2,130041,3
+1316,2,130051,3
+1317,3,130022,3
+1318,3,130032,3
+1319,3,130042,3
+1320,3,130052,3
+1321,3,130060,3
+1322,3,130070,3
+1323,3,130080,3
+1324,3,130090,3
+1325,3,130100,3
+1326,3,130110,3
+1327,3,130120,3
+1328,3,130130,3
+1329,3,130140,3
+1330,3,130150,3
+1331,3,130160,3
+1332,3,130170,3
+1333,3,130180,3
+1334,3,130190,3
+1335,3,130200,3
+1336,3,130420,3
+1337,3,130510,3
+1338,3,130520,3
+1339,3,130530,3
+1340,3,130540,3
+1341,4,140000,3
+1343,2,108000030,1
+1344,2,108000040,1
+1345,2,106000020,1
+1346,3,108000060,1
+1347,3,108000070,1
+1348,3,108000080,1
+1349,3,107000050,1
+1350,4,108000100,1
+1351,4,105000090,1
+1352,1,108000000,2
+1353,2,108000001,2
+1354,3,108000002,2
+1355,4,108000003,2
+1356,5,108000004,2
+1357,1,120000000,2
+1358,2,120000001,2
+1359,3,120000002,2
+1360,4,120000003,2
+1361,5,120000004,2
+1362,1,120020,3
+1363,1,120030,3
+1364,1,120040,3
+1365,1,120050,3
+1366,2,120021,3
+1367,2,120031,3
+1368,2,120041,3
+1369,2,120051,3
+1370,3,120022,3
+1371,3,120032,3
+1372,3,120042,3
+1373,3,120052,3
+1374,3,120240,3
+1375,3,120250,3
+1376,3,120260,3
+1377,3,120270,3
+1378,3,120300,3
+1379,3,120310,3
+1380,3,120320,3
+1381,3,120330,3
+1382,3,120340,3
+1383,3,120350,3
+1384,3,120360,3
+1385,3,120370,3
+1386,3,120380,3
+1387,3,120390,3
+1388,3,120400,3
+1389,3,120410,3
+1390,3,120420,3
+1391,3,120430,3
+1392,3,120450,3
+1393,3,120460,3
+1394,4,140000,3
+1396,2,103000030,1
+1397,2,103000040,1
+1398,2,107000020,1
+1399,2,101000030,1
+1400,3,101000050,1
+1401,3,101000060,1
+1402,3,101000080,1
+1403,3,103000060,1
+1404,3,103000070,1
+1405,3,103000080,1
+1406,3,101000040,1
+1407,4,101000090,1
+1408,4,102000090,1
+1409,4,103000100,1
+1410,4,101000100,1
+1411,4,101000110,1
+1412,1,101000000,2
+1413,2,101000001,2
+1414,3,101000002,2
+1415,4,101000008,2
+1416,5,101000004,2
+1417,1,120000000,2
+1418,2,120000001,2
+1419,3,120000002,2
+1420,4,120000003,2
+1421,5,120000004,2
+1422,3,170002,3
+1423,4,170003,3
+1425,2,105000030,1
+1426,2,105000040,1
+1427,2,102000020,1
+1428,2,103000020,1
+1429,3,105000060,1
+1430,3,105000070,1
+1431,3,105000080,1
+1432,3,104000050,1
+1433,3,106000050,1
+1434,4,105000100,1
+1435,4,105000110,1
+1436,4,108000090,1
+1437,1,109000000,2
+1438,2,109000001,2
+1439,3,109000002,2
+1440,4,109000003,2
+1441,5,109000004,2
+1442,1,112000000,2
+1443,2,112000001,2
+1444,3,112000002,2
+1445,4,112000003,2
+1446,5,112000004,2
+1447,3,180002,3
+1448,4,180003,3
+1450,2,107000030,1
+1451,2,107000040,1
+1452,2,101000020,1
+1453,3,107000060,1
+1454,3,107000070,1
+1455,3,107000080,1
+1456,3,108000050,1
+1457,4,107000100,1
+1458,4,103000090,1
+1459,1,105000000,2
+1460,2,105000001,2
+1461,3,105000002,2
+1462,4,105000003,2
+1463,5,105000004,2
+1464,1,120000000,2
+1465,2,120000001,2
+1466,3,120000002,2
+1467,4,120000003,2
+1468,5,120000004,2
+1469,3,170002,3
+1470,4,170003,3
+1472,2,104000030,1
+1473,2,104000040,1
+1474,2,108000020,1
+1475,3,104000060,1
+1476,3,104000070,1
+1477,3,104000080,1
+1478,3,102000050,1
+1479,4,104000100,1
+1480,4,104000110,1
+1481,4,107000090,1
+1482,1,111000000,2
+1483,2,111000001,2
+1484,3,111000002,2
+1485,4,111000003,2
+1486,5,111000004,2
+1487,1,120000000,2
+1488,2,120000001,2
+1489,3,120000002,2
+1490,4,120000003,2
+1491,5,120000004,2
+1492,1,110020,3
+1493,1,110030,3
+1494,1,110040,3
+1495,1,110050,3
+1496,2,110021,3
+1497,2,110031,3
+1498,2,110041,3
+1499,2,110051,3
+1500,3,110022,3
+1501,3,110032,3
+1502,3,110042,3
+1503,3,110052,3
+1504,3,110060,3
+1505,3,110070,3
+1506,3,110080,3
+1507,3,110090,3
+1508,3,110100,3
+1509,3,110110,3
+1510,3,110120,3
+1511,3,110130,3
+1512,3,110140,3
+1513,3,110150,3
+1514,3,110160,3
+1515,3,110170,3
+1516,3,110180,3
+1517,3,110190,3
+1518,3,110200,3
+1519,3,110210,3
+1520,3,110220,3
+1521,3,110230,3
+1522,3,110240,3
+1523,3,110250,3
+1524,3,110260,3
+1525,3,110270,3
+1526,4,140000,3
+1528,2,108000030,1
+1529,2,108000040,1
+1530,2,106000020,1
+1531,3,108000060,1
+1532,3,108000070,1
+1533,3,108000080,1
+1534,3,107000050,1
+1535,4,108000100,1
+1536,4,105000090,1
+1537,1,108000000,2
+1538,2,108000001,2
+1539,3,108000002,2
+1540,4,108000003,2
+1541,5,108000004,2
+1542,1,120000000,2
+1543,2,120000001,2
+1544,3,120000002,2
+1545,4,120000003,2
+1546,5,120000004,2
+1547,3,170002,3
+1548,4,170003,3
+1550,2,103000030,1
+1551,2,103000040,1
+1552,2,107000020,1
+1553,2,101000030,1
+1554,3,101000050,1
+1555,3,101000060,1
+1556,3,101000080,1
+1557,3,103000060,1
+1558,3,103000070,1
+1559,3,103000080,1
+1560,3,101000040,1
+1561,4,101000090,1
+1562,4,102000090,1
+1563,4,103000100,1
+1564,4,101000100,1
+1565,4,101000110,1
+1566,1,101000000,2
+1567,2,101000001,2
+1568,3,101000002,2
+1569,4,101000008,2
+1570,5,101000004,2
+1571,1,112000000,2
+1572,2,112000001,2
+1573,3,112000002,2
+1574,4,112000003,2
+1575,5,112000004,2
+1576,1,120020,3
+1577,1,120030,3
+1578,1,120040,3
+1579,1,120050,3
+1580,2,120021,3
+1581,2,120031,3
+1582,2,120041,3
+1583,2,120051,3
+1584,3,120022,3
+1585,3,120032,3
+1586,3,120042,3
+1587,3,120052,3
+1588,4,120023,3
+1589,4,120033,3
+1590,4,120043,3
+1591,4,120053,3
+1592,3,120240,3
+1593,3,120250,3
+1594,3,120260,3
+1595,3,120270,3
+1596,3,120300,3
+1597,3,120310,3
+1598,3,120320,3
+1599,3,120330,3
+1600,3,120340,3
+1601,3,120350,3
+1602,3,120360,3
+1603,3,120370,3
+1604,3,120380,3
+1605,3,120390,3
+1606,3,120400,3
+1607,3,120410,3
+1608,3,120420,3
+1609,3,120430,3
+1610,3,120450,3
+1611,3,120460,3
+1612,4,140000,3
+1613,4,150010,3
+1614,4,150020,3
+1615,4,150030,3
+1616,4,150040,3
+1618,2,102000030,1
+1619,2,102000040,1
+1620,2,104000020,1
+1621,3,102000060,1
+1622,3,102000070,1
+1623,3,102000080,1
+1624,3,103000050,1
+1625,3,105000050,1
+1626,4,102000100,1
+1627,4,102000110,1
+1628,4,106000090,1
+1629,1,102000000,2
+1630,2,102000001,2
+1631,3,102000002,2
+1632,4,102000003,2
+1633,5,102000004,2
+1634,1,112000000,2
+1635,2,112000001,2
+1636,3,112000002,2
+1637,4,112000003,2
+1638,5,112000004,2
+1639,1,110020,3
+1640,1,110030,3
+1641,1,110040,3
+1642,1,110050,3
+1643,2,110021,3
+1644,2,110031,3
+1645,2,110041,3
+1646,2,110051,3
+1647,3,110022,3
+1648,3,110032,3
+1649,3,110042,3
+1650,3,110052,3
+1651,4,110023,3
+1652,4,110033,3
+1653,4,110043,3
+1654,4,110053,3
+1655,3,110060,3
+1656,3,110070,3
+1657,3,110080,3
+1658,3,110090,3
+1659,3,110100,3
+1660,3,110110,3
+1661,3,110120,3
+1662,3,110130,3
+1663,3,110140,3
+1664,3,110150,3
+1665,3,110160,3
+1666,3,110170,3
+1667,3,110180,3
+1668,3,110190,3
+1669,3,110200,3
+1670,3,110210,3
+1671,3,110220,3
+1672,3,110230,3
+1673,3,110240,3
+1674,3,110250,3
+1675,3,110260,3
+1676,3,110270,3
+1677,4,140000,3
+1678,4,150010,3
+1679,4,150020,3
+1680,4,150030,3
+1681,4,150040,3
+1683,2,106000030,1
+1684,2,106000040,1
+1685,2,105000020,1
+1686,3,106000060,1
+1687,3,106000070,1
+1688,3,106000080,1
+1689,3,101000070,1
+1690,4,106000100,1
+1691,4,106000110,1
+1692,4,104000090,1
+1693,1,103000000,2
+1694,2,103000001,2
+1695,3,103000002,2
+1696,4,103000003,2
+1697,5,103000004,2
+1698,1,112000000,2
+1699,2,112000001,2
+1700,3,112000002,2
+1701,4,112000003,2
+1702,5,112000004,2
+1703,1,120020,3
+1704,1,120030,3
+1705,1,120040,3
+1706,1,120050,3
+1707,2,120021,3
+1708,2,120031,3
+1709,2,120041,3
+1710,2,120051,3
+1711,3,120022,3
+1712,3,120032,3
+1713,3,120042,3
+1714,3,120052,3
+1715,4,120023,3
+1716,4,120033,3
+1717,4,120043,3
+1718,4,120053,3
+1719,3,120240,3
+1720,3,120250,3
+1721,3,120260,3
+1722,3,120270,3
+1723,3,120300,3
+1724,3,120310,3
+1725,3,120320,3
+1726,3,120330,3
+1727,3,120340,3
+1728,3,120350,3
+1729,3,120360,3
+1730,3,120370,3
+1731,3,120380,3
+1732,3,120390,3
+1733,3,120400,3
+1734,3,120410,3
+1735,3,120420,3
+1736,3,120430,3
+1737,3,120450,3
+1738,3,120460,3
+1739,4,140000,3
+1740,4,150010,3
+1741,4,150020,3
+1742,4,150030,3
+1743,4,150040,3
+1745,2,103000030,1
+1746,2,103000040,1
+1747,2,107000020,1
+1748,2,101000030,1
+1749,3,101000050,1
+1750,3,101000060,1
+1751,3,101000080,1
+1752,3,103000060,1
+1753,3,103000070,1
+1754,3,103000080,1
+1755,3,101000040,1
+1756,4,101000090,1
+1757,4,102000090,1
+1758,4,103000100,1
+1759,4,101000100,1
+1760,4,101000110,1
+1761,1,101000000,2
+1762,2,101000001,2
+1763,3,101000002,2
+1764,4,101000008,2
+1765,5,101000004,2
+1766,1,120000000,2
+1767,2,120000001,2
+1768,3,120000002,2
+1769,4,120000003,2
+1770,5,120000004,2
+1771,3,170003,3
+1772,4,170004,3
+1774,2,107000030,1
+1775,2,107000040,1
+1776,2,101000020,1
+1777,3,107000060,1
+1778,3,107000070,1
+1779,3,107000080,1
+1780,3,108000050,1
+1781,4,107000100,1
+1782,4,103000090,1
+1783,1,105000000,2
+1784,2,105000001,2
+1785,3,105000002,2
+1786,4,105000003,2
+1787,5,105000004,2
+1788,1,120000000,2
+1789,2,120000001,2
+1790,3,120000002,2
+1791,4,120000003,2
+1792,5,120000004,2
+1793,1,130020,3
+1794,1,130030,3
+1795,1,130040,3
+1796,1,130050,3
+1797,2,130021,3
+1798,2,130031,3
+1799,2,130041,3
+1800,2,130051,3
+1801,3,130022,3
+1802,3,130032,3
+1803,3,130042,3
+1804,3,130052,3
+1805,4,130023,3
+1806,4,130033,3
+1807,4,130043,3
+1808,4,130053,3
+1809,3,130060,3
+1810,3,130070,3
+1811,3,130080,3
+1812,3,130090,3
+1813,3,130100,3
+1814,3,130110,3
+1815,3,130120,3
+1816,3,130130,3
+1817,3,130140,3
+1818,3,130150,3
+1819,3,130160,3
+1820,3,130170,3
+1821,3,130180,3
+1822,3,130190,3
+1823,3,130200,3
+1824,3,130420,3
+1825,3,130510,3
+1826,3,130520,3
+1827,3,130530,3
+1828,3,130540,3
+1829,4,140000,3
+1830,4,150010,3
+1831,4,150020,3
+1832,4,150030,3
+1833,4,150040,3
+1835,2,102000030,1
+1836,2,102000040,1
+1837,2,104000020,1
+1838,3,102000060,1
+1839,3,102000070,1
+1840,3,102000080,1
+1841,3,103000050,1
+1842,3,105000050,1
+1843,4,102000100,1
+1844,4,102000110,1
+1845,4,106000090,1
+1846,1,102000000,2
+1847,2,102000001,2
+1848,3,102000002,2
+1849,4,102000003,2
+1850,5,102000004,2
+1851,1,112000000,2
+1852,2,112000001,2
+1853,3,112000002,2
+1854,4,112000003,2
+1855,5,112000004,2
+1856,1,120020,3
+1857,1,120030,3
+1858,1,120040,3
+1859,1,120050,3
+1860,2,120021,3
+1861,2,120031,3
+1862,2,120041,3
+1863,2,120051,3
+1864,3,120022,3
+1865,3,120032,3
+1866,3,120042,3
+1867,3,120052,3
+1868,4,120023,3
+1869,4,120033,3
+1870,4,120043,3
+1871,4,120053,3
+1872,3,120240,3
+1873,3,120250,3
+1874,3,120260,3
+1875,3,120270,3
+1876,3,120300,3
+1877,3,120310,3
+1878,3,120320,3
+1879,3,120330,3
+1880,3,120340,3
+1881,3,120350,3
+1882,3,120360,3
+1883,3,120370,3
+1884,3,120380,3
+1885,3,120390,3
+1886,3,120400,3
+1887,3,120410,3
+1888,3,120420,3
+1889,3,120430,3
+1890,3,120450,3
+1891,3,120460,3
+1892,4,140000,3
+1893,4,150010,3
+1894,4,150020,3
+1895,4,150030,3
+1896,4,150040,3
+1898,2,108000030,1
+1899,2,108000040,1
+1900,2,106000020,1
+1901,3,108000060,1
+1902,3,108000070,1
+1903,3,108000080,1
+1904,3,107000050,1
+1905,4,108000100,1
+1906,4,105000090,1
+1907,1,108000000,2
+1908,2,108000001,2
+1909,3,108000002,2
+1910,4,108000003,2
+1911,5,108000004,2
+1912,1,120000000,2
+1913,2,120000001,2
+1914,3,120000002,2
+1915,4,120000003,2
+1916,5,120000004,2
+1917,3,170003,3
+1918,4,170004,3
+1920,2,103000030,1
+1921,2,103000040,1
+1922,2,107000020,1
+1923,2,101000030,1
+1924,3,101000050,1
+1925,3,101000060,1
+1926,3,101000080,1
+1927,3,103000060,1
+1928,3,103000070,1
+1929,3,103000080,1
+1930,3,101000040,1
+1931,4,101000090,1
+1932,4,102000090,1
+1933,4,103000100,1
+1934,4,101000100,1
+1935,4,101000110,1
+1936,1,101000000,2
+1937,2,101000001,2
+1938,3,101000002,2
+1939,4,101000008,2
+1940,5,101000004,2
+1941,1,112000000,2
+1942,2,112000001,2
+1943,3,112000002,2
+1944,4,112000003,2
+1945,5,112000004,2
+1946,3,170003,3
+1947,4,170004,3
+1949,2,105000030,1
+1950,2,105000040,1
+1951,2,102000020,1
+1952,2,103000020,1
+1953,3,105000060,1
+1954,3,105000070,1
+1955,3,105000080,1
+1956,3,104000050,1
+1957,3,106000050,1
+1958,4,105000100,1
+1959,4,105000110,1
+1960,4,108000090,1
+1961,1,109000000,2
+1962,2,109000001,2
+1963,3,109000002,2
+1964,4,109000003,2
+1965,5,109000004,2
+1966,1,112000000,2
+1967,2,112000001,2
+1968,3,112000002,2
+1969,4,112000003,2
+1970,5,112000004,2
+1971,3,180003,3
+1972,4,180004,3
+1974,2,104000030,1
+1975,2,104000040,1
+1976,2,108000020,1
+1977,3,104000060,1
+1978,3,104000070,1
+1979,3,104000080,1
+1980,3,102000050,1
+1981,4,104000100,1
+1982,4,104000110,1
+1983,4,107000090,1
+1984,1,111000000,2
+1985,2,111000001,2
+1986,3,111000002,2
+1987,4,111000003,2
+1988,5,111000004,2
+1989,1,120000000,2
+1990,2,120000001,2
+1991,3,120000002,2
+1992,4,120000003,2
+1993,5,120000004,2
+1994,1,110020,3
+1995,1,110030,3
+1996,1,110040,3
+1997,1,110050,3
+1998,2,110021,3
+1999,2,110031,3
+2000,2,110041,3
+2001,2,110051,3
+2002,3,110022,3
+2003,3,110032,3
+2004,3,110042,3
+2005,3,110052,3
+2006,4,110023,3
+2007,4,110033,3
+2008,4,110043,3
+2009,4,110053,3
+2010,3,110060,3
+2011,3,110070,3
+2012,3,110080,3
+2013,3,110090,3
+2014,3,110100,3
+2015,3,110110,3
+2016,3,110120,3
+2017,3,110130,3
+2018,3,110140,3
+2019,3,110150,3
+2020,3,110160,3
+2021,3,110170,3
+2022,3,110180,3
+2023,3,110190,3
+2024,3,110200,3
+2025,3,110210,3
+2026,3,110220,3
+2027,3,110230,3
+2028,3,110240,3
+2029,3,110250,3
+2030,3,110260,3
+2031,3,110270,3
+2032,4,140000,3
+2033,4,150010,3
+2034,4,150020,3
+2035,4,150030,3
+2036,4,150040,3
+2038,3,105000060,1
+2039,3,105000070,1
+2040,3,105000080,1
+2041,3,104000050,1
+2042,3,106000050,1
+2043,4,105000100,1
+2044,4,105000110,1
+2045,4,108000090,1
+2046,5,105000120,1
+2047,1,109000000,2
+2048,2,109000001,2
+2049,3,109000002,2
+2050,4,109000003,2
+2051,5,109000004,2
+2052,1,112000000,2
+2053,2,112000001,2
+2054,3,112000002,2
+2055,4,112000003,2
+2056,5,112000004,2
+2057,3,170004,3
+2059,3,101000050,1
+2060,3,101000060,1
+2061,3,101000080,1
+2062,3,103000060,1
+2063,3,103000070,1
+2064,3,103000080,1
+2065,3,101000040,1
+2066,4,101000090,1
+2067,4,102000090,1
+2068,4,103000100,1
+2069,4,101000100,1
+2070,4,101000110,1
+2071,5,101000120,1
+2072,5,103000120,1
+2073,1,101000000,2
+2074,2,101000001,2
+2075,3,101000002,2
+2076,4,101000008,2
+2077,5,101000004,2
+2078,1,120000000,2
+2079,2,120000001,2
+2080,3,120000002,2
+2081,4,120000003,2
+2082,5,120000004,2
+2083,3,170004,3
+2085,3,107000060,1
+2086,3,107000070,1
+2087,3,107000080,1
+2088,3,108000050,1
+2089,4,107000100,1
+2090,4,103000090,1
+2091,5,107000110,1
+2092,1,105000000,2
+2093,2,105000001,2
+2094,3,105000002,2
+2095,4,105000003,2
+2096,5,105000004,2
+2097,1,120000000,2
+2098,2,120000001,2
+2099,3,120000002,2
+2100,4,120000003,2
+2101,5,120000004,2
+2102,3,170004,3
+2104,3,101000050,1
+2105,3,101000060,1
+2106,3,101000080,1
+2107,3,103000060,1
+2108,3,103000070,1
+2109,3,103000080,1
+2110,3,101000040,1
+2111,4,101000090,1
+2112,4,102000090,1
+2113,4,103000100,1
+2114,4,101000100,1
+2115,4,101000110,1
+2116,5,101000120,1
+2117,5,103000120,1
+2118,1,101000000,2
+2119,2,101000001,2
+2120,3,101000002,2
+2121,4,101000008,2
+2122,5,101000004,2
+2123,1,112000000,2
+2124,2,112000001,2
+2125,3,112000002,2
+2126,4,112000003,2
+2127,5,112000004,2
+2128,1,130020,3
+2129,1,130030,3
+2130,1,130040,3
+2131,1,130050,3
+2132,2,130021,3
+2133,2,130031,3
+2134,2,130041,3
+2135,2,130051,3
+2136,3,130022,3
+2137,3,130032,3
+2138,3,130042,3
+2139,3,130052,3
+2140,4,130023,3
+2141,4,130033,3
+2142,4,130043,3
+2143,4,130053,3
+2144,5,130024,3
+2145,5,130034,3
+2146,5,130044,3
+2147,5,130054,3
+2148,3,130060,3
+2149,3,130070,3
+2150,3,130080,3
+2151,3,130090,3
+2152,3,130100,3
+2153,3,130110,3
+2154,3,130120,3
+2155,3,130130,3
+2156,3,130140,3
+2157,3,130150,3
+2158,3,130160,3
+2159,3,130170,3
+2160,3,130180,3
+2161,3,130190,3
+2162,3,130200,3
+2163,3,130420,3
+2164,3,130510,3
+2165,3,130520,3
+2166,3,130530,3
+2167,3,130540,3
+2168,4,140000,3
+2169,4,150010,3
+2170,4,150020,3
+2171,4,150030,3
+2172,4,150040,3
+2174,3,102000060,1
+2175,3,102000070,1
+2176,3,102000080,1
+2177,3,103000050,1
+2178,3,105000050,1
+2179,4,102000100,1
+2180,4,102000110,1
+2181,4,106000090,1
+2182,5,102000120,1
+2183,1,102000000,2
+2184,2,102000001,2
+2185,3,102000002,2
+2186,4,102000003,2
+2187,5,102000004,2
+2188,1,112000000,2
+2189,2,112000001,2
+2190,3,112000002,2
+2191,4,112000003,2
+2192,5,112000004,2
+2193,3,170004,3
+2195,3,101000050,1
+2196,3,101000060,1
+2197,3,101000080,1
+2198,3,103000060,1
+2199,3,103000070,1
+2200,3,103000080,1
+2201,3,101000040,1
+2202,4,101000090,1
+2203,4,102000090,1
+2204,4,103000100,1
+2205,4,101000100,1
+2206,4,101000110,1
+2207,5,101000120,1
+2208,5,103000120,1
+2209,1,101000000,2
+2210,2,101000001,2
+2211,3,101000002,2
+2212,4,101000008,2
+2213,5,101000004,2
+2214,1,120000000,2
+2215,2,120000001,2
+2216,3,120000002,2
+2217,4,120000003,2
+2218,5,120000004,2
+2219,3,170004,3
+2221,3,106000060,1
+2222,3,106000070,1
+2223,3,106000080,1
+2224,3,101000070,1
+2225,4,106000100,1
+2226,4,106000110,1
+2227,4,104000090,1
+2228,5,106000120,1
+2229,1,103000000,2
+2230,2,103000001,2
+2231,3,103000002,2
+2232,4,103000003,2
+2233,5,103000004,2
+2234,1,112000000,2
+2235,2,112000001,2
+2236,3,112000002,2
+2237,4,112000003,2
+2238,5,112000004,2
+2239,1,130020,3
+2240,1,130030,3
+2241,1,130040,3
+2242,1,130050,3
+2243,2,130021,3
+2244,2,130031,3
+2245,2,130041,3
+2246,2,130051,3
+2247,3,130022,3
+2248,3,130032,3
+2249,3,130042,3
+2250,3,130052,3
+2251,4,130023,3
+2252,4,130033,3
+2253,4,130043,3
+2254,4,130053,3
+2255,5,130024,3
+2256,5,130034,3
+2257,5,130044,3
+2258,5,130054,3
+2259,3,130060,3
+2260,3,130070,3
+2261,3,130080,3
+2262,3,130090,3
+2263,3,130100,3
+2264,3,130110,3
+2265,3,130120,3
+2266,3,130130,3
+2267,3,130140,3
+2268,3,130150,3
+2269,3,130160,3
+2270,3,130170,3
+2271,3,130180,3
+2272,3,130190,3
+2273,3,130200,3
+2274,3,130420,3
+2275,3,130510,3
+2276,3,130520,3
+2277,3,130530,3
+2278,3,130540,3
+2279,4,140000,3
+2280,4,150010,3
+2281,4,150020,3
+2282,4,150030,3
+2283,4,150040,3
+2285,3,108000060,1
+2286,3,108000070,1
+2287,3,108000080,1
+2288,3,107000050,1
+2289,4,108000100,1
+2290,4,105000090,1
+2291,5,108000110,1
+2292,1,108000000,2
+2293,2,108000001,2
+2294,3,108000002,2
+2295,4,108000003,2
+2296,5,108000004,2
+2297,1,120000000,2
+2298,2,120000001,2
+2299,3,120000002,2
+2300,4,120000003,2
+2301,5,120000004,2
+2302,1,120020,3
+2303,1,120030,3
+2304,1,120040,3
+2305,1,120050,3
+2306,2,120021,3
+2307,2,120031,3
+2308,2,120041,3
+2309,2,120051,3
+2310,3,120022,3
+2311,3,120032,3
+2312,3,120042,3
+2313,3,120052,3
+2314,4,120023,3
+2315,4,120033,3
+2316,4,120043,3
+2317,4,120053,3
+2318,5,120024,3
+2319,5,120034,3
+2320,5,120044,3
+2321,5,120054,3
+2322,3,120240,3
+2323,3,120250,3
+2324,3,120260,3
+2325,3,120270,3
+2326,3,120300,3
+2327,3,120310,3
+2328,3,120320,3
+2329,3,120330,3
+2330,3,120340,3
+2331,3,120350,3
+2332,3,120360,3
+2333,3,120370,3
+2334,3,120380,3
+2335,3,120390,3
+2336,3,120400,3
+2337,3,120410,3
+2338,3,120420,3
+2339,3,120430,3
+2340,3,120450,3
+2341,3,120460,3
+2342,4,140000,3
+2343,4,150010,3
+2344,4,150020,3
+2345,4,150030,3
+2346,4,150040,3
+2348,3,104000060,1
+2349,3,104000070,1
+2350,3,104000080,1
+2351,3,102000050,1
+2352,4,104000100,1
+2353,4,104000110,1
+2354,4,107000090,1
+2355,5,104000120,1
+2356,1,111000000,2
+2357,2,111000001,2
+2358,3,111000002,2
+2359,4,111000003,2
+2360,5,111000004,2
+2361,1,120000000,2
+2362,2,120000001,2
+2363,3,120000002,2
+2364,4,120000003,2
+2365,5,120000004,2
+2366,1,110020,3
+2367,1,110030,3
+2368,1,110040,3
+2369,1,110050,3
+2370,2,110021,3
+2371,2,110031,3
+2372,2,110041,3
+2373,2,110051,3
+2374,3,110022,3
+2375,3,110032,3
+2376,3,110042,3
+2377,3,110052,3
+2378,4,110023,3
+2379,4,110033,3
+2380,4,110043,3
+2381,4,110053,3
+2382,5,110024,3
+2383,5,110034,3
+2384,5,110044,3
+2385,5,110054,3
+2386,3,110060,3
+2387,3,110070,3
+2388,3,110080,3
+2389,3,110090,3
+2390,3,110100,3
+2391,3,110110,3
+2392,3,110120,3
+2393,3,110130,3
+2394,3,110140,3
+2395,3,110150,3
+2396,3,110160,3
+2397,3,110170,3
+2398,3,110180,3
+2399,3,110190,3
+2400,3,110200,3
+2401,3,110210,3
+2402,3,110220,3
+2403,3,110230,3
+2404,3,110240,3
+2405,3,110250,3
+2406,3,110260,3
+2407,3,110270,3
+2408,4,140000,3
+2409,4,150010,3
+2410,4,150020,3
+2411,4,150030,3
+2412,4,150040,3
+2414,3,105000060,1
+2415,3,105000070,1
+2416,3,105000080,1
+2417,3,104000050,1
+2418,3,106000050,1
+2419,4,105000100,1
+2420,4,105000110,1
+2421,4,108000090,1
+2422,5,105000120,1
+2423,1,109000000,2
+2424,2,109000001,2
+2425,3,109000002,2
+2426,4,109000003,2
+2427,5,109000004,2
+2428,1,112000000,2
+2429,2,112000001,2
+2430,3,112000002,2
+2431,4,112000003,2
+2432,5,112000004,2
+2433,3,170004,3
+2435,3,104000060,1
+2436,3,104000070,1
+2437,3,104000080,1
+2438,3,102000050,1
+2439,4,104000100,1
+2440,4,104000110,1
+2441,4,107000090,1
+2442,5,104000120,1
+2443,1,111000000,2
+2444,2,111000001,2
+2445,3,111000002,2
+2446,4,111000003,2
+2447,5,111000004,2
+2448,1,120000000,2
+2449,2,120000001,2
+2450,3,120000002,2
+2451,4,120000003,2
+2452,5,120000004,2
+2453,1,130020,3
+2454,1,130030,3
+2455,1,130040,3
+2456,1,130050,3
+2457,2,130021,3
+2458,2,130031,3
+2459,2,130041,3
+2460,2,130051,3
+2461,3,130022,3
+2462,3,130032,3
+2463,3,130042,3
+2464,3,130052,3
+2465,4,130023,3
+2466,4,130033,3
+2467,4,130043,3
+2468,4,130053,3
+2469,5,130024,3
+2470,5,130034,3
+2471,5,130044,3
+2472,5,130054,3
+2473,3,130060,3
+2474,3,130070,3
+2475,3,130080,3
+2476,3,130090,3
+2477,3,130100,3
+2478,3,130110,3
+2479,3,130120,3
+2480,3,130130,3
+2481,3,130140,3
+2482,3,130150,3
+2483,3,130160,3
+2484,3,130170,3
+2485,3,130180,3
+2486,3,130190,3
+2487,3,130200,3
+2488,3,130420,3
+2489,3,130510,3
+2490,3,130520,3
+2491,3,130530,3
+2492,3,130540,3
+2493,4,140000,3
+2494,4,150010,3
+2495,4,150020,3
+2496,4,150030,3
+2497,4,150040,3
+2500,1,101000000,2
+2501,2,101000001,2
+2502,3,101000002,2
+2503,4,101000008,2
+2504,5,101000004,2
+2505,1,102000000,2
+2506,2,102000001,2
+2507,3,102000002,2
+2508,4,102000003,2
+2509,5,102000004,2
+2510,1,103000000,2
+2511,2,103000001,2
+2512,3,103000002,2
+2513,4,103000003,2
+2514,5,103000004,2
+2515,1,105000000,2
+2516,2,105000001,2
+2517,3,105000002,2
+2518,4,105000003,2
+2519,5,105000004,2
+2520,1,108000000,2
+2521,2,108000001,2
+2522,3,108000002,2
+2523,4,108000003,2
+2524,5,108000004,2
+2525,1,109000000,2
+2526,2,109000001,2
+2527,3,109000002,2
+2528,4,109000003,2
+2529,5,109000004,2
+2530,1,111000000,2
+2531,2,111000001,2
+2532,3,111000002,2
+2533,4,111000003,2
+2534,5,111000004,2
+2535,1,112000000,2
+2536,2,112000001,2
+2537,3,112000002,2
+2538,4,112000003,2
+2539,5,112000004,2
+2540,1,120000000,2
+2541,2,120000001,2
+2542,3,120000002,2
+2543,4,120000003,2
+2544,5,120000004,2
+2545,1,101000010,1
+2546,2,101000020,1
+2547,2,101000030,1
+2548,3,101000040,1
+2549,3,101000050,1
+2550,3,101000060,1
+2551,3,101000070,1
+2552,3,101000080,1
+2553,1,102000010,1
+2554,2,102000020,1
+2555,2,102000030,1
+2556,2,102000040,1
+2557,3,102000050,1
+2558,3,102000060,1
+2559,3,102000070,1
+2560,3,102000080,1
+2561,1,103000010,1
+2562,2,103000020,1
+2563,2,103000030,1
+2564,2,103000040,1
+2565,3,103000050,1
+2566,3,103000060,1
+2567,3,103000070,1
+2568,3,103000080,1
+2569,1,104000010,1
+2570,2,104000020,1
+2571,2,104000030,1
+2572,2,104000040,1
+2573,3,104000050,1
+2574,3,104000060,1
+2575,3,104000070,1
+2576,3,104000080,1
+2577,1,105000010,1
+2578,2,105000020,1
+2579,2,105000030,1
+2580,2,105000040,1
+2581,3,105000050,1
+2582,3,105000060,1
+2583,3,105000070,1
+2584,3,105000080,1
+2585,1,106000010,1
+2586,2,106000020,1
+2587,2,106000030,1
+2588,2,106000040,1
+2589,3,106000050,1
+2590,3,106000060,1
+2591,3,106000070,1
+2592,3,106000080,1
+2593,1,107000010,1
+2594,2,107000020,1
+2595,2,107000030,1
+2596,2,107000040,1
+2597,3,107000050,1
+2598,3,107000060,1
+2599,3,107000070,1
+2600,3,107000080,1
+2601,1,108000010,1
+2602,2,108000020,1
+2603,2,108000030,1
+2604,2,108000040,1
+2605,3,108000050,1
+2606,3,108000060,1
+2607,3,108000070,1
+2608,3,108000080,1
+2609,2,180001,3
+2611,1,101000000,2
+2612,2,101000001,2
+2613,3,101000002,2
+2614,4,101000008,2
+2615,5,101000004,2
+2616,1,102000000,2
+2617,2,102000001,2
+2618,3,102000002,2
+2619,4,102000003,2
+2620,5,102000004,2
+2621,1,103000000,2
+2622,2,103000001,2
+2623,3,103000002,2
+2624,4,103000003,2
+2625,5,103000004,2
+2626,1,105000000,2
+2627,2,105000001,2
+2628,3,105000002,2
+2629,4,105000003,2
+2630,5,105000004,2
+2631,1,108000000,2
+2632,2,108000001,2
+2633,3,108000002,2
+2634,4,108000003,2
+2635,5,108000004,2
+2636,1,109000000,2
+2637,2,109000001,2
+2638,3,109000002,2
+2639,4,109000003,2
+2640,5,109000004,2
+2641,1,111000000,2
+2642,2,111000001,2
+2643,3,111000002,2
+2644,4,111000003,2
+2645,5,111000004,2
+2646,1,112000000,2
+2647,2,112000001,2
+2648,3,112000002,2
+2649,4,112000003,2
+2650,5,112000004,2
+2651,1,120000000,2
+2652,2,120000001,2
+2653,3,120000002,2
+2654,4,120000003,2
+2655,5,120000004,2
+2656,1,101000010,1
+2657,2,101000020,1
+2658,2,101000030,1
+2659,3,101000040,1
+2660,3,101000050,1
+2661,3,101000060,1
+2662,3,101000070,1
+2663,3,101000080,1
+2664,1,102000010,1
+2665,2,102000020,1
+2666,2,102000030,1
+2667,2,102000040,1
+2668,3,102000050,1
+2669,3,102000060,1
+2670,3,102000070,1
+2671,3,102000080,1
+2672,1,103000010,1
+2673,2,103000020,1
+2674,2,103000030,1
+2675,2,103000040,1
+2676,3,103000050,1
+2677,3,103000060,1
+2678,3,103000070,1
+2679,3,103000080,1
+2680,1,104000010,1
+2681,2,104000020,1
+2682,2,104000030,1
+2683,2,104000040,1
+2684,3,104000050,1
+2685,3,104000060,1
+2686,3,104000070,1
+2687,3,104000080,1
+2688,1,105000010,1
+2689,2,105000020,1
+2690,2,105000030,1
+2691,2,105000040,1
+2692,3,105000050,1
+2693,3,105000060,1
+2694,3,105000070,1
+2695,3,105000080,1
+2696,1,106000010,1
+2697,2,106000020,1
+2698,2,106000030,1
+2699,2,106000040,1
+2700,3,106000050,1
+2701,3,106000060,1
+2702,3,106000070,1
+2703,3,106000080,1
+2704,1,107000010,1
+2705,2,107000020,1
+2706,2,107000030,1
+2707,2,107000040,1
+2708,3,107000050,1
+2709,3,107000060,1
+2710,3,107000070,1
+2711,3,107000080,1
+2712,1,108000010,1
+2713,2,108000020,1
+2714,2,108000030,1
+2715,2,108000040,1
+2716,3,108000050,1
+2717,3,108000060,1
+2718,3,108000070,1
+2719,3,108000080,1
+2720,1,109000010,1
+2721,2,109000020,1
+2722,2,109000030,1
+2723,2,109000040,1
+2724,3,109000050,1
+2725,3,109000060,1
+2726,3,109000070,1
+2727,3,109000080,1
+2728,2,180001,3
+2731,1,101000000,2
+2732,2,101000001,2
+2733,3,101000002,2
+2734,4,101000008,2
+2735,5,101000004,2
+2736,1,102000000,2
+2737,2,102000001,2
+2738,3,102000002,2
+2739,4,102000003,2
+2740,5,102000004,2
+2741,1,103000000,2
+2742,2,103000001,2
+2743,3,103000002,2
+2744,4,103000003,2
+2745,5,103000004,2
+2746,1,105000000,2
+2747,2,105000001,2
+2748,3,105000002,2
+2749,4,105000003,2
+2750,5,105000004,2
+2751,1,107000000,2
+2752,2,107000001,2
+2753,3,107000002,2
+2754,4,107000003,2
+2755,5,107000004,2
+2756,1,108000000,2
+2757,2,108000001,2
+2758,3,108000002,2
+2759,4,108000003,2
+2760,5,108000004,2
+2761,1,109000000,2
+2762,2,109000001,2
+2763,3,109000002,2
+2764,4,109000003,2
+2765,5,109000004,2
+2766,1,111000000,2
+2767,2,111000001,2
+2768,3,111000002,2
+2769,4,111000003,2
+2770,5,111000004,2
+2771,1,112000000,2
+2772,2,112000001,2
+2773,3,112000002,2
+2774,4,112000003,2
+2775,5,112000004,2
+2776,1,120000000,2
+2777,2,120000001,2
+2778,3,120000002,2
+2779,4,120000003,2
+2780,5,120000004,2
+2781,1,101000010,1
+2782,2,101000020,1
+2783,2,101000030,1
+2784,3,101000040,1
+2785,3,101000050,1
+2786,3,101000060,1
+2787,3,101000070,1
+2788,3,101000080,1
+2789,1,102000010,1
+2790,2,102000020,1
+2791,2,102000030,1
+2792,2,102000040,1
+2793,3,102000050,1
+2794,3,102000060,1
+2795,3,102000070,1
+2796,3,102000080,1
+2797,1,103000010,1
+2798,2,103000020,1
+2799,2,103000030,1
+2800,2,103000040,1
+2801,3,103000050,1
+2802,3,103000060,1
+2803,3,103000070,1
+2804,3,103000080,1
+2805,1,104000010,1
+2806,2,104000020,1
+2807,2,104000030,1
+2808,2,104000040,1
+2809,3,104000050,1
+2810,3,104000060,1
+2811,3,104000070,1
+2812,3,104000080,1
+2813,1,105000010,1
+2814,2,105000020,1
+2815,2,105000030,1
+2816,2,105000040,1
+2817,3,105000050,1
+2818,3,105000060,1
+2819,3,105000070,1
+2820,3,105000080,1
+2821,1,106000010,1
+2822,2,106000020,1
+2823,2,106000030,1
+2824,2,106000040,1
+2825,3,106000050,1
+2826,3,106000060,1
+2827,3,106000070,1
+2828,3,106000080,1
+2829,1,107000010,1
+2830,2,107000020,1
+2831,2,107000030,1
+2832,2,107000040,1
+2833,3,107000050,1
+2834,3,107000060,1
+2835,3,107000070,1
+2836,3,107000080,1
+2837,1,108000010,1
+2838,2,108000020,1
+2839,2,108000030,1
+2840,2,108000040,1
+2841,3,108000050,1
+2842,3,108000060,1
+2843,3,108000070,1
+2844,3,108000080,1
+2845,1,109000010,1
+2846,2,109000020,1
+2847,2,109000030,1
+2848,2,109000040,1
+2849,3,109000050,1
+2850,3,109000060,1
+2851,3,109000070,1
+2852,3,109000080,1
+2853,1,110000010,1
+2854,2,110000020,1
+2855,2,110000030,1
+2856,2,110000040,1
+2857,3,110000050,1
+2858,3,110000060,1
+2859,3,110000070,1
+2860,3,110000080,1
+2861,2,180001,3
+2863,1,107000000,2
+2864,2,107000001,2
+2865,3,107000002,2
+2866,4,107000003,2
+2867,5,107000004,2
+2868,1,120000000,2
+2869,2,120000001,2
+2870,3,120000002,2
+2871,4,120000003,2
+2872,5,120000004,2
+2874,3,110000070,1
+2875,3,110000080,1
+2876,4,110000100,1
+2877,5,110000110,1
+2878,1,107000000,2
+2879,2,107000001,2
+2880,3,107000002,2
+2881,4,107000003,2
+2882,5,107000004,2
+2883,1,120000000,2
+2884,2,120000001,2
+2885,3,120000002,2
+2886,4,120000003,2
+2887,5,120000004,2
+2888,3,120023,3
+2889,3,120033,3
+2890,3,120043,3
+2891,3,120053,3
+2892,4,120024,3
+2893,4,120034,3
+2894,4,120044,3
+2895,4,120054,3
+2896,3,120240,3
+2897,3,120250,3
+2898,3,120260,3
+2899,3,120270,3
+2900,3,120300,3
+2901,3,120310,3
+2902,3,120320,3
+2903,3,120330,3
+2904,3,120340,3
+2905,3,120350,3
+2906,3,120360,3
+2907,3,120370,3
+2908,3,120380,3
+2909,3,120390,3
+2910,3,120400,3
+2911,3,120410,3
+2912,3,120420,3
+2913,3,120430,3
+2914,3,120450,3
+2915,3,120460,3
+2916,3,120550,3
+2917,3,120560,3
+2918,3,120570,3
+2919,3,120990,3
+2920,3,121000,3
+2921,3,121010,3
+2922,3,121020,3
+2923,4,140000,3
+2924,4,150010,3
+2925,4,150020,3
+2926,4,150030,3
+2927,4,150040,3
+2929,3,108000060,1
+2930,3,108000070,1
+2931,3,108000080,1
+2932,3,107000050,1
+2933,4,108000100,1
+2934,4,105000090,1
+2935,5,108000110,1
+2936,1,108000000,2
+2937,2,108000001,2
+2938,3,108000002,2
+2939,4,108000003,2
+2940,5,108000004,2
+2941,1,120000000,2
+2942,2,120000001,2
+2943,3,120000002,2
+2944,4,120000003,2
+2945,5,120000004,2
+2946,3,170004,3
+2948,3,102000060,1
+2949,3,102000070,1
+2950,3,102000080,1
+2951,3,103000050,1
+2952,3,105000050,1
+2953,4,102000100,1
+2954,4,102000110,1
+2955,4,106000090,1
+2956,4,109000090,1
+2957,5,102000120,1
+2958,1,102000000,2
+2959,2,102000001,2
+2960,3,102000002,2
+2961,4,102000003,2
+2962,5,102000004,2
+2963,1,112000000,2
+2964,2,112000001,2
+2965,3,112000002,2
+2966,4,112000003,2
+2967,5,112000004,2
+2968,3,170004,3
+2970,3,101000050,1
+2971,3,101000060,1
+2972,3,101000080,1
+2973,3,103000060,1
+2974,3,103000070,1
+2975,3,103000080,1
+2976,3,101000040,1
+2977,3,109000060,1
+2978,3,109000070,1
+2979,3,109000080,1
+2980,3,110000050,1
+2981,4,101000090,1
+2982,4,102000090,1
+2983,4,103000100,1
+2984,4,101000100,1
+2985,4,101000110,1
+2986,4,109000100,1
+2987,5,101000120,1
+2988,5,103000120,1
+2989,5,109000110,1
+2990,1,101000000,2
+2991,2,101000001,2
+2992,3,101000002,2
+2993,4,101000008,2
+2994,5,101000004,2
+2995,1,112000000,2
+2996,2,112000001,2
+2997,3,112000002,2
+2998,4,112000003,2
+2999,5,112000004,2
+3000,3,120023,3
+3001,3,120033,3
+3002,3,120043,3
+3003,3,120053,3
+3004,4,120024,3
+3005,4,120034,3
+3006,4,120044,3
+3007,4,120054,3
+3008,3,120240,3
+3009,3,120250,3
+3010,3,120260,3
+3011,3,120270,3
+3012,3,120300,3
+3013,3,120310,3
+3014,3,120320,3
+3015,3,120330,3
+3016,3,120340,3
+3017,3,120350,3
+3018,3,120360,3
+3019,3,120370,3
+3020,3,120380,3
+3021,3,120390,3
+3022,3,120400,3
+3023,3,120410,3
+3024,3,120420,3
+3025,3,120430,3
+3026,3,120450,3
+3027,3,120460,3
+3028,3,120550,3
+3029,3,120560,3
+3030,3,120570,3
+3031,3,120990,3
+3032,3,121000,3
+3033,3,121010,3
+3034,3,121020,3
+3035,4,140000,3
+3036,4,150010,3
+3037,4,150020,3
+3038,4,150030,3
+3039,4,150040,3
+3041,3,105000060,1
+3042,3,105000070,1
+3043,3,105000080,1
+3044,3,104000050,1
+3045,3,106000050,1
+3046,4,105000100,1
+3047,4,105000110,1
+3048,4,108000090,1
+3049,4,110000090,1
+3050,5,105000120,1
+3051,1,109000000,2
+3052,2,109000001,2
+3053,3,109000002,2
+3054,4,109000003,2
+3055,5,109000004,2
+3056,1,112000000,2
+3057,2,112000001,2
+3058,3,112000002,2
+3059,4,112000003,2
+3060,5,112000004,2
+3061,3,170004,3
+3063,3,107000060,1
+3064,3,107000070,1
+3065,3,107000080,1
+3066,3,108000050,1
+3067,3,109000050,1
+3068,4,107000100,1
+3069,4,103000090,1
+3070,5,107000110,1
+3071,1,105000000,2
+3072,2,105000001,2
+3073,3,105000002,2
+3074,4,105000003,2
+3075,5,105000004,2
+3076,1,120000000,2
+3077,2,120000001,2
+3078,3,120000002,2
+3079,4,120000003,2
+3080,5,120000004,2
+3081,3,130023,3
+3082,3,130033,3
+3083,3,130043,3
+3084,3,130053,3
+3085,4,130024,3
+3086,4,130034,3
+3087,4,130044,3
+3088,4,130054,3
+3089,3,130060,3
+3090,3,130070,3
+3091,3,130080,3
+3092,3,130090,3
+3093,3,130100,3
+3094,3,130110,3
+3095,3,130120,3
+3096,3,130130,3
+3097,3,130140,3
+3098,3,130150,3
+3099,3,130160,3
+3100,3,130170,3
+3101,3,130180,3
+3102,3,130190,3
+3103,3,130200,3
+3104,3,130420,3
+3105,3,130510,3
+3106,3,130520,3
+3107,3,130530,3
+3108,3,130540,3
+3109,3,130660,3
+3110,4,140000,3
+3111,4,150010,3
+3112,4,150020,3
+3113,4,150030,3
+3114,4,150040,3
+3116,3,106000060,1
+3117,3,106000070,1
+3118,3,106000080,1
+3119,3,101000070,1
+3120,3,110000060,1
+3121,4,106000100,1
+3122,4,106000110,1
+3123,4,104000090,1
+3124,5,106000120,1
+3125,1,103000000,2
+3126,2,103000001,2
+3127,3,103000002,2
+3128,4,103000003,2
+3129,5,103000004,2
+3130,1,112000000,2
+3131,2,112000001,2
+3132,3,112000002,2
+3133,4,112000003,2
+3134,5,112000004,2
+3135,3,170004,3
+3137,3,104000060,1
+3138,3,104000070,1
+3139,3,104000080,1
+3140,3,102000050,1
+3141,4,104000100,1
+3142,4,104000110,1
+3143,4,107000090,1
+3144,5,104000120,1
+3145,1,111000000,2
+3146,2,111000001,2
+3147,3,111000002,2
+3148,4,111000003,2
+3149,5,111000004,2
+3150,1,120000000,2
+3151,2,120000001,2
+3152,3,120000002,2
+3153,4,120000003,2
+3154,5,120000004,2
+3155,3,110023,3
+3156,3,110033,3
+3157,3,110043,3
+3158,3,110053,3
+3159,4,110024,3
+3160,4,110034,3
+3161,4,110044,3
+3162,4,110054,3
+3163,3,110060,3
+3164,3,110070,3
+3165,3,110080,3
+3166,3,110090,3
+3167,3,110100,3
+3168,3,110110,3
+3169,3,110120,3
+3170,3,110130,3
+3171,3,110140,3
+3172,3,110150,3
+3173,3,110160,3
+3174,3,110170,3
+3175,3,110180,3
+3176,3,110190,3
+3177,3,110200,3
+3178,3,110210,3
+3179,3,110220,3
+3180,3,110230,3
+3181,3,110240,3
+3182,3,110250,3
+3183,3,110260,3
+3184,3,110270,3
+3185,3,110620,3
+3186,3,110670,3
+3187,4,140000,3
+3188,4,150010,3
+3189,4,150020,3
+3190,4,150030,3
+3191,4,150040,3
+3193,3,101000050,1
+3194,3,101000060,1
+3195,3,101000080,1
+3196,3,103000060,1
+3197,3,103000070,1
+3198,3,103000080,1
+3199,3,101000040,1
+3200,3,109000060,1
+3201,3,109000070,1
+3202,3,109000080,1
+3203,3,110000050,1
+3204,4,101000090,1
+3205,4,102000090,1
+3206,4,103000100,1
+3207,4,101000100,1
+3208,4,101000110,1
+3209,4,109000100,1
+3210,5,101000120,1
+3211,5,103000120,1
+3212,5,109000110,1
+3213,1,101000000,2
+3214,2,101000001,2
+3215,3,101000002,2
+3216,4,101000008,2
+3217,5,101000004,2
+3218,1,120000000,2
+3219,2,120000001,2
+3220,3,120000002,2
+3221,4,120000003,2
+3222,5,120000004,2
+3223,3,170004,3
+3225,3,110000070,1
+3226,3,110000080,1
+3227,4,110000100,1
+3228,5,110000110,1
+3229,1,107000000,2
+3230,2,107000001,2
+3231,3,107000002,2
+3232,4,107000003,2
+3233,5,107000004,2
+3234,1,120000000,2
+3235,2,120000001,2
+3236,3,120000002,2
+3237,4,120000003,2
+3238,5,120000004,2
+3239,3,180004,3
+3241,3,105000060,1
+3242,3,105000070,1
+3243,3,105000080,1
+3244,3,104000050,1
+3245,3,106000050,1
+3246,4,105000100,1
+3247,4,105000110,1
+3248,4,108000090,1
+3249,4,110000090,1
+3250,5,105000120,1
+3251,1,109000000,2
+3252,2,109000001,2
+3253,3,109000002,2
+3254,4,109000003,2
+3255,5,109000004,2
+3256,1,112000000,2
+3257,2,112000001,2
+3258,3,112000002,2
+3259,4,112000003,2
+3260,5,112000004,2
+3261,3,170004,3
+3263,3,108000060,1
+3264,3,108000070,1
+3265,3,108000080,1
+3266,3,107000050,1
+3267,4,108000100,1
+3268,4,105000090,1
+3269,5,108000110,1
+3270,1,108000000,2
+3271,2,108000001,2
+3272,3,108000002,2
+3273,4,108000003,2
+3274,5,108000004,2
+3275,1,120000000,2
+3276,2,120000001,2
+3277,3,120000002,2
+3278,4,120000003,2
+3279,5,120000004,2
+3280,4,120024,3
+3281,4,120034,3
+3282,4,120044,3
+3283,4,120054,3
+3284,3,120240,3
+3285,3,120250,3
+3286,3,120260,3
+3287,3,120270,3
+3288,3,120300,3
+3289,3,120310,3
+3290,3,120320,3
+3291,3,120330,3
+3292,3,120340,3
+3293,3,120350,3
+3294,3,120360,3
+3295,3,120370,3
+3296,3,120380,3
+3297,3,120390,3
+3298,3,120400,3
+3299,3,120410,3
+3300,3,120420,3
+3301,3,120430,3
+3302,3,120450,3
+3303,3,120460,3
+3304,3,120550,3
+3305,3,120560,3
+3306,3,120570,3
+3307,3,120990,3
+3308,3,121000,3
+3309,3,121010,3
+3310,3,121020,3
+3311,4,140000,3
+3312,4,150010,3
+3313,4,150020,3
+3314,4,150030,3
+3315,4,150040,3
+3317,3,104000060,1
+3318,3,104000070,1
+3319,3,104000080,1
+3320,3,102000050,1
+3321,4,104000100,1
+3322,4,104000110,1
+3323,4,107000090,1
+3324,5,104000120,1
+3325,1,111000000,2
+3326,2,111000001,2
+3327,3,111000002,2
+3328,4,111000003,2
+3329,5,111000004,2
+3330,1,120000000,2
+3331,2,120000001,2
+3332,3,120000002,2
+3333,4,120000003,2
+3334,5,120000004,2
+3335,4,110024,3
+3336,4,110034,3
+3337,4,110044,3
+3338,4,110054,3
+3339,3,110060,3
+3340,3,110070,3
+3341,3,110080,3
+3342,3,110090,3
+3343,3,110100,3
+3344,3,110110,3
+3345,3,110120,3
+3346,3,110130,3
+3347,3,110140,3
+3348,3,110150,3
+3349,3,110160,3
+3350,3,110170,3
+3351,3,110180,3
+3352,3,110190,3
+3353,3,110200,3
+3354,3,110210,3
+3355,3,110220,3
+3356,3,110230,3
+3357,3,110240,3
+3358,3,110250,3
+3359,3,110260,3
+3360,3,110270,3
+3361,3,110620,3
+3362,3,110670,3
+3363,4,140000,3
+3364,4,150010,3
+3365,4,150020,3
+3366,4,150030,3
+3367,4,150040,3
+3369,3,101000050,1
+3370,3,101000060,1
+3371,3,101000080,1
+3372,3,103000060,1
+3373,3,103000070,1
+3374,3,103000080,1
+3375,3,101000040,1
+3376,3,109000060,1
+3377,3,109000070,1
+3378,3,109000080,1
+3379,3,110000050,1
+3380,4,101000090,1
+3381,4,102000090,1
+3382,4,103000100,1
+3383,4,101000100,1
+3384,4,101000110,1
+3385,4,109000100,1
+3386,5,101000120,1
+3387,5,103000120,1
+3388,5,109000110,1
+3389,1,101000000,2
+3390,2,101000001,2
+3391,3,101000002,2
+3392,4,101000008,2
+3393,5,101000004,2
+3394,1,112000000,2
+3395,2,112000001,2
+3396,3,112000002,2
+3397,4,112000003,2
+3398,5,112000004,2
+3399,3,170004,3
+3401,3,107000060,1
+3402,3,107000070,1
+3403,3,107000080,1
+3404,3,108000050,1
+3405,3,109000050,1
+3406,4,107000100,1
+3407,4,103000090,1
+3408,5,107000110,1
+3409,1,105000000,2
+3410,2,105000001,2
+3411,3,105000002,2
+3412,4,105000003,2
+3413,5,105000004,2
+3414,1,120000000,2
+3415,2,120000001,2
+3416,3,120000002,2
+3417,4,120000003,2
+3418,5,120000004,2
+3419,4,120024,3
+3420,4,120034,3
+3421,4,120044,3
+3422,4,120054,3
+3423,3,120240,3
+3424,3,120250,3
+3425,3,120260,3
+3426,3,120270,3
+3427,3,120300,3
+3428,3,120310,3
+3429,3,120320,3
+3430,3,120330,3
+3431,3,120340,3
+3432,3,120350,3
+3433,3,120360,3
+3434,3,120370,3
+3435,3,120380,3
+3436,3,120390,3
+3437,3,120400,3
+3438,3,120410,3
+3439,3,120420,3
+3440,3,120430,3
+3441,3,120450,3
+3442,3,120460,3
+3443,3,120550,3
+3444,3,120560,3
+3445,3,120570,3
+3446,3,120990,3
+3447,3,121000,3
+3448,3,121010,3
+3449,3,121020,3
+3450,4,140000,3
+3451,4,150010,3
+3452,4,150020,3
+3453,4,150030,3
+3454,4,150040,3
+3456,3,108000060,1
+3457,3,108000070,1
+3458,3,108000080,1
+3459,3,107000050,1
+3460,4,108000100,1
+3461,4,105000090,1
+3462,5,108000110,1
+3463,1,108000000,2
+3464,2,108000001,2
+3465,3,108000002,2
+3466,4,108000003,2
+3467,5,108000004,2
+3468,1,120000000,2
+3469,2,120000001,2
+3470,3,120000002,2
+3471,4,120000003,2
+3472,5,120000004,2
+3473,3,170004,3
+3475,3,102000060,1
+3476,3,102000070,1
+3477,3,102000080,1
+3478,3,103000050,1
+3479,3,105000050,1
+3480,4,102000100,1
+3481,4,102000110,1
+3482,4,106000090,1
+3483,4,109000090,1
+3484,5,102000120,1
+3485,1,102000000,2
+3486,2,102000001,2
+3487,3,102000002,2
+3488,4,102000003,2
+3489,5,102000004,2
+3490,1,112000000,2
+3491,2,112000001,2
+3492,3,112000002,2
+3493,4,112000003,2
+3494,5,112000004,2
+3495,3,180004,3
+3497,3,106000060,1
+3498,3,106000070,1
+3499,3,106000080,1
+3500,3,101000070,1
+3501,3,110000060,1
+3502,4,106000100,1
+3503,4,106000110,1
+3504,4,104000090,1
+3505,5,106000120,1
+3506,1,103000000,2
+3507,2,103000001,2
+3508,3,103000002,2
+3509,4,103000003,2
+3510,5,103000004,2
+3511,1,112000000,2
+3512,2,112000001,2
+3513,3,112000002,2
+3514,4,112000003,2
+3515,5,112000004,2
+3516,4,130024,3
+3517,4,130034,3
+3518,4,130044,3
+3519,4,130054,3
+3520,3,130060,3
+3521,3,130070,3
+3522,3,130080,3
+3523,3,130090,3
+3524,3,130100,3
+3525,3,130110,3
+3526,3,130120,3
+3527,3,130130,3
+3528,3,130140,3
+3529,3,130150,3
+3530,3,130160,3
+3531,3,130170,3
+3532,3,130180,3
+3533,3,130190,3
+3534,3,130200,3
+3535,3,130420,3
+3536,3,130510,3
+3537,3,130520,3
+3538,3,130530,3
+3539,3,130540,3
+3540,3,130660,3
+3541,4,140000,3
+3542,4,150010,3
+3543,4,150020,3
+3544,4,150030,3
+3545,4,150040,3
+3547,3,110000070,1
+3548,3,110000080,1
+3549,4,110000100,1
+3550,5,110000110,1
+3551,1,107000000,2
+3552,2,107000001,2
+3553,3,107000002,2
+3554,4,107000003,2
+3555,5,107000004,2
+3556,1,120000000,2
+3557,2,120000001,2
+3558,3,120000002,2
+3559,4,120000003,2
+3560,5,120000004,2
+3561,3,170004,3
+3563,3,105000060,1
+3564,3,105000070,1
+3565,3,105000080,1
+3566,3,104000050,1
+3567,3,106000050,1
+3568,4,105000100,1
+3569,4,105000110,1
+3570,4,108000090,1
+3571,4,110000090,1
+3572,5,105000120,1
+3573,1,109000000,2
+3574,2,109000001,2
+3575,3,109000002,2
+3576,4,109000003,2
+3577,5,109000004,2
+3578,1,112000000,2
+3579,2,112000001,2
+3580,3,112000002,2
+3581,4,112000003,2
+3582,5,112000004,2
+3583,4,120024,3
+3584,4,120034,3
+3585,4,120044,3
+3586,4,120054,3
+3587,3,120240,3
+3588,3,120250,3
+3589,3,120260,3
+3590,3,120270,3
+3591,3,120300,3
+3592,3,120310,3
+3593,3,120320,3
+3594,3,120330,3
+3595,3,120340,3
+3596,3,120350,3
+3597,3,120360,3
+3598,3,120370,3
+3599,3,120380,3
+3600,3,120390,3
+3601,3,120400,3
+3602,3,120410,3
+3603,3,120420,3
+3604,3,120430,3
+3605,3,120450,3
+3606,3,120460,3
+3607,3,120550,3
+3608,3,120560,3
+3609,3,120570,3
+3610,3,120990,3
+3611,3,121000,3
+3612,3,121010,3
+3613,3,121020,3
+3614,4,140000,3
+3615,4,150010,3
+3616,4,150020,3
+3617,4,150030,3
+3618,4,150040,3
+3620,1,170000,3
+3621,2,170001,3
+3622,3,170002,3
+3623,4,170003,3
+3624,5,170004,3
+3625,1,180000,3
+3626,2,180001,3
+3627,3,180002,3
+3628,4,180003,3
+3629,5,180004,3
+3630,4,140000,3
+3631,1,201000010,8
+3632,1,292000010,8
+3633,1,299000040,8
+3634,1,299000070,8
+3635,1,299000110,8
+3636,1,299000120,8
+3637,1,299000140,8
+3638,2,202000010,8
+3639,2,290000010,8
+3640,2,299000010,8
+3641,2,299000150,8
+3642,2,299000190,8
+3643,2,299000200,8
+3644,2,299000210,8
+3645,3,298000050,8
+3646,3,298000060,8
+3647,3,299000060,8
+3648,3,299000170,8
+3649,5,150010,3
+3650,5,150020,3
+3651,5,150030,3
+3652,5,150040,3
+3654,3,105000060,1
+3655,3,105000070,1
+3656,3,105000080,1
+3657,3,104000050,1
+3658,3,106000050,1
+3659,4,105000100,1
+3660,4,105000110,1
+3661,4,108000090,1
+3662,4,110000090,1
+3663,5,105000120,1
+3664,1,109000000,2
+3665,2,109000001,2
+3666,3,109000002,2
+3667,4,109000003,2
+3668,5,109000004,2
+3669,1,112000000,2
+3670,2,112000001,2
+3671,3,112000002,2
+3672,4,112000003,2
+3673,5,112000004,2
+3674,3,170004,3
+3676,3,108000060,1
+3677,3,108000070,1
+3678,3,108000080,1
+3679,3,107000050,1
+3680,4,108000100,1
+3681,4,105000090,1
+3682,5,108000110,1
+3683,1,108000000,2
+3684,2,108000001,2
+3685,3,108000002,2
+3686,4,108000003,2
+3687,5,108000004,2
+3688,1,120000000,2
+3689,2,120000001,2
+3690,3,120000002,2
+3691,4,120000003,2
+3692,5,120000004,2
+3693,3,180004,3
+3695,3,106000060,1
+3696,3,106000070,1
+3697,3,106000080,1
+3698,3,101000070,1
+3699,3,110000060,1
+3700,4,106000100,1
+3701,4,106000110,1
+3702,4,104000090,1
+3703,5,106000120,1
+3704,1,103000000,2
+3705,2,103000001,2
+3706,3,103000002,2
+3707,4,103000003,2
+3708,5,103000004,2
+3709,1,112000000,2
+3710,2,112000001,2
+3711,3,112000002,2
+3712,4,112000003,2
+3713,5,112000004,2
+3714,3,170004,3
+3716,3,104000170,1
+3717,1,115000000,2
+3718,2,115000001,2
+3719,3,115000002,2
+3720,4,115000003,2
+3721,5,115000004,2
+3722,1,120000000,2
+3723,2,120000001,2
+3724,3,120000002,2
+3725,4,120000003,2
+3726,5,120000004,2
+3727,4,120024,3
+3728,4,120034,3
+3729,4,120044,3
+3730,4,120054,3
+3731,3,120241,3
+3732,3,120251,3
+3733,3,120261,3
+3734,3,120271,3
+3735,3,120300,3
+3736,3,120310,3
+3737,3,120320,3
+3738,3,120330,3
+3739,3,120340,3
+3740,3,120350,3
+3741,3,120360,3
+3742,3,120370,3
+3743,3,120380,3
+3744,3,120390,3
+3745,3,120400,3
+3746,3,120410,3
+3747,3,120420,3
+3748,3,120430,3
+3749,3,120450,3
+3750,3,120460,3
+3751,3,120550,3
+3752,3,120560,3
+3753,3,120570,3
+3754,3,120990,3
+3755,3,121000,3
+3756,3,121010,3
+3757,3,121020,3
+3758,4,140000,3
+3759,4,150010,3
+3760,4,150020,3
+3761,4,150030,3
+3762,4,150040,3
+3764,3,102000060,1
+3765,3,102000070,1
+3766,3,102000080,1
+3767,3,103000050,1
+3768,3,105000050,1
+3769,4,102000100,1
+3770,4,102000110,1
+3771,4,106000090,1
+3772,4,109000090,1
+3773,5,102000120,1
+3774,1,102000000,2
+3775,2,102000001,2
+3776,3,102000002,2
+3777,4,102000003,2
+3778,5,102000004,2
+3779,1,112000000,2
+3780,2,112000001,2
+3781,3,112000002,2
+3782,4,112000003,2
+3783,5,112000004,2
+3784,4,110024,3
+3785,4,110034,3
+3786,4,110044,3
+3787,4,110054,3
+3788,3,110060,3
+3789,3,110070,3
+3790,3,110080,3
+3791,3,110090,3
+3792,3,110100,3
+3793,3,110110,3
+3794,3,110120,3
+3795,3,110130,3
+3796,3,110140,3
+3797,3,110150,3
+3798,3,110160,3
+3799,3,110170,3
+3800,3,110180,3
+3801,3,110190,3
+3802,3,110200,3
+3803,3,110210,3
+3804,3,110220,3
+3805,3,110230,3
+3806,3,110240,3
+3807,3,110250,3
+3808,3,110260,3
+3809,3,110270,3
+3810,3,110620,3
+3811,3,110670,3
+3812,4,140000,3
+3813,4,150010,3
+3814,4,150020,3
+3815,4,150030,3
+3816,4,150040,3
+3818,3,104000060,1
+3819,3,104000070,1
+3820,3,104000080,1
+3821,3,102000050,1
+3822,4,104000100,1
+3823,4,104000110,1
+3824,4,107000090,1
+3825,5,104000120,1
+3826,1,111000000,2
+3827,2,111000001,2
+3828,3,111000002,2
+3829,4,111000003,2
+3830,5,111000004,2
+3831,1,120000000,2
+3832,2,120000001,2
+3833,3,120000002,2
+3834,4,120000003,2
+3835,5,120000004,2
+3836,4,110024,3
+3837,4,110034,3
+3838,4,110044,3
+3839,4,110054,3
+3840,3,110060,3
+3841,3,110070,3
+3842,3,110080,3
+3843,3,110090,3
+3844,3,110100,3
+3845,3,110110,3
+3846,3,110120,3
+3847,3,110130,3
+3848,3,110140,3
+3849,3,110150,3
+3850,3,110160,3
+3851,3,110170,3
+3852,3,110180,3
+3853,3,110190,3
+3854,3,110200,3
+3855,3,110210,3
+3856,3,110220,3
+3857,3,110230,3
+3858,3,110240,3
+3859,3,110250,3
+3860,3,110260,3
+3861,3,110270,3
+3862,3,110620,3
+3863,3,110670,3
+3864,4,140000,3
+3865,4,150010,3
+3866,4,150020,3
+3867,4,150030,3
+3868,4,150040,3
+3870,3,110000070,1
+3871,3,110000080,1
+3872,4,110000100,1
+3873,5,110000110,1
+3874,1,107000000,2
+3875,2,107000001,2
+3876,3,107000002,2
+3877,4,107000003,2
+3878,5,107000004,2
+3879,1,120000000,2
+3880,2,120000001,2
+3881,3,120000002,2
+3882,4,120000003,2
+3883,5,120000004,2
+3884,4,130024,3
+3885,4,130034,3
+3886,4,130044,3
+3887,4,130054,3
+3888,3,130060,3
+3889,3,130070,3
+3890,3,130080,3
+3891,3,130090,3
+3892,3,130100,3
+3893,3,130110,3
+3894,3,130120,3
+3895,3,130130,3
+3896,3,130140,3
+3897,3,130150,3
+3898,3,130160,3
+3899,3,130170,3
+3900,3,130180,3
+3901,3,130190,3
+3902,3,130200,3
+3903,3,130420,3
+3904,3,130510,3
+3905,3,130520,3
+3906,3,130530,3
+3907,3,130540,3
+3908,3,130660,3
+3909,4,140000,3
+3910,4,150010,3
+3911,4,150020,3
+3912,4,150030,3
+3913,4,150040,3
+3915,3,101000050,1
+3916,3,101000060,1
+3917,3,101000080,1
+3918,3,103000060,1
+3919,3,103000070,1
+3920,3,103000080,1
+3921,3,101000040,1
+3922,3,109000060,1
+3923,3,109000070,1
+3924,3,109000080,1
+3925,3,110000050,1
+3926,4,101000090,1
+3927,4,102000090,1
+3928,4,103000100,1
+3929,4,101000100,1
+3930,4,101000110,1
+3931,4,109000100,1
+3932,5,101000120,1
+3933,5,101000160,1
+3934,5,103000120,1
+3935,5,109000110,1
+3936,1,101000000,2
+3937,2,101000001,2
+3938,3,101000002,2
+3939,4,101000008,2
+3940,5,101000004,2
+3941,1,120000000,2
+3942,2,120000001,2
+3943,3,120000002,2
+3944,4,120000003,2
+3945,5,120000004,2
+3946,3,170004,3
+3948,3,107000060,1
+3949,3,107000070,1
+3950,3,107000080,1
+3951,3,108000050,1
+3952,3,109000050,1
+3953,4,107000100,1
+3954,4,103000090,1
+3955,5,107000110,1
+3956,1,105000000,2
+3957,2,105000001,2
+3958,3,105000002,2
+3959,4,105000003,2
+3960,5,105000004,2
+3961,1,120000000,2
+3962,2,120000001,2
+3963,3,120000002,2
+3964,4,120000003,2
+3965,5,120000004,2
+3966,3,170004,3
+3968,3,104000170,1
+3969,1,115000000,2
+3970,2,115000001,2
+3971,3,115000002,2
+3972,4,115000003,2
+3973,5,115000004,2
+3974,1,120000000,2
+3975,2,120000001,2
+3976,3,120000002,2
+3977,4,120000003,2
+3978,5,120000004,2
+3979,4,120024,3
+3980,4,120034,3
+3981,4,120044,3
+3982,4,120054,3
+3983,3,120241,3
+3984,3,120251,3
+3985,3,120261,3
+3986,3,120271,3
+3987,3,120300,3
+3988,3,120310,3
+3989,3,120320,3
+3990,3,120330,3
+3991,3,120340,3
+3992,3,120350,3
+3993,3,120360,3
+3994,3,120370,3
+3995,3,120380,3
+3996,3,120390,3
+3997,3,120400,3
+3998,3,120410,3
+3999,3,120420,3
+4000,3,120430,3
+4001,3,120450,3
+4002,3,120460,3
+4003,3,120550,3
+4004,3,120560,3
+4005,3,120570,3
+4006,3,120990,3
+4007,3,121000,3
+4008,3,121010,3
+4009,3,121020,3
+4010,4,140000,3
+4011,4,150010,3
+4012,4,150020,3
+4013,4,150030,3
+4014,4,150040,3
+4016,1,101000000,2
+4017,2,101000001,2
+4018,3,101000002,2
+4019,4,101000008,2
+4020,5,101000012,2
+4021,1,120000000,2
+4022,2,120000001,2
+4023,3,120000002,2
+4024,4,120000003,2
+4025,5,120000004,2
+4027,1,101000000,2
+4028,2,101000001,2
+4029,3,101000002,2
+4030,4,101000008,2
+4031,5,101000011,2
+4032,1,120000000,2
+4033,2,120000001,2
+4034,3,120000002,2
+4035,4,120000003,2
+4036,5,120000004,2
+4038,3,101000050,1
+4039,3,101000060,1
+4040,3,101000080,1
+4041,3,103000060,1
+4042,3,103000070,1
+4043,3,103000080,1
+4044,3,101000040,1
+4045,3,109000060,1
+4046,3,109000070,1
+4047,3,109000080,1
+4048,3,110000050,1
+4049,4,101000090,1
+4050,4,102000090,1
+4051,4,103000100,1
+4052,4,101000100,1
+4053,4,101000110,1
+4054,4,109000100,1
+4055,5,101000120,1
+4056,5,101000160,1
+4057,5,103000120,1
+4058,5,109000110,1
+4059,1,101000000,2
+4060,2,101000001,2
+4061,3,101000002,2
+4062,4,101000008,2
+4063,5,101000004,2
+4064,1,120000000,2
+4065,2,120000001,2
+4066,3,120000002,2
+4067,4,120000003,2
+4068,5,120000004,2
+4069,4,120024,3
+4070,4,120034,3
+4071,4,120044,3
+4072,4,120054,3
+4073,3,120241,3
+4074,3,120251,3
+4075,3,120261,3
+4076,3,120271,3
+4077,3,120300,3
+4078,3,120310,3
+4079,3,120320,3
+4080,3,120330,3
+4081,3,120340,3
+4082,3,120350,3
+4083,3,120360,3
+4084,3,120370,3
+4085,3,120380,3
+4086,3,120390,3
+4087,3,120400,3
+4088,3,120410,3
+4089,3,120420,3
+4090,3,120430,3
+4091,3,120450,3
+4092,3,120460,3
+4093,3,120550,3
+4094,3,120560,3
+4095,3,120570,3
+4096,3,120990,3
+4097,3,121000,3
+4098,3,121010,3
+4099,3,121020,3
+4100,4,140000,3
+4101,4,150010,3
+4102,4,150020,3
+4103,4,150030,3
+4104,4,150040,3
+4106,3,108000060,1
+4107,3,108000070,1
+4108,3,108000080,1
+4109,3,107000050,1
+4110,4,108000100,1
+4111,4,105000090,1
+4112,5,108000110,1
+4113,1,108000000,2
+4114,2,108000001,2
+4115,3,108000002,2
+4116,4,108000003,2
+4117,5,108000004,2
+4118,1,120000000,2
+4119,2,120000001,2
+4120,3,120000002,2
+4121,4,120000003,2
+4122,5,120000004,2
+4123,3,170004,3
+4125,3,102000060,1
+4126,3,102000070,1
+4127,3,102000080,1
+4128,3,103000050,1
+4129,3,105000050,1
+4130,4,102000100,1
+4131,4,102000110,1
+4132,4,106000090,1
+4133,4,109000090,1
+4134,5,102000120,1
+4135,1,102000000,2
+4136,2,102000001,2
+4137,3,102000002,2
+4138,4,102000003,2
+4139,5,102000004,2
+4140,1,112000000,2
+4141,2,112000001,2
+4142,3,112000002,2
+4143,4,112000003,2
+4144,5,112000004,2
+4145,4,110024,3
+4146,4,110034,3
+4147,4,110044,3
+4148,4,110054,3
+4149,3,110060,3
+4150,3,110070,3
+4151,3,110080,3
+4152,3,110090,3
+4153,3,110100,3
+4154,3,110110,3
+4155,3,110120,3
+4156,3,110130,3
+4157,3,110140,3
+4158,3,110150,3
+4159,3,110160,3
+4160,3,110170,3
+4161,3,110180,3
+4162,3,110190,3
+4163,3,110200,3
+4164,3,110210,3
+4165,3,110220,3
+4166,3,110230,3
+4167,3,110240,3
+4168,3,110250,3
+4169,3,110260,3
+4170,3,110270,3
+4171,3,110620,3
+4172,3,110670,3
+4173,4,140000,3
+4174,4,150010,3
+4175,4,150020,3
+4176,4,150030,3
+4177,4,150040,3
+4179,3,104000170,1
+4180,4,104000180,1
+4181,5,104000190,1
+4182,1,115000000,2
+4183,2,115000001,2
+4184,3,115000002,2
+4185,4,115000003,2
+4186,5,115000004,2
+4187,1,120000000,2
+4188,2,120000001,2
+4189,3,120000002,2
+4190,4,120000003,2
+4191,5,120000004,2
+4192,4,120024,3
+4193,4,120034,3
+4194,4,120044,3
+4195,4,120054,3
+4196,3,120241,3
+4197,3,120251,3
+4198,3,120261,3
+4199,3,120271,3
+4200,3,120300,3
+4201,3,120310,3
+4202,3,120320,3
+4203,3,120330,3
+4204,3,120340,3
+4205,3,120350,3
+4206,3,120360,3
+4207,3,120370,3
+4208,3,120380,3
+4209,3,120390,3
+4210,3,120400,3
+4211,3,120410,3
+4212,3,120420,3
+4213,3,120430,3
+4214,3,120450,3
+4215,3,120460,3
+4216,3,120550,3
+4217,3,120560,3
+4218,3,120570,3
+4219,3,120990,3
+4220,3,121000,3
+4221,3,121010,3
+4222,3,121020,3
+4223,4,140000,3
+4224,4,150010,3
+4225,4,150020,3
+4226,4,150030,3
+4227,4,150040,3
+4229,3,110000070,1
+4230,3,110000080,1
+4231,4,110000100,1
+4232,5,110000110,1
+4233,1,107000000,2
+4234,2,107000001,2
+4235,3,107000002,2
+4236,4,107000003,2
+4237,5,107000004,2
+4238,1,120000000,2
+4239,2,120000001,2
+4240,3,120000002,2
+4241,4,120000003,2
+4242,5,120000004,2
+4243,4,120024,3
+4244,4,120034,3
+4245,4,120044,3
+4246,4,120054,3
+4247,3,120241,3
+4248,3,120251,3
+4249,3,120261,3
+4250,3,120271,3
+4251,3,120300,3
+4252,3,120310,3
+4253,3,120320,3
+4254,3,120330,3
+4255,3,120340,3
+4256,3,120350,3
+4257,3,120360,3
+4258,3,120370,3
+4259,3,120380,3
+4260,3,120390,3
+4261,3,120400,3
+4262,3,120410,3
+4263,3,120420,3
+4264,3,120430,3
+4265,3,120450,3
+4266,3,120460,3
+4267,3,120550,3
+4268,3,120560,3
+4269,3,120570,3
+4270,3,120990,3
+4271,3,121000,3
+4272,3,121010,3
+4273,3,121020,3
+4274,4,140000,3
+4275,4,150010,3
+4276,4,150020,3
+4277,4,150030,3
+4278,4,150040,3
+4280,3,106000060,1
+4281,3,106000070,1
+4282,3,106000080,1
+4283,3,101000070,1
+4284,3,110000060,1
+4285,4,106000100,1
+4286,4,106000110,1
+4287,4,104000090,1
+4288,5,106000120,1
+4289,1,103000000,2
+4290,2,103000001,2
+4291,3,103000002,2
+4292,4,103000003,2
+4293,5,103000004,2
+4294,1,112000000,2
+4295,2,112000001,2
+4296,3,112000002,2
+4297,4,112000003,2
+4298,5,112000004,2
+4299,3,170004,3
+4301,3,105000060,1
+4302,3,105000070,1
+4303,3,105000080,1
+4304,3,104000050,1
+4305,3,106000050,1
+4306,4,105000100,1
+4307,4,105000110,1
+4308,4,108000090,1
+4309,4,110000090,1
+4310,5,105000120,1
+4311,1,109000000,2
+4312,2,109000001,2
+4313,3,109000002,2
+4314,4,109000003,2
+4315,5,109000004,2
+4316,1,112000000,2
+4317,2,112000001,2
+4318,3,112000002,2
+4319,4,112000003,2
+4320,5,112000004,2
+4321,4,130024,3
+4322,4,130034,3
+4323,4,130044,3
+4324,4,130054,3
+4325,3,130060,3
+4326,3,130070,3
+4327,3,130080,3
+4328,3,130090,3
+4329,3,130100,3
+4330,3,130110,3
+4331,3,130120,3
+4332,3,130130,3
+4333,3,130140,3
+4334,3,130150,3
+4335,3,130160,3
+4336,3,130170,3
+4337,3,130180,3
+4338,3,130190,3
+4339,3,130200,3
+4340,3,130420,3
+4341,3,130510,3
+4342,3,130520,3
+4343,3,130530,3
+4344,3,130540,3
+4345,3,130660,3
+4346,4,140000,3
+4347,4,150010,3
+4348,4,150020,3
+4349,4,150030,3
+4350,4,150040,3
+4352,3,101000050,1
+4353,3,101000060,1
+4354,3,101000080,1
+4355,3,103000060,1
+4356,3,103000070,1
+4357,3,103000080,1
+4358,3,101000040,1
+4359,3,109000060,1
+4360,3,109000070,1
+4361,3,109000080,1
+4362,3,110000050,1
+4363,4,101000090,1
+4364,4,102000090,1
+4365,4,103000100,1
+4366,4,101000100,1
+4367,4,101000110,1
+4368,4,109000100,1
+4369,5,101000120,1
+4370,5,103000120,1
+4371,5,109000110,1
+4372,1,101000000,2
+4373,2,101000001,2
+4374,3,101000002,2
+4375,4,101000008,2
+4376,5,101000004,2
+4377,1,112000000,2
+4378,2,112000001,2
+4379,3,112000002,2
+4380,4,112000003,2
+4381,5,112000004,2
+4382,3,180004,3
+4384,3,104000060,1
+4385,3,104000070,1
+4386,3,104000080,1
+4387,3,102000050,1
+4388,4,104000100,1
+4389,4,104000110,1
+4390,4,107000090,1
+4391,5,104000120,1
+4392,1,111000000,2
+4393,2,111000001,2
+4394,3,111000002,2
+4395,4,111000003,2
+4396,5,111000004,2
+4397,1,120000000,2
+4398,2,120000001,2
+4399,3,120000002,2
+4400,4,120000003,2
+4401,5,120000004,2
+4402,4,110024,3
+4403,4,110034,3
+4404,4,110044,3
+4405,4,110054,3
+4406,3,110060,3
+4407,3,110070,3
+4408,3,110080,3
+4409,3,110090,3
+4410,3,110100,3
+4411,3,110110,3
+4412,3,110120,3
+4413,3,110130,3
+4414,3,110140,3
+4415,3,110150,3
+4416,3,110160,3
+4417,3,110170,3
+4418,3,110180,3
+4419,3,110190,3
+4420,3,110200,3
+4421,3,110210,3
+4422,3,110220,3
+4423,3,110230,3
+4424,3,110240,3
+4425,3,110250,3
+4426,3,110260,3
+4427,3,110270,3
+4428,3,110620,3
+4429,3,110670,3
+4430,4,140000,3
+4431,4,150010,3
+4432,4,150020,3
+4433,4,150030,3
+4434,4,150040,3
+4436,3,107000060,1
+4437,3,107000070,1
+4438,3,107000080,1
+4439,3,108000050,1
+4440,3,109000050,1
+4441,4,107000100,1
+4442,4,103000090,1
+4443,5,107000110,1
+4444,1,105000000,2
+4445,2,105000001,2
+4446,3,105000002,2
+4447,4,105000003,2
+4448,5,105000004,2
+4449,1,120000000,2
+4450,2,120000001,2
+4451,3,120000002,2
+4452,4,120000003,2
+4453,5,120000004,2
+4454,4,130024,3
+4455,4,130034,3
+4456,4,130044,3
+4457,4,130054,3
+4458,3,130060,3
+4459,3,130070,3
+4460,3,130080,3
+4461,3,130090,3
+4462,3,130100,3
+4463,3,130110,3
+4464,3,130120,3
+4465,3,130130,3
+4466,3,130140,3
+4467,3,130150,3
+4468,3,130160,3
+4469,3,130170,3
+4470,3,130180,3
+4471,3,130190,3
+4472,3,130200,3
+4473,3,130420,3
+4474,3,130510,3
+4475,3,130520,3
+4476,3,130530,3
+4477,3,130540,3
+4478,3,130660,3
+4479,4,140000,3
+4480,4,150010,3
+4481,4,150020,3
+4482,4,150030,3
+4483,4,150040,3
+4485,1,109000010,1
+4486,2,109000020,1
+4487,2,109000030,1
+4488,2,109000040,1
+4489,3,109000050,1
+4490,3,109000060,1
+4491,3,109000070,1
+4492,3,109000080,1
+4493,4,109000090,1
+4494,4,109000100,1
+4495,5,109000110,1
+4496,1,170000,3
+4497,2,170001,3
+4498,3,170002,3
+4499,4,170003,3
+4500,5,170004,3
+4501,1,180000,3
+4502,2,180001,3
+4503,3,180002,3
+4504,4,180003,3
+4505,5,180004,3
+4506,1,201000010,8
+4507,1,292000010,8
+4508,1,299000040,8
+4509,1,299000070,8
+4510,1,299000110,8
+4511,1,299000120,8
+4512,1,299000140,8
+4513,2,202000010,8
+4514,2,290000010,8
+4515,2,299000010,8
+4516,2,299000150,8
+4517,2,299000190,8
+4518,2,299000200,8
+4519,2,299000210,8
+4520,3,298000050,8
+4521,3,298000060,8
+4522,3,299000060,8
+4523,3,299000170,8
+4524,4,140000,3
+4525,5,150010,3
+4526,5,150020,3
+4527,5,150030,3
+4528,5,150040,3
+4530,1,109000010,1
+4531,2,109000020,1
+4532,2,109000030,1
+4533,2,109000040,1
+4534,3,109000050,1
+4535,3,109000060,1
+4536,3,109000070,1
+4537,3,109000080,1
+4538,4,109000090,1
+4539,4,109000100,1
+4540,5,109000110,1
+4541,1,170000,3
+4542,2,170001,3
+4543,3,170002,3
+4544,4,170003,3
+4545,5,170004,3
+4546,1,180000,3
+4547,2,180001,3
+4548,3,180002,3
+4549,4,180003,3
+4550,5,180004,3
+4551,1,201000010,8
+4552,1,292000010,8
+4553,1,299000040,8
+4554,1,299000070,8
+4555,1,299000110,8
+4556,1,299000120,8
+4557,1,299000140,8
+4558,2,202000010,8
+4559,2,290000010,8
+4560,2,299000010,8
+4561,2,299000150,8
+4562,2,299000190,8
+4563,2,299000200,8
+4564,2,299000210,8
+4565,3,298000050,8
+4566,3,298000060,8
+4567,3,299000060,8
+4568,3,299000170,8
+4569,4,140000,3
+4570,5,150010,3
+4571,5,150020,3
+4572,5,150030,3
+4573,5,150040,3
+4575,3,109000050,1
+4576,3,109000060,1
+4577,3,109000070,1
+4578,3,109000080,1
+4579,4,109000090,1
+4580,4,109000100,1
+4581,5,109000110,1
+4582,1,170000,3
+4583,2,170001,3
+4584,3,170002,3
+4585,4,170003,3
+4586,5,170004,3
+4587,1,180000,3
+4588,2,180001,3
+4589,3,180002,3
+4590,4,180003,3
+4591,5,180004,3
+4592,1,201000010,8
+4593,1,292000010,8
+4594,1,299000040,8
+4595,1,299000070,8
+4596,1,299000110,8
+4597,1,299000120,8
+4598,1,299000140,8
+4599,2,202000010,8
+4600,2,290000010,8
+4601,2,299000010,8
+4602,2,299000150,8
+4603,2,299000190,8
+4604,2,299000200,8
+4605,2,299000210,8
+4606,3,298000050,8
+4607,3,298000060,8
+4608,3,299000060,8
+4609,3,299000170,8
+4610,4,140000,3
+4611,5,150010,3
+4612,5,150020,3
+4613,5,150030,3
+4614,5,150040,3
+4616,3,109000050,1
+4617,3,109000060,1
+4618,3,109000070,1
+4619,3,109000080,1
+4620,4,109000090,1
+4621,4,109000100,1
+4622,5,109000110,1
+4623,1,170000,3
+4624,2,170001,3
+4625,3,170002,3
+4626,4,170003,3
+4627,5,170004,3
+4628,1,180000,3
+4629,2,180001,3
+4630,3,180002,3
+4631,4,180003,3
+4632,5,180004,3
+4633,1,201000010,8
+4634,1,292000010,8
+4635,1,299000040,8
+4636,1,299000070,8
+4637,1,299000110,8
+4638,1,299000120,8
+4639,1,299000140,8
+4640,2,202000010,8
+4641,2,290000010,8
+4642,2,299000010,8
+4643,2,299000150,8
+4644,2,299000190,8
+4645,2,299000200,8
+4646,2,299000210,8
+4647,3,298000050,8
+4648,3,298000060,8
+4649,3,299000060,8
+4650,3,299000170,8
+4651,4,140000,3
+4652,5,150010,3
+4653,5,150020,3
+4654,5,150030,3
+4655,5,150040,3
+4657,3,109000050,1
+4658,3,109000060,1
+4659,3,109000070,1
+4660,3,109000080,1
+4661,4,109000090,1
+4662,4,109000100,1
+4663,5,109000110,1
+4664,1,170000,3
+4665,2,170001,3
+4666,3,170002,3
+4667,4,170003,3
+4668,5,170004,3
+4669,1,180000,3
+4670,2,180001,3
+4671,3,180002,3
+4672,4,180003,3
+4673,5,180004,3
+4674,1,201000010,8
+4675,1,292000010,8
+4676,1,299000040,8
+4677,1,299000070,8
+4678,1,299000110,8
+4679,1,299000120,8
+4680,1,299000140,8
+4681,2,202000010,8
+4682,2,290000010,8
+4683,2,299000010,8
+4684,2,299000150,8
+4685,2,299000190,8
+4686,2,299000200,8
+4687,2,299000210,8
+4688,3,298000050,8
+4689,3,298000060,8
+4690,3,299000060,8
+4691,3,299000170,8
+4692,4,140000,3
+4693,5,150010,3
+4694,5,150020,3
+4695,5,150030,3
+4696,5,150040,3
+4697,5,190000,3
+4698,5,200000,3
+4699,5,210000,3
+4701,3,102000060,1
+4702,3,102000070,1
+4703,3,102000080,1
+4704,3,103000050,1
+4705,3,105000050,1
+4706,4,102000100,1
+4707,4,102000110,1
+4708,4,106000090,1
+4709,4,109000090,1
+4710,5,102000120,1
+4711,1,102000000,2
+4712,2,102000001,2
+4713,3,102000002,2
+4714,4,102000003,2
+4715,5,102000004,2
+4716,1,112000000,2
+4717,2,112000001,2
+4718,3,112000002,2
+4719,4,112000003,2
+4720,5,112000004,2
+4721,3,170004,3
+4722,4,170005,3
+4724,3,110000070,1
+4725,3,110000080,1
+4726,4,110000100,1
+4727,5,110000110,1
+4728,1,107000000,2
+4729,2,107000001,2
+4730,3,107000002,2
+4731,4,107000003,2
+4732,5,107000004,2
+4733,1,120000000,2
+4734,2,120000001,2
+4735,3,120000002,2
+4736,4,120000003,2
+4737,5,120000004,2
+4738,4,120024,3
+4739,4,120034,3
+4740,4,120044,3
+4741,4,120054,3
+4742,3,120241,3
+4743,3,120251,3
+4744,3,120261,3
+4745,3,120271,3
+4746,3,120300,3
+4747,3,120310,3
+4748,3,120320,3
+4749,3,120330,3
+4750,3,120340,3
+4751,3,120350,3
+4752,3,120360,3
+4753,3,120370,3
+4754,3,120380,3
+4755,3,120390,3
+4756,3,120400,3
+4757,3,120410,3
+4758,3,120420,3
+4759,3,120430,3
+4760,3,120450,3
+4761,3,120460,3
+4762,3,120550,3
+4763,3,120560,3
+4764,3,120570,3
+4765,3,120990,3
+4766,3,121000,3
+4767,3,121010,3
+4768,3,121020,3
+4769,4,140000,3
+4770,4,150010,3
+4771,4,150020,3
+4772,4,150030,3
+4773,4,150040,3
+4775,3,105000060,1
+4776,3,105000070,1
+4777,3,105000080,1
+4778,3,104000050,1
+4779,3,106000050,1
+4780,4,105000100,1
+4781,4,105000110,1
+4782,4,108000090,1
+4783,4,110000090,1
+4784,5,105000120,1
+4785,1,109000000,2
+4786,2,109000001,2
+4787,3,109000002,2
+4788,4,109000003,2
+4789,5,109000004,2
+4790,1,112000000,2
+4791,2,112000001,2
+4792,3,112000002,2
+4793,4,112000003,2
+4794,5,112000004,2
+4795,4,130024,3
+4796,4,130034,3
+4797,4,130044,3
+4798,4,130054,3
+4799,3,130060,3
+4800,3,130070,3
+4801,3,130080,3
+4802,3,130090,3
+4803,3,130100,3
+4804,3,130110,3
+4805,3,130120,3
+4806,3,130130,3
+4807,3,130140,3
+4808,3,130150,3
+4809,3,130160,3
+4810,3,130170,3
+4811,3,130180,3
+4812,3,130190,3
+4813,3,130200,3
+4814,3,130420,3
+4815,3,130510,3
+4816,3,130520,3
+4817,3,130530,3
+4818,3,130540,3
+4819,3,130660,3
+4820,4,140000,3
+4821,4,150010,3
+4822,4,150020,3
+4823,4,150030,3
+4824,4,150040,3
+4826,3,104000060,1
+4827,3,104000070,1
+4828,3,104000080,1
+4829,3,102000050,1
+4830,4,104000100,1
+4831,4,104000110,1
+4832,4,107000090,1
+4833,5,104000120,1
+4834,1,111000000,2
+4835,2,111000001,2
+4836,3,111000002,2
+4837,4,111000003,2
+4838,5,111000004,2
+4839,1,120000000,2
+4840,2,120000001,2
+4841,3,120000002,2
+4842,4,120000003,2
+4843,5,120000004,2
+4844,4,110024,3
+4845,4,110034,3
+4846,4,110044,3
+4847,4,110054,3
+4848,3,110060,3
+4849,3,110070,3
+4850,3,110080,3
+4851,3,110090,3
+4852,3,110100,3
+4853,3,110110,3
+4854,3,110120,3
+4855,3,110130,3
+4856,3,110140,3
+4857,3,110150,3
+4858,3,110160,3
+4859,3,110170,3
+4860,3,110180,3
+4861,3,110190,3
+4862,3,110200,3
+4863,3,110210,3
+4864,3,110220,3
+4865,3,110230,3
+4866,3,110240,3
+4867,3,110250,3
+4868,3,110260,3
+4869,3,110270,3
+4870,3,110620,3
+4871,3,110670,3
+4872,4,140000,3
+4873,4,150010,3
+4874,4,150020,3
+4875,4,150030,3
+4876,4,150040,3
+4878,3,107000060,1
+4879,3,107000070,1
+4880,3,107000080,1
+4881,3,108000050,1
+4882,3,109000050,1
+4883,4,107000100,1
+4884,4,103000090,1
+4885,5,107000110,1
+4886,1,105000000,2
+4887,2,105000001,2
+4888,3,105000002,2
+4889,4,105000003,2
+4890,5,105000004,2
+4891,1,120000000,2
+4892,2,120000001,2
+4893,3,120000002,2
+4894,4,120000003,2
+4895,5,120000004,2
+4896,3,180004,3
+4897,4,180005,3
+4899,3,106000060,1
+4900,3,106000070,1
+4901,3,106000080,1
+4902,3,101000070,1
+4903,3,110000060,1
+4904,4,106000100,1
+4905,4,106000110,1
+4906,4,104000090,1
+4907,5,106000120,1
+4908,1,103000000,2
+4909,2,103000001,2
+4910,3,103000002,2
+4911,4,103000003,2
+4912,5,103000004,2
+4913,1,112000000,2
+4914,2,112000001,2
+4915,3,112000002,2
+4916,4,112000003,2
+4917,5,112000004,2
+4918,3,170004,3
+4919,4,170005,3
+4921,3,112000020,1
+4922,3,112000030,1
+4923,4,112000040,1
+4924,5,112000060,1
+4925,1,101000000,2
+4926,2,101000001,2
+4927,3,101000002,2
+4928,4,101000008,2
+4929,5,101000004,2
+4930,1,112000000,2
+4931,2,112000001,2
+4932,3,112000002,2
+4933,4,112000003,2
+4934,5,112000004,2
+4935,3,170004,3
+4936,4,170005,3
+4938,3,104000170,1
+4939,4,104000180,1
+4940,5,104000190,1
+4941,1,115000000,2
+4942,2,115000001,2
+4943,3,115000002,2
+4944,4,115000003,2
+4945,5,115000004,2
+4946,1,120000000,2
+4947,2,120000001,2
+4948,3,120000002,2
+4949,4,120000003,2
+4950,5,120000004,2
+4951,4,120024,3
+4952,4,120034,3
+4953,4,120044,3
+4954,4,120054,3
+4955,3,120241,3
+4956,3,120251,3
+4957,3,120261,3
+4958,3,120271,3
+4959,3,120300,3
+4960,3,120310,3
+4961,3,120320,3
+4962,3,120330,3
+4963,3,120340,3
+4964,3,120350,3
+4965,3,120360,3
+4966,3,120370,3
+4967,3,120380,3
+4968,3,120390,3
+4969,3,120400,3
+4970,3,120410,3
+4971,3,120420,3
+4972,3,120430,3
+4973,3,120450,3
+4974,3,120460,3
+4975,3,120550,3
+4976,3,120560,3
+4977,3,120570,3
+4978,3,120990,3
+4979,3,121000,3
+4980,3,121010,3
+4981,3,121020,3
+4982,4,140000,3
+4983,4,150010,3
+4984,4,150020,3
+4985,4,150030,3
+4986,4,150040,3
+4988,3,111000010,1
+4989,3,111000020,1
+4990,3,111000030,1
+4991,4,111000040,1
+4992,5,111000060,1
+4993,1,101000000,2
+4994,2,101000001,2
+4995,3,101000002,2
+4996,4,101000008,2
+4997,5,101000004,2
+4998,1,120000000,2
+4999,2,120000001,2
+5000,3,120000002,2
+5001,4,120000003,2
+5002,5,120000004,2
+5003,4,110024,3
+5004,4,110034,3
+5005,4,110044,3
+5006,4,110054,3
+5007,3,110060,3
+5008,3,110070,3
+5009,3,110080,3
+5010,3,110090,3
+5011,3,110100,3
+5012,3,110110,3
+5013,3,110120,3
+5014,3,110130,3
+5015,3,110140,3
+5016,3,110150,3
+5017,3,110160,3
+5018,3,110170,3
+5019,3,110180,3
+5020,3,110190,3
+5021,3,110200,3
+5022,3,110210,3
+5023,3,110220,3
+5024,3,110230,3
+5025,3,110240,3
+5026,3,110250,3
+5027,3,110260,3
+5028,3,110270,3
+5029,3,110620,3
+5030,3,110670,3
+5031,4,140000,3
+5032,4,150010,3
+5033,4,150020,3
+5034,4,150030,3
+5035,4,150040,3
+5037,3,108000060,1
+5038,3,108000070,1
+5039,3,108000080,1
+5040,3,107000050,1
+5041,3,112000010,1
+5042,4,108000100,1
+5043,4,105000090,1
+5044,5,108000110,1
+5045,1,108000000,2
+5046,2,108000001,2
+5047,3,108000002,2
+5048,4,108000003,2
+5049,5,108000004,2
+5050,1,120000000,2
+5051,2,120000001,2
+5052,3,120000002,2
+5053,4,120000003,2
+5054,5,120000004,2
+5055,4,130024,3
+5056,4,130034,3
+5057,4,130044,3
+5058,4,130054,3
+5059,3,130060,3
+5060,3,130070,3
+5061,3,130080,3
+5062,3,130090,3
+5063,3,130100,3
+5064,3,130110,3
+5065,3,130120,3
+5066,3,130130,3
+5067,3,130140,3
+5068,3,130150,3
+5069,3,130160,3
+5070,3,130170,3
+5071,3,130180,3
+5072,3,130190,3
+5073,3,130200,3
+5074,3,130420,3
+5075,3,130510,3
+5076,3,130520,3
+5077,3,130530,3
+5078,3,130540,3
+5079,3,130660,3
+5080,4,140000,3
+5081,4,150010,3
+5082,4,150020,3
+5083,4,150030,3
+5084,4,150040,3
+5086,3,111000010,1
+5087,3,111000020,1
+5088,3,111000030,1
+5089,4,111000040,1
+5090,5,111000060,1
+5091,1,170002,3
+5092,2,170003,3
+5093,3,170004,3
+5094,1,180002,3
+5095,2,180003,3
+5096,3,180004,3
+5097,1,201000010,8
+5098,1,292000010,8
+5099,1,299000040,8
+5100,1,299000070,8
+5101,1,299000110,8
+5102,1,299000120,8
+5103,1,299000140,8
+5104,2,202000010,8
+5105,2,290000010,8
+5106,2,299000010,8
+5107,2,299000150,8
+5108,2,299000190,8
+5109,2,299000200,8
+5110,2,299000210,8
+5111,3,298000050,8
+5112,3,298000060,8
+5113,3,299000060,8
+5114,3,299000170,8
+5115,4,140000,3
+5116,5,150010,3
+5117,5,150020,3
+5118,5,150030,3
+5119,5,150040,3
+5121,3,111000010,1
+5122,3,111000020,1
+5123,3,111000030,1
+5124,4,111000040,1
+5125,5,111000060,1
+5126,2,170003,3
+5127,3,170004,3
+5128,2,180003,3
+5129,3,180004,3
+5130,1,201000010,8
+5131,1,292000010,8
+5132,1,299000040,8
+5133,1,299000070,8
+5134,1,299000110,8
+5135,1,299000120,8
+5136,1,299000140,8
+5137,2,202000010,8
+5138,2,290000010,8
+5139,2,299000010,8
+5140,2,299000150,8
+5141,2,299000190,8
+5142,2,299000200,8
+5143,2,299000210,8
+5144,3,298000050,8
+5145,3,298000060,8
+5146,3,299000060,8
+5147,3,299000170,8
+5148,4,140000,3
+5149,5,150010,3
+5150,5,150020,3
+5151,5,150030,3
+5152,5,150040,3
+5154,3,111000010,1
+5155,3,111000020,1
+5156,3,111000030,1
+5157,4,111000040,1
+5158,5,111000060,1
+5159,3,170004,3
+5160,3,180004,3
+5161,1,201000010,8
+5162,1,292000010,8
+5163,1,299000040,8
+5164,1,299000070,8
+5165,1,299000110,8
+5166,1,299000120,8
+5167,1,299000140,8
+5168,2,202000010,8
+5169,2,290000010,8
+5170,2,299000010,8
+5171,2,299000150,8
+5172,2,299000190,8
+5173,2,299000200,8
+5174,2,299000210,8
+5175,3,298000050,8
+5176,3,298000060,8
+5177,3,299000060,8
+5178,3,299000170,8
+5179,4,140000,3
+5180,5,150010,3
+5181,5,150020,3
+5182,5,150030,3
+5183,5,150040,3
+5185,3,111000010,1
+5186,3,111000020,1
+5187,3,111000030,1
+5188,4,111000040,1
+5189,5,111000060,1
+5190,3,170004,3
+5191,3,180004,3
+5192,1,201000010,8
+5193,1,292000010,8
+5194,1,299000040,8
+5195,1,299000070,8
+5196,1,299000110,8
+5197,1,299000120,8
+5198,1,299000140,8
+5199,2,202000010,8
+5200,2,290000010,8
+5201,2,299000010,8
+5202,2,299000150,8
+5203,2,299000190,8
+5204,2,299000200,8
+5205,2,299000210,8
+5206,3,298000050,8
+5207,3,298000060,8
+5208,3,299000060,8
+5209,3,299000170,8
+5210,4,140000,3
+5211,5,150010,3
+5212,5,150020,3
+5213,5,150030,3
+5214,5,150040,3
+5216,3,111000010,1
+5217,3,111000020,1
+5218,3,111000030,1
+5219,4,111000040,1
+5220,5,111000060,1
+5221,3,170004,3
+5222,3,180004,3
+5223,1,201000010,8
+5224,1,292000010,8
+5225,1,299000040,8
+5226,1,299000070,8
+5227,1,299000110,8
+5228,1,299000120,8
+5229,1,299000140,8
+5230,2,202000010,8
+5231,2,290000010,8
+5232,2,299000010,8
+5233,2,299000150,8
+5234,2,299000190,8
+5235,2,299000200,8
+5236,2,299000210,8
+5237,3,298000050,8
+5238,3,298000060,8
+5239,3,299000060,8
+5240,3,299000170,8
+5241,4,140000,3
+5242,5,150010,3
+5243,5,150020,3
+5244,5,150030,3
+5245,5,150040,3
+5246,5,190000,3
+5247,5,200000,3
+5248,5,210000,3
+5250,3,101000050,1
+5251,3,101000060,1
+5252,3,101000080,1
+5253,3,101000040,1
+5254,3,109000060,1
+5255,3,109000070,1
+5256,3,109000080,1
+5257,3,105000060,1
+5258,3,105000070,1
+5259,3,105000080,1
+5260,3,104000050,1
+5261,3,106000050,1
+5262,4,101000090,1
+5263,4,101000100,1
+5264,4,101000110,1
+5265,4,109000100,1
+5266,4,105000100,1
+5267,4,105000110,1
+5268,4,108000090,1
+5269,4,110000090,1
+5270,5,101000120,1
+5271,5,109000110,1
+5272,5,105000120,1
+5273,1,101000000,2
+5274,2,101000001,2
+5275,3,101000002,2
+5276,4,101000008,2
+5277,5,101000004,2
+5278,1,109000000,2
+5279,2,109000001,2
+5280,3,109000002,2
+5281,4,109000003,2
+5282,5,109000004,2
+5283,3,170004,3
+5284,4,170005,3
+5285,3,180004,3
+5286,4,180005,3
+5287,4,140000,3
+5288,4,150010,3
+5289,4,150020,3
+5290,4,150030,3
+5291,4,150040,3
+5293,3,102000060,1
+5294,3,102000070,1
+5295,3,102000080,1
+5296,3,103000050,1
+5297,3,105000050,1
+5298,3,107000060,1
+5299,3,107000070,1
+5300,3,107000080,1
+5301,3,108000050,1
+5302,3,109000050,1
+5303,3,103000060,1
+5304,3,103000070,1
+5305,3,103000080,1
+5306,3,110000050,1
+5307,4,102000100,1
+5308,4,102000110,1
+5309,4,106000090,1
+5310,4,109000090,1
+5311,4,107000100,1
+5312,4,103000090,1
+5313,4,102000090,1
+5314,4,103000100,1
+5315,5,102000120,1
+5316,5,107000110,1
+5317,5,103000120,1
+5318,1,102000000,2
+5319,2,102000001,2
+5320,3,102000002,2
+5321,4,102000003,2
+5322,5,102000004,2
+5323,1,105000000,2
+5324,2,105000001,2
+5325,3,105000002,2
+5326,4,105000003,2
+5327,5,105000004,2
+5328,1,112000000,2
+5329,2,112000001,2
+5330,3,112000002,2
+5331,4,112000003,2
+5332,5,112000004,2
+5333,4,110024,3
+5334,4,110034,3
+5335,4,110044,3
+5336,4,110054,3
+5337,3,110060,3
+5338,3,110070,3
+5339,3,110080,3
+5340,3,110090,3
+5341,3,110100,3
+5342,3,110110,3
+5343,3,110120,3
+5344,3,110130,3
+5345,3,110140,3
+5346,3,110150,3
+5347,3,110160,3
+5348,3,110170,3
+5349,3,110180,3
+5350,3,110190,3
+5351,3,110200,3
+5352,3,110210,3
+5353,3,110220,3
+5354,3,110230,3
+5355,3,110240,3
+5356,3,110250,3
+5357,3,110260,3
+5358,3,110270,3
+5359,3,110620,3
+5360,3,110670,3
+5361,4,140000,3
+5362,4,150010,3
+5363,4,150020,3
+5364,4,150030,3
+5365,4,150040,3
+5367,3,106000060,1
+5368,3,106000070,1
+5369,3,106000080,1
+5370,3,101000070,1
+5371,3,110000060,1
+5372,3,104000060,1
+5373,3,104000070,1
+5374,3,104000080,1
+5375,3,102000050,1
+5376,3,104000170,1
+5377,3,104000260,1
+5378,4,106000100,1
+5379,4,106000110,1
+5380,4,104000090,1
+5381,4,104000100,1
+5382,4,104000110,1
+5383,4,107000090,1
+5384,4,104000180,1
+5385,4,104000270,1
+5386,5,106000120,1
+5387,5,104000120,1
+5388,5,104000190,1
+5389,1,103000000,2
+5390,2,103000001,2
+5391,3,103000002,2
+5392,4,103000003,2
+5393,5,103000004,2
+5394,1,111000000,2
+5395,2,111000001,2
+5396,3,111000002,2
+5397,4,111000003,2
+5398,5,111000004,2
+5399,1,115000000,2
+5400,2,115000001,2
+5401,3,115000002,2
+5402,4,115000003,2
+5403,5,115000004,2
+5404,4,120024,3
+5405,4,120034,3
+5406,4,120044,3
+5407,4,120054,3
+5408,3,120241,3
+5409,3,120251,3
+5410,3,120261,3
+5411,3,120271,3
+5412,3,120300,3
+5413,3,120310,3
+5414,3,120320,3
+5415,3,120330,3
+5416,3,120340,3
+5417,3,120350,3
+5418,3,120360,3
+5419,3,120370,3
+5420,3,120380,3
+5421,3,120390,3
+5422,3,120400,3
+5423,3,120410,3
+5424,3,120420,3
+5425,3,120430,3
+5426,3,120450,3
+5427,3,120460,3
+5428,3,120550,3
+5429,3,120560,3
+5430,3,120570,3
+5431,3,120990,3
+5432,3,121000,3
+5433,3,121010,3
+5434,3,121020,3
+5435,4,140000,3
+5436,4,150010,3
+5437,4,150020,3
+5438,4,150030,3
+5439,4,150040,3
+5441,3,111000010,1
+5442,3,111000020,1
+5443,3,111000030,1
+5444,3,112000020,1
+5445,3,112000030,1
+5446,3,108000060,1
+5447,3,108000070,1
+5448,3,108000080,1
+5449,3,107000050,1
+5450,3,112000010,1
+5451,3,110000070,1
+5452,3,110000080,1
+5453,4,111000040,1
+5454,4,112000040,1
+5455,4,108000100,1
+5456,4,105000090,1
+5457,4,110000100,1
+5458,5,111000060,1
+5459,5,112000060,1
+5460,5,108000110,1
+5461,5,110000110,1
+5462,1,108000000,2
+5463,2,108000001,2
+5464,3,108000002,2
+5465,4,108000003,2
+5466,5,108000004,2
+5467,1,107000000,2
+5468,2,107000001,2
+5469,3,107000002,2
+5470,4,107000003,2
+5471,5,107000004,2
+5472,1,120000000,2
+5473,2,120000001,2
+5474,3,120000002,2
+5475,4,120000003,2
+5476,5,120000004,2
+5477,4,130024,3
+5478,4,130034,3
+5479,4,130044,3
+5480,4,130054,3
+5481,3,130060,3
+5482,3,130070,3
+5483,3,130080,3
+5484,3,130090,3
+5485,3,130100,3
+5486,3,130110,3
+5487,3,130120,3
+5488,3,130130,3
+5489,3,130140,3
+5490,3,130150,3
+5491,3,130160,3
+5492,3,130170,3
+5493,3,130180,3
+5494,3,130190,3
+5495,3,130200,3
+5496,3,130420,3
+5497,3,130510,3
+5498,3,130520,3
+5499,3,130530,3
+5500,3,130540,3
+5501,3,130660,3
+5502,4,140000,3
+5503,4,150010,3
+5504,4,150020,3
+5505,4,150030,3
+5506,4,150040,3
+5508,1,101000000,2
+5509,2,101000001,2
+5510,3,101000002,2
+5511,4,101000008,2
+5512,5,101000004,2
+5513,1,120000000,2
+5514,2,120000001,2
+5515,3,120000002,2
+5516,4,120000003,2
+5517,5,120000004,2
+5519,1,101000010,1
+5520,1,102000010,1
+5521,1,103000010,1
+5522,1,104000010,1
+5523,1,105000010,1
+5524,1,106000010,1
+5525,1,107000010,1
+5526,1,108000010,1
+5527,1,109000010,1
+5528,1,110000010,1
+5529,2,101000020,1
+5530,2,101000030,1
+5531,2,102000020,1
+5532,2,102000030,1
+5533,2,102000040,1
+5534,2,103000020,1
+5535,2,103000030,1
+5536,2,103000040,1
+5537,2,104000020,1
+5538,2,104000030,1
+5539,2,104000040,1
+5540,2,105000020,1
+5541,2,105000030,1
+5542,2,105000040,1
+5543,2,106000020,1
+5544,2,106000030,1
+5545,2,106000040,1
+5546,2,107000020,1
+5547,2,107000030,1
+5548,2,107000040,1
+5549,2,108000020,1
+5550,2,108000030,1
+5551,2,108000040,1
+5552,2,109000020,1
+5553,2,109000030,1
+5554,2,109000040,1
+5555,2,110000020,1
+5556,2,110000030,1
+5557,2,110000040,1
+5558,3,101000050,1
+5559,3,101000060,1
+5560,3,101000080,1
+5561,3,101000040,1
+5562,3,109000060,1
+5563,3,109000070,1
+5564,3,109000080,1
+5565,3,105000060,1
+5566,3,105000070,1
+5567,3,105000080,1
+5568,3,104000050,1
+5569,3,106000050,1
+5570,3,102000060,1
+5571,3,102000070,1
+5572,3,102000080,1
+5573,3,103000050,1
+5574,3,105000050,1
+5575,3,107000060,1
+5576,3,107000070,1
+5577,3,107000080,1
+5578,3,108000050,1
+5579,3,109000050,1
+5580,3,103000060,1
+5581,3,103000070,1
+5582,3,103000080,1
+5583,3,110000050,1
+5584,3,106000060,1
+5585,3,106000070,1
+5586,3,106000080,1
+5587,3,101000070,1
+5588,3,110000060,1
+5589,3,104000060,1
+5590,3,104000070,1
+5591,3,104000080,1
+5592,3,102000050,1
+5593,3,104000170,1
+5594,3,104000260,1
+5595,3,111000010,1
+5596,3,111000020,1
+5597,3,111000030,1
+5598,3,112000020,1
+5599,3,112000030,1
+5600,3,108000060,1
+5601,3,108000070,1
+5602,3,108000080,1
+5603,3,107000050,1
+5604,3,112000010,1
+5605,3,110000070,1
+5606,3,110000080,1
+5607,4,101000090,1
+5608,4,101000100,1
+5609,4,101000110,1
+5610,4,109000100,1
+5611,4,105000100,1
+5612,4,105000110,1
+5613,4,108000090,1
+5614,4,110000090,1
+5615,4,102000100,1
+5616,4,102000110,1
+5617,4,106000090,1
+5618,4,109000090,1
+5619,4,107000100,1
+5620,4,103000090,1
+5621,4,102000090,1
+5622,4,103000100,1
+5623,4,106000100,1
+5624,4,106000110,1
+5625,4,104000090,1
+5626,4,104000100,1
+5627,4,104000110,1
+5628,4,107000090,1
+5629,4,104000180,1
+5630,4,111000040,1
+5631,4,112000040,1
+5632,4,108000100,1
+5633,4,105000090,1
+5634,4,110000100,1
+5635,5,101000120,1
+5636,5,109000110,1
+5637,5,105000120,1
+5638,5,102000120,1
+5639,5,107000110,1
+5640,5,103000120,1
+5641,5,106000120,1
+5642,5,104000120,1
+5643,5,104000190,1
+5644,5,111000060,1
+5645,5,112000060,1
+5646,5,108000110,1
+5647,5,110000110,1
+5648,1,170002,3
+5649,2,170003,3
+5650,3,170004,3
+5651,1,180002,3
+5652,2,180003,3
+5653,3,180004,3
+5654,1,201000010,8
+5655,1,292000010,8
+5656,1,299000040,8
+5657,1,299000070,8
+5658,1,299000110,8
+5659,1,299000120,8
+5660,1,299000140,8
+5661,2,202000010,8
+5662,2,290000010,8
+5663,2,299000010,8
+5664,2,299000150,8
+5665,2,299000190,8
+5666,2,299000200,8
+5667,2,299000210,8
+5668,3,298000050,8
+5669,3,298000060,8
+5670,3,299000060,8
+5671,3,299000170,8
+5672,5,297000100,8
+5673,5,291000020,8
+5674,4,140000,3
+5675,5,150010,3
+5676,5,150020,3
+5677,5,150030,3
+5678,5,150040,3
+5680,1,101000010,1
+5681,1,102000010,1
+5682,1,103000010,1
+5683,1,104000010,1
+5684,1,105000010,1
+5685,1,106000010,1
+5686,1,107000010,1
+5687,1,108000010,1
+5688,1,109000010,1
+5689,1,110000010,1
+5690,2,101000020,1
+5691,2,101000030,1
+5692,2,102000020,1
+5693,2,102000030,1
+5694,2,102000040,1
+5695,2,103000020,1
+5696,2,103000030,1
+5697,2,103000040,1
+5698,2,104000020,1
+5699,2,104000030,1
+5700,2,104000040,1
+5701,2,105000020,1
+5702,2,105000030,1
+5703,2,105000040,1
+5704,2,106000020,1
+5705,2,106000030,1
+5706,2,106000040,1
+5707,2,107000020,1
+5708,2,107000030,1
+5709,2,107000040,1
+5710,2,108000020,1
+5711,2,108000030,1
+5712,2,108000040,1
+5713,2,109000020,1
+5714,2,109000030,1
+5715,2,109000040,1
+5716,2,110000020,1
+5717,2,110000030,1
+5718,2,110000040,1
+5719,3,101000050,1
+5720,3,101000060,1
+5721,3,101000080,1
+5722,3,101000040,1
+5723,3,109000060,1
+5724,3,109000070,1
+5725,3,109000080,1
+5726,3,105000060,1
+5727,3,105000070,1
+5728,3,105000080,1
+5729,3,104000050,1
+5730,3,106000050,1
+5731,3,102000060,1
+5732,3,102000070,1
+5733,3,102000080,1
+5734,3,103000050,1
+5735,3,105000050,1
+5736,3,107000060,1
+5737,3,107000070,1
+5738,3,107000080,1
+5739,3,108000050,1
+5740,3,109000050,1
+5741,3,103000060,1
+5742,3,103000070,1
+5743,3,103000080,1
+5744,3,110000050,1
+5745,3,106000060,1
+5746,3,106000070,1
+5747,3,106000080,1
+5748,3,101000070,1
+5749,3,110000060,1
+5750,3,104000060,1
+5751,3,104000070,1
+5752,3,104000080,1
+5753,3,102000050,1
+5754,3,104000170,1
+5755,3,104000260,1
+5756,3,111000010,1
+5757,3,111000020,1
+5758,3,111000030,1
+5759,3,112000020,1
+5760,3,112000030,1
+5761,3,108000060,1
+5762,3,108000070,1
+5763,3,108000080,1
+5764,3,107000050,1
+5765,3,112000010,1
+5766,3,110000070,1
+5767,3,110000080,1
+5768,4,101000090,1
+5769,4,101000100,1
+5770,4,101000110,1
+5771,4,109000100,1
+5772,4,105000100,1
+5773,4,105000110,1
+5774,4,108000090,1
+5775,4,110000090,1
+5776,4,102000100,1
+5777,4,102000110,1
+5778,4,106000090,1
+5779,4,109000090,1
+5780,4,107000100,1
+5781,4,103000090,1
+5782,4,102000090,1
+5783,4,103000100,1
+5784,4,106000100,1
+5785,4,106000110,1
+5786,4,104000090,1
+5787,4,104000100,1
+5788,4,104000110,1
+5789,4,107000090,1
+5790,4,104000180,1
+5791,4,111000040,1
+5792,4,112000040,1
+5793,4,108000100,1
+5794,4,105000090,1
+5795,4,110000100,1
+5796,5,101000120,1
+5797,5,109000110,1
+5798,5,105000120,1
+5799,5,102000120,1
+5800,5,107000110,1
+5801,5,103000120,1
+5802,5,106000120,1
+5803,5,104000120,1
+5804,5,104000190,1
+5805,5,111000060,1
+5806,5,112000060,1
+5807,5,108000110,1
+5808,5,110000110,1
+5809,2,170003,3
+5810,3,170004,3
+5811,2,180003,3
+5812,3,180004,3
+5813,1,201000010,8
+5814,1,292000010,8
+5815,1,299000040,8
+5816,1,299000070,8
+5817,1,299000110,8
+5818,1,299000120,8
+5819,1,299000140,8
+5820,2,202000010,8
+5821,2,290000010,8
+5822,2,299000010,8
+5823,2,299000150,8
+5824,2,299000190,8
+5825,2,299000200,8
+5826,2,299000210,8
+5827,3,298000050,8
+5828,3,298000060,8
+5829,3,299000060,8
+5830,3,299000170,8
+5831,5,297000100,8
+5832,5,291000020,8
+5833,4,140000,3
+5834,5,150010,3
+5835,5,150020,3
+5836,5,150030,3
+5837,5,150040,3
+5839,3,101000050,1
+5840,3,101000060,1
+5841,3,101000080,1
+5842,3,101000040,1
+5843,3,109000060,1
+5844,3,109000070,1
+5845,3,109000080,1
+5846,3,105000060,1
+5847,3,105000070,1
+5848,3,105000080,1
+5849,3,104000050,1
+5850,3,106000050,1
+5851,3,102000060,1
+5852,3,102000070,1
+5853,3,102000080,1
+5854,3,103000050,1
+5855,3,105000050,1
+5856,3,107000060,1
+5857,3,107000070,1
+5858,3,107000080,1
+5859,3,108000050,1
+5860,3,109000050,1
+5861,3,103000060,1
+5862,3,103000070,1
+5863,3,103000080,1
+5864,3,110000050,1
+5865,3,106000060,1
+5866,3,106000070,1
+5867,3,106000080,1
+5868,3,101000070,1
+5869,3,110000060,1
+5870,3,104000060,1
+5871,3,104000070,1
+5872,3,104000080,1
+5873,3,102000050,1
+5874,3,104000170,1
+5875,3,104000260,1
+5876,3,111000010,1
+5877,3,111000020,1
+5878,3,111000030,1
+5879,3,112000020,1
+5880,3,112000030,1
+5881,3,108000060,1
+5882,3,108000070,1
+5883,3,108000080,1
+5884,3,107000050,1
+5885,3,112000010,1
+5886,3,110000070,1
+5887,3,110000080,1
+5888,4,101000090,1
+5889,4,101000100,1
+5890,4,101000110,1
+5891,4,109000100,1
+5892,4,105000100,1
+5893,4,105000110,1
+5894,4,108000090,1
+5895,4,110000090,1
+5896,4,102000100,1
+5897,4,102000110,1
+5898,4,106000090,1
+5899,4,109000090,1
+5900,4,107000100,1
+5901,4,103000090,1
+5902,4,102000090,1
+5903,4,103000100,1
+5904,4,106000100,1
+5905,4,106000110,1
+5906,4,104000090,1
+5907,4,104000100,1
+5908,4,104000110,1
+5909,4,107000090,1
+5910,4,104000180,1
+5911,4,111000040,1
+5912,4,112000040,1
+5913,4,108000100,1
+5914,4,105000090,1
+5915,4,110000100,1
+5916,5,101000120,1
+5917,5,109000110,1
+5918,5,105000120,1
+5919,5,102000120,1
+5920,5,107000110,1
+5921,5,103000120,1
+5922,5,106000120,1
+5923,5,104000120,1
+5924,5,104000190,1
+5925,5,111000060,1
+5926,5,112000060,1
+5927,5,108000110,1
+5928,5,110000110,1
+5929,3,170004,3
+5930,3,180004,3
+5931,1,201000010,8
+5932,1,292000010,8
+5933,1,299000040,8
+5934,1,299000070,8
+5935,1,299000110,8
+5936,1,299000120,8
+5937,1,299000140,8
+5938,2,202000010,8
+5939,2,290000010,8
+5940,2,299000010,8
+5941,2,299000150,8
+5942,2,299000190,8
+5943,2,299000200,8
+5944,2,299000210,8
+5945,3,298000050,8
+5946,3,298000060,8
+5947,3,299000060,8
+5948,3,299000170,8
+5949,5,297000100,8
+5950,5,291000020,8
+5951,4,140000,3
+5952,5,150010,3
+5953,5,150020,3
+5954,5,150030,3
+5955,5,150040,3
+5957,3,101000050,1
+5958,3,101000060,1
+5959,3,101000080,1
+5960,3,101000040,1
+5961,3,109000060,1
+5962,3,109000070,1
+5963,3,109000080,1
+5964,3,105000060,1
+5965,3,105000070,1
+5966,3,105000080,1
+5967,3,104000050,1
+5968,3,106000050,1
+5969,3,102000060,1
+5970,3,102000070,1
+5971,3,102000080,1
+5972,3,103000050,1
+5973,3,105000050,1
+5974,3,107000060,1
+5975,3,107000070,1
+5976,3,107000080,1
+5977,3,108000050,1
+5978,3,109000050,1
+5979,3,103000060,1
+5980,3,103000070,1
+5981,3,103000080,1
+5982,3,110000050,1
+5983,3,106000060,1
+5984,3,106000070,1
+5985,3,106000080,1
+5986,3,101000070,1
+5987,3,110000060,1
+5988,3,104000060,1
+5989,3,104000070,1
+5990,3,104000080,1
+5991,3,102000050,1
+5992,3,104000170,1
+5993,3,104000260,1
+5994,3,111000010,1
+5995,3,111000020,1
+5996,3,111000030,1
+5997,3,112000020,1
+5998,3,112000030,1
+5999,3,108000060,1
+6000,3,108000070,1
+6001,3,108000080,1
+6002,3,107000050,1
+6003,3,112000010,1
+6004,3,110000070,1
+6005,3,110000080,1
+6006,4,101000090,1
+6007,4,101000100,1
+6008,4,101000110,1
+6009,4,109000100,1
+6010,4,105000100,1
+6011,4,105000110,1
+6012,4,108000090,1
+6013,4,110000090,1
+6014,4,102000100,1
+6015,4,102000110,1
+6016,4,106000090,1
+6017,4,109000090,1
+6018,4,107000100,1
+6019,4,103000090,1
+6020,4,102000090,1
+6021,4,103000100,1
+6022,4,106000100,1
+6023,4,106000110,1
+6024,4,104000090,1
+6025,4,104000100,1
+6026,4,104000110,1
+6027,4,107000090,1
+6028,4,104000180,1
+6029,4,111000040,1
+6030,4,112000040,1
+6031,4,108000100,1
+6032,4,105000090,1
+6033,4,110000100,1
+6034,5,101000120,1
+6035,5,109000110,1
+6036,5,105000120,1
+6037,5,102000120,1
+6038,5,107000110,1
+6039,5,103000120,1
+6040,5,106000120,1
+6041,5,104000120,1
+6042,5,104000190,1
+6043,5,111000060,1
+6044,5,112000060,1
+6045,5,108000110,1
+6046,5,110000110,1
+6047,3,170004,3
+6048,3,180004,3
+6049,1,201000010,8
+6050,1,292000010,8
+6051,1,299000040,8
+6052,1,299000070,8
+6053,1,299000110,8
+6054,1,299000120,8
+6055,1,299000140,8
+6056,2,202000010,8
+6057,2,290000010,8
+6058,2,299000010,8
+6059,2,299000150,8
+6060,2,299000190,8
+6061,2,299000200,8
+6062,2,299000210,8
+6063,3,298000050,8
+6064,3,298000060,8
+6065,3,299000060,8
+6066,3,299000170,8
+6067,5,297000100,8
+6068,5,291000020,8
+6069,4,140000,3
+6070,5,150010,3
+6071,5,150020,3
+6072,5,150030,3
+6073,5,150040,3
+6075,3,101000050,1
+6076,3,101000060,1
+6077,3,101000080,1
+6078,3,101000040,1
+6079,3,109000060,1
+6080,3,109000070,1
+6081,3,109000080,1
+6082,3,105000060,1
+6083,3,105000070,1
+6084,3,105000080,1
+6085,3,104000050,1
+6086,3,106000050,1
+6087,3,102000060,1
+6088,3,102000070,1
+6089,3,102000080,1
+6090,3,103000050,1
+6091,3,105000050,1
+6092,3,107000060,1
+6093,3,107000070,1
+6094,3,107000080,1
+6095,3,108000050,1
+6096,3,109000050,1
+6097,3,103000060,1
+6098,3,103000070,1
+6099,3,103000080,1
+6100,3,110000050,1
+6101,3,106000060,1
+6102,3,106000070,1
+6103,3,106000080,1
+6104,3,101000070,1
+6105,3,110000060,1
+6106,3,104000060,1
+6107,3,104000070,1
+6108,3,104000080,1
+6109,3,102000050,1
+6110,3,104000170,1
+6111,3,104000260,1
+6112,3,111000010,1
+6113,3,111000020,1
+6114,3,111000030,1
+6115,3,112000020,1
+6116,3,112000030,1
+6117,3,108000060,1
+6118,3,108000070,1
+6119,3,108000080,1
+6120,3,107000050,1
+6121,3,112000010,1
+6122,3,110000070,1
+6123,3,110000080,1
+6124,4,101000090,1
+6125,4,101000100,1
+6126,4,101000110,1
+6127,4,109000100,1
+6128,4,105000100,1
+6129,4,105000110,1
+6130,4,108000090,1
+6131,4,110000090,1
+6132,4,102000100,1
+6133,4,102000110,1
+6134,4,106000090,1
+6135,4,109000090,1
+6136,4,107000100,1
+6137,4,103000090,1
+6138,4,102000090,1
+6139,4,103000100,1
+6140,4,106000100,1
+6141,4,106000110,1
+6142,4,104000090,1
+6143,4,104000100,1
+6144,4,104000110,1
+6145,4,107000090,1
+6146,4,104000180,1
+6147,4,111000040,1
+6148,4,112000040,1
+6149,4,108000100,1
+6150,4,105000090,1
+6151,4,110000100,1
+6152,5,101000120,1
+6153,5,109000110,1
+6154,5,105000120,1
+6155,5,102000120,1
+6156,5,107000110,1
+6157,5,103000120,1
+6158,5,106000120,1
+6159,5,104000120,1
+6160,5,104000190,1
+6161,5,111000060,1
+6162,5,112000060,1
+6163,5,108000110,1
+6164,5,110000110,1
+6165,3,170004,3
+6166,3,180004,3
+6167,1,201000010,8
+6168,1,292000010,8
+6169,1,299000040,8
+6170,1,299000070,8
+6171,1,299000110,8
+6172,1,299000120,8
+6173,1,299000140,8
+6174,2,202000010,8
+6175,2,290000010,8
+6176,2,299000010,8
+6177,2,299000150,8
+6178,2,299000190,8
+6179,2,299000200,8
+6180,2,299000210,8
+6181,3,298000050,8
+6182,3,298000060,8
+6183,3,299000060,8
+6184,3,299000170,8
+6185,5,297000100,8
+6186,5,291000020,8
+6187,4,140000,3
+6188,5,150010,3
+6189,5,150020,3
+6190,5,150030,3
+6191,5,150040,3
+6192,5,190000,3
+6193,5,200000,3
+6194,5,210000,3
+6196,3,111000010,1
+6197,3,111000020,1
+6198,3,111000030,1
+6199,3,112000020,1
+6200,3,112000030,1
+6201,3,108000060,1
+6202,3,108000070,1
+6203,3,108000080,1
+6204,3,107000050,1
+6205,3,112000010,1
+6206,3,110000070,1
+6207,3,110000080,1
+6208,4,111000040,1
+6209,4,112000040,1
+6210,4,108000100,1
+6211,4,105000090,1
+6212,4,110000100,1
+6213,5,111000060,1
+6214,5,112000060,1
+6215,5,108000110,1
+6216,5,110000110,1
+6217,1,108000000,2
+6218,2,108000001,2
+6219,3,108000002,2
+6220,4,108000003,2
+6221,5,108000004,2
+6222,1,107000000,2
+6223,2,107000001,2
+6224,3,107000002,2
+6225,4,107000003,2
+6226,5,107000004,2
+6227,1,120000000,2
+6228,2,120000001,2
+6229,3,120000002,2
+6230,4,120000003,2
+6231,5,120000004,2
+6232,3,170004,3
+6233,4,170005,3
+6234,3,180004,3
+6235,4,180005,3
+6236,4,140000,3
+6237,4,150010,3
+6238,4,150020,3
+6239,4,150030,3
+6240,4,150040,3
+6242,3,101000050,1
+6243,3,101000060,1
+6244,3,101000080,1
+6245,3,101000040,1
+6246,3,109000060,1
+6247,3,109000070,1
+6248,3,109000080,1
+6249,3,105000060,1
+6250,3,105000070,1
+6251,3,105000080,1
+6252,3,104000050,1
+6253,3,106000050,1
+6254,4,101000090,1
+6255,4,101000100,1
+6256,4,101000110,1
+6257,4,109000100,1
+6258,4,105000100,1
+6259,4,105000110,1
+6260,4,108000090,1
+6261,4,110000090,1
+6262,5,101000120,1
+6263,5,109000110,1
+6264,5,105000120,1
+6265,1,101000000,2
+6266,2,101000001,2
+6267,3,101000002,2
+6268,4,101000008,2
+6269,5,101000004,2
+6270,1,109000000,2
+6271,2,109000001,2
+6272,3,109000002,2
+6273,4,109000003,2
+6274,5,109000004,2
+6275,4,110024,3
+6276,4,110034,3
+6277,4,110044,3
+6278,4,110054,3
+6279,3,110060,3
+6280,3,110070,3
+6281,3,110080,3
+6282,3,110090,3
+6283,3,110100,3
+6284,3,110110,3
+6285,3,110120,3
+6286,3,110130,3
+6287,3,110140,3
+6288,3,110150,3
+6289,3,110160,3
+6290,3,110170,3
+6291,3,110180,3
+6292,3,110190,3
+6293,3,110200,3
+6294,3,110210,3
+6295,3,110220,3
+6296,3,110230,3
+6297,3,110240,3
+6298,3,110250,3
+6299,3,110260,3
+6300,3,110270,3
+6301,3,110620,3
+6302,3,110670,3
+6303,4,140000,3
+6304,4,150010,3
+6305,4,150020,3
+6306,4,150030,3
+6307,4,150040,3
+6309,3,102000060,1
+6310,3,102000070,1
+6311,3,102000080,1
+6312,3,103000050,1
+6313,3,105000050,1
+6314,3,107000060,1
+6315,3,107000070,1
+6316,3,107000080,1
+6317,3,108000050,1
+6318,3,109000050,1
+6319,3,103000060,1
+6320,3,103000070,1
+6321,3,103000080,1
+6322,3,110000050,1
+6323,4,102000100,1
+6324,4,102000110,1
+6325,4,106000090,1
+6326,4,109000090,1
+6327,4,107000100,1
+6328,4,103000090,1
+6329,4,102000090,1
+6330,4,103000100,1
+6331,5,102000120,1
+6332,5,107000110,1
+6333,5,103000120,1
+6334,1,102000000,2
+6335,2,102000001,2
+6336,3,102000002,2
+6337,4,102000003,2
+6338,5,102000004,2
+6339,1,105000000,2
+6340,2,105000001,2
+6341,3,105000002,2
+6342,4,105000003,2
+6343,5,105000004,2
+6344,1,112000000,2
+6345,2,112000001,2
+6346,3,112000002,2
+6347,4,112000003,2
+6348,5,112000004,2
+6349,4,120024,3
+6350,4,120034,3
+6351,4,120044,3
+6352,4,120054,3
+6353,3,120241,3
+6354,3,120251,3
+6355,3,120261,3
+6356,3,120271,3
+6357,3,120300,3
+6358,3,120310,3
+6359,3,120320,3
+6360,3,120330,3
+6361,3,120340,3
+6362,3,120350,3
+6363,3,120360,3
+6364,3,120370,3
+6365,3,120380,3
+6366,3,120390,3
+6367,3,120400,3
+6368,3,120410,3
+6369,3,120420,3
+6370,3,120430,3
+6371,3,120450,3
+6372,3,120460,3
+6373,3,120550,3
+6374,3,120560,3
+6375,3,120570,3
+6376,3,120990,3
+6377,3,121000,3
+6378,3,121010,3
+6379,3,121020,3
+6380,4,140000,3
+6381,4,150010,3
+6382,4,150020,3
+6383,4,150030,3
+6384,4,150040,3
+6386,3,106000060,1
+6387,3,106000070,1
+6388,3,106000080,1
+6389,3,101000070,1
+6390,3,110000060,1
+6391,3,104000060,1
+6392,3,104000070,1
+6393,3,104000080,1
+6394,3,102000050,1
+6395,3,104000170,1
+6396,3,104000260,1
+6397,4,106000100,1
+6398,4,106000110,1
+6399,4,104000090,1
+6400,4,104000100,1
+6401,4,104000110,1
+6402,4,107000090,1
+6403,4,104000180,1
+6404,5,106000120,1
+6405,5,104000120,1
+6406,5,104000190,1
+6407,1,103000000,2
+6408,2,103000001,2
+6409,3,103000002,2
+6410,4,103000003,2
+6411,5,103000004,2
+6412,1,111000000,2
+6413,2,111000001,2
+6414,3,111000002,2
+6415,4,111000003,2
+6416,5,111000004,2
+6417,1,115000000,2
+6418,2,115000001,2
+6419,3,115000002,2
+6420,4,115000003,2
+6421,5,115000004,2
+6422,4,130024,3
+6423,4,130034,3
+6424,4,130044,3
+6425,4,130054,3
+6426,3,130060,3
+6427,3,130070,3
+6428,3,130080,3
+6429,3,130090,3
+6430,3,130100,3
+6431,3,130110,3
+6432,3,130120,3
+6433,3,130130,3
+6434,3,130140,3
+6435,3,130150,3
+6436,3,130160,3
+6437,3,130170,3
+6438,3,130180,3
+6439,3,130190,3
+6440,3,130200,3
+6441,3,130420,3
+6442,3,130510,3
+6443,3,130520,3
+6444,3,130530,3
+6445,3,130540,3
+6446,3,130660,3
+6447,3,130790,3
+6448,3,130800,3
+6449,4,140000,3
+6450,4,150010,3
+6451,4,150020,3
+6452,4,150030,3
+6453,4,150040,3
+6455,1,101000010,1
+6456,1,102000010,1
+6457,1,103000010,1
+6458,1,104000010,1
+6459,1,105000010,1
+6460,1,106000010,1
+6461,1,107000010,1
+6462,1,108000010,1
+6463,1,109000010,1
+6464,1,110000010,1
+6465,2,101000020,1
+6466,2,101000030,1
+6467,2,102000020,1
+6468,2,102000030,1
+6469,2,102000040,1
+6470,2,103000020,1
+6471,2,103000030,1
+6472,2,103000040,1
+6473,2,104000020,1
+6474,2,104000030,1
+6475,2,104000040,1
+6476,2,105000020,1
+6477,2,105000030,1
+6478,2,105000040,1
+6479,2,106000020,1
+6480,2,106000030,1
+6481,2,106000040,1
+6482,2,107000020,1
+6483,2,107000030,1
+6484,2,107000040,1
+6485,2,108000020,1
+6486,2,108000030,1
+6487,2,108000040,1
+6488,2,109000020,1
+6489,2,109000030,1
+6490,2,109000040,1
+6491,2,110000020,1
+6492,2,110000030,1
+6493,2,110000040,1
+6494,2,118000010,1
+6495,3,101000050,1
+6496,3,101000060,1
+6497,3,101000080,1
+6498,3,101000040,1
+6499,3,109000060,1
+6500,3,109000070,1
+6501,3,109000080,1
+6502,3,105000060,1
+6503,3,105000070,1
+6504,3,105000080,1
+6505,3,104000050,1
+6506,3,106000050,1
+6507,3,102000060,1
+6508,3,102000070,1
+6509,3,102000080,1
+6510,3,103000050,1
+6511,3,105000050,1
+6512,3,107000060,1
+6513,3,107000070,1
+6514,3,107000080,1
+6515,3,108000050,1
+6516,3,109000050,1
+6517,3,103000060,1
+6518,3,103000070,1
+6519,3,103000080,1
+6520,3,110000050,1
+6521,3,106000060,1
+6522,3,106000070,1
+6523,3,106000080,1
+6524,3,101000070,1
+6525,3,110000060,1
+6526,3,104000060,1
+6527,3,104000070,1
+6528,3,104000080,1
+6529,3,102000050,1
+6530,3,104000170,1
+6531,3,104000260,1
+6532,3,111000010,1
+6533,3,111000020,1
+6534,3,111000030,1
+6535,3,112000020,1
+6536,3,112000030,1
+6537,3,108000060,1
+6538,3,108000070,1
+6539,3,108000080,1
+6540,3,107000050,1
+6541,3,112000010,1
+6542,3,110000070,1
+6543,3,110000080,1
+6544,3,118000020,1
+6545,3,118000030,1
+6546,3,118000040,1
+6547,4,101000090,1
+6548,4,101000100,1
+6549,4,101000110,1
+6550,4,109000100,1
+6551,4,105000100,1
+6552,4,105000110,1
+6553,4,108000090,1
+6554,4,110000090,1
+6555,4,102000100,1
+6556,4,102000110,1
+6557,4,106000090,1
+6558,4,109000090,1
+6559,4,107000100,1
+6560,4,103000090,1
+6561,4,102000090,1
+6562,4,103000100,1
+6563,4,106000100,1
+6564,4,106000110,1
+6565,4,104000090,1
+6566,4,104000100,1
+6567,4,104000110,1
+6568,4,107000090,1
+6569,4,104000180,1
+6570,4,111000040,1
+6571,4,112000040,1
+6572,4,108000100,1
+6573,4,105000090,1
+6574,4,110000100,1
+6575,4,118000050,1
+6576,4,118000060,1
+6577,5,101000120,1
+6578,5,109000110,1
+6579,5,105000120,1
+6580,5,102000120,1
+6581,5,107000110,1
+6582,5,103000120,1
+6583,5,106000120,1
+6584,5,104000120,1
+6585,5,104000190,1
+6586,5,111000060,1
+6587,5,112000060,1
+6588,5,108000110,1
+6589,5,110000110,1
+6590,5,118000070,1
+6591,1,170002,3
+6592,2,170003,3
+6593,3,170004,3
+6594,1,180002,3
+6595,2,180003,3
+6596,3,180004,3
+6597,1,201000010,8
+6598,1,292000010,8
+6599,1,299000040,8
+6600,1,299000070,8
+6601,1,299000110,8
+6602,1,299000120,8
+6603,1,299000140,8
+6604,2,202000010,8
+6605,2,290000010,8
+6606,2,299000010,8
+6607,2,299000150,8
+6608,2,299000190,8
+6609,2,299000200,8
+6610,2,299000210,8
+6611,3,298000050,8
+6612,3,298000060,8
+6613,3,299000060,8
+6614,3,299000170,8
+6615,5,297000100,8
+6616,5,291000020,8
+6617,4,140000,3
+6618,5,150010,3
+6619,5,150020,3
+6620,5,150030,3
+6621,5,150040,3
+6623,1,101000010,1
+6624,1,102000010,1
+6625,1,103000010,1
+6626,1,104000010,1
+6627,1,105000010,1
+6628,1,106000010,1
+6629,1,107000010,1
+6630,1,108000010,1
+6631,1,109000010,1
+6632,1,110000010,1
+6633,2,101000020,1
+6634,2,101000030,1
+6635,2,102000020,1
+6636,2,102000030,1
+6637,2,102000040,1
+6638,2,103000020,1
+6639,2,103000030,1
+6640,2,103000040,1
+6641,2,104000020,1
+6642,2,104000030,1
+6643,2,104000040,1
+6644,2,105000020,1
+6645,2,105000030,1
+6646,2,105000040,1
+6647,2,106000020,1
+6648,2,106000030,1
+6649,2,106000040,1
+6650,2,107000020,1
+6651,2,107000030,1
+6652,2,107000040,1
+6653,2,108000020,1
+6654,2,108000030,1
+6655,2,108000040,1
+6656,2,109000020,1
+6657,2,109000030,1
+6658,2,109000040,1
+6659,2,110000020,1
+6660,2,110000030,1
+6661,2,110000040,1
+6662,2,118000010,1
+6663,3,101000050,1
+6664,3,101000060,1
+6665,3,101000080,1
+6666,3,101000040,1
+6667,3,109000060,1
+6668,3,109000070,1
+6669,3,109000080,1
+6670,3,105000060,1
+6671,3,105000070,1
+6672,3,105000080,1
+6673,3,104000050,1
+6674,3,106000050,1
+6675,3,102000060,1
+6676,3,102000070,1
+6677,3,102000080,1
+6678,3,103000050,1
+6679,3,105000050,1
+6680,3,107000060,1
+6681,3,107000070,1
+6682,3,107000080,1
+6683,3,108000050,1
+6684,3,109000050,1
+6685,3,103000060,1
+6686,3,103000070,1
+6687,3,103000080,1
+6688,3,110000050,1
+6689,3,106000060,1
+6690,3,106000070,1
+6691,3,106000080,1
+6692,3,101000070,1
+6693,3,110000060,1
+6694,3,104000060,1
+6695,3,104000070,1
+6696,3,104000080,1
+6697,3,102000050,1
+6698,3,104000170,1
+6699,3,104000260,1
+6700,3,111000010,1
+6701,3,111000020,1
+6702,3,111000030,1
+6703,3,112000020,1
+6704,3,112000030,1
+6705,3,108000060,1
+6706,3,108000070,1
+6707,3,108000080,1
+6708,3,107000050,1
+6709,3,112000010,1
+6710,3,110000070,1
+6711,3,110000080,1
+6712,3,118000020,1
+6713,3,118000030,1
+6714,3,118000040,1
+6715,4,101000090,1
+6716,4,101000100,1
+6717,4,101000110,1
+6718,4,109000100,1
+6719,4,105000100,1
+6720,4,105000110,1
+6721,4,108000090,1
+6722,4,110000090,1
+6723,4,102000100,1
+6724,4,102000110,1
+6725,4,106000090,1
+6726,4,109000090,1
+6727,4,107000100,1
+6728,4,103000090,1
+6729,4,102000090,1
+6730,4,103000100,1
+6731,4,106000100,1
+6732,4,106000110,1
+6733,4,104000090,1
+6734,4,104000100,1
+6735,4,104000110,1
+6736,4,107000090,1
+6737,4,104000180,1
+6738,4,111000040,1
+6739,4,112000040,1
+6740,4,108000100,1
+6741,4,105000090,1
+6742,4,110000100,1
+6743,4,118000050,1
+6744,4,118000060,1
+6745,5,101000120,1
+6746,5,109000110,1
+6747,5,105000120,1
+6748,5,102000120,1
+6749,5,107000110,1
+6750,5,103000120,1
+6751,5,106000120,1
+6752,5,104000120,1
+6753,5,104000190,1
+6754,5,111000060,1
+6755,5,112000060,1
+6756,5,108000110,1
+6757,5,110000110,1
+6758,5,118000070,1
+6759,2,170003,3
+6760,3,170004,3
+6761,2,180003,3
+6762,3,180004,3
+6763,1,201000010,8
+6764,1,292000010,8
+6765,1,299000040,8
+6766,1,299000070,8
+6767,1,299000110,8
+6768,1,299000120,8
+6769,1,299000140,8
+6770,2,202000010,8
+6771,2,290000010,8
+6772,2,299000010,8
+6773,2,299000150,8
+6774,2,299000190,8
+6775,2,299000200,8
+6776,2,299000210,8
+6777,3,298000050,8
+6778,3,298000060,8
+6779,3,299000060,8
+6780,3,299000170,8
+6781,5,297000100,8
+6782,5,291000020,8
+6783,4,140000,3
+6784,5,150010,3
+6785,5,150020,3
+6786,5,150030,3
+6787,5,150040,3
+6789,3,101000050,1
+6790,3,101000060,1
+6791,3,101000080,1
+6792,3,101000040,1
+6793,3,109000060,1
+6794,3,109000070,1
+6795,3,109000080,1
+6796,3,105000060,1
+6797,3,105000070,1
+6798,3,105000080,1
+6799,3,104000050,1
+6800,3,106000050,1
+6801,3,102000060,1
+6802,3,102000070,1
+6803,3,102000080,1
+6804,3,103000050,1
+6805,3,105000050,1
+6806,3,107000060,1
+6807,3,107000070,1
+6808,3,107000080,1
+6809,3,108000050,1
+6810,3,109000050,1
+6811,3,103000060,1
+6812,3,103000070,1
+6813,3,103000080,1
+6814,3,110000050,1
+6815,3,106000060,1
+6816,3,106000070,1
+6817,3,106000080,1
+6818,3,101000070,1
+6819,3,110000060,1
+6820,3,104000060,1
+6821,3,104000070,1
+6822,3,104000080,1
+6823,3,102000050,1
+6824,3,104000170,1
+6825,3,104000260,1
+6826,3,111000010,1
+6827,3,111000020,1
+6828,3,111000030,1
+6829,3,112000020,1
+6830,3,112000030,1
+6831,3,108000060,1
+6832,3,108000070,1
+6833,3,108000080,1
+6834,3,107000050,1
+6835,3,112000010,1
+6836,3,110000070,1
+6837,3,110000080,1
+6838,3,118000020,1
+6839,3,118000030,1
+6840,3,118000040,1
+6841,4,101000090,1
+6842,4,101000100,1
+6843,4,101000110,1
+6844,4,109000100,1
+6845,4,105000100,1
+6846,4,105000110,1
+6847,4,108000090,1
+6848,4,110000090,1
+6849,4,102000100,1
+6850,4,102000110,1
+6851,4,106000090,1
+6852,4,109000090,1
+6853,4,107000100,1
+6854,4,103000090,1
+6855,4,102000090,1
+6856,4,103000100,1
+6857,4,106000100,1
+6858,4,106000110,1
+6859,4,104000090,1
+6860,4,104000100,1
+6861,4,104000110,1
+6862,4,107000090,1
+6863,4,104000180,1
+6864,4,111000040,1
+6865,4,112000040,1
+6866,4,108000100,1
+6867,4,105000090,1
+6868,4,110000100,1
+6869,4,118000050,1
+6870,4,118000060,1
+6871,5,101000120,1
+6872,5,109000110,1
+6873,5,105000120,1
+6874,5,102000120,1
+6875,5,107000110,1
+6876,5,103000120,1
+6877,5,106000120,1
+6878,5,104000120,1
+6879,5,104000190,1
+6880,5,111000060,1
+6881,5,112000060,1
+6882,5,108000110,1
+6883,5,110000110,1
+6884,5,118000070,1
+6885,3,170004,3
+6886,3,180004,3
+6887,1,201000010,8
+6888,1,292000010,8
+6889,1,299000040,8
+6890,1,299000070,8
+6891,1,299000110,8
+6892,1,299000120,8
+6893,1,299000140,8
+6894,2,202000010,8
+6895,2,290000010,8
+6896,2,299000010,8
+6897,2,299000150,8
+6898,2,299000190,8
+6899,2,299000200,8
+6900,2,299000210,8
+6901,3,298000050,8
+6902,3,298000060,8
+6903,3,299000060,8
+6904,3,299000170,8
+6905,5,297000100,8
+6906,5,291000020,8
+6907,4,140000,3
+6908,5,150010,3
+6909,5,150020,3
+6910,5,150030,3
+6911,5,150040,3
+6913,3,101000050,1
+6914,3,101000060,1
+6915,3,101000080,1
+6916,3,101000040,1
+6917,3,109000060,1
+6918,3,109000070,1
+6919,3,109000080,1
+6920,3,105000060,1
+6921,3,105000070,1
+6922,3,105000080,1
+6923,3,104000050,1
+6924,3,106000050,1
+6925,3,102000060,1
+6926,3,102000070,1
+6927,3,102000080,1
+6928,3,103000050,1
+6929,3,105000050,1
+6930,3,107000060,1
+6931,3,107000070,1
+6932,3,107000080,1
+6933,3,108000050,1
+6934,3,109000050,1
+6935,3,103000060,1
+6936,3,103000070,1
+6937,3,103000080,1
+6938,3,110000050,1
+6939,3,106000060,1
+6940,3,106000070,1
+6941,3,106000080,1
+6942,3,101000070,1
+6943,3,110000060,1
+6944,3,104000060,1
+6945,3,104000070,1
+6946,3,104000080,1
+6947,3,102000050,1
+6948,3,104000170,1
+6949,3,104000260,1
+6950,3,111000010,1
+6951,3,111000020,1
+6952,3,111000030,1
+6953,3,112000020,1
+6954,3,112000030,1
+6955,3,108000060,1
+6956,3,108000070,1
+6957,3,108000080,1
+6958,3,107000050,1
+6959,3,112000010,1
+6960,3,110000070,1
+6961,3,110000080,1
+6962,3,118000020,1
+6963,3,118000030,1
+6964,3,118000040,1
+6965,4,101000090,1
+6966,4,101000100,1
+6967,4,101000110,1
+6968,4,109000100,1
+6969,4,105000100,1
+6970,4,105000110,1
+6971,4,108000090,1
+6972,4,110000090,1
+6973,4,102000100,1
+6974,4,102000110,1
+6975,4,106000090,1
+6976,4,109000090,1
+6977,4,107000100,1
+6978,4,103000090,1
+6979,4,102000090,1
+6980,4,103000100,1
+6981,4,106000100,1
+6982,4,106000110,1
+6983,4,104000090,1
+6984,4,104000100,1
+6985,4,104000110,1
+6986,4,107000090,1
+6987,4,104000180,1
+6988,4,111000040,1
+6989,4,112000040,1
+6990,4,108000100,1
+6991,4,105000090,1
+6992,4,110000100,1
+6993,4,118000050,1
+6994,4,118000060,1
+6995,5,101000120,1
+6996,5,109000110,1
+6997,5,105000120,1
+6998,5,102000120,1
+6999,5,107000110,1
+7000,5,103000120,1
+7001,5,106000120,1
+7002,5,104000120,1
+7003,5,104000190,1
+7004,5,111000060,1
+7005,5,112000060,1
+7006,5,108000110,1
+7007,5,110000110,1
+7008,5,118000070,1
+7009,3,170004,3
+7010,3,180004,3
+7011,1,201000010,8
+7012,1,292000010,8
+7013,1,299000040,8
+7014,1,299000070,8
+7015,1,299000110,8
+7016,1,299000120,8
+7017,1,299000140,8
+7018,2,202000010,8
+7019,2,290000010,8
+7020,2,299000010,8
+7021,2,299000150,8
+7022,2,299000190,8
+7023,2,299000200,8
+7024,2,299000210,8
+7025,3,298000050,8
+7026,3,298000060,8
+7027,3,299000060,8
+7028,3,299000170,8
+7029,5,297000100,8
+7030,5,291000020,8
+7031,4,140000,3
+7032,5,150010,3
+7033,5,150020,3
+7034,5,150030,3
+7035,5,150040,3
+7037,3,101000050,1
+7038,3,101000060,1
+7039,3,101000080,1
+7040,3,101000040,1
+7041,3,109000060,1
+7042,3,109000070,1
+7043,3,109000080,1
+7044,3,105000060,1
+7045,3,105000070,1
+7046,3,105000080,1
+7047,3,104000050,1
+7048,3,106000050,1
+7049,3,102000060,1
+7050,3,102000070,1
+7051,3,102000080,1
+7052,3,103000050,1
+7053,3,105000050,1
+7054,3,107000060,1
+7055,3,107000070,1
+7056,3,107000080,1
+7057,3,108000050,1
+7058,3,109000050,1
+7059,3,103000060,1
+7060,3,103000070,1
+7061,3,103000080,1
+7062,3,110000050,1
+7063,3,106000060,1
+7064,3,106000070,1
+7065,3,106000080,1
+7066,3,101000070,1
+7067,3,110000060,1
+7068,3,104000060,1
+7069,3,104000070,1
+7070,3,104000080,1
+7071,3,102000050,1
+7072,3,104000170,1
+7073,3,104000260,1
+7074,3,111000010,1
+7075,3,111000020,1
+7076,3,111000030,1
+7077,3,112000020,1
+7078,3,112000030,1
+7079,3,108000060,1
+7080,3,108000070,1
+7081,3,108000080,1
+7082,3,107000050,1
+7083,3,112000010,1
+7084,3,110000070,1
+7085,3,110000080,1
+7086,3,118000020,1
+7087,3,118000030,1
+7088,3,118000040,1
+7089,4,101000090,1
+7090,4,101000100,1
+7091,4,101000110,1
+7092,4,109000100,1
+7093,4,105000100,1
+7094,4,105000110,1
+7095,4,108000090,1
+7096,4,110000090,1
+7097,4,102000100,1
+7098,4,102000110,1
+7099,4,106000090,1
+7100,4,109000090,1
+7101,4,107000100,1
+7102,4,103000090,1
+7103,4,102000090,1
+7104,4,103000100,1
+7105,4,106000100,1
+7106,4,106000110,1
+7107,4,104000090,1
+7108,4,104000100,1
+7109,4,104000110,1
+7110,4,107000090,1
+7111,4,104000180,1
+7112,4,111000040,1
+7113,4,112000040,1
+7114,4,108000100,1
+7115,4,105000090,1
+7116,4,110000100,1
+7117,4,118000050,1
+7118,4,118000060,1
+7119,5,101000120,1
+7120,5,109000110,1
+7121,5,105000120,1
+7122,5,102000120,1
+7123,5,107000110,1
+7124,5,103000120,1
+7125,5,106000120,1
+7126,5,104000120,1
+7127,5,104000190,1
+7128,5,111000060,1
+7129,5,112000060,1
+7130,5,108000110,1
+7131,5,110000110,1
+7132,5,118000070,1
+7133,3,170004,3
+7134,3,180004,3
+7135,1,201000010,8
+7136,1,292000010,8
+7137,1,299000040,8
+7138,1,299000070,8
+7139,1,299000110,8
+7140,1,299000120,8
+7141,1,299000140,8
+7142,2,202000010,8
+7143,2,290000010,8
+7144,2,299000010,8
+7145,2,299000150,8
+7146,2,299000190,8
+7147,2,299000200,8
+7148,2,299000210,8
+7149,3,298000050,8
+7150,3,298000060,8
+7151,3,299000060,8
+7152,3,299000170,8
+7153,5,297000100,8
+7154,5,291000020,8
+7155,4,140000,3
+7156,5,150010,3
+7157,5,150020,3
+7158,5,150030,3
+7159,5,150040,3
+7160,5,190000,3
+7161,5,200000,3
+7162,5,210000,3
+7164,3,118000020,1
+7165,3,118000030,1
+7166,3,118000040,1
+7167,3,106000060,1
+7168,3,106000070,1
+7169,3,106000080,1
+7170,3,101000070,1
+7171,3,110000060,1
+7172,3,104000060,1
+7173,3,104000070,1
+7174,3,104000080,1
+7175,3,102000050,1
+7176,3,104000170,1
+7177,3,104000260,1
+7178,4,118000050,1
+7179,4,118000060,1
+7180,4,106000100,1
+7181,4,106000110,1
+7182,4,104000090,1
+7183,4,104000100,1
+7184,4,104000110,1
+7185,4,104000270,1
+7186,4,107000090,1
+7187,4,104000180,1
+7188,5,118000070,1
+7189,5,106000120,1
+7190,5,104000120,1
+7191,5,104000190,1
+7192,1,103000000,2
+7193,2,103000001,2
+7194,3,103000002,2
+7195,4,103000003,2
+7196,5,103000004,2
+7197,1,111000000,2
+7198,2,111000001,2
+7199,3,111000002,2
+7200,4,111000003,2
+7201,5,111000004,2
+7202,1,115000000,2
+7203,2,115000001,2
+7204,3,115000002,2
+7205,4,115000003,2
+7206,5,115000004,2
+7207,3,170004,3
+7208,4,170005,3
+7209,3,180004,3
+7210,4,180005,3
+7211,4,140000,3
+7212,4,150010,3
+7213,4,150020,3
+7214,4,150030,3
+7215,4,150040,3
+7217,3,111000010,1
+7218,3,111000020,1
+7219,3,111000030,1
+7220,3,112000020,1
+7221,3,112000030,1
+7222,3,108000060,1
+7223,3,108000070,1
+7224,3,108000080,1
+7225,3,107000050,1
+7226,3,112000010,1
+7227,3,110000070,1
+7228,3,110000080,1
+7229,4,111000040,1
+7230,4,112000040,1
+7231,4,108000100,1
+7232,4,105000090,1
+7233,4,110000100,1
+7234,5,111000060,1
+7235,5,112000060,1
+7236,5,108000110,1
+7237,5,110000110,1
+7238,1,108000000,2
+7239,2,108000001,2
+7240,3,108000002,2
+7241,4,108000003,2
+7242,5,108000004,2
+7243,1,107000000,2
+7244,2,107000001,2
+7245,3,107000002,2
+7246,4,107000003,2
+7247,5,107000004,2
+7248,1,120000000,2
+7249,2,120000001,2
+7250,3,120000002,2
+7251,4,120000003,2
+7252,5,120000004,2
+7253,4,110024,3
+7254,4,110034,3
+7255,4,110044,3
+7256,4,110054,3
+7257,3,110060,3
+7258,3,110070,3
+7259,3,110080,3
+7260,3,110090,3
+7261,3,110100,3
+7262,3,110110,3
+7263,3,110120,3
+7264,3,110130,3
+7265,3,110140,3
+7266,3,110150,3
+7267,3,110160,3
+7268,3,110170,3
+7269,3,110180,3
+7270,3,110190,3
+7271,3,110200,3
+7272,3,110210,3
+7273,3,110220,3
+7274,3,110230,3
+7275,3,110240,3
+7276,3,110250,3
+7277,3,110260,3
+7278,3,110270,3
+7279,3,110620,3
+7280,3,110670,3
+7281,4,140000,3
+7282,4,150010,3
+7283,4,150020,3
+7284,4,150030,3
+7285,4,150040,3
+7287,3,101000050,1
+7288,3,101000060,1
+7289,3,101000080,1
+7290,3,101000040,1
+7291,3,109000060,1
+7292,3,109000070,1
+7293,3,109000080,1
+7294,3,105000060,1
+7295,3,105000070,1
+7296,3,105000080,1
+7297,3,104000050,1
+7298,3,106000050,1
+7299,4,101000090,1
+7300,4,101000100,1
+7301,4,101000110,1
+7302,4,109000100,1
+7303,4,105000100,1
+7304,4,105000110,1
+7305,4,108000090,1
+7306,4,110000090,1
+7307,5,101000120,1
+7308,5,109000110,1
+7309,5,105000120,1
+7310,1,101000000,2
+7311,2,101000001,2
+7312,3,101000002,2
+7313,4,101000008,2
+7314,5,101000004,2
+7315,1,109000000,2
+7316,2,109000001,2
+7317,3,109000002,2
+7318,4,109000003,2
+7319,5,109000004,2
+7320,4,120024,3
+7321,4,120034,3
+7322,4,120044,3
+7323,4,120054,3
+7324,3,120241,3
+7325,3,120251,3
+7326,3,120261,3
+7327,3,120271,3
+7328,3,120300,3
+7329,3,120310,3
+7330,3,120320,3
+7331,3,120330,3
+7332,3,120340,3
+7333,3,120350,3
+7334,3,120360,3
+7335,3,120370,3
+7336,3,120380,3
+7337,3,120390,3
+7338,3,120400,3
+7339,3,120410,3
+7340,3,120420,3
+7341,3,120430,3
+7342,3,120450,3
+7343,3,120460,3
+7344,3,120550,3
+7345,3,120560,3
+7346,3,120570,3
+7347,3,120990,3
+7348,3,121000,3
+7349,3,121010,3
+7350,3,121020,3
+7351,4,140000,3
+7352,4,150010,3
+7353,4,150020,3
+7354,4,150030,3
+7355,4,150040,3
+7357,3,102000060,1
+7358,3,102000070,1
+7359,3,102000080,1
+7360,3,103000050,1
+7361,3,105000050,1
+7362,3,107000060,1
+7363,3,107000070,1
+7364,3,107000080,1
+7365,3,108000050,1
+7366,3,109000050,1
+7367,3,103000060,1
+7368,3,103000070,1
+7369,3,103000080,1
+7370,3,110000050,1
+7371,4,102000100,1
+7372,4,102000110,1
+7373,4,106000090,1
+7374,4,109000090,1
+7375,4,107000100,1
+7376,4,103000090,1
+7377,4,102000090,1
+7378,4,103000100,1
+7379,5,102000120,1
+7380,5,107000110,1
+7381,5,103000120,1
+7382,1,102000000,2
+7383,2,102000001,2
+7384,3,102000002,2
+7385,4,102000003,2
+7386,5,102000004,2
+7387,1,105000000,2
+7388,2,105000001,2
+7389,3,105000002,2
+7390,4,105000003,2
+7391,5,105000004,2
+7392,1,112000000,2
+7393,2,112000001,2
+7394,3,112000002,2
+7395,4,112000003,2
+7396,5,112000004,2
+7397,4,130024,3
+7398,4,130034,3
+7399,4,130044,3
+7400,4,130054,3
+7401,3,130060,3
+7402,3,130070,3
+7403,3,130080,3
+7404,3,130090,3
+7405,3,130100,3
+7406,3,130110,3
+7407,3,130120,3
+7408,3,130130,3
+7409,3,130140,3
+7410,3,130150,3
+7411,3,130160,3
+7412,3,130170,3
+7413,3,130180,3
+7414,3,130190,3
+7415,3,130200,3
+7416,3,130420,3
+7417,3,130510,3
+7418,3,130520,3
+7419,3,130530,3
+7420,3,130540,3
+7421,3,130660,3
+7422,3,130790,3
+7423,3,130800,3
+7424,4,140000,3
+7425,4,150010,3
+7426,4,150020,3
+7427,4,150030,3
+7428,4,150040,3
+7430,1,101000010,1
+7431,1,102000010,1
+7432,1,103000010,1
+7433,1,104000010,1
+7434,1,105000010,1
+7435,1,106000010,1
+7436,1,107000010,1
+7437,1,108000010,1
+7438,1,109000010,1
+7439,1,110000010,1
+7440,2,101000020,1
+7441,2,101000030,1
+7442,2,102000020,1
+7443,2,102000030,1
+7444,2,102000040,1
+7445,2,103000020,1
+7446,2,103000030,1
+7447,2,103000040,1
+7448,2,104000020,1
+7449,2,104000030,1
+7450,2,104000040,1
+7451,2,105000020,1
+7452,2,105000030,1
+7453,2,105000040,1
+7454,2,106000020,1
+7455,2,106000030,1
+7456,2,106000040,1
+7457,2,107000020,1
+7458,2,107000030,1
+7459,2,107000040,1
+7460,2,108000020,1
+7461,2,108000030,1
+7462,2,108000040,1
+7463,2,109000020,1
+7464,2,109000030,1
+7465,2,109000040,1
+7466,2,110000020,1
+7467,2,110000030,1
+7468,2,110000040,1
+7469,2,118000010,1
+7470,3,101000050,1
+7471,3,101000060,1
+7472,3,101000080,1
+7473,3,101000040,1
+7474,3,109000060,1
+7475,3,109000070,1
+7476,3,109000080,1
+7477,3,105000060,1
+7478,3,105000070,1
+7479,3,105000080,1
+7480,3,104000050,1
+7481,3,106000050,1
+7482,3,102000060,1
+7483,3,102000070,1
+7484,3,102000080,1
+7485,3,103000050,1
+7486,3,105000050,1
+7487,3,107000060,1
+7488,3,107000070,1
+7489,3,107000080,1
+7490,3,108000050,1
+7491,3,109000050,1
+7492,3,103000060,1
+7493,3,103000070,1
+7494,3,103000080,1
+7495,3,110000050,1
+7496,3,106000060,1
+7497,3,106000070,1
+7498,3,106000080,1
+7499,3,101000070,1
+7500,3,110000060,1
+7501,3,104000060,1
+7502,3,104000070,1
+7503,3,104000080,1
+7504,3,102000050,1
+7505,3,104000170,1
+7506,3,104000260,1
+7507,3,111000010,1
+7508,3,111000020,1
+7509,3,111000030,1
+7510,3,112000020,1
+7511,3,112000030,1
+7512,3,108000060,1
+7513,3,108000070,1
+7514,3,108000080,1
+7515,3,107000050,1
+7516,3,112000010,1
+7517,3,110000070,1
+7518,3,110000080,1
+7519,3,118000020,1
+7520,3,118000030,1
+7521,3,118000040,1
+7522,4,101000090,1
+7523,4,101000100,1
+7524,4,101000110,1
+7525,4,109000100,1
+7526,4,105000100,1
+7527,4,105000110,1
+7528,4,108000090,1
+7529,4,110000090,1
+7530,4,102000100,1
+7531,4,102000110,1
+7532,4,106000090,1
+7533,4,109000090,1
+7534,4,107000100,1
+7535,4,103000090,1
+7536,4,102000090,1
+7537,4,103000100,1
+7538,4,106000100,1
+7539,4,106000110,1
+7540,4,104000090,1
+7541,4,104000100,1
+7542,4,104000110,1
+7543,4,107000090,1
+7544,4,104000180,1
+7545,4,111000040,1
+7546,4,112000040,1
+7547,4,108000100,1
+7548,4,105000090,1
+7549,4,110000100,1
+7550,4,118000050,1
+7551,4,118000060,1
+7552,5,101000120,1
+7553,5,109000110,1
+7554,5,105000120,1
+7555,5,102000120,1
+7556,5,107000110,1
+7557,5,103000120,1
+7558,5,106000120,1
+7559,5,104000120,1
+7560,5,104000190,1
+7561,5,111000060,1
+7562,5,112000060,1
+7563,5,108000110,1
+7564,5,110000110,1
+7565,5,118000070,1
+7566,1,170002,3
+7567,2,170003,3
+7568,3,170004,3
+7569,1,180002,3
+7570,2,180003,3
+7571,3,180004,3
+7572,1,201000010,8
+7573,1,292000010,8
+7574,1,299000040,8
+7575,1,299000070,8
+7576,1,299000110,8
+7577,1,299000120,8
+7578,1,299000140,8
+7579,2,202000010,8
+7580,2,290000010,8
+7581,2,299000010,8
+7582,2,299000150,8
+7583,2,299000190,8
+7584,2,299000200,8
+7585,2,299000210,8
+7586,3,298000050,8
+7587,3,298000060,8
+7588,3,299000060,8
+7589,3,299000170,8
+7590,3,290000120,8
+7591,3,291000050,8
+7592,3,292000020,8
+7593,4,299000670,8
+7594,4,299000680,8
+7595,4,204000010,8
+7596,5,297000100,8
+7597,5,291000020,8
+7598,5,297000130,8
+7599,5,297000140,8
+7600,5,203000010,8
+7601,4,140000,3
+7602,5,150010,3
+7603,5,150020,3
+7604,5,150030,3
+7605,5,150040,3
+7607,1,101000010,1
+7608,1,102000010,1
+7609,1,103000010,1
+7610,1,104000010,1
+7611,1,105000010,1
+7612,1,106000010,1
+7613,1,107000010,1
+7614,1,108000010,1
+7615,1,109000010,1
+7616,1,110000010,1
+7617,2,101000020,1
+7618,2,101000030,1
+7619,2,102000020,1
+7620,2,102000030,1
+7621,2,102000040,1
+7622,2,103000020,1
+7623,2,103000030,1
+7624,2,103000040,1
+7625,2,104000020,1
+7626,2,104000030,1
+7627,2,104000040,1
+7628,2,105000020,1
+7629,2,105000030,1
+7630,2,105000040,1
+7631,2,106000020,1
+7632,2,106000030,1
+7633,2,106000040,1
+7634,2,107000020,1
+7635,2,107000030,1
+7636,2,107000040,1
+7637,2,108000020,1
+7638,2,108000030,1
+7639,2,108000040,1
+7640,2,109000020,1
+7641,2,109000030,1
+7642,2,109000040,1
+7643,2,110000020,1
+7644,2,110000030,1
+7645,2,110000040,1
+7646,2,118000010,1
+7647,3,101000050,1
+7648,3,101000060,1
+7649,3,101000080,1
+7650,3,101000040,1
+7651,3,109000060,1
+7652,3,109000070,1
+7653,3,109000080,1
+7654,3,105000060,1
+7655,3,105000070,1
+7656,3,105000080,1
+7657,3,104000050,1
+7658,3,106000050,1
+7659,3,102000060,1
+7660,3,102000070,1
+7661,3,102000080,1
+7662,3,103000050,1
+7663,3,105000050,1
+7664,3,107000060,1
+7665,3,107000070,1
+7666,3,107000080,1
+7667,3,108000050,1
+7668,3,109000050,1
+7669,3,103000060,1
+7670,3,103000070,1
+7671,3,103000080,1
+7672,3,110000050,1
+7673,3,106000060,1
+7674,3,106000070,1
+7675,3,106000080,1
+7676,3,101000070,1
+7677,3,110000060,1
+7678,3,104000060,1
+7679,3,104000070,1
+7680,3,104000080,1
+7681,3,102000050,1
+7682,3,104000170,1
+7683,3,104000260,1
+7684,3,111000010,1
+7685,3,111000020,1
+7686,3,111000030,1
+7687,3,112000020,1
+7688,3,112000030,1
+7689,3,108000060,1
+7690,3,108000070,1
+7691,3,108000080,1
+7692,3,107000050,1
+7693,3,112000010,1
+7694,3,110000070,1
+7695,3,110000080,1
+7696,3,118000020,1
+7697,3,118000030,1
+7698,3,118000040,1
+7699,4,101000090,1
+7700,4,101000100,1
+7701,4,101000110,1
+7702,4,109000100,1
+7703,4,105000100,1
+7704,4,105000110,1
+7705,4,108000090,1
+7706,4,110000090,1
+7707,4,102000100,1
+7708,4,102000110,1
+7709,4,106000090,1
+7710,4,109000090,1
+7711,4,107000100,1
+7712,4,103000090,1
+7713,4,102000090,1
+7714,4,103000100,1
+7715,4,106000100,1
+7716,4,106000110,1
+7717,4,104000090,1
+7718,4,104000100,1
+7719,4,104000110,1
+7720,4,107000090,1
+7721,4,104000180,1
+7722,4,111000040,1
+7723,4,112000040,1
+7724,4,108000100,1
+7725,4,105000090,1
+7726,4,110000100,1
+7727,4,118000050,1
+7728,4,118000060,1
+7729,5,101000120,1
+7730,5,109000110,1
+7731,5,105000120,1
+7732,5,102000120,1
+7733,5,107000110,1
+7734,5,103000120,1
+7735,5,106000120,1
+7736,5,104000120,1
+7737,5,104000190,1
+7738,5,111000060,1
+7739,5,112000060,1
+7740,5,108000110,1
+7741,5,110000110,1
+7742,5,118000070,1
+7743,2,170003,3
+7744,3,170004,3
+7745,2,180003,3
+7746,3,180004,3
+7747,1,201000010,8
+7748,1,292000010,8
+7749,1,299000040,8
+7750,1,299000070,8
+7751,1,299000110,8
+7752,1,299000120,8
+7753,1,299000140,8
+7754,2,202000010,8
+7755,2,290000010,8
+7756,2,299000010,8
+7757,2,299000150,8
+7758,2,299000190,8
+7759,2,299000200,8
+7760,2,299000210,8
+7761,3,298000050,8
+7762,3,298000060,8
+7763,3,299000060,8
+7764,3,299000170,8
+7765,3,290000120,8
+7766,3,291000050,8
+7767,3,292000020,8
+7768,4,299000670,8
+7769,4,299000680,8
+7770,4,204000010,8
+7771,5,297000100,8
+7772,5,291000020,8
+7773,5,297000130,8
+7774,5,297000140,8
+7775,5,203000010,8
+7776,4,140000,3
+7777,5,150010,3
+7778,5,150020,3
+7779,5,150030,3
+7780,5,150040,3
+7782,3,101000050,1
+7783,3,101000060,1
+7784,3,101000080,1
+7785,3,101000040,1
+7786,3,109000060,1
+7787,3,109000070,1
+7788,3,109000080,1
+7789,3,105000060,1
+7790,3,105000070,1
+7791,3,105000080,1
+7792,3,104000050,1
+7793,3,106000050,1
+7794,3,102000060,1
+7795,3,102000070,1
+7796,3,102000080,1
+7797,3,103000050,1
+7798,3,105000050,1
+7799,3,107000060,1
+7800,3,107000070,1
+7801,3,107000080,1
+7802,3,108000050,1
+7803,3,109000050,1
+7804,3,103000060,1
+7805,3,103000070,1
+7806,3,103000080,1
+7807,3,110000050,1
+7808,3,106000060,1
+7809,3,106000070,1
+7810,3,106000080,1
+7811,3,101000070,1
+7812,3,110000060,1
+7813,3,104000060,1
+7814,3,104000070,1
+7815,3,104000080,1
+7816,3,102000050,1
+7817,3,104000170,1
+7818,3,104000260,1
+7819,3,111000010,1
+7820,3,111000020,1
+7821,3,111000030,1
+7822,3,112000020,1
+7823,3,112000030,1
+7824,3,108000060,1
+7825,3,108000070,1
+7826,3,108000080,1
+7827,3,107000050,1
+7828,3,112000010,1
+7829,3,110000070,1
+7830,3,110000080,1
+7831,3,118000020,1
+7832,3,118000030,1
+7833,3,118000040,1
+7834,4,101000090,1
+7835,4,101000100,1
+7836,4,101000110,1
+7837,4,109000100,1
+7838,4,105000100,1
+7839,4,105000110,1
+7840,4,108000090,1
+7841,4,110000090,1
+7842,4,102000100,1
+7843,4,102000110,1
+7844,4,106000090,1
+7845,4,109000090,1
+7846,4,107000100,1
+7847,4,103000090,1
+7848,4,102000090,1
+7849,4,103000100,1
+7850,4,106000100,1
+7851,4,106000110,1
+7852,4,104000090,1
+7853,4,104000100,1
+7854,4,104000110,1
+7855,4,107000090,1
+7856,4,104000180,1
+7857,4,111000040,1
+7858,4,112000040,1
+7859,4,108000100,1
+7860,4,105000090,1
+7861,4,110000100,1
+7862,4,118000050,1
+7863,4,118000060,1
+7864,5,101000120,1
+7865,5,109000110,1
+7866,5,105000120,1
+7867,5,102000120,1
+7868,5,107000110,1
+7869,5,103000120,1
+7870,5,106000120,1
+7871,5,104000120,1
+7872,5,104000190,1
+7873,5,111000060,1
+7874,5,112000060,1
+7875,5,108000110,1
+7876,5,110000110,1
+7877,5,118000070,1
+7878,3,170004,3
+7879,3,180004,3
+7880,1,201000010,8
+7881,1,292000010,8
+7882,1,299000040,8
+7883,1,299000070,8
+7884,1,299000110,8
+7885,1,299000120,8
+7886,1,299000140,8
+7887,2,202000010,8
+7888,2,290000010,8
+7889,2,299000010,8
+7890,2,299000150,8
+7891,2,299000190,8
+7892,2,299000200,8
+7893,2,299000210,8
+7894,3,298000050,8
+7895,3,298000060,8
+7896,3,299000060,8
+7897,3,299000170,8
+7898,3,290000120,8
+7899,3,291000050,8
+7900,3,292000020,8
+7901,4,299000670,8
+7902,4,299000680,8
+7903,4,204000010,8
+7904,5,297000100,8
+7905,5,291000020,8
+7906,5,297000130,8
+7907,5,297000140,8
+7908,5,203000010,8
+7909,4,140000,3
+7910,5,150010,3
+7911,5,150020,3
+7912,5,150030,3
+7913,5,150040,3
+7915,3,101000050,1
+7916,3,101000060,1
+7917,3,101000080,1
+7918,3,101000040,1
+7919,3,109000060,1
+7920,3,109000070,1
+7921,3,109000080,1
+7922,3,105000060,1
+7923,3,105000070,1
+7924,3,105000080,1
+7925,3,104000050,1
+7926,3,106000050,1
+7927,3,102000060,1
+7928,3,102000070,1
+7929,3,102000080,1
+7930,3,103000050,1
+7931,3,105000050,1
+7932,3,107000060,1
+7933,3,107000070,1
+7934,3,107000080,1
+7935,3,108000050,1
+7936,3,109000050,1
+7937,3,103000060,1
+7938,3,103000070,1
+7939,3,103000080,1
+7940,3,110000050,1
+7941,3,106000060,1
+7942,3,106000070,1
+7943,3,106000080,1
+7944,3,101000070,1
+7945,3,110000060,1
+7946,3,104000060,1
+7947,3,104000070,1
+7948,3,104000080,1
+7949,3,102000050,1
+7950,3,104000170,1
+7951,3,104000260,1
+7952,3,111000010,1
+7953,3,111000020,1
+7954,3,111000030,1
+7955,3,112000020,1
+7956,3,112000030,1
+7957,3,108000060,1
+7958,3,108000070,1
+7959,3,108000080,1
+7960,3,107000050,1
+7961,3,112000010,1
+7962,3,110000070,1
+7963,3,110000080,1
+7964,3,118000020,1
+7965,3,118000030,1
+7966,3,118000040,1
+7967,4,101000090,1
+7968,4,101000100,1
+7969,4,101000110,1
+7970,4,109000100,1
+7971,4,105000100,1
+7972,4,105000110,1
+7973,4,108000090,1
+7974,4,110000090,1
+7975,4,102000100,1
+7976,4,102000110,1
+7977,4,106000090,1
+7978,4,109000090,1
+7979,4,107000100,1
+7980,4,103000090,1
+7981,4,102000090,1
+7982,4,103000100,1
+7983,4,106000100,1
+7984,4,106000110,1
+7985,4,104000090,1
+7986,4,104000100,1
+7987,4,104000110,1
+7988,4,107000090,1
+7989,4,104000180,1
+7990,4,111000040,1
+7991,4,112000040,1
+7992,4,108000100,1
+7993,4,105000090,1
+7994,4,110000100,1
+7995,4,118000050,1
+7996,4,118000060,1
+7997,5,101000120,1
+7998,5,109000110,1
+7999,5,105000120,1
+8000,5,102000120,1
+8001,5,107000110,1
+8002,5,103000120,1
+8003,5,106000120,1
+8004,5,104000120,1
+8005,5,104000190,1
+8006,5,111000060,1
+8007,5,112000060,1
+8008,5,108000110,1
+8009,5,110000110,1
+8010,5,118000070,1
+8011,3,170004,3
+8012,3,180004,3
+8013,1,201000010,8
+8014,1,292000010,8
+8015,1,299000040,8
+8016,1,299000070,8
+8017,1,299000110,8
+8018,1,299000120,8
+8019,1,299000140,8
+8020,2,202000010,8
+8021,2,290000010,8
+8022,2,299000010,8
+8023,2,299000150,8
+8024,2,299000190,8
+8025,2,299000200,8
+8026,2,299000210,8
+8027,3,298000050,8
+8028,3,298000060,8
+8029,3,299000060,8
+8030,3,299000170,8
+8031,3,290000120,8
+8032,3,291000050,8
+8033,3,292000020,8
+8034,4,299000670,8
+8035,4,299000680,8
+8036,4,204000010,8
+8037,5,297000100,8
+8038,5,291000020,8
+8039,5,297000130,8
+8040,5,297000140,8
+8041,5,203000010,8
+8042,4,140000,3
+8043,5,150010,3
+8044,5,150020,3
+8045,5,150030,3
+8046,5,150040,3
+8048,3,101000050,1
+8049,3,101000060,1
+8050,3,101000080,1
+8051,3,101000040,1
+8052,3,109000060,1
+8053,3,109000070,1
+8054,3,109000080,1
+8055,3,105000060,1
+8056,3,105000070,1
+8057,3,105000080,1
+8058,3,104000050,1
+8059,3,106000050,1
+8060,3,102000060,1
+8061,3,102000070,1
+8062,3,102000080,1
+8063,3,103000050,1
+8064,3,105000050,1
+8065,3,107000060,1
+8066,3,107000070,1
+8067,3,107000080,1
+8068,3,108000050,1
+8069,3,109000050,1
+8070,3,103000060,1
+8071,3,103000070,1
+8072,3,103000080,1
+8073,3,110000050,1
+8074,3,106000060,1
+8075,3,106000070,1
+8076,3,106000080,1
+8077,3,101000070,1
+8078,3,110000060,1
+8079,3,104000060,1
+8080,3,104000070,1
+8081,3,104000080,1
+8082,3,102000050,1
+8083,3,104000170,1
+8084,3,104000260,1
+8085,3,111000010,1
+8086,3,111000020,1
+8087,3,111000030,1
+8088,3,112000020,1
+8089,3,112000030,1
+8090,3,108000060,1
+8091,3,108000070,1
+8092,3,108000080,1
+8093,3,107000050,1
+8094,3,112000010,1
+8095,3,110000070,1
+8096,3,110000080,1
+8097,3,118000020,1
+8098,3,118000030,1
+8099,3,118000040,1
+8100,4,101000090,1
+8101,4,101000100,1
+8102,4,101000110,1
+8103,4,109000100,1
+8104,4,105000100,1
+8105,4,105000110,1
+8106,4,108000090,1
+8107,4,110000090,1
+8108,4,102000100,1
+8109,4,102000110,1
+8110,4,106000090,1
+8111,4,109000090,1
+8112,4,107000100,1
+8113,4,103000090,1
+8114,4,102000090,1
+8115,4,103000100,1
+8116,4,106000100,1
+8117,4,106000110,1
+8118,4,104000090,1
+8119,4,104000100,1
+8120,4,104000110,1
+8121,4,107000090,1
+8122,4,104000180,1
+8123,4,111000040,1
+8124,4,112000040,1
+8125,4,108000100,1
+8126,4,105000090,1
+8127,4,110000100,1
+8128,4,118000050,1
+8129,4,118000060,1
+8130,5,101000120,1
+8131,5,109000110,1
+8132,5,105000120,1
+8133,5,102000120,1
+8134,5,107000110,1
+8135,5,103000120,1
+8136,5,106000120,1
+8137,5,104000120,1
+8138,5,104000190,1
+8139,5,111000060,1
+8140,5,112000060,1
+8141,5,108000110,1
+8142,5,110000110,1
+8143,5,118000070,1
+8144,3,170004,3
+8145,3,180004,3
+8146,1,201000010,8
+8147,1,292000010,8
+8148,1,299000040,8
+8149,1,299000070,8
+8150,1,299000110,8
+8151,1,299000120,8
+8152,1,299000140,8
+8153,2,202000010,8
+8154,2,290000010,8
+8155,2,299000010,8
+8156,2,299000150,8
+8157,2,299000190,8
+8158,2,299000200,8
+8159,2,299000210,8
+8160,3,298000050,8
+8161,3,298000060,8
+8162,3,299000060,8
+8163,3,299000170,8
+8164,3,290000120,8
+8165,3,291000050,8
+8166,3,292000020,8
+8167,4,299000670,8
+8168,4,299000680,8
+8169,4,204000010,8
+8170,5,297000100,8
+8171,5,291000020,8
+8172,5,297000130,8
+8173,5,297000140,8
+8174,5,203000010,8
+8175,4,140000,3
+8176,5,150010,3
+8177,5,150020,3
+8178,5,150030,3
+8179,5,150040,3
+8180,5,190000,3
+8181,5,200000,3
+8182,5,210000,3
+8184,3,102000060,1
+8185,3,102000070,1
+8186,3,102000080,1
+8187,3,103000050,1
+8188,3,105000050,1
+8189,3,107000060,1
+8190,3,107000070,1
+8191,3,107000080,1
+8192,3,108000050,1
+8193,3,109000050,1
+8194,3,103000060,1
+8195,3,103000070,1
+8196,3,103000080,1
+8197,3,110000050,1
+8198,4,102000100,1
+8199,4,102000110,1
+8200,4,106000090,1
+8201,4,109000090,1
+8202,4,107000100,1
+8203,4,103000090,1
+8204,4,102000090,1
+8205,4,103000100,1
+8206,5,102000120,1
+8207,5,107000110,1
+8208,5,103000120,1
+8209,1,102000000,2
+8210,2,102000001,2
+8211,3,102000002,2
+8212,4,102000003,2
+8213,5,102000004,2
+8214,1,105000000,2
+8215,2,105000001,2
+8216,3,105000002,2
+8217,4,105000003,2
+8218,5,105000004,2
+8219,1,112000000,2
+8220,2,112000001,2
+8221,3,112000002,2
+8222,4,112000003,2
+8223,5,112000004,2
+8224,3,170004,3
+8225,4,170005,3
+8226,3,180004,3
+8227,4,180005,3
+8228,4,140000,3
+8229,4,150010,3
+8230,4,150020,3
+8231,4,150030,3
+8232,4,150040,3
+8234,3,118000020,1
+8235,3,118000030,1
+8236,3,118000040,1
+8237,3,106000060,1
+8238,3,106000070,1
+8239,3,106000080,1
+8240,3,101000070,1
+8241,3,110000060,1
+8242,3,104000060,1
+8243,3,104000070,1
+8244,3,104000080,1
+8245,3,102000050,1
+8246,3,104000170,1
+8247,3,104000260,1
+8248,4,118000050,1
+8249,4,118000060,1
+8250,4,106000100,1
+8251,4,106000110,1
+8252,4,104000090,1
+8253,4,104000100,1
+8254,4,104000110,1
+8255,4,104000270,1
+8256,4,107000090,1
+8257,4,104000180,1
+8258,5,118000070,1
+8259,5,106000120,1
+8260,5,104000120,1
+8261,5,104000190,1
+8262,1,103000000,2
+8263,2,103000001,2
+8264,3,103000002,2
+8265,4,103000003,2
+8266,5,103000004,2
+8267,1,111000000,2
+8268,2,111000001,2
+8269,3,111000002,2
+8270,4,111000003,2
+8271,5,111000004,2
+8272,1,115000000,2
+8273,2,115000001,2
+8274,3,115000002,2
+8275,4,115000003,2
+8276,5,115000004,2
+8277,4,110024,3
+8278,4,110034,3
+8279,4,110044,3
+8280,4,110054,3
+8281,3,110060,3
+8282,3,110070,3
+8283,3,110080,3
+8284,3,110090,3
+8285,3,110100,3
+8286,3,110110,3
+8287,3,110120,3
+8288,3,110130,3
+8289,3,110140,3
+8290,3,110150,3
+8291,3,110160,3
+8292,3,110170,3
+8293,3,110180,3
+8294,3,110190,3
+8295,3,110200,3
+8296,3,110210,3
+8297,3,110220,3
+8298,3,110230,3
+8299,3,110240,3
+8300,3,110250,3
+8301,3,110260,3
+8302,3,110270,3
+8303,3,110620,3
+8304,3,110670,3
+8305,4,140000,3
+8306,4,150010,3
+8307,4,150020,3
+8308,4,150030,3
+8309,4,150040,3
+8311,3,111000010,1
+8312,3,111000020,1
+8313,3,111000030,1
+8314,3,112000020,1
+8315,3,112000030,1
+8316,3,108000060,1
+8317,3,108000070,1
+8318,3,108000080,1
+8319,3,107000050,1
+8320,3,112000010,1
+8321,3,110000070,1
+8322,3,110000080,1
+8323,4,111000040,1
+8324,4,112000040,1
+8325,4,108000100,1
+8326,4,105000090,1
+8327,4,110000100,1
+8328,5,111000060,1
+8329,5,112000060,1
+8330,5,108000110,1
+8331,5,110000110,1
+8332,1,108000000,2
+8333,2,108000001,2
+8334,3,108000002,2
+8335,4,108000003,2
+8336,5,108000004,2
+8337,1,107000000,2
+8338,2,107000001,2
+8339,3,107000002,2
+8340,4,107000003,2
+8341,5,107000004,2
+8342,1,120000000,2
+8343,2,120000001,2
+8344,3,120000002,2
+8345,4,120000003,2
+8346,5,120000004,2
+8347,4,120024,3
+8348,4,120034,3
+8349,4,120044,3
+8350,4,120054,3
+8351,3,120241,3
+8352,3,120251,3
+8353,3,120261,3
+8354,3,120271,3
+8355,3,120300,3
+8356,3,120310,3
+8357,3,120320,3
+8358,3,120330,3
+8359,3,120340,3
+8360,3,120350,3
+8361,3,120360,3
+8362,3,120370,3
+8363,3,120380,3
+8364,3,120390,3
+8365,3,120400,3
+8366,3,120410,3
+8367,3,120420,3
+8368,3,120430,3
+8369,3,120450,3
+8370,3,120460,3
+8371,3,120550,3
+8372,3,120560,3
+8373,3,120570,3
+8374,3,120990,3
+8375,3,121000,3
+8376,3,121010,3
+8377,3,121020,3
+8378,4,140000,3
+8379,4,150010,3
+8380,4,150020,3
+8381,4,150030,3
+8382,4,150040,3
+8384,3,101000050,1
+8385,3,101000060,1
+8386,3,101000080,1
+8387,3,101000040,1
+8388,3,109000060,1
+8389,3,109000070,1
+8390,3,109000080,1
+8391,3,105000060,1
+8392,3,105000070,1
+8393,3,105000080,1
+8394,3,104000050,1
+8395,3,106000050,1
+8396,4,101000090,1
+8397,4,101000100,1
+8398,4,101000110,1
+8399,4,109000100,1
+8400,4,105000100,1
+8401,4,105000110,1
+8402,4,108000090,1
+8403,4,110000090,1
+8404,5,101000120,1
+8405,5,109000110,1
+8406,5,105000120,1
+8407,1,101000000,2
+8408,2,101000001,2
+8409,3,101000002,2
+8410,4,101000008,2
+8411,5,101000004,2
+8412,1,109000000,2
+8413,2,109000001,2
+8414,3,109000002,2
+8415,4,109000003,2
+8416,5,109000004,2
+8417,4,130024,3
+8418,4,130034,3
+8419,4,130044,3
+8420,4,130054,3
+8421,3,130060,3
+8422,3,130070,3
+8423,3,130080,3
+8424,3,130090,3
+8425,3,130100,3
+8426,3,130110,3
+8427,3,130120,3
+8428,3,130130,3
+8429,3,130140,3
+8430,3,130150,3
+8431,3,130160,3
+8432,3,130170,3
+8433,3,130180,3
+8434,3,130190,3
+8435,3,130200,3
+8436,3,130420,3
+8437,3,130510,3
+8438,3,130520,3
+8439,3,130531,3
+8440,3,130540,3
+8441,3,130660,3
+8442,3,130790,3
+8443,3,130800,3
+8444,3,131130,3
+8445,4,140000,3
+8446,4,150010,3
+8447,4,150020,3
+8448,4,150030,3
+8449,4,150040,3
+8451,1,101000000,2
+8452,2,101000001,2
+8453,3,101000002,2
+8454,4,101000008,2
+8455,5,101000004,2
+8456,1,102000000,2
+8457,2,102000001,2
+8458,3,102000002,2
+8459,4,102000003,2
+8460,5,102000004,2
+8461,1,103000000,2
+8462,2,103000001,2
+8463,3,103000002,2
+8464,4,103000003,2
+8465,5,103000004,2
+8466,1,105000000,2
+8467,2,105000001,2
+8468,3,105000002,2
+8469,4,105000003,2
+8470,5,105000004,2
+8471,1,108000000,2
+8472,2,108000001,2
+8473,3,108000002,2
+8474,4,108000003,2
+8475,5,108000004,2
+8476,1,109000000,2
+8477,2,109000001,2
+8478,3,109000002,2
+8479,4,109000003,2
+8480,5,109000004,2
+8481,1,111000000,2
+8482,2,111000001,2
+8483,3,111000002,2
+8484,4,111000003,2
+8485,5,111000004,2
+8486,1,112000000,2
+8487,2,112000001,2
+8488,3,112000002,2
+8489,4,112000003,2
+8490,5,112000004,2
+8491,1,120000000,2
+8492,2,120000001,2
+8493,3,120000002,2
+8494,4,120000003,2
+8495,5,120000004,2
+8496,1,101000010,1
+8497,2,101000020,1
+8498,2,101000030,1
+8499,3,101000040,1
+8500,3,101000050,1
+8501,3,101000060,1
+8502,3,101000070,1
+8503,3,101000080,1
+8504,1,102000010,1
+8505,2,102000020,1
+8506,2,102000030,1
+8507,2,102000040,1
+8508,3,102000050,1
+8509,3,102000060,1
+8510,3,102000070,1
+8511,3,102000080,1
+8512,1,103000010,1
+8513,2,103000020,1
+8514,2,103000030,1
+8515,2,103000040,1
+8516,3,103000050,1
+8517,3,103000060,1
+8518,3,103000070,1
+8519,3,103000080,1
+8520,1,104000010,1
+8521,2,104000020,1
+8522,2,104000030,1
+8523,2,104000040,1
+8524,3,104000050,1
+8525,3,104000060,1
+8526,3,104000070,1
+8527,3,104000080,1
+8528,1,105000010,1
+8529,2,105000020,1
+8530,2,105000030,1
+8531,2,105000040,1
+8532,3,105000050,1
+8533,3,105000060,1
+8534,3,105000070,1
+8535,3,105000080,1
+8536,1,106000010,1
+8537,2,106000020,1
+8538,2,106000030,1
+8539,2,106000040,1
+8540,3,106000050,1
+8541,3,106000060,1
+8542,3,106000070,1
+8543,3,106000080,1
+8544,1,107000010,1
+8545,2,107000020,1
+8546,2,107000030,1
+8547,2,107000040,1
+8548,3,107000050,1
+8549,3,107000060,1
+8550,3,107000070,1
+8551,3,107000080,1
+8552,1,108000010,1
+8553,2,108000020,1
+8554,2,108000030,1
+8555,2,108000040,1
+8556,3,108000050,1
+8557,3,108000060,1
+8558,3,108000070,1
+8559,3,108000080,1
+8560,2,180000,3
+8561,2,170002,3
+8562,3,170003,3
+8563,4,170004,3
+8565,1,101000000,2
+8566,2,101000001,2
+8567,3,101000002,2
+8568,4,101000008,2
+8569,5,101000004,2
+8570,1,102000000,2
+8571,2,102000001,2
+8572,3,102000002,2
+8573,4,102000003,2
+8574,5,102000004,2
+8575,1,103000000,2
+8576,2,103000001,2
+8577,3,103000002,2
+8578,4,103000003,2
+8579,5,103000004,2
+8580,1,105000000,2
+8581,2,105000001,2
+8582,3,105000002,2
+8583,4,105000003,2
+8584,5,105000004,2
+8585,1,108000000,2
+8586,2,108000001,2
+8587,3,108000002,2
+8588,4,108000003,2
+8589,5,108000004,2
+8590,1,109000000,2
+8591,2,109000001,2
+8592,3,109000002,2
+8593,4,109000003,2
+8594,5,109000004,2
+8595,1,111000000,2
+8596,2,111000001,2
+8597,3,111000002,2
+8598,4,111000003,2
+8599,5,111000004,2
+8600,1,112000000,2
+8601,2,112000001,2
+8602,3,112000002,2
+8603,4,112000003,2
+8604,5,112000004,2
+8605,1,120000000,2
+8606,2,120000001,2
+8607,3,120000002,2
+8608,4,120000003,2
+8609,5,120000004,2
+8610,1,101000010,1
+8611,2,101000020,1
+8612,2,101000030,1
+8613,3,101000040,1
+8614,3,101000050,1
+8615,3,101000060,1
+8616,3,101000070,1
+8617,3,101000080,1
+8618,1,102000010,1
+8619,2,102000020,1
+8620,2,102000030,1
+8621,2,102000040,1
+8622,3,102000050,1
+8623,3,102000060,1
+8624,3,102000070,1
+8625,3,102000080,1
+8626,1,103000010,1
+8627,2,103000020,1
+8628,2,103000030,1
+8629,2,103000040,1
+8630,3,103000050,1
+8631,3,103000060,1
+8632,3,103000070,1
+8633,3,103000080,1
+8634,1,104000010,1
+8635,2,104000020,1
+8636,2,104000030,1
+8637,2,104000040,1
+8638,3,104000050,1
+8639,3,104000060,1
+8640,3,104000070,1
+8641,3,104000080,1
+8642,1,105000010,1
+8643,2,105000020,1
+8644,2,105000030,1
+8645,2,105000040,1
+8646,3,105000050,1
+8647,3,105000060,1
+8648,3,105000070,1
+8649,3,105000080,1
+8650,1,106000010,1
+8651,2,106000020,1
+8652,2,106000030,1
+8653,2,106000040,1
+8654,3,106000050,1
+8655,3,106000060,1
+8656,3,106000070,1
+8657,3,106000080,1
+8658,1,107000010,1
+8659,2,107000020,1
+8660,2,107000030,1
+8661,2,107000040,1
+8662,3,107000050,1
+8663,3,107000060,1
+8664,3,107000070,1
+8665,3,107000080,1
+8666,1,108000010,1
+8667,2,108000020,1
+8668,2,108000030,1
+8669,2,108000040,1
+8670,3,108000050,1
+8671,3,108000060,1
+8672,3,108000070,1
+8673,3,108000080,1
+8674,2,180000,3
+8675,2,170002,3
+8676,3,170003,3
+8677,4,170004,3
+8679,1,101000000,2
+8680,2,101000001,2
+8681,3,101000002,2
+8682,4,101000008,2
+8683,5,101000004,2
+8684,1,102000000,2
+8685,2,102000001,2
+8686,3,102000002,2
+8687,4,102000003,2
+8688,5,102000004,2
+8689,1,103000000,2
+8690,2,103000001,2
+8691,3,103000002,2
+8692,4,103000003,2
+8693,5,103000004,2
+8694,1,105000000,2
+8695,2,105000001,2
+8696,3,105000002,2
+8697,4,105000003,2
+8698,5,105000004,2
+8699,1,108000000,2
+8700,2,108000001,2
+8701,3,108000002,2
+8702,4,108000003,2
+8703,5,108000004,2
+8704,1,109000000,2
+8705,2,109000001,2
+8706,3,109000002,2
+8707,4,109000003,2
+8708,5,109000004,2
+8709,1,111000000,2
+8710,2,111000001,2
+8711,3,111000002,2
+8712,4,111000003,2
+8713,5,111000004,2
+8714,1,112000000,2
+8715,2,112000001,2
+8716,3,112000002,2
+8717,4,112000003,2
+8718,5,112000004,2
+8719,1,120000000,2
+8720,2,120000001,2
+8721,3,120000002,2
+8722,4,120000003,2
+8723,5,120000004,2
+8724,1,101000010,1
+8725,2,101000020,1
+8726,2,101000030,1
+8727,3,101000040,1
+8728,3,101000050,1
+8729,3,101000060,1
+8730,3,101000070,1
+8731,3,101000080,1
+8732,1,102000010,1
+8733,2,102000020,1
+8734,2,102000030,1
+8735,2,102000040,1
+8736,3,102000050,1
+8737,3,102000060,1
+8738,3,102000070,1
+8739,3,102000080,1
+8740,1,103000010,1
+8741,2,103000020,1
+8742,2,103000030,1
+8743,2,103000040,1
+8744,3,103000050,1
+8745,3,103000060,1
+8746,3,103000070,1
+8747,3,103000080,1
+8748,1,104000010,1
+8749,2,104000020,1
+8750,2,104000030,1
+8751,2,104000040,1
+8752,3,104000050,1
+8753,3,104000060,1
+8754,3,104000070,1
+8755,3,104000080,1
+8756,1,105000010,1
+8757,2,105000020,1
+8758,2,105000030,1
+8759,2,105000040,1
+8760,3,105000050,1
+8761,3,105000060,1
+8762,3,105000070,1
+8763,3,105000080,1
+8764,1,106000010,1
+8765,2,106000020,1
+8766,2,106000030,1
+8767,2,106000040,1
+8768,3,106000050,1
+8769,3,106000060,1
+8770,3,106000070,1
+8771,3,106000080,1
+8772,1,107000010,1
+8773,2,107000020,1
+8774,2,107000030,1
+8775,2,107000040,1
+8776,3,107000050,1
+8777,3,107000060,1
+8778,3,107000070,1
+8779,3,107000080,1
+8780,1,108000010,1
+8781,2,108000020,1
+8782,2,108000030,1
+8783,2,108000040,1
+8784,3,108000050,1
+8785,3,108000060,1
+8786,3,108000070,1
+8787,3,108000080,1
+8788,2,180001,3
+8789,2,170002,3
+8790,3,170003,3
+8791,4,170004,3
+8793,1,101000000,2
+8794,2,101000001,2
+8795,3,101000002,2
+8796,4,101000008,2
+8797,5,101000004,2
+8798,1,102000000,2
+8799,2,102000001,2
+8800,3,102000002,2
+8801,4,102000003,2
+8802,5,102000004,2
+8803,1,103000000,2
+8804,2,103000001,2
+8805,3,103000002,2
+8806,4,103000003,2
+8807,5,103000004,2
+8808,1,105000000,2
+8809,2,105000001,2
+8810,3,105000002,2
+8811,4,105000003,2
+8812,5,105000004,2
+8813,1,108000000,2
+8814,2,108000001,2
+8815,3,108000002,2
+8816,4,108000003,2
+8817,5,108000004,2
+8818,1,109000000,2
+8819,2,109000001,2
+8820,3,109000002,2
+8821,4,109000003,2
+8822,5,109000004,2
+8823,1,111000000,2
+8824,2,111000001,2
+8825,3,111000002,2
+8826,4,111000003,2
+8827,5,111000004,2
+8828,1,112000000,2
+8829,2,112000001,2
+8830,3,112000002,2
+8831,4,112000003,2
+8832,5,112000004,2
+8833,1,120000000,2
+8834,2,120000001,2
+8835,3,120000002,2
+8836,4,120000003,2
+8837,5,120000004,2
+8838,1,101000010,1
+8839,2,101000020,1
+8840,2,101000030,1
+8841,3,101000040,1
+8842,3,101000050,1
+8843,3,101000060,1
+8844,3,101000070,1
+8845,3,101000080,1
+8846,1,102000010,1
+8847,2,102000020,1
+8848,2,102000030,1
+8849,2,102000040,1
+8850,3,102000050,1
+8851,3,102000060,1
+8852,3,102000070,1
+8853,3,102000080,1
+8854,1,103000010,1
+8855,2,103000020,1
+8856,2,103000030,1
+8857,2,103000040,1
+8858,3,103000050,1
+8859,3,103000060,1
+8860,3,103000070,1
+8861,3,103000080,1
+8862,1,104000010,1
+8863,2,104000020,1
+8864,2,104000030,1
+8865,2,104000040,1
+8866,3,104000050,1
+8867,3,104000060,1
+8868,3,104000070,1
+8869,3,104000080,1
+8870,1,105000010,1
+8871,2,105000020,1
+8872,2,105000030,1
+8873,2,105000040,1
+8874,3,105000050,1
+8875,3,105000060,1
+8876,3,105000070,1
+8877,3,105000080,1
+8878,1,106000010,1
+8879,2,106000020,1
+8880,2,106000030,1
+8881,2,106000040,1
+8882,3,106000050,1
+8883,3,106000060,1
+8884,3,106000070,1
+8885,3,106000080,1
+8886,1,107000010,1
+8887,2,107000020,1
+8888,2,107000030,1
+8889,2,107000040,1
+8890,3,107000050,1
+8891,3,107000060,1
+8892,3,107000070,1
+8893,3,107000080,1
+8894,1,108000010,1
+8895,2,108000020,1
+8896,2,108000030,1
+8897,2,108000040,1
+8898,3,108000050,1
+8899,3,108000060,1
+8900,3,108000070,1
+8901,3,108000080,1
+8902,1,109000010,1
+8903,2,109000020,1
+8904,2,109000030,1
+8905,2,109000040,1
+8906,3,109000050,1
+8907,3,109000060,1
+8908,3,109000070,1
+8909,3,109000080,1
+8910,2,180001,3
+8911,2,170002,3
+8912,3,170003,3
+8913,4,170004,3
+8915,1,101000000,2
+8916,2,101000001,2
+8917,3,101000002,2
+8918,4,101000008,2
+8919,5,101000004,2
+8920,1,102000000,2
+8921,2,102000001,2
+8922,3,102000002,2
+8923,4,102000003,2
+8924,5,102000004,2
+8925,1,103000000,2
+8926,2,103000001,2
+8927,3,103000002,2
+8928,4,103000003,2
+8929,5,103000004,2
+8930,1,105000000,2
+8931,2,105000001,2
+8932,3,105000002,2
+8933,4,105000003,2
+8934,5,105000004,2
+8935,1,107000000,2
+8936,2,107000001,2
+8937,3,107000002,2
+8938,4,107000003,2
+8939,5,107000004,2
+8940,1,108000000,2
+8941,2,108000001,2
+8942,3,108000002,2
+8943,4,108000003,2
+8944,5,108000004,2
+8945,1,109000000,2
+8946,2,109000001,2
+8947,3,109000002,2
+8948,4,109000003,2
+8949,5,109000004,2
+8950,1,111000000,2
+8951,2,111000001,2
+8952,3,111000002,2
+8953,4,111000003,2
+8954,5,111000004,2
+8955,1,112000000,2
+8956,2,112000001,2
+8957,3,112000002,2
+8958,4,112000003,2
+8959,5,112000004,2
+8960,1,120000000,2
+8961,2,120000001,2
+8962,3,120000002,2
+8963,4,120000003,2
+8964,5,120000004,2
+8965,1,101000010,1
+8966,2,101000020,1
+8967,2,101000030,1
+8968,3,101000040,1
+8969,3,101000050,1
+8970,3,101000060,1
+8971,3,101000070,1
+8972,3,101000080,1
+8973,1,102000010,1
+8974,2,102000020,1
+8975,2,102000030,1
+8976,2,102000040,1
+8977,3,102000050,1
+8978,3,102000060,1
+8979,3,102000070,1
+8980,3,102000080,1
+8981,1,103000010,1
+8982,2,103000020,1
+8983,2,103000030,1
+8984,2,103000040,1
+8985,3,103000050,1
+8986,3,103000060,1
+8987,3,103000070,1
+8988,3,103000080,1
+8989,1,104000010,1
+8990,2,104000020,1
+8991,2,104000030,1
+8992,2,104000040,1
+8993,3,104000050,1
+8994,3,104000060,1
+8995,3,104000070,1
+8996,3,104000080,1
+8997,1,105000010,1
+8998,2,105000020,1
+8999,2,105000030,1
+9000,2,105000040,1
+9001,3,105000050,1
+9002,3,105000060,1
+9003,3,105000070,1
+9004,3,105000080,1
+9005,1,106000010,1
+9006,2,106000020,1
+9007,2,106000030,1
+9008,2,106000040,1
+9009,3,106000050,1
+9010,3,106000060,1
+9011,3,106000070,1
+9012,3,106000080,1
+9013,1,107000010,1
+9014,2,107000020,1
+9015,2,107000030,1
+9016,2,107000040,1
+9017,3,107000050,1
+9018,3,107000060,1
+9019,3,107000070,1
+9020,3,107000080,1
+9021,1,108000010,1
+9022,2,108000020,1
+9023,2,108000030,1
+9024,2,108000040,1
+9025,3,108000050,1
+9026,3,108000060,1
+9027,3,108000070,1
+9028,3,108000080,1
+9029,1,109000010,1
+9030,2,109000020,1
+9031,2,109000030,1
+9032,2,109000040,1
+9033,3,109000050,1
+9034,3,109000060,1
+9035,3,109000070,1
+9036,3,109000080,1
+9037,1,110000010,1
+9038,2,110000020,1
+9039,2,110000030,1
+9040,2,110000040,1
+9041,3,110000050,1
+9042,3,110000060,1
+9043,3,110000070,1
+9044,3,110000080,1
+9045,2,180001,3
+9046,2,170002,3
+9047,3,170003,3
+9048,4,170004,3
+9050,1,101000010,1
+9051,1,102000010,1
+9052,1,103000010,1
+9053,1,104000010,1
+9054,1,105000010,1
+9055,1,106000010,1
+9056,1,107000010,1
+9057,1,108000010,1
+9058,1,109000010,1
+9059,1,110000010,1
+9060,2,101000020,1
+9061,2,101000030,1
+9062,2,102000020,1
+9063,2,102000030,1
+9064,2,102000040,1
+9065,2,103000020,1
+9066,2,103000030,1
+9067,2,103000040,1
+9068,2,104000020,1
+9069,2,104000030,1
+9070,2,104000040,1
+9071,2,105000020,1
+9072,2,105000030,1
+9073,2,105000040,1
+9074,2,106000020,1
+9075,2,106000030,1
+9076,2,106000040,1
+9077,2,107000020,1
+9078,2,107000030,1
+9079,2,107000040,1
+9080,2,108000020,1
+9081,2,108000030,1
+9082,2,108000040,1
+9083,2,109000020,1
+9084,2,109000030,1
+9085,2,109000040,1
+9086,2,110000020,1
+9087,2,110000030,1
+9088,2,110000040,1
+9089,2,118000010,1
+9090,3,101000050,1
+9091,3,101000060,1
+9092,3,101000080,1
+9093,3,101000040,1
+9094,3,109000060,1
+9095,3,109000070,1
+9096,3,109000080,1
+9097,3,105000060,1
+9098,3,105000070,1
+9099,3,105000080,1
+9100,3,104000050,1
+9101,3,106000050,1
+9102,3,102000060,1
+9103,3,102000070,1
+9104,3,102000080,1
+9105,3,103000050,1
+9106,3,105000050,1
+9107,3,107000060,1
+9108,3,107000070,1
+9109,3,107000080,1
+9110,3,108000050,1
+9111,3,109000050,1
+9112,3,103000060,1
+9113,3,103000070,1
+9114,3,103000080,1
+9115,3,110000050,1
+9116,3,106000060,1
+9117,3,106000070,1
+9118,3,106000080,1
+9119,3,101000070,1
+9120,3,110000060,1
+9121,3,104000060,1
+9122,3,104000070,1
+9123,3,104000080,1
+9124,3,102000050,1
+9125,3,104000170,1
+9126,3,104000260,1
+9127,3,111000010,1
+9128,3,111000020,1
+9129,3,111000030,1
+9130,3,112000020,1
+9131,3,112000030,1
+9132,3,108000060,1
+9133,3,108000070,1
+9134,3,108000080,1
+9135,3,107000050,1
+9136,3,112000010,1
+9137,3,110000070,1
+9138,3,110000080,1
+9139,3,118000020,1
+9140,3,118000030,1
+9141,3,118000040,1
+9142,4,101000090,1
+9143,4,101000100,1
+9144,4,101000110,1
+9145,4,109000100,1
+9146,4,105000100,1
+9147,4,105000110,1
+9148,4,108000090,1
+9149,4,110000090,1
+9150,4,102000100,1
+9151,4,102000110,1
+9152,4,106000090,1
+9153,4,109000090,1
+9154,4,107000100,1
+9155,4,103000090,1
+9156,4,102000090,1
+9157,4,103000100,1
+9158,4,106000100,1
+9159,4,106000110,1
+9160,4,104000090,1
+9161,4,104000100,1
+9162,4,104000110,1
+9163,4,107000090,1
+9164,4,104000180,1
+9165,4,111000040,1
+9166,4,112000040,1
+9167,4,108000100,1
+9168,4,105000090,1
+9169,4,110000100,1
+9170,4,118000050,1
+9171,4,118000060,1
+9172,5,101000120,1
+9173,5,109000110,1
+9174,5,105000120,1
+9175,5,102000120,1
+9176,5,107000110,1
+9177,5,103000120,1
+9178,5,106000120,1
+9179,5,104000120,1
+9180,5,104000190,1
+9181,5,111000060,1
+9182,5,112000060,1
+9183,5,108000110,1
+9184,5,110000110,1
+9185,5,118000070,1
+9186,1,201000010,8
+9187,1,292000010,8
+9188,1,299000040,8
+9189,1,299000070,8
+9190,1,299000110,8
+9191,1,299000120,8
+9192,1,299000140,8
+9193,2,202000010,8
+9194,2,290000010,8
+9195,2,299000010,8
+9196,2,299000150,8
+9197,2,299000190,8
+9198,2,299000200,8
+9199,2,299000210,8
+9200,3,298000050,8
+9201,3,298000060,8
+9202,3,299000060,8
+9203,3,299000170,8
+9204,3,290000120,8
+9205,3,291000050,8
+9206,3,292000020,8
+9207,4,299000670,8
+9208,4,299000680,8
+9209,4,204000010,8
+9210,4,209000040,8
+9211,5,297000100,8
+9212,5,291000020,8
+9213,5,297000130,8
+9214,5,297000140,8
+9215,5,203000010,8
+9216,5,206000030,8
+9217,1,170002,3
+9218,1,180002,3
+9219,2,170003,3
+9220,2,180003,3
+9221,3,170004,3
+9222,3,180004,3
+9223,4,140000,3
+9224,5,150010,3
+9225,5,150020,3
+9226,5,150030,3
+9227,5,150040,3
+9229,1,101000010,1
+9230,1,102000010,1
+9231,1,103000010,1
+9232,1,104000010,1
+9233,1,105000010,1
+9234,1,106000010,1
+9235,1,107000010,1
+9236,1,108000010,1
+9237,1,109000010,1
+9238,1,110000010,1
+9239,2,101000020,1
+9240,2,101000030,1
+9241,2,102000020,1
+9242,2,102000030,1
+9243,2,102000040,1
+9244,2,103000020,1
+9245,2,103000030,1
+9246,2,103000040,1
+9247,2,104000020,1
+9248,2,104000030,1
+9249,2,104000040,1
+9250,2,105000020,1
+9251,2,105000030,1
+9252,2,105000040,1
+9253,2,106000020,1
+9254,2,106000030,1
+9255,2,106000040,1
+9256,2,107000020,1
+9257,2,107000030,1
+9258,2,107000040,1
+9259,2,108000020,1
+9260,2,108000030,1
+9261,2,108000040,1
+9262,2,109000020,1
+9263,2,109000030,1
+9264,2,109000040,1
+9265,2,110000020,1
+9266,2,110000030,1
+9267,2,110000040,1
+9268,2,118000010,1
+9269,3,101000050,1
+9270,3,101000060,1
+9271,3,101000080,1
+9272,3,101000040,1
+9273,3,109000060,1
+9274,3,109000070,1
+9275,3,109000080,1
+9276,3,105000060,1
+9277,3,105000070,1
+9278,3,105000080,1
+9279,3,104000050,1
+9280,3,106000050,1
+9281,3,102000060,1
+9282,3,102000070,1
+9283,3,102000080,1
+9284,3,103000050,1
+9285,3,105000050,1
+9286,3,107000060,1
+9287,3,107000070,1
+9288,3,107000080,1
+9289,3,108000050,1
+9290,3,109000050,1
+9291,3,103000060,1
+9292,3,103000070,1
+9293,3,103000080,1
+9294,3,110000050,1
+9295,3,106000060,1
+9296,3,106000070,1
+9297,3,106000080,1
+9298,3,101000070,1
+9299,3,110000060,1
+9300,3,104000060,1
+9301,3,104000070,1
+9302,3,104000080,1
+9303,3,102000050,1
+9304,3,104000170,1
+9305,3,104000260,1
+9306,3,111000010,1
+9307,3,111000020,1
+9308,3,111000030,1
+9309,3,112000020,1
+9310,3,112000030,1
+9311,3,108000060,1
+9312,3,108000070,1
+9313,3,108000080,1
+9314,3,107000050,1
+9315,3,112000010,1
+9316,3,110000070,1
+9317,3,110000080,1
+9318,3,118000020,1
+9319,3,118000030,1
+9320,3,118000040,1
+9321,4,101000090,1
+9322,4,101000100,1
+9323,4,101000110,1
+9324,4,109000100,1
+9325,4,105000100,1
+9326,4,105000110,1
+9327,4,108000090,1
+9328,4,110000090,1
+9329,4,102000100,1
+9330,4,102000110,1
+9331,4,106000090,1
+9332,4,109000090,1
+9333,4,107000100,1
+9334,4,103000090,1
+9335,4,102000090,1
+9336,4,103000100,1
+9337,4,106000100,1
+9338,4,106000110,1
+9339,4,104000090,1
+9340,4,104000100,1
+9341,4,104000110,1
+9342,4,107000090,1
+9343,4,104000180,1
+9344,4,111000040,1
+9345,4,112000040,1
+9346,4,108000100,1
+9347,4,105000090,1
+9348,4,110000100,1
+9349,4,118000050,1
+9350,4,118000060,1
+9351,5,101000120,1
+9352,5,109000110,1
+9353,5,105000120,1
+9354,5,102000120,1
+9355,5,107000110,1
+9356,5,103000120,1
+9357,5,106000120,1
+9358,5,104000120,1
+9359,5,104000190,1
+9360,5,111000060,1
+9361,5,112000060,1
+9362,5,108000110,1
+9363,5,110000110,1
+9364,5,118000070,1
+9365,1,201000010,8
+9366,1,292000010,8
+9367,1,299000040,8
+9368,1,299000070,8
+9369,1,299000110,8
+9370,1,299000120,8
+9371,1,299000140,8
+9372,2,202000010,8
+9373,2,290000010,8
+9374,2,299000010,8
+9375,2,299000150,8
+9376,2,299000190,8
+9377,2,299000200,8
+9378,2,299000210,8
+9379,3,298000050,8
+9380,3,298000060,8
+9381,3,299000060,8
+9382,3,299000170,8
+9383,3,290000120,8
+9384,3,291000050,8
+9385,3,292000020,8
+9386,4,299000670,8
+9387,4,299000680,8
+9388,4,204000010,8
+9389,4,209000040,8
+9390,5,297000100,8
+9391,5,291000020,8
+9392,5,297000130,8
+9393,5,297000140,8
+9394,5,203000010,8
+9395,5,206000030,8
+9396,2,170003,3
+9397,2,180003,3
+9398,3,170004,3
+9399,3,180004,3
+9400,4,140000,3
+9401,5,150010,3
+9402,5,150020,3
+9403,5,150030,3
+9404,5,150040,3
+9406,3,101000050,1
+9407,3,101000060,1
+9408,3,101000080,1
+9409,3,101000040,1
+9410,3,109000060,1
+9411,3,109000070,1
+9412,3,109000080,1
+9413,3,105000060,1
+9414,3,105000070,1
+9415,3,105000080,1
+9416,3,104000050,1
+9417,3,106000050,1
+9418,3,102000060,1
+9419,3,102000070,1
+9420,3,102000080,1
+9421,3,103000050,1
+9422,3,105000050,1
+9423,3,107000060,1
+9424,3,107000070,1
+9425,3,107000080,1
+9426,3,108000050,1
+9427,3,109000050,1
+9428,3,103000060,1
+9429,3,103000070,1
+9430,3,103000080,1
+9431,3,110000050,1
+9432,3,106000060,1
+9433,3,106000070,1
+9434,3,106000080,1
+9435,3,101000070,1
+9436,3,110000060,1
+9437,3,104000060,1
+9438,3,104000070,1
+9439,3,104000080,1
+9440,3,102000050,1
+9441,3,104000170,1
+9442,3,104000260,1
+9443,3,111000010,1
+9444,3,111000020,1
+9445,3,111000030,1
+9446,3,112000020,1
+9447,3,112000030,1
+9448,3,108000060,1
+9449,3,108000070,1
+9450,3,108000080,1
+9451,3,107000050,1
+9452,3,112000010,1
+9453,3,110000070,1
+9454,3,110000080,1
+9455,3,118000020,1
+9456,3,118000030,1
+9457,3,118000040,1
+9458,4,101000090,1
+9459,4,101000100,1
+9460,4,101000110,1
+9461,4,109000100,1
+9462,4,105000100,1
+9463,4,105000110,1
+9464,4,108000090,1
+9465,4,110000090,1
+9466,4,102000100,1
+9467,4,102000110,1
+9468,4,106000090,1
+9469,4,109000090,1
+9470,4,107000100,1
+9471,4,103000090,1
+9472,4,102000090,1
+9473,4,103000100,1
+9474,4,106000100,1
+9475,4,106000110,1
+9476,4,104000090,1
+9477,4,104000100,1
+9478,4,104000110,1
+9479,4,107000090,1
+9480,4,104000180,1
+9481,4,111000040,1
+9482,4,112000040,1
+9483,4,108000100,1
+9484,4,105000090,1
+9485,4,110000100,1
+9486,4,118000050,1
+9487,4,118000060,1
+9488,5,101000120,1
+9489,5,109000110,1
+9490,5,105000120,1
+9491,5,102000120,1
+9492,5,107000110,1
+9493,5,103000120,1
+9494,5,106000120,1
+9495,5,104000120,1
+9496,5,104000190,1
+9497,5,111000060,1
+9498,5,112000060,1
+9499,5,108000110,1
+9500,5,110000110,1
+9501,5,118000070,1
+9502,1,201000010,8
+9503,1,292000010,8
+9504,1,299000040,8
+9505,1,299000070,8
+9506,1,299000110,8
+9507,1,299000120,8
+9508,1,299000140,8
+9509,2,202000010,8
+9510,2,290000010,8
+9511,2,299000010,8
+9512,2,299000150,8
+9513,2,299000190,8
+9514,2,299000200,8
+9515,2,299000210,8
+9516,3,298000050,8
+9517,3,298000060,8
+9518,3,299000060,8
+9519,3,299000170,8
+9520,3,290000120,8
+9521,3,291000050,8
+9522,3,292000020,8
+9523,4,299000670,8
+9524,4,299000680,8
+9525,4,204000010,8
+9526,4,209000040,8
+9527,5,297000100,8
+9528,5,291000020,8
+9529,5,297000130,8
+9530,5,297000140,8
+9531,5,203000010,8
+9532,5,206000030,8
+9533,3,170004,3
+9534,3,180004,3
+9535,4,140000,3
+9536,5,150010,3
+9537,5,150020,3
+9538,5,150030,3
+9539,5,150040,3
+9541,3,101000050,1
+9542,3,101000060,1
+9543,3,101000080,1
+9544,3,101000040,1
+9545,3,109000060,1
+9546,3,109000070,1
+9547,3,109000080,1
+9548,3,105000060,1
+9549,3,105000070,1
+9550,3,105000080,1
+9551,3,104000050,1
+9552,3,106000050,1
+9553,3,102000060,1
+9554,3,102000070,1
+9555,3,102000080,1
+9556,3,103000050,1
+9557,3,105000050,1
+9558,3,107000060,1
+9559,3,107000070,1
+9560,3,107000080,1
+9561,3,108000050,1
+9562,3,109000050,1
+9563,3,103000060,1
+9564,3,103000070,1
+9565,3,103000080,1
+9566,3,110000050,1
+9567,3,106000060,1
+9568,3,106000070,1
+9569,3,106000080,1
+9570,3,101000070,1
+9571,3,110000060,1
+9572,3,104000060,1
+9573,3,104000070,1
+9574,3,104000080,1
+9575,3,102000050,1
+9576,3,104000170,1
+9577,3,104000260,1
+9578,3,111000010,1
+9579,3,111000020,1
+9580,3,111000030,1
+9581,3,112000020,1
+9582,3,112000030,1
+9583,3,108000060,1
+9584,3,108000070,1
+9585,3,108000080,1
+9586,3,107000050,1
+9587,3,112000010,1
+9588,3,110000070,1
+9589,3,110000080,1
+9590,3,118000020,1
+9591,3,118000030,1
+9592,3,118000040,1
+9593,4,101000090,1
+9594,4,101000100,1
+9595,4,101000110,1
+9596,4,109000100,1
+9597,4,105000100,1
+9598,4,105000110,1
+9599,4,108000090,1
+9600,4,110000090,1
+9601,4,102000100,1
+9602,4,102000110,1
+9603,4,106000090,1
+9604,4,109000090,1
+9605,4,107000100,1
+9606,4,103000090,1
+9607,4,102000090,1
+9608,4,103000100,1
+9609,4,106000100,1
+9610,4,106000110,1
+9611,4,104000090,1
+9612,4,104000100,1
+9613,4,104000110,1
+9614,4,107000090,1
+9615,4,104000180,1
+9616,4,111000040,1
+9617,4,112000040,1
+9618,4,108000100,1
+9619,4,105000090,1
+9620,4,110000100,1
+9621,4,118000050,1
+9622,4,118000060,1
+9623,5,101000120,1
+9624,5,109000110,1
+9625,5,105000120,1
+9626,5,102000120,1
+9627,5,107000110,1
+9628,5,103000120,1
+9629,5,106000120,1
+9630,5,104000120,1
+9631,5,104000190,1
+9632,5,111000060,1
+9633,5,112000060,1
+9634,5,108000110,1
+9635,5,110000110,1
+9636,5,118000070,1
+9637,1,201000010,8
+9638,1,292000010,8
+9639,1,299000040,8
+9640,1,299000070,8
+9641,1,299000110,8
+9642,1,299000120,8
+9643,1,299000140,8
+9644,2,202000010,8
+9645,2,290000010,8
+9646,2,299000010,8
+9647,2,299000150,8
+9648,2,299000190,8
+9649,2,299000200,8
+9650,2,299000210,8
+9651,3,298000050,8
+9652,3,298000060,8
+9653,3,299000060,8
+9654,3,299000170,8
+9655,3,290000120,8
+9656,3,291000050,8
+9657,3,292000020,8
+9658,4,299000670,8
+9659,4,299000680,8
+9660,4,204000010,8
+9661,4,209000040,8
+9662,5,297000100,8
+9663,5,291000020,8
+9664,5,297000130,8
+9665,5,297000140,8
+9666,5,203000010,8
+9667,5,206000030,8
+9668,3,170004,3
+9669,3,180004,3
+9670,4,140000,3
+9671,5,150010,3
+9672,5,150020,3
+9673,5,150030,3
+9674,5,150040,3
+9676,3,101000050,1
+9677,3,101000060,1
+9678,3,101000080,1
+9679,3,101000040,1
+9680,3,109000060,1
+9681,3,109000070,1
+9682,3,109000080,1
+9683,3,105000060,1
+9684,3,105000070,1
+9685,3,105000080,1
+9686,3,104000050,1
+9687,3,106000050,1
+9688,3,102000060,1
+9689,3,102000070,1
+9690,3,102000080,1
+9691,3,103000050,1
+9692,3,105000050,1
+9693,3,107000060,1
+9694,3,107000070,1
+9695,3,107000080,1
+9696,3,108000050,1
+9697,3,109000050,1
+9698,3,103000060,1
+9699,3,103000070,1
+9700,3,103000080,1
+9701,3,110000050,1
+9702,3,106000060,1
+9703,3,106000070,1
+9704,3,106000080,1
+9705,3,101000070,1
+9706,3,110000060,1
+9707,3,104000060,1
+9708,3,104000070,1
+9709,3,104000080,1
+9710,3,102000050,1
+9711,3,104000170,1
+9712,3,104000260,1
+9713,3,111000010,1
+9714,3,111000020,1
+9715,3,111000030,1
+9716,3,112000020,1
+9717,3,112000030,1
+9718,3,108000060,1
+9719,3,108000070,1
+9720,3,108000080,1
+9721,3,107000050,1
+9722,3,112000010,1
+9723,3,110000070,1
+9724,3,110000080,1
+9725,3,118000020,1
+9726,3,118000030,1
+9727,3,118000040,1
+9728,4,101000090,1
+9729,4,101000100,1
+9730,4,101000110,1
+9731,4,109000100,1
+9732,4,105000100,1
+9733,4,105000110,1
+9734,4,108000090,1
+9735,4,110000090,1
+9736,4,102000100,1
+9737,4,102000110,1
+9738,4,106000090,1
+9739,4,109000090,1
+9740,4,107000100,1
+9741,4,103000090,1
+9742,4,102000090,1
+9743,4,103000100,1
+9744,4,106000100,1
+9745,4,106000110,1
+9746,4,104000090,1
+9747,4,104000100,1
+9748,4,104000110,1
+9749,4,107000090,1
+9750,4,104000180,1
+9751,4,111000040,1
+9752,4,112000040,1
+9753,4,108000100,1
+9754,4,105000090,1
+9755,4,110000100,1
+9756,4,118000050,1
+9757,4,118000060,1
+9758,5,101000120,1
+9759,5,109000110,1
+9760,5,105000120,1
+9761,5,102000120,1
+9762,5,107000110,1
+9763,5,103000120,1
+9764,5,106000120,1
+9765,5,104000120,1
+9766,5,104000190,1
+9767,5,111000060,1
+9768,5,112000060,1
+9769,5,108000110,1
+9770,5,110000110,1
+9771,5,118000070,1
+9772,1,201000010,8
+9773,1,292000010,8
+9774,1,299000040,8
+9775,1,299000070,8
+9776,1,299000110,8
+9777,1,299000120,8
+9778,1,299000140,8
+9779,2,202000010,8
+9780,2,290000010,8
+9781,2,299000010,8
+9782,2,299000150,8
+9783,2,299000190,8
+9784,2,299000200,8
+9785,2,299000210,8
+9786,3,298000050,8
+9787,3,298000060,8
+9788,3,299000060,8
+9789,3,299000170,8
+9790,3,290000120,8
+9791,3,291000050,8
+9792,3,292000020,8
+9793,4,299000670,8
+9794,4,299000680,8
+9795,4,204000010,8
+9796,4,209000040,8
+9797,5,297000100,8
+9798,5,291000020,8
+9799,5,297000130,8
+9800,5,297000140,8
+9801,5,203000010,8
+9802,5,206000030,8
+9803,3,170004,3
+9804,3,180004,3
+9805,4,140000,3
+9806,5,150010,3
+9807,5,150020,3
+9808,5,150030,3
+9809,5,150040,3
+9810,5,190000,3
+9811,5,200000,3
+9812,5,210000,3
+9814,3,101000050,1
+9815,3,101000060,1
+9816,3,101000080,1
+9817,3,101000040,1
+9818,3,109000060,1
+9819,3,109000070,1
+9820,3,109000080,1
+9821,3,105000060,1
+9822,3,105000070,1
+9823,3,105000080,1
+9824,3,104000050,1
+9825,3,106000050,1
+9826,4,101000090,1
+9827,4,101000100,1
+9828,4,101000110,1
+9829,4,109000100,1
+9830,4,105000100,1
+9831,4,105000110,1
+9832,4,108000090,1
+9833,4,110000090,1
+9834,5,101000120,1
+9835,5,109000110,1
+9836,5,105000120,1
+9837,1,101000000,2
+9838,2,101000001,2
+9839,3,101000002,2
+9840,4,101000008,2
+9841,5,101000004,2
+9842,1,109000000,2
+9843,2,109000001,2
+9844,3,109000002,2
+9845,4,109000003,2
+9846,5,109000004,2
+9847,3,170004,3
+9848,4,170005,3
+9849,3,180004,3
+9850,4,180005,3
+9851,4,140000,3
+9852,4,150010,3
+9853,4,150020,3
+9854,4,150030,3
+9855,4,150040,3
+9857,3,102000060,1
+9858,3,102000070,1
+9859,3,102000080,1
+9860,3,103000050,1
+9861,3,105000050,1
+9862,3,107000060,1
+9863,3,107000070,1
+9864,3,107000080,1
+9865,3,108000050,1
+9866,3,109000050,1
+9867,3,103000060,1
+9868,3,103000070,1
+9869,3,103000080,1
+9870,3,110000050,1
+9871,4,102000100,1
+9872,4,102000350,1
+9873,4,102000110,1
+9874,4,106000090,1
+9875,4,109000090,1
+9876,4,107000100,1
+9877,4,103000090,1
+9878,4,102000090,1
+9879,4,103000100,1
+9880,5,102000120,1
+9881,5,107000110,1
+9882,5,103000120,1
+9883,1,102000000,2
+9884,2,102000001,2
+9885,3,102000002,2
+9886,4,102000003,2
+9887,5,102000004,2
+9888,1,105000000,2
+9889,2,105000001,2
+9890,3,105000002,2
+9891,4,105000003,2
+9892,5,105000004,2
+9893,1,112000000,2
+9894,2,112000001,2
+9895,3,112000002,2
+9896,4,112000003,2
+9897,5,112000004,2
+9898,4,110024,3
+9899,4,110034,3
+9900,4,110044,3
+9901,4,110054,3
+9902,3,110060,3
+9903,3,110070,3
+9904,3,110080,3
+9905,3,110090,3
+9906,3,110100,3
+9907,3,110110,3
+9908,3,110120,3
+9909,3,110130,3
+9910,3,110140,3
+9911,3,110150,3
+9912,3,110160,3
+9913,3,110170,3
+9914,3,110180,3
+9915,3,110190,3
+9916,3,110200,3
+9917,3,110210,3
+9918,3,110220,3
+9919,3,110230,3
+9920,3,110240,3
+9921,3,110250,3
+9922,3,110260,3
+9923,3,110270,3
+9924,3,110620,3
+9925,3,110670,3
+9926,4,140000,3
+9927,4,150010,3
+9928,4,150020,3
+9929,4,150030,3
+9930,4,150040,3
+9932,3,118000020,1
+9933,3,118000030,1
+9934,3,118000040,1
+9935,3,106000060,1
+9936,3,106000070,1
+9937,3,106000080,1
+9938,3,101000070,1
+9939,3,110000060,1
+9940,3,104000060,1
+9941,3,104000070,1
+9942,3,104000080,1
+9943,3,102000050,1
+9944,3,104000170,1
+9945,3,104000260,1
+9946,4,118000050,1
+9947,4,118000060,1
+9948,4,106000100,1
+9949,4,106000110,1
+9950,4,104000090,1
+9951,4,104000100,1
+9952,4,104000110,1
+9953,4,104000270,1
+9954,4,107000090,1
+9955,4,104000180,1
+9956,5,118000070,1
+9957,5,106000120,1
+9958,5,104000120,1
+9959,5,104000190,1
+9960,1,103000000,2
+9961,2,103000001,2
+9962,3,103000002,2
+9963,4,103000003,2
+9964,5,103000004,2
+9965,1,111000000,2
+9966,2,111000001,2
+9967,3,111000002,2
+9968,4,111000003,2
+9969,5,111000004,2
+9970,1,115000000,2
+9971,2,115000001,2
+9972,3,115000002,2
+9973,4,115000003,2
+9974,5,115000004,2
+9975,4,120024,3
+9976,4,120034,3
+9977,4,120044,3
+9978,4,120054,3
+9979,3,120241,3
+9980,3,120251,3
+9981,3,120261,3
+9982,3,120271,3
+9983,3,120300,3
+9984,3,120310,3
+9985,3,120320,3
+9986,3,120330,3
+9987,3,120340,3
+9988,3,120350,3
+9989,3,120360,3
+9990,3,120370,3
+9991,3,120380,3
+9992,3,120390,3
+9993,3,120400,3
+9994,3,120410,3
+9995,3,120420,3
+9996,3,120430,3
+9997,3,120450,3
+9998,3,120460,3
+9999,3,120550,3
+10000,3,120560,3
+10001,3,120570,3
+10002,3,120990,3
+10003,3,121000,3
+10004,3,121010,3
+10005,3,121020,3
+10006,4,140000,3
+10007,4,150010,3
+10008,4,150020,3
+10009,4,150030,3
+10010,4,150040,3
+10012,3,111000010,1
+10013,3,111000020,1
+10014,3,111000030,1
+10015,3,112000020,1
+10016,3,112000030,1
+10017,3,108000060,1
+10018,3,108000070,1
+10019,3,108000080,1
+10020,3,107000050,1
+10021,3,112000010,1
+10022,3,110000070,1
+10023,3,110000080,1
+10024,4,111000040,1
+10025,4,112000040,1
+10026,4,108000100,1
+10027,4,105000090,1
+10028,4,110000100,1
+10029,5,111000060,1
+10030,5,112000060,1
+10031,5,108000110,1
+10032,5,110000110,1
+10033,1,108000000,2
+10034,2,108000001,2
+10035,3,108000002,2
+10036,4,108000003,2
+10037,5,108000004,2
+10038,1,107000000,2
+10039,2,107000001,2
+10040,3,107000002,2
+10041,4,107000003,2
+10042,5,107000004,2
+10043,1,120000000,2
+10044,2,120000001,2
+10045,3,120000002,2
+10046,4,120000003,2
+10047,5,120000004,2
+10048,4,130024,3
+10049,4,130034,3
+10050,4,130044,3
+10051,4,130054,3
+10052,3,130060,3
+10053,3,130070,3
+10054,3,130080,3
+10055,3,130090,3
+10056,3,130100,3
+10057,3,130110,3
+10058,3,130120,3
+10059,3,130130,3
+10060,3,130140,3
+10061,3,130150,3
+10062,3,130160,3
+10063,3,130170,3
+10064,3,130180,3
+10065,3,130190,3
+10066,3,130200,3
+10067,3,130420,3
+10068,3,130510,3
+10069,3,130520,3
+10070,3,130531,3
+10071,3,130540,3
+10072,3,130660,3
+10073,3,130790,3
+10074,3,130800,3
+10075,3,131130,3
+10076,4,140000,3
+10077,4,150010,3
+10078,4,150020,3
+10079,4,150030,3
+10080,4,150040,3
+10082,3,111000010,1
+10083,3,111000020,1
+10084,3,111000030,1
+10085,3,112000020,1
+10086,3,112000030,1
+10087,3,108000060,1
+10088,3,108000070,1
+10089,3,108000080,1
+10090,3,107000050,1
+10091,3,112000010,1
+10092,3,110000070,1
+10093,3,110000080,1
+10094,4,111000040,1
+10095,4,112000040,1
+10096,4,108000100,1
+10097,4,105000090,1
+10098,4,110000100,1
+10099,5,111000060,1
+10100,5,112000060,1
+10101,5,108000110,1
+10102,5,110000110,1
+10103,1,108000000,2
+10104,2,108000001,2
+10105,3,108000002,2
+10106,4,108000003,2
+10107,5,108000004,2
+10108,1,107000000,2
+10109,2,107000001,2
+10110,3,107000002,2
+10111,4,107000003,2
+10112,5,107000004,2
+10113,1,120000000,2
+10114,2,120000001,2
+10115,3,120000002,2
+10116,4,120000003,2
+10117,5,120000004,2
+10118,3,170004,3
+10119,4,170005,3
+10120,3,180004,3
+10121,4,180005,3
+10122,4,140000,3
+10123,4,150010,3
+10124,4,150020,3
+10125,4,150030,3
+10126,4,150040,3
+10128,3,101000050,1
+10129,3,101000060,1
+10130,3,101000080,1
+10131,3,101000040,1
+10132,3,109000060,1
+10133,3,109000070,1
+10134,3,109000080,1
+10135,3,105000060,1
+10136,3,105000070,1
+10137,3,105000080,1
+10138,3,104000050,1
+10139,3,106000050,1
+10140,4,101000090,1
+10141,4,101000100,1
+10142,4,101000110,1
+10143,4,109000100,1
+10144,4,105000100,1
+10145,4,105000110,1
+10146,4,108000090,1
+10147,4,110000090,1
+10148,5,101000120,1
+10149,5,109000110,1
+10150,5,105000120,1
+10151,1,101000000,2
+10152,2,101000001,2
+10153,3,101000002,2
+10154,4,101000008,2
+10155,5,101000004,2
+10156,1,109000000,2
+10157,2,109000001,2
+10158,3,109000002,2
+10159,4,109000003,2
+10160,5,109000004,2
+10161,4,110024,3
+10162,4,110034,3
+10163,4,110044,3
+10164,4,110054,3
+10165,3,110060,3
+10166,3,110070,3
+10167,3,110080,3
+10168,3,110090,3
+10169,3,110100,3
+10170,3,110110,3
+10171,3,110120,3
+10172,3,110130,3
+10173,3,110140,3
+10174,3,110150,3
+10175,3,110160,3
+10176,3,110170,3
+10177,3,110180,3
+10178,3,110190,3
+10179,3,110200,3
+10180,3,110210,3
+10181,3,110220,3
+10182,3,110230,3
+10183,3,110240,3
+10184,3,110250,3
+10185,3,110260,3
+10186,3,110270,3
+10187,3,110620,3
+10188,3,110670,3
+10189,4,140000,3
+10190,4,150010,3
+10191,4,150020,3
+10192,4,150030,3
+10193,4,150040,3
+10195,3,102000060,1
+10196,3,102000070,1
+10197,3,102000080,1
+10198,3,103000050,1
+10199,3,105000050,1
+10200,3,107000060,1
+10201,3,107000070,1
+10202,3,107000080,1
+10203,3,108000050,1
+10204,3,109000050,1
+10205,3,103000060,1
+10206,3,103000070,1
+10207,3,103000080,1
+10208,3,110000050,1
+10209,4,102000100,1
+10210,4,102000110,1
+10211,4,102000350,1
+10212,4,106000090,1
+10213,4,109000090,1
+10214,4,107000100,1
+10215,4,103000090,1
+10216,4,102000090,1
+10217,4,103000100,1
+10218,5,102000120,1
+10219,5,107000110,1
+10220,5,103000120,1
+10221,1,102000000,2
+10222,2,102000001,2
+10223,3,102000002,2
+10224,4,102000003,2
+10225,5,102000004,2
+10226,1,105000000,2
+10227,2,105000001,2
+10228,3,105000002,2
+10229,4,105000003,2
+10230,5,105000004,2
+10231,1,112000000,2
+10232,2,112000001,2
+10233,3,112000002,2
+10234,4,112000003,2
+10235,5,112000004,2
+10236,4,120024,3
+10237,4,120034,3
+10238,4,120044,3
+10239,4,120054,3
+10240,3,120241,3
+10241,3,120251,3
+10242,3,120261,3
+10243,3,120271,3
+10244,3,120300,3
+10245,3,120310,3
+10246,3,120320,3
+10247,3,120330,3
+10248,3,120340,3
+10249,3,120350,3
+10250,3,120360,3
+10251,3,120370,3
+10252,3,120380,3
+10253,3,120390,3
+10254,3,120400,3
+10255,3,120410,3
+10256,3,120420,3
+10257,3,120430,3
+10258,3,120450,3
+10259,3,120460,3
+10260,3,120550,3
+10261,3,120560,3
+10262,3,120570,3
+10263,3,120990,3
+10264,3,121000,3
+10265,3,121010,3
+10266,3,121020,3
+10267,3,121100,3
+10268,4,140000,3
+10269,4,150010,3
+10270,4,150020,3
+10271,4,150030,3
+10272,4,150040,3
+10274,3,118000020,1
+10275,3,118000030,1
+10276,3,118000040,1
+10277,3,106000060,1
+10278,3,106000070,1
+10279,3,106000080,1
+10280,3,101000070,1
+10281,3,110000060,1
+10282,3,104000060,1
+10283,3,104000070,1
+10284,3,104000080,1
+10285,3,102000050,1
+10286,3,104000170,1
+10287,3,104000260,1
+10288,4,118000050,1
+10289,4,118000060,1
+10290,4,106000100,1
+10291,4,106000110,1
+10292,4,104000090,1
+10293,4,104000100,1
+10294,4,104000110,1
+10295,4,104000270,1
+10296,4,107000090,1
+10297,4,104000180,1
+10298,5,118000070,1
+10299,5,106000120,1
+10300,5,104000120,1
+10301,5,104000190,1
+10302,1,103000000,2
+10303,2,103000001,2
+10304,3,103000002,2
+10305,4,103000003,2
+10306,5,103000004,2
+10307,1,111000000,2
+10308,2,111000001,2
+10309,3,111000002,2
+10310,4,111000003,2
+10311,5,111000004,2
+10312,1,115000000,2
+10313,2,115000001,2
+10314,3,115000002,2
+10315,4,115000003,2
+10316,5,115000004,2
+10317,4,130024,3
+10318,4,130034,3
+10319,4,130044,3
+10320,4,130054,3
+10321,3,130060,3
+10322,3,130070,3
+10323,3,130080,3
+10324,3,130090,3
+10325,3,130100,3
+10326,3,130110,3
+10327,3,130120,3
+10328,3,130130,3
+10329,3,130140,3
+10330,3,130150,3
+10331,3,130160,3
+10332,3,130170,3
+10333,3,130180,3
+10334,3,130190,3
+10335,3,130200,3
+10336,3,130420,3
+10337,3,130510,3
+10338,3,130520,3
+10339,3,130531,3
+10340,3,130540,3
+10341,3,130660,3
+10342,3,130790,3
+10343,3,130800,3
+10344,3,131130,3
+10345,4,140000,3
+10346,4,150010,3
+10347,4,150020,3
+10348,4,150030,3
+10349,4,150040,3
+10351,1,101000010,1
+10352,1,102000010,1
+10353,1,103000010,1
+10354,1,104000010,1
+10355,1,105000010,1
+10356,1,106000010,1
+10357,1,107000010,1
+10358,1,108000010,1
+10359,1,109000010,1
+10360,1,110000010,1
+10361,2,101000020,1
+10362,2,101000030,1
+10363,2,102000020,1
+10364,2,102000030,1
+10365,2,102000040,1
+10366,2,103000020,1
+10367,2,103000030,1
+10368,2,103000040,1
+10369,2,104000020,1
+10370,2,104000030,1
+10371,2,104000040,1
+10372,2,105000020,1
+10373,2,105000030,1
+10374,2,105000040,1
+10375,2,106000020,1
+10376,2,106000030,1
+10377,2,106000040,1
+10378,2,107000020,1
+10379,2,107000030,1
+10380,2,107000040,1
+10381,2,108000020,1
+10382,2,108000030,1
+10383,2,108000040,1
+10384,2,109000020,1
+10385,2,109000030,1
+10386,2,109000040,1
+10387,2,110000020,1
+10388,2,110000030,1
+10389,2,110000040,1
+10390,2,118000010,1
+10391,3,101000050,1
+10392,3,101000060,1
+10393,3,101000080,1
+10394,3,101000040,1
+10395,3,109000060,1
+10396,3,109000070,1
+10397,3,109000080,1
+10398,3,105000060,1
+10399,3,105000070,1
+10400,3,105000080,1
+10401,3,104000050,1
+10402,3,106000050,1
+10403,3,102000060,1
+10404,3,102000070,1
+10405,3,102000080,1
+10406,3,103000050,1
+10407,3,105000050,1
+10408,3,107000060,1
+10409,3,107000070,1
+10410,3,107000080,1
+10411,3,108000050,1
+10412,3,109000050,1
+10413,3,103000060,1
+10414,3,103000070,1
+10415,3,103000080,1
+10416,3,110000050,1
+10417,3,106000060,1
+10418,3,106000070,1
+10419,3,106000080,1
+10420,3,101000070,1
+10421,3,110000060,1
+10422,3,104000060,1
+10423,3,104000070,1
+10424,3,104000080,1
+10425,3,102000050,1
+10426,3,104000170,1
+10427,3,104000260,1
+10428,3,111000010,1
+10429,3,111000020,1
+10430,3,111000030,1
+10431,3,112000020,1
+10432,3,112000030,1
+10433,3,108000060,1
+10434,3,108000070,1
+10435,3,108000080,1
+10436,3,107000050,1
+10437,3,112000010,1
+10438,3,110000070,1
+10439,3,110000080,1
+10440,3,118000020,1
+10441,3,118000030,1
+10442,3,118000040,1
+10443,4,101000090,1
+10444,4,101000100,1
+10445,4,101000110,1
+10446,4,109000100,1
+10447,4,105000100,1
+10448,4,105000110,1
+10449,4,108000090,1
+10450,4,110000090,1
+10451,4,102000100,1
+10452,4,102000110,1
+10453,4,106000090,1
+10454,4,109000090,1
+10455,4,107000100,1
+10456,4,103000090,1
+10457,4,102000090,1
+10458,4,103000100,1
+10459,4,106000100,1
+10460,4,106000110,1
+10461,4,104000090,1
+10462,4,104000100,1
+10463,4,104000110,1
+10464,4,107000090,1
+10465,4,104000180,1
+10466,4,111000040,1
+10467,4,112000040,1
+10468,4,108000100,1
+10469,4,105000090,1
+10470,4,110000100,1
+10471,4,118000050,1
+10472,4,118000060,1
+10473,5,101000120,1
+10474,5,109000110,1
+10475,5,105000120,1
+10476,5,102000120,1
+10477,5,107000110,1
+10478,5,103000120,1
+10479,5,106000120,1
+10480,5,104000120,1
+10481,5,104000190,1
+10482,5,111000060,1
+10483,5,112000060,1
+10484,5,108000110,1
+10485,5,110000110,1
+10486,5,118000070,1
+10487,1,201000010,8
+10488,1,292000010,8
+10489,1,299000040,8
+10490,1,299000070,8
+10491,1,299000110,8
+10492,1,299000120,8
+10493,1,299000140,8
+10494,2,202000010,8
+10495,2,290000010,8
+10496,2,299000010,8
+10497,2,299000150,8
+10498,2,299000190,8
+10499,2,299000200,8
+10500,2,299000210,8
+10501,3,298000050,8
+10502,3,298000060,8
+10503,3,299000060,8
+10504,3,299000170,8
+10505,3,290000120,8
+10506,3,291000050,8
+10507,3,292000020,8
+10508,4,299000670,8
+10509,4,299000680,8
+10510,4,204000010,8
+10511,4,209000040,8
+10512,4,202000070,8
+10513,5,297000100,8
+10514,5,291000020,8
+10515,5,297000130,8
+10516,5,297000140,8
+10517,5,203000010,8
+10518,5,206000030,8
+10519,5,203000050,8
+10520,1,170002,3
+10521,1,180002,3
+10522,2,170003,3
+10523,2,180003,3
+10524,3,170004,3
+10525,3,180004,3
+10526,4,140000,3
+10527,5,150010,3
+10528,5,150020,3
+10529,5,150030,3
+10530,5,150040,3
+10532,1,101000010,1
+10533,1,102000010,1
+10534,1,103000010,1
+10535,1,104000010,1
+10536,1,105000010,1
+10537,1,106000010,1
+10538,1,107000010,1
+10539,1,108000010,1
+10540,1,109000010,1
+10541,1,110000010,1
+10542,2,101000020,1
+10543,2,101000030,1
+10544,2,102000020,1
+10545,2,102000030,1
+10546,2,102000040,1
+10547,2,103000020,1
+10548,2,103000030,1
+10549,2,103000040,1
+10550,2,104000020,1
+10551,2,104000030,1
+10552,2,104000040,1
+10553,2,105000020,1
+10554,2,105000030,1
+10555,2,105000040,1
+10556,2,106000020,1
+10557,2,106000030,1
+10558,2,106000040,1
+10559,2,107000020,1
+10560,2,107000030,1
+10561,2,107000040,1
+10562,2,108000020,1
+10563,2,108000030,1
+10564,2,108000040,1
+10565,2,109000020,1
+10566,2,109000030,1
+10567,2,109000040,1
+10568,2,110000020,1
+10569,2,110000030,1
+10570,2,110000040,1
+10571,2,118000010,1
+10572,3,101000050,1
+10573,3,101000060,1
+10574,3,101000080,1
+10575,3,101000040,1
+10576,3,109000060,1
+10577,3,109000070,1
+10578,3,109000080,1
+10579,3,105000060,1
+10580,3,105000070,1
+10581,3,105000080,1
+10582,3,104000050,1
+10583,3,106000050,1
+10584,3,102000060,1
+10585,3,102000070,1
+10586,3,102000080,1
+10587,3,103000050,1
+10588,3,105000050,1
+10589,3,107000060,1
+10590,3,107000070,1
+10591,3,107000080,1
+10592,3,108000050,1
+10593,3,109000050,1
+10594,3,103000060,1
+10595,3,103000070,1
+10596,3,103000080,1
+10597,3,110000050,1
+10598,3,106000060,1
+10599,3,106000070,1
+10600,3,106000080,1
+10601,3,101000070,1
+10602,3,110000060,1
+10603,3,104000060,1
+10604,3,104000070,1
+10605,3,104000080,1
+10606,3,102000050,1
+10607,3,104000170,1
+10608,3,104000260,1
+10609,3,111000010,1
+10610,3,111000020,1
+10611,3,111000030,1
+10612,3,112000020,1
+10613,3,112000030,1
+10614,3,108000060,1
+10615,3,108000070,1
+10616,3,108000080,1
+10617,3,107000050,1
+10618,3,112000010,1
+10619,3,110000070,1
+10620,3,110000080,1
+10621,3,118000020,1
+10622,3,118000030,1
+10623,3,118000040,1
+10624,4,101000090,1
+10625,4,101000100,1
+10626,4,101000110,1
+10627,4,109000100,1
+10628,4,105000100,1
+10629,4,105000110,1
+10630,4,108000090,1
+10631,4,110000090,1
+10632,4,102000100,1
+10633,4,102000110,1
+10634,4,106000090,1
+10635,4,109000090,1
+10636,4,107000100,1
+10637,4,103000090,1
+10638,4,102000090,1
+10639,4,103000100,1
+10640,4,106000100,1
+10641,4,106000110,1
+10642,4,104000090,1
+10643,4,104000100,1
+10644,4,104000110,1
+10645,4,107000090,1
+10646,4,104000180,1
+10647,4,111000040,1
+10648,4,112000040,1
+10649,4,108000100,1
+10650,4,105000090,1
+10651,4,110000100,1
+10652,4,118000050,1
+10653,4,118000060,1
+10654,5,101000120,1
+10655,5,109000110,1
+10656,5,105000120,1
+10657,5,102000120,1
+10658,5,107000110,1
+10659,5,103000120,1
+10660,5,106000120,1
+10661,5,104000120,1
+10662,5,104000190,1
+10663,5,111000060,1
+10664,5,112000060,1
+10665,5,108000110,1
+10666,5,110000110,1
+10667,5,118000070,1
+10668,1,201000010,8
+10669,1,292000010,8
+10670,1,299000040,8
+10671,1,299000070,8
+10672,1,299000110,8
+10673,1,299000120,8
+10674,1,299000140,8
+10675,2,202000010,8
+10676,2,290000010,8
+10677,2,299000010,8
+10678,2,299000150,8
+10679,2,299000190,8
+10680,2,299000200,8
+10681,2,299000210,8
+10682,3,298000050,8
+10683,3,298000060,8
+10684,3,299000060,8
+10685,3,299000170,8
+10686,3,290000120,8
+10687,3,291000050,8
+10688,3,292000020,8
+10689,4,299000670,8
+10690,4,299000680,8
+10691,4,204000010,8
+10692,4,209000040,8
+10693,4,202000070,8
+10694,5,297000100,8
+10695,5,291000020,8
+10696,5,297000130,8
+10697,5,297000140,8
+10698,5,203000010,8
+10699,5,206000030,8
+10700,5,203000050,8
+10701,2,170003,3
+10702,2,180003,3
+10703,3,170004,3
+10704,3,180004,3
+10705,4,140000,3
+10706,5,150010,3
+10707,5,150020,3
+10708,5,150030,3
+10709,5,150040,3
+10711,3,101000050,1
+10712,3,101000060,1
+10713,3,101000080,1
+10714,3,101000040,1
+10715,3,109000060,1
+10716,3,109000070,1
+10717,3,109000080,1
+10718,3,105000060,1
+10719,3,105000070,1
+10720,3,105000080,1
+10721,3,104000050,1
+10722,3,106000050,1
+10723,3,102000060,1
+10724,3,102000070,1
+10725,3,102000080,1
+10726,3,103000050,1
+10727,3,105000050,1
+10728,3,107000060,1
+10729,3,107000070,1
+10730,3,107000080,1
+10731,3,108000050,1
+10732,3,109000050,1
+10733,3,103000060,1
+10734,3,103000070,1
+10735,3,103000080,1
+10736,3,110000050,1
+10737,3,106000060,1
+10738,3,106000070,1
+10739,3,106000080,1
+10740,3,101000070,1
+10741,3,110000060,1
+10742,3,104000060,1
+10743,3,104000070,1
+10744,3,104000080,1
+10745,3,102000050,1
+10746,3,104000170,1
+10747,3,104000260,1
+10748,3,111000010,1
+10749,3,111000020,1
+10750,3,111000030,1
+10751,3,112000020,1
+10752,3,112000030,1
+10753,3,108000060,1
+10754,3,108000070,1
+10755,3,108000080,1
+10756,3,107000050,1
+10757,3,112000010,1
+10758,3,110000070,1
+10759,3,110000080,1
+10760,3,118000020,1
+10761,3,118000030,1
+10762,3,118000040,1
+10763,4,101000090,1
+10764,4,101000100,1
+10765,4,101000110,1
+10766,4,109000100,1
+10767,4,105000100,1
+10768,4,105000110,1
+10769,4,108000090,1
+10770,4,110000090,1
+10771,4,102000100,1
+10772,4,102000110,1
+10773,4,106000090,1
+10774,4,109000090,1
+10775,4,107000100,1
+10776,4,103000090,1
+10777,4,102000090,1
+10778,4,103000100,1
+10779,4,106000100,1
+10780,4,106000110,1
+10781,4,104000090,1
+10782,4,104000100,1
+10783,4,104000110,1
+10784,4,107000090,1
+10785,4,104000180,1
+10786,4,111000040,1
+10787,4,112000040,1
+10788,4,108000100,1
+10789,4,105000090,1
+10790,4,110000100,1
+10791,4,118000050,1
+10792,4,118000060,1
+10793,5,101000120,1
+10794,5,109000110,1
+10795,5,105000120,1
+10796,5,102000120,1
+10797,5,107000110,1
+10798,5,103000120,1
+10799,5,106000120,1
+10800,5,104000120,1
+10801,5,104000190,1
+10802,5,111000060,1
+10803,5,112000060,1
+10804,5,108000110,1
+10805,5,110000110,1
+10806,5,118000070,1
+10807,1,201000010,8
+10808,1,292000010,8
+10809,1,299000040,8
+10810,1,299000070,8
+10811,1,299000110,8
+10812,1,299000120,8
+10813,1,299000140,8
+10814,2,202000010,8
+10815,2,290000010,8
+10816,2,299000010,8
+10817,2,299000150,8
+10818,2,299000190,8
+10819,2,299000200,8
+10820,2,299000210,8
+10821,3,298000050,8
+10822,3,298000060,8
+10823,3,299000060,8
+10824,3,299000170,8
+10825,3,290000120,8
+10826,3,291000050,8
+10827,3,292000020,8
+10828,4,299000670,8
+10829,4,299000680,8
+10830,4,204000010,8
+10831,4,209000040,8
+10832,4,202000070,8
+10833,5,297000100,8
+10834,5,291000020,8
+10835,5,297000130,8
+10836,5,297000140,8
+10837,5,203000010,8
+10838,5,206000030,8
+10839,5,203000050,8
+10840,3,170004,3
+10841,3,180004,3
+10842,4,140000,3
+10843,5,150010,3
+10844,5,150020,3
+10845,5,150030,3
+10846,5,150040,3
+10848,3,101000050,1
+10849,3,101000060,1
+10850,3,101000080,1
+10851,3,101000040,1
+10852,3,109000060,1
+10853,3,109000070,1
+10854,3,109000080,1
+10855,3,105000060,1
+10856,3,105000070,1
+10857,3,105000080,1
+10858,3,104000050,1
+10859,3,106000050,1
+10860,3,102000060,1
+10861,3,102000070,1
+10862,3,102000080,1
+10863,3,103000050,1
+10864,3,105000050,1
+10865,3,107000060,1
+10866,3,107000070,1
+10867,3,107000080,1
+10868,3,108000050,1
+10869,3,109000050,1
+10870,3,103000060,1
+10871,3,103000070,1
+10872,3,103000080,1
+10873,3,110000050,1
+10874,3,106000060,1
+10875,3,106000070,1
+10876,3,106000080,1
+10877,3,101000070,1
+10878,3,110000060,1
+10879,3,104000060,1
+10880,3,104000070,1
+10881,3,104000080,1
+10882,3,102000050,1
+10883,3,104000170,1
+10884,3,104000260,1
+10885,3,111000010,1
+10886,3,111000020,1
+10887,3,111000030,1
+10888,3,112000020,1
+10889,3,112000030,1
+10890,3,108000060,1
+10891,3,108000070,1
+10892,3,108000080,1
+10893,3,107000050,1
+10894,3,112000010,1
+10895,3,110000070,1
+10896,3,110000080,1
+10897,3,118000020,1
+10898,3,118000030,1
+10899,3,118000040,1
+10900,4,101000090,1
+10901,4,101000100,1
+10902,4,101000110,1
+10903,4,109000100,1
+10904,4,105000100,1
+10905,4,105000110,1
+10906,4,108000090,1
+10907,4,110000090,1
+10908,4,102000100,1
+10909,4,102000110,1
+10910,4,106000090,1
+10911,4,109000090,1
+10912,4,107000100,1
+10913,4,103000090,1
+10914,4,102000090,1
+10915,4,103000100,1
+10916,4,106000100,1
+10917,4,106000110,1
+10918,4,104000090,1
+10919,4,104000100,1
+10920,4,104000110,1
+10921,4,107000090,1
+10922,4,104000180,1
+10923,4,111000040,1
+10924,4,112000040,1
+10925,4,108000100,1
+10926,4,105000090,1
+10927,4,110000100,1
+10928,4,118000050,1
+10929,4,118000060,1
+10930,5,101000120,1
+10931,5,109000110,1
+10932,5,105000120,1
+10933,5,102000120,1
+10934,5,107000110,1
+10935,5,103000120,1
+10936,5,106000120,1
+10937,5,104000120,1
+10938,5,104000190,1
+10939,5,111000060,1
+10940,5,112000060,1
+10941,5,108000110,1
+10942,5,110000110,1
+10943,5,118000070,1
+10944,1,201000010,8
+10945,1,292000010,8
+10946,1,299000040,8
+10947,1,299000070,8
+10948,1,299000110,8
+10949,1,299000120,8
+10950,1,299000140,8
+10951,2,202000010,8
+10952,2,290000010,8
+10953,2,299000010,8
+10954,2,299000150,8
+10955,2,299000190,8
+10956,2,299000200,8
+10957,2,299000210,8
+10958,3,298000050,8
+10959,3,298000060,8
+10960,3,299000060,8
+10961,3,299000170,8
+10962,3,290000120,8
+10963,3,291000050,8
+10964,3,292000020,8
+10965,4,299000670,8
+10966,4,299000680,8
+10967,4,204000010,8
+10968,4,209000040,8
+10969,4,202000070,8
+10970,5,297000100,8
+10971,5,291000020,8
+10972,5,297000130,8
+10973,5,297000140,8
+10974,5,203000010,8
+10975,5,206000030,8
+10976,5,203000050,8
+10977,3,170004,3
+10978,3,180004,3
+10979,4,140000,3
+10980,5,150010,3
+10981,5,150020,3
+10982,5,150030,3
+10983,5,150040,3
+10985,3,101000050,1
+10986,3,101000060,1
+10987,3,101000080,1
+10988,3,101000040,1
+10989,3,109000060,1
+10990,3,109000070,1
+10991,3,109000080,1
+10992,3,105000060,1
+10993,3,105000070,1
+10994,3,105000080,1
+10995,3,104000050,1
+10996,3,106000050,1
+10997,3,102000060,1
+10998,3,102000070,1
+10999,3,102000080,1
+11000,3,103000050,1
+11001,3,105000050,1
+11002,3,107000060,1
+11003,3,107000070,1
+11004,3,107000080,1
+11005,3,108000050,1
+11006,3,109000050,1
+11007,3,103000060,1
+11008,3,103000070,1
+11009,3,103000080,1
+11010,3,110000050,1
+11011,3,106000060,1
+11012,3,106000070,1
+11013,3,106000080,1
+11014,3,101000070,1
+11015,3,110000060,1
+11016,3,104000060,1
+11017,3,104000070,1
+11018,3,104000080,1
+11019,3,102000050,1
+11020,3,104000170,1
+11021,3,104000260,1
+11022,3,111000010,1
+11023,3,111000020,1
+11024,3,111000030,1
+11025,3,112000020,1
+11026,3,112000030,1
+11027,3,108000060,1
+11028,3,108000070,1
+11029,3,108000080,1
+11030,3,107000050,1
+11031,3,112000010,1
+11032,3,110000070,1
+11033,3,110000080,1
+11034,3,118000020,1
+11035,3,118000030,1
+11036,3,118000040,1
+11037,4,101000090,1
+11038,4,101000100,1
+11039,4,101000110,1
+11040,4,109000100,1
+11041,4,105000100,1
+11042,4,105000110,1
+11043,4,108000090,1
+11044,4,110000090,1
+11045,4,102000100,1
+11046,4,102000110,1
+11047,4,106000090,1
+11048,4,109000090,1
+11049,4,107000100,1
+11050,4,103000090,1
+11051,4,102000090,1
+11052,4,103000100,1
+11053,4,106000100,1
+11054,4,106000110,1
+11055,4,104000090,1
+11056,4,104000100,1
+11057,4,104000110,1
+11058,4,107000090,1
+11059,4,104000180,1
+11060,4,111000040,1
+11061,4,112000040,1
+11062,4,108000100,1
+11063,4,105000090,1
+11064,4,110000100,1
+11065,4,118000050,1
+11066,4,118000060,1
+11067,5,101000120,1
+11068,5,109000110,1
+11069,5,105000120,1
+11070,5,102000120,1
+11071,5,107000110,1
+11072,5,103000120,1
+11073,5,106000120,1
+11074,5,104000120,1
+11075,5,104000190,1
+11076,5,111000060,1
+11077,5,112000060,1
+11078,5,108000110,1
+11079,5,110000110,1
+11080,5,118000070,1
+11081,1,201000010,8
+11082,1,292000010,8
+11083,1,299000040,8
+11084,1,299000070,8
+11085,1,299000110,8
+11086,1,299000120,8
+11087,1,299000140,8
+11088,2,202000010,8
+11089,2,290000010,8
+11090,2,299000010,8
+11091,2,299000150,8
+11092,2,299000190,8
+11093,2,299000200,8
+11094,2,299000210,8
+11095,3,298000050,8
+11096,3,298000060,8
+11097,3,299000060,8
+11098,3,299000170,8
+11099,3,290000120,8
+11100,3,291000050,8
+11101,3,292000020,8
+11102,4,299000670,8
+11103,4,299000680,8
+11104,4,204000010,8
+11105,4,209000040,8
+11106,4,202000070,8
+11107,5,297000100,8
+11108,5,291000020,8
+11109,5,297000130,8
+11110,5,297000140,8
+11111,5,203000010,8
+11112,5,206000030,8
+11113,5,203000050,8
+11114,3,170004,3
+11115,3,180004,3
+11116,4,140000,3
+11117,5,150010,3
+11118,5,150020,3
+11119,5,150030,3
+11120,5,150040,3
+11121,5,190000,3
+11122,5,200000,3
+11123,5,210000,3
+11125,3,118000020,1
+11126,3,118000030,1
+11127,3,118000040,1
+11128,3,106000060,1
+11129,3,106000070,1
+11130,3,106000080,1
+11131,3,101000070,1
+11132,3,110000060,1
+11133,3,104000060,1
+11134,3,104000070,1
+11135,3,104000080,1
+11136,3,102000050,1
+11137,3,104000170,1
+11138,3,104000260,1
+11139,4,118000050,1
+11140,4,118000060,1
+11141,4,106000100,1
+11142,4,106000110,1
+11143,4,104000090,1
+11144,4,104000100,1
+11145,4,104000110,1
+11146,4,104000270,1
+11147,4,107000090,1
+11148,4,104000180,1
+11149,5,118000070,1
+11150,5,106000120,1
+11151,5,104000120,1
+11152,5,104000190,1
+11153,1,103000000,2
+11154,2,103000001,2
+11155,3,103000002,2
+11156,4,103000003,2
+11157,5,103000004,2
+11158,1,111000000,2
+11159,2,111000001,2
+11160,3,111000002,2
+11161,4,111000003,2
+11162,5,111000004,2
+11163,1,115000000,2
+11164,2,115000001,2
+11165,3,115000002,2
+11166,4,115000003,2
+11167,5,115000004,2
+11168,3,170004,3
+11169,4,170005,3
+11170,3,180004,3
+11171,4,180005,3
+11172,4,140000,3
+11173,4,150010,3
+11174,4,150020,3
+11175,4,150030,3
+11176,4,150040,3
+11178,3,111000010,1
+11179,3,111000020,1
+11180,3,111000030,1
+11181,3,112000020,1
+11182,3,112000030,1
+11183,3,108000060,1
+11184,3,108000070,1
+11185,3,108000080,1
+11186,3,107000050,1
+11187,3,112000010,1
+11188,3,110000070,1
+11189,3,110000080,1
+11190,4,111000040,1
+11191,4,112000040,1
+11192,4,108000100,1
+11193,4,105000090,1
+11194,4,110000100,1
+11195,5,111000060,1
+11196,5,112000060,1
+11197,5,108000110,1
+11198,5,110000110,1
+11199,1,108000000,2
+11200,2,108000001,2
+11201,3,108000002,2
+11202,4,108000003,2
+11203,5,108000004,2
+11204,1,107000000,2
+11205,2,107000001,2
+11206,3,107000002,2
+11207,4,107000003,2
+11208,5,107000004,2
+11209,1,120000000,2
+11210,2,120000001,2
+11211,3,120000002,2
+11212,4,120000003,2
+11213,5,120000004,2
+11214,4,110024,3
+11215,4,110034,3
+11216,4,110044,3
+11217,4,110054,3
+11218,3,110060,3
+11219,3,110070,3
+11220,3,110080,3
+11221,3,110090,3
+11222,3,110100,3
+11223,3,110110,3
+11224,3,110120,3
+11225,3,110130,3
+11226,3,110140,3
+11227,3,110150,3
+11228,3,110160,3
+11229,3,110170,3
+11230,3,110180,3
+11231,3,110190,3
+11232,3,110200,3
+11233,3,110210,3
+11234,3,110220,3
+11235,3,110230,3
+11236,3,110240,3
+11237,3,110250,3
+11238,3,110260,3
+11239,3,110270,3
+11240,3,110620,3
+11241,3,110670,3
+11242,4,140000,3
+11243,4,150010,3
+11244,4,150020,3
+11245,4,150030,3
+11246,4,150040,3
+11248,3,101000050,1
+11249,3,101000060,1
+11250,3,101000080,1
+11251,3,101000040,1
+11252,3,109000060,1
+11253,3,109000070,1
+11254,3,109000080,1
+11255,3,105000060,1
+11256,3,105000070,1
+11257,3,105000080,1
+11258,3,104000050,1
+11259,3,106000050,1
+11260,4,101000090,1
+11261,4,101000100,1
+11262,4,101000110,1
+11263,4,109000100,1
+11264,4,105000100,1
+11265,4,105000110,1
+11266,4,108000090,1
+11267,4,110000090,1
+11268,5,101000120,1
+11269,5,109000110,1
+11270,5,105000120,1
+11271,1,101000000,2
+11272,2,101000001,2
+11273,3,101000002,2
+11274,4,101000008,2
+11275,5,101000004,2
+11276,1,109000000,2
+11277,2,109000001,2
+11278,3,109000002,2
+11279,4,109000003,2
+11280,5,109000004,2
+11281,4,120024,3
+11282,4,120034,3
+11283,4,120044,3
+11284,4,120054,3
+11285,3,120241,3
+11286,3,120251,3
+11287,3,120261,3
+11288,3,120271,3
+11289,3,120300,3
+11290,3,120310,3
+11291,3,120320,3
+11292,3,120330,3
+11293,3,120340,3
+11294,3,120350,3
+11295,3,120360,3
+11296,3,120370,3
+11297,3,120380,3
+11298,3,120390,3
+11299,3,120400,3
+11300,3,120410,3
+11301,3,120420,3
+11302,3,120430,3
+11303,3,120450,3
+11304,3,120460,3
+11305,3,120550,3
+11306,3,120560,3
+11307,3,120570,3
+11308,3,120990,3
+11309,3,121000,3
+11310,3,121010,3
+11311,3,121020,3
+11312,3,121100,3
+11313,4,140000,3
+11314,4,150010,3
+11315,4,150020,3
+11316,4,150030,3
+11317,4,150040,3
+11319,3,102000060,1
+11320,3,102000070,1
+11321,3,102000080,1
+11322,3,103000050,1
+11323,3,105000050,1
+11324,3,107000060,1
+11325,3,107000070,1
+11326,3,107000080,1
+11327,3,108000050,1
+11328,3,109000050,1
+11329,3,103000060,1
+11330,3,103000070,1
+11331,3,103000080,1
+11332,3,110000050,1
+11333,4,102000100,1
+11334,4,102000110,1
+11335,4,102000350,1
+11336,4,106000090,1
+11337,4,109000090,1
+11338,4,107000100,1
+11339,4,103000090,1
+11340,4,102000090,1
+11341,4,103000100,1
+11342,5,102000120,1
+11343,5,107000110,1
+11344,5,103000120,1
+11345,1,102000000,2
+11346,2,102000001,2
+11347,3,102000002,2
+11348,4,102000003,2
+11349,5,102000004,2
+11350,1,105000000,2
+11351,2,105000001,2
+11352,3,105000002,2
+11353,4,105000003,2
+11354,5,105000004,2
+11355,1,112000000,2
+11356,2,112000001,2
+11357,3,112000002,2
+11358,4,112000003,2
+11359,5,112000004,2
+11360,4,130024,3
+11361,4,130034,3
+11362,4,130044,3
+11363,4,130054,3
+11364,3,130060,3
+11365,3,130070,3
+11366,3,130080,3
+11367,3,130090,3
+11368,3,130100,3
+11369,3,130110,3
+11370,3,130120,3
+11371,3,130130,3
+11372,3,130140,3
+11373,3,130150,3
+11374,3,130160,3
+11375,3,130170,3
+11376,3,130180,3
+11377,3,130190,3
+11378,3,130200,3
+11379,3,130420,3
+11380,3,130510,3
+11381,3,130520,3
+11382,3,130531,3
+11383,3,130540,3
+11384,3,130660,3
+11385,3,130790,3
+11386,3,130800,3
+11387,3,131130,3
+11388,4,140000,3
+11389,4,150010,3
+11390,4,150020,3
+11391,4,150030,3
+11392,4,150040,3
+11394,1,101000010,1
+11395,1,102000010,1
+11396,1,103000010,1
+11397,1,104000010,1
+11398,1,105000010,1
+11399,1,106000010,1
+11400,1,107000010,1
+11401,1,108000010,1
+11402,1,109000010,1
+11403,1,110000010,1
+11404,2,101000020,1
+11405,2,101000030,1
+11406,2,102000020,1
+11407,2,102000030,1
+11408,2,102000040,1
+11409,2,103000020,1
+11410,2,103000030,1
+11411,2,103000040,1
+11412,2,104000020,1
+11413,2,104000030,1
+11414,2,104000040,1
+11415,2,105000020,1
+11416,2,105000030,1
+11417,2,105000040,1
+11418,2,106000020,1
+11419,2,106000030,1
+11420,2,106000040,1
+11421,2,107000020,1
+11422,2,107000030,1
+11423,2,107000040,1
+11424,2,108000020,1
+11425,2,108000030,1
+11426,2,108000040,1
+11427,2,109000020,1
+11428,2,109000030,1
+11429,2,109000040,1
+11430,2,110000020,1
+11431,2,110000030,1
+11432,2,110000040,1
+11433,2,118000010,1
+11434,3,101000050,1
+11435,3,101000060,1
+11436,3,101000080,1
+11437,3,101000040,1
+11438,3,109000060,1
+11439,3,109000070,1
+11440,3,109000080,1
+11441,3,105000060,1
+11442,3,105000070,1
+11443,3,105000080,1
+11444,3,104000050,1
+11445,3,106000050,1
+11446,3,102000060,1
+11447,3,102000070,1
+11448,3,102000080,1
+11449,3,103000050,1
+11450,3,105000050,1
+11451,3,107000060,1
+11452,3,107000070,1
+11453,3,107000080,1
+11454,3,108000050,1
+11455,3,109000050,1
+11456,3,103000060,1
+11457,3,103000070,1
+11458,3,103000080,1
+11459,3,110000050,1
+11460,3,106000060,1
+11461,3,106000070,1
+11462,3,106000080,1
+11463,3,101000070,1
+11464,3,110000060,1
+11465,3,104000060,1
+11466,3,104000070,1
+11467,3,104000080,1
+11468,3,102000050,1
+11469,3,104000170,1
+11470,3,104000260,1
+11471,3,111000010,1
+11472,3,111000020,1
+11473,3,111000030,1
+11474,3,112000020,1
+11475,3,112000030,1
+11476,3,108000060,1
+11477,3,108000070,1
+11478,3,108000080,1
+11479,3,107000050,1
+11480,3,112000010,1
+11481,3,110000070,1
+11482,3,110000080,1
+11483,3,118000020,1
+11484,3,118000030,1
+11485,3,118000040,1
+11486,4,101000090,1
+11487,4,101000100,1
+11488,4,101000110,1
+11489,4,109000100,1
+11490,4,105000100,1
+11491,4,105000110,1
+11492,4,108000090,1
+11493,4,110000090,1
+11494,4,102000100,1
+11495,4,102000110,1
+11496,4,106000090,1
+11497,4,109000090,1
+11498,4,107000100,1
+11499,4,103000090,1
+11500,4,102000090,1
+11501,4,103000100,1
+11502,4,106000100,1
+11503,4,106000110,1
+11504,4,104000090,1
+11505,4,104000100,1
+11506,4,104000110,1
+11507,4,107000090,1
+11508,4,104000180,1
+11509,4,111000040,1
+11510,4,112000040,1
+11511,4,108000100,1
+11512,4,105000090,1
+11513,4,110000100,1
+11514,4,118000050,1
+11515,4,118000060,1
+11516,5,101000120,1
+11517,5,109000110,1
+11518,5,105000120,1
+11519,5,102000120,1
+11520,5,107000110,1
+11521,5,103000120,1
+11522,5,106000120,1
+11523,5,104000120,1
+11524,5,104000190,1
+11525,5,111000060,1
+11526,5,112000060,1
+11527,5,108000110,1
+11528,5,110000110,1
+11529,5,118000070,1
+11530,1,201000010,8
+11531,1,292000010,8
+11532,1,299000040,8
+11533,1,299000070,8
+11534,1,299000110,8
+11535,1,299000120,8
+11536,1,299000140,8
+11537,2,202000010,8
+11538,2,290000010,8
+11539,2,299000010,8
+11540,2,299000150,8
+11541,2,299000190,8
+11542,2,299000200,8
+11543,2,299000210,8
+11544,3,298000050,8
+11545,3,298000060,8
+11546,3,299000060,8
+11547,3,299000170,8
+11548,3,290000120,8
+11549,3,291000050,8
+11550,3,292000020,8
+11551,4,299000670,8
+11552,4,299000680,8
+11553,4,204000010,8
+11554,4,209000040,8
+11555,4,202000070,8
+11556,4,209000070,8
+11557,5,297000100,8
+11558,5,291000020,8
+11559,5,297000130,8
+11560,5,297000140,8
+11561,5,203000010,8
+11562,5,206000030,8
+11563,5,203000050,8
+11564,5,202000090,8
+11565,1,170002,3
+11566,1,180002,3
+11567,2,170003,3
+11568,2,180003,3
+11569,3,170004,3
+11570,3,180004,3
+11571,4,140000,3
+11572,5,150010,3
+11573,5,150020,3
+11574,5,150030,3
+11575,5,150040,3
+11577,1,101000010,1
+11578,1,102000010,1
+11579,1,103000010,1
+11580,1,104000010,1
+11581,1,105000010,1
+11582,1,106000010,1
+11583,1,107000010,1
+11584,1,108000010,1
+11585,1,109000010,1
+11586,1,110000010,1
+11587,2,101000020,1
+11588,2,101000030,1
+11589,2,102000020,1
+11590,2,102000030,1
+11591,2,102000040,1
+11592,2,103000020,1
+11593,2,103000030,1
+11594,2,103000040,1
+11595,2,104000020,1
+11596,2,104000030,1
+11597,2,104000040,1
+11598,2,105000020,1
+11599,2,105000030,1
+11600,2,105000040,1
+11601,2,106000020,1
+11602,2,106000030,1
+11603,2,106000040,1
+11604,2,107000020,1
+11605,2,107000030,1
+11606,2,107000040,1
+11607,2,108000020,1
+11608,2,108000030,1
+11609,2,108000040,1
+11610,2,109000020,1
+11611,2,109000030,1
+11612,2,109000040,1
+11613,2,110000020,1
+11614,2,110000030,1
+11615,2,110000040,1
+11616,2,118000010,1
+11617,3,101000050,1
+11618,3,101000060,1
+11619,3,101000080,1
+11620,3,101000040,1
+11621,3,109000060,1
+11622,3,109000070,1
+11623,3,109000080,1
+11624,3,105000060,1
+11625,3,105000070,1
+11626,3,105000080,1
+11627,3,104000050,1
+11628,3,106000050,1
+11629,3,102000060,1
+11630,3,102000070,1
+11631,3,102000080,1
+11632,3,103000050,1
+11633,3,105000050,1
+11634,3,107000060,1
+11635,3,107000070,1
+11636,3,107000080,1
+11637,3,108000050,1
+11638,3,109000050,1
+11639,3,103000060,1
+11640,3,103000070,1
+11641,3,103000080,1
+11642,3,110000050,1
+11643,3,106000060,1
+11644,3,106000070,1
+11645,3,106000080,1
+11646,3,101000070,1
+11647,3,110000060,1
+11648,3,104000060,1
+11649,3,104000070,1
+11650,3,104000080,1
+11651,3,102000050,1
+11652,3,104000170,1
+11653,3,104000260,1
+11654,3,111000010,1
+11655,3,111000020,1
+11656,3,111000030,1
+11657,3,112000020,1
+11658,3,112000030,1
+11659,3,108000060,1
+11660,3,108000070,1
+11661,3,108000080,1
+11662,3,107000050,1
+11663,3,112000010,1
+11664,3,110000070,1
+11665,3,110000080,1
+11666,3,118000020,1
+11667,3,118000030,1
+11668,3,118000040,1
+11669,4,101000090,1
+11670,4,101000100,1
+11671,4,101000110,1
+11672,4,109000100,1
+11673,4,105000100,1
+11674,4,105000110,1
+11675,4,108000090,1
+11676,4,110000090,1
+11677,4,102000100,1
+11678,4,102000110,1
+11679,4,106000090,1
+11680,4,109000090,1
+11681,4,107000100,1
+11682,4,103000090,1
+11683,4,102000090,1
+11684,4,103000100,1
+11685,4,106000100,1
+11686,4,106000110,1
+11687,4,104000090,1
+11688,4,104000100,1
+11689,4,104000110,1
+11690,4,107000090,1
+11691,4,104000180,1
+11692,4,111000040,1
+11693,4,112000040,1
+11694,4,108000100,1
+11695,4,105000090,1
+11696,4,110000100,1
+11697,4,118000050,1
+11698,4,118000060,1
+11699,5,101000120,1
+11700,5,109000110,1
+11701,5,105000120,1
+11702,5,102000120,1
+11703,5,107000110,1
+11704,5,103000120,1
+11705,5,106000120,1
+11706,5,104000120,1
+11707,5,104000190,1
+11708,5,111000060,1
+11709,5,112000060,1
+11710,5,108000110,1
+11711,5,110000110,1
+11712,5,118000070,1
+11713,1,201000010,8
+11714,1,292000010,8
+11715,1,299000040,8
+11716,1,299000070,8
+11717,1,299000110,8
+11718,1,299000120,8
+11719,1,299000140,8
+11720,2,202000010,8
+11721,2,290000010,8
+11722,2,299000010,8
+11723,2,299000150,8
+11724,2,299000190,8
+11725,2,299000200,8
+11726,2,299000210,8
+11727,3,298000050,8
+11728,3,298000060,8
+11729,3,299000060,8
+11730,3,299000170,8
+11731,3,290000120,8
+11732,3,291000050,8
+11733,3,292000020,8
+11734,4,299000670,8
+11735,4,299000680,8
+11736,4,204000010,8
+11737,4,209000040,8
+11738,4,202000070,8
+11739,4,209000070,8
+11740,5,297000100,8
+11741,5,291000020,8
+11742,5,297000130,8
+11743,5,297000140,8
+11744,5,203000010,8
+11745,5,206000030,8
+11746,5,203000050,8
+11747,5,202000090,8
+11748,2,170003,3
+11749,2,180003,3
+11750,3,170004,3
+11751,3,180004,3
+11752,4,140000,3
+11753,5,150010,3
+11754,5,150020,3
+11755,5,150030,3
+11756,5,150040,3
+11758,3,101000050,1
+11759,3,101000060,1
+11760,3,101000080,1
+11761,3,101000040,1
+11762,3,109000060,1
+11763,3,109000070,1
+11764,3,109000080,1
+11765,3,105000060,1
+11766,3,105000070,1
+11767,3,105000080,1
+11768,3,104000050,1
+11769,3,106000050,1
+11770,3,102000060,1
+11771,3,102000070,1
+11772,3,102000080,1
+11773,3,103000050,1
+11774,3,105000050,1
+11775,3,107000060,1
+11776,3,107000070,1
+11777,3,107000080,1
+11778,3,108000050,1
+11779,3,109000050,1
+11780,3,103000060,1
+11781,3,103000070,1
+11782,3,103000080,1
+11783,3,110000050,1
+11784,3,106000060,1
+11785,3,106000070,1
+11786,3,106000080,1
+11787,3,101000070,1
+11788,3,110000060,1
+11789,3,104000060,1
+11790,3,104000070,1
+11791,3,104000080,1
+11792,3,102000050,1
+11793,3,104000170,1
+11794,3,104000260,1
+11795,3,111000010,1
+11796,3,111000020,1
+11797,3,111000030,1
+11798,3,112000020,1
+11799,3,112000030,1
+11800,3,108000060,1
+11801,3,108000070,1
+11802,3,108000080,1
+11803,3,107000050,1
+11804,3,112000010,1
+11805,3,110000070,1
+11806,3,110000080,1
+11807,3,118000020,1
+11808,3,118000030,1
+11809,3,118000040,1
+11810,4,101000090,1
+11811,4,101000100,1
+11812,4,101000110,1
+11813,4,109000100,1
+11814,4,105000100,1
+11815,4,105000110,1
+11816,4,108000090,1
+11817,4,110000090,1
+11818,4,102000100,1
+11819,4,102000110,1
+11820,4,106000090,1
+11821,4,109000090,1
+11822,4,107000100,1
+11823,4,103000090,1
+11824,4,102000090,1
+11825,4,103000100,1
+11826,4,106000100,1
+11827,4,106000110,1
+11828,4,104000090,1
+11829,4,104000100,1
+11830,4,104000110,1
+11831,4,107000090,1
+11832,4,104000180,1
+11833,4,111000040,1
+11834,4,112000040,1
+11835,4,108000100,1
+11836,4,105000090,1
+11837,4,110000100,1
+11838,4,118000050,1
+11839,4,118000060,1
+11840,5,101000120,1
+11841,5,109000110,1
+11842,5,105000120,1
+11843,5,102000120,1
+11844,5,107000110,1
+11845,5,103000120,1
+11846,5,106000120,1
+11847,5,104000120,1
+11848,5,104000190,1
+11849,5,111000060,1
+11850,5,112000060,1
+11851,5,108000110,1
+11852,5,110000110,1
+11853,5,118000070,1
+11854,1,201000010,8
+11855,1,292000010,8
+11856,1,299000040,8
+11857,1,299000070,8
+11858,1,299000110,8
+11859,1,299000120,8
+11860,1,299000140,8
+11861,2,202000010,8
+11862,2,290000010,8
+11863,2,299000010,8
+11864,2,299000150,8
+11865,2,299000190,8
+11866,2,299000200,8
+11867,2,299000210,8
+11868,3,298000050,8
+11869,3,298000060,8
+11870,3,299000060,8
+11871,3,299000170,8
+11872,3,290000120,8
+11873,3,291000050,8
+11874,3,292000020,8
+11875,4,299000670,8
+11876,4,299000680,8
+11877,4,204000010,8
+11878,4,209000040,8
+11879,4,202000070,8
+11880,4,209000070,8
+11881,5,297000100,8
+11882,5,291000020,8
+11883,5,297000130,8
+11884,5,297000140,8
+11885,5,203000010,8
+11886,5,206000030,8
+11887,5,203000050,8
+11888,5,202000090,8
+11889,3,170004,3
+11890,3,180004,3
+11891,4,140000,3
+11892,5,150010,3
+11893,5,150020,3
+11894,5,150030,3
+11895,5,150040,3
+11897,3,101000050,1
+11898,3,101000060,1
+11899,3,101000080,1
+11900,3,101000040,1
+11901,3,109000060,1
+11902,3,109000070,1
+11903,3,109000080,1
+11904,3,105000060,1
+11905,3,105000070,1
+11906,3,105000080,1
+11907,3,104000050,1
+11908,3,106000050,1
+11909,3,102000060,1
+11910,3,102000070,1
+11911,3,102000080,1
+11912,3,103000050,1
+11913,3,105000050,1
+11914,3,107000060,1
+11915,3,107000070,1
+11916,3,107000080,1
+11917,3,108000050,1
+11918,3,109000050,1
+11919,3,103000060,1
+11920,3,103000070,1
+11921,3,103000080,1
+11922,3,110000050,1
+11923,3,106000060,1
+11924,3,106000070,1
+11925,3,106000080,1
+11926,3,101000070,1
+11927,3,110000060,1
+11928,3,104000060,1
+11929,3,104000070,1
+11930,3,104000080,1
+11931,3,102000050,1
+11932,3,104000170,1
+11933,3,104000260,1
+11934,3,111000010,1
+11935,3,111000020,1
+11936,3,111000030,1
+11937,3,112000020,1
+11938,3,112000030,1
+11939,3,108000060,1
+11940,3,108000070,1
+11941,3,108000080,1
+11942,3,107000050,1
+11943,3,112000010,1
+11944,3,110000070,1
+11945,3,110000080,1
+11946,3,118000020,1
+11947,3,118000030,1
+11948,3,118000040,1
+11949,4,101000090,1
+11950,4,101000100,1
+11951,4,101000110,1
+11952,4,109000100,1
+11953,4,105000100,1
+11954,4,105000110,1
+11955,4,108000090,1
+11956,4,110000090,1
+11957,4,102000100,1
+11958,4,102000110,1
+11959,4,106000090,1
+11960,4,109000090,1
+11961,4,107000100,1
+11962,4,103000090,1
+11963,4,102000090,1
+11964,4,103000100,1
+11965,4,106000100,1
+11966,4,106000110,1
+11967,4,104000090,1
+11968,4,104000100,1
+11969,4,104000110,1
+11970,4,107000090,1
+11971,4,104000180,1
+11972,4,111000040,1
+11973,4,112000040,1
+11974,4,108000100,1
+11975,4,105000090,1
+11976,4,110000100,1
+11977,4,118000050,1
+11978,4,118000060,1
+11979,5,101000120,1
+11980,5,109000110,1
+11981,5,105000120,1
+11982,5,102000120,1
+11983,5,107000110,1
+11984,5,103000120,1
+11985,5,106000120,1
+11986,5,104000120,1
+11987,5,104000190,1
+11988,5,111000060,1
+11989,5,112000060,1
+11990,5,108000110,1
+11991,5,110000110,1
+11992,5,118000070,1
+11993,1,201000010,8
+11994,1,292000010,8
+11995,1,299000040,8
+11996,1,299000070,8
+11997,1,299000110,8
+11998,1,299000120,8
+11999,1,299000140,8
+12000,2,202000010,8
+12001,2,290000010,8
+12002,2,299000010,8
+12003,2,299000150,8
+12004,2,299000190,8
+12005,2,299000200,8
+12006,2,299000210,8
+12007,3,298000050,8
+12008,3,298000060,8
+12009,3,299000060,8
+12010,3,299000170,8
+12011,3,290000120,8
+12012,3,291000050,8
+12013,3,292000020,8
+12014,4,299000670,8
+12015,4,299000680,8
+12016,4,204000010,8
+12017,4,209000040,8
+12018,4,202000070,8
+12019,4,209000070,8
+12020,5,297000100,8
+12021,5,291000020,8
+12022,5,297000130,8
+12023,5,297000140,8
+12024,5,203000010,8
+12025,5,206000030,8
+12026,5,203000050,8
+12027,5,202000090,8
+12028,3,170004,3
+12029,3,180004,3
+12030,4,140000,3
+12031,5,150010,3
+12032,5,150020,3
+12033,5,150030,3
+12034,5,150040,3
+12036,3,101000050,1
+12037,3,101000060,1
+12038,3,101000080,1
+12039,3,101000040,1
+12040,3,109000060,1
+12041,3,109000070,1
+12042,3,109000080,1
+12043,3,105000060,1
+12044,3,105000070,1
+12045,3,105000080,1
+12046,3,104000050,1
+12047,3,106000050,1
+12048,3,102000060,1
+12049,3,102000070,1
+12050,3,102000080,1
+12051,3,103000050,1
+12052,3,105000050,1
+12053,3,107000060,1
+12054,3,107000070,1
+12055,3,107000080,1
+12056,3,108000050,1
+12057,3,109000050,1
+12058,3,103000060,1
+12059,3,103000070,1
+12060,3,103000080,1
+12061,3,110000050,1
+12062,3,106000060,1
+12063,3,106000070,1
+12064,3,106000080,1
+12065,3,101000070,1
+12066,3,110000060,1
+12067,3,104000060,1
+12068,3,104000070,1
+12069,3,104000080,1
+12070,3,102000050,1
+12071,3,104000170,1
+12072,3,104000260,1
+12073,3,111000010,1
+12074,3,111000020,1
+12075,3,111000030,1
+12076,3,112000020,1
+12077,3,112000030,1
+12078,3,108000060,1
+12079,3,108000070,1
+12080,3,108000080,1
+12081,3,107000050,1
+12082,3,112000010,1
+12083,3,110000070,1
+12084,3,110000080,1
+12085,3,118000020,1
+12086,3,118000030,1
+12087,3,118000040,1
+12088,4,101000090,1
+12089,4,101000100,1
+12090,4,101000110,1
+12091,4,109000100,1
+12092,4,105000100,1
+12093,4,105000110,1
+12094,4,108000090,1
+12095,4,110000090,1
+12096,4,102000100,1
+12097,4,102000110,1
+12098,4,106000090,1
+12099,4,109000090,1
+12100,4,107000100,1
+12101,4,103000090,1
+12102,4,102000090,1
+12103,4,103000100,1
+12104,4,106000100,1
+12105,4,106000110,1
+12106,4,104000090,1
+12107,4,104000100,1
+12108,4,104000110,1
+12109,4,107000090,1
+12110,4,104000180,1
+12111,4,111000040,1
+12112,4,112000040,1
+12113,4,108000100,1
+12114,4,105000090,1
+12115,4,110000100,1
+12116,4,118000050,1
+12117,4,118000060,1
+12118,5,101000120,1
+12119,5,109000110,1
+12120,5,105000120,1
+12121,5,102000120,1
+12122,5,107000110,1
+12123,5,103000120,1
+12124,5,106000120,1
+12125,5,104000120,1
+12126,5,104000190,1
+12127,5,111000060,1
+12128,5,112000060,1
+12129,5,108000110,1
+12130,5,110000110,1
+12131,5,118000070,1
+12132,1,201000010,8
+12133,1,292000010,8
+12134,1,299000040,8
+12135,1,299000070,8
+12136,1,299000110,8
+12137,1,299000120,8
+12138,1,299000140,8
+12139,2,202000010,8
+12140,2,290000010,8
+12141,2,299000010,8
+12142,2,299000150,8
+12143,2,299000190,8
+12144,2,299000200,8
+12145,2,299000210,8
+12146,3,298000050,8
+12147,3,298000060,8
+12148,3,299000060,8
+12149,3,299000170,8
+12150,3,290000120,8
+12151,3,291000050,8
+12152,3,292000020,8
+12153,4,299000670,8
+12154,4,299000680,8
+12155,4,204000010,8
+12156,4,209000040,8
+12157,4,202000070,8
+12158,4,209000070,8
+12159,5,297000100,8
+12160,5,291000020,8
+12161,5,297000130,8
+12162,5,297000140,8
+12163,5,203000010,8
+12164,5,206000030,8
+12165,5,203000050,8
+12166,5,202000090,8
+12167,3,170004,3
+12168,3,180004,3
+12169,4,140000,3
+12170,5,150010,3
+12171,5,150020,3
+12172,5,150030,3
+12173,5,150040,3
+12174,5,190000,3
+12175,5,200000,3
+12176,5,210000,3
+12178,1,101000010,1
+12179,1,102000010,1
+12180,1,103000010,1
+12181,1,104000010,1
+12182,1,105000010,1
+12183,1,106000010,1
+12184,1,107000010,1
+12185,1,108000010,1
+12186,1,109000010,1
+12187,1,110000010,1
+12188,2,101000020,1
+12189,2,101000030,1
+12190,2,102000020,1
+12191,2,102000030,1
+12192,2,102000040,1
+12193,2,103000020,1
+12194,2,103000030,1
+12195,2,103000040,1
+12196,2,104000020,1
+12197,2,104000030,1
+12198,2,104000040,1
+12199,2,105000020,1
+12200,2,105000030,1
+12201,2,105000040,1
+12202,2,106000020,1
+12203,2,106000030,1
+12204,2,106000040,1
+12205,2,107000020,1
+12206,2,107000030,1
+12207,2,107000040,1
+12208,2,108000020,1
+12209,2,108000030,1
+12210,2,108000040,1
+12211,2,109000020,1
+12212,2,109000030,1
+12213,2,109000040,1
+12214,2,110000020,1
+12215,2,110000030,1
+12216,2,110000040,1
+12217,2,118000010,1
+12218,3,101000050,1
+12219,3,101000060,1
+12220,3,101000080,1
+12221,3,101000040,1
+12222,3,109000060,1
+12223,3,109000070,1
+12224,3,109000080,1
+12225,3,105000060,1
+12226,3,105000070,1
+12227,3,105000080,1
+12228,3,104000050,1
+12229,3,106000050,1
+12230,3,102000060,1
+12231,3,102000070,1
+12232,3,102000080,1
+12233,3,103000050,1
+12234,3,105000050,1
+12235,3,107000060,1
+12236,3,107000070,1
+12237,3,107000080,1
+12238,3,108000050,1
+12239,3,109000050,1
+12240,3,103000060,1
+12241,3,103000070,1
+12242,3,103000080,1
+12243,3,110000050,1
+12244,3,106000060,1
+12245,3,106000070,1
+12246,3,106000080,1
+12247,3,101000070,1
+12248,3,110000060,1
+12249,3,104000060,1
+12250,3,104000070,1
+12251,3,104000080,1
+12252,3,102000050,1
+12253,3,104000170,1
+12254,3,104000260,1
+12255,3,111000010,1
+12256,3,111000020,1
+12257,3,111000030,1
+12258,3,112000020,1
+12259,3,112000030,1
+12260,3,108000060,1
+12261,3,108000070,1
+12262,3,108000080,1
+12263,3,107000050,1
+12264,3,112000010,1
+12265,3,110000070,1
+12266,3,110000080,1
+12267,3,118000020,1
+12268,3,118000030,1
+12269,3,118000040,1
+12270,4,101000090,1
+12271,4,101000100,1
+12272,4,101000110,1
+12273,4,109000100,1
+12274,4,105000100,1
+12275,4,105000110,1
+12276,4,108000090,1
+12277,4,110000090,1
+12278,4,102000100,1
+12279,4,102000110,1
+12280,4,106000090,1
+12281,4,109000090,1
+12282,4,107000100,1
+12283,4,103000090,1
+12284,4,102000090,1
+12285,4,103000100,1
+12286,4,106000100,1
+12287,4,106000110,1
+12288,4,104000090,1
+12289,4,104000100,1
+12290,4,104000110,1
+12291,4,107000090,1
+12292,4,104000180,1
+12293,4,111000040,1
+12294,4,112000040,1
+12295,4,108000100,1
+12296,4,105000090,1
+12297,4,110000100,1
+12298,4,118000050,1
+12299,4,118000060,1
+12300,5,101000120,1
+12301,5,109000110,1
+12302,5,105000120,1
+12303,5,102000120,1
+12304,5,107000110,1
+12305,5,103000120,1
+12306,5,106000120,1
+12307,5,104000120,1
+12308,5,104000190,1
+12309,5,111000060,1
+12310,5,112000060,1
+12311,5,108000110,1
+12312,5,110000110,1
+12313,5,118000070,1
+12314,1,201000010,8
+12315,1,292000010,8
+12316,1,299000040,8
+12317,1,299000070,8
+12318,1,299000110,8
+12319,1,299000120,8
+12320,1,299000140,8
+12321,2,202000010,8
+12322,2,290000010,8
+12323,2,299000010,8
+12324,2,299000150,8
+12325,2,299000190,8
+12326,2,299000200,8
+12327,2,299000210,8
+12328,3,298000050,8
+12329,3,298000060,8
+12330,3,299000060,8
+12331,3,299000170,8
+12332,3,290000120,8
+12333,3,291000050,8
+12334,3,292000020,8
+12335,4,299000670,8
+12336,4,299000680,8
+12337,4,204000010,8
+12338,4,209000040,8
+12339,4,202000070,8
+12340,4,209000070,8
+12341,4,203000110,8
+12342,5,297000100,8
+12343,5,291000020,8
+12344,5,297000130,8
+12345,5,297000140,8
+12346,5,203000010,8
+12347,5,206000030,8
+12348,5,203000050,8
+12349,5,202000090,8
+12350,5,204000080,8
+12351,1,170002,3
+12352,1,180002,3
+12353,2,170003,3
+12354,2,180003,3
+12355,3,170004,3
+12356,3,180004,3
+12357,4,140000,3
+12358,5,150010,3
+12359,5,150020,3
+12360,5,150030,3
+12361,5,150040,3
+12363,1,101000010,1
+12364,1,102000010,1
+12365,1,103000010,1
+12366,1,104000010,1
+12367,1,105000010,1
+12368,1,106000010,1
+12369,1,107000010,1
+12370,1,108000010,1
+12371,1,109000010,1
+12372,1,110000010,1
+12373,2,101000020,1
+12374,2,101000030,1
+12375,2,102000020,1
+12376,2,102000030,1
+12377,2,102000040,1
+12378,2,103000020,1
+12379,2,103000030,1
+12380,2,103000040,1
+12381,2,104000020,1
+12382,2,104000030,1
+12383,2,104000040,1
+12384,2,105000020,1
+12385,2,105000030,1
+12386,2,105000040,1
+12387,2,106000020,1
+12388,2,106000030,1
+12389,2,106000040,1
+12390,2,107000020,1
+12391,2,107000030,1
+12392,2,107000040,1
+12393,2,108000020,1
+12394,2,108000030,1
+12395,2,108000040,1
+12396,2,109000020,1
+12397,2,109000030,1
+12398,2,109000040,1
+12399,2,110000020,1
+12400,2,110000030,1
+12401,2,110000040,1
+12402,2,118000010,1
+12403,3,101000050,1
+12404,3,101000060,1
+12405,3,101000080,1
+12406,3,101000040,1
+12407,3,109000060,1
+12408,3,109000070,1
+12409,3,109000080,1
+12410,3,105000060,1
+12411,3,105000070,1
+12412,3,105000080,1
+12413,3,104000050,1
+12414,3,106000050,1
+12415,3,102000060,1
+12416,3,102000070,1
+12417,3,102000080,1
+12418,3,103000050,1
+12419,3,105000050,1
+12420,3,107000060,1
+12421,3,107000070,1
+12422,3,107000080,1
+12423,3,108000050,1
+12424,3,109000050,1
+12425,3,103000060,1
+12426,3,103000070,1
+12427,3,103000080,1
+12428,3,110000050,1
+12429,3,106000060,1
+12430,3,106000070,1
+12431,3,106000080,1
+12432,3,101000070,1
+12433,3,110000060,1
+12434,3,104000060,1
+12435,3,104000070,1
+12436,3,104000080,1
+12437,3,102000050,1
+12438,3,104000170,1
+12439,3,104000260,1
+12440,3,111000010,1
+12441,3,111000020,1
+12442,3,111000030,1
+12443,3,112000020,1
+12444,3,112000030,1
+12445,3,108000060,1
+12446,3,108000070,1
+12447,3,108000080,1
+12448,3,107000050,1
+12449,3,112000010,1
+12450,3,110000070,1
+12451,3,110000080,1
+12452,3,118000020,1
+12453,3,118000030,1
+12454,3,118000040,1
+12455,4,101000090,1
+12456,4,101000100,1
+12457,4,101000110,1
+12458,4,109000100,1
+12459,4,105000100,1
+12460,4,105000110,1
+12461,4,108000090,1
+12462,4,110000090,1
+12463,4,102000100,1
+12464,4,102000110,1
+12465,4,106000090,1
+12466,4,109000090,1
+12467,4,107000100,1
+12468,4,103000090,1
+12469,4,102000090,1
+12470,4,103000100,1
+12471,4,106000100,1
+12472,4,106000110,1
+12473,4,104000090,1
+12474,4,104000100,1
+12475,4,104000110,1
+12476,4,107000090,1
+12477,4,104000180,1
+12478,4,111000040,1
+12479,4,112000040,1
+12480,4,108000100,1
+12481,4,105000090,1
+12482,4,110000100,1
+12483,4,118000050,1
+12484,4,118000060,1
+12485,5,101000120,1
+12486,5,109000110,1
+12487,5,105000120,1
+12488,5,102000120,1
+12489,5,107000110,1
+12490,5,103000120,1
+12491,5,106000120,1
+12492,5,104000120,1
+12493,5,104000190,1
+12494,5,111000060,1
+12495,5,112000060,1
+12496,5,108000110,1
+12497,5,110000110,1
+12498,5,118000070,1
+12499,1,201000010,8
+12500,1,292000010,8
+12501,1,299000040,8
+12502,1,299000070,8
+12503,1,299000110,8
+12504,1,299000120,8
+12505,1,299000140,8
+12506,2,202000010,8
+12507,2,290000010,8
+12508,2,299000010,8
+12509,2,299000150,8
+12510,2,299000190,8
+12511,2,299000200,8
+12512,2,299000210,8
+12513,3,298000050,8
+12514,3,298000060,8
+12515,3,299000060,8
+12516,3,299000170,8
+12517,3,290000120,8
+12518,3,291000050,8
+12519,3,292000020,8
+12520,4,299000670,8
+12521,4,299000680,8
+12522,4,204000010,8
+12523,4,209000040,8
+12524,4,202000070,8
+12525,4,209000070,8
+12526,4,203000110,8
+12527,5,297000100,8
+12528,5,291000020,8
+12529,5,297000130,8
+12530,5,297000140,8
+12531,5,203000010,8
+12532,5,206000030,8
+12533,5,203000050,8
+12534,5,202000090,8
+12535,5,204000080,8
+12536,2,170003,3
+12537,2,180003,3
+12538,3,170004,3
+12539,3,180004,3
+12540,4,140000,3
+12541,5,150010,3
+12542,5,150020,3
+12543,5,150030,3
+12544,5,150040,3
+12546,3,101000050,1
+12547,3,101000060,1
+12548,3,101000080,1
+12549,3,101000040,1
+12550,3,109000060,1
+12551,3,109000070,1
+12552,3,109000080,1
+12553,3,105000060,1
+12554,3,105000070,1
+12555,3,105000080,1
+12556,3,104000050,1
+12557,3,106000050,1
+12558,3,102000060,1
+12559,3,102000070,1
+12560,3,102000080,1
+12561,3,103000050,1
+12562,3,105000050,1
+12563,3,107000060,1
+12564,3,107000070,1
+12565,3,107000080,1
+12566,3,108000050,1
+12567,3,109000050,1
+12568,3,103000060,1
+12569,3,103000070,1
+12570,3,103000080,1
+12571,3,110000050,1
+12572,3,106000060,1
+12573,3,106000070,1
+12574,3,106000080,1
+12575,3,101000070,1
+12576,3,110000060,1
+12577,3,104000060,1
+12578,3,104000070,1
+12579,3,104000080,1
+12580,3,102000050,1
+12581,3,104000170,1
+12582,3,104000260,1
+12583,3,111000010,1
+12584,3,111000020,1
+12585,3,111000030,1
+12586,3,112000020,1
+12587,3,112000030,1
+12588,3,108000060,1
+12589,3,108000070,1
+12590,3,108000080,1
+12591,3,107000050,1
+12592,3,112000010,1
+12593,3,110000070,1
+12594,3,110000080,1
+12595,3,118000020,1
+12596,3,118000030,1
+12597,3,118000040,1
+12598,4,101000090,1
+12599,4,101000100,1
+12600,4,101000110,1
+12601,4,109000100,1
+12602,4,105000100,1
+12603,4,105000110,1
+12604,4,108000090,1
+12605,4,110000090,1
+12606,4,102000100,1
+12607,4,102000110,1
+12608,4,106000090,1
+12609,4,109000090,1
+12610,4,107000100,1
+12611,4,103000090,1
+12612,4,102000090,1
+12613,4,103000100,1
+12614,4,106000100,1
+12615,4,106000110,1
+12616,4,104000090,1
+12617,4,104000100,1
+12618,4,104000110,1
+12619,4,107000090,1
+12620,4,104000180,1
+12621,4,111000040,1
+12622,4,112000040,1
+12623,4,108000100,1
+12624,4,105000090,1
+12625,4,110000100,1
+12626,4,118000050,1
+12627,4,118000060,1
+12628,5,101000120,1
+12629,5,109000110,1
+12630,5,105000120,1
+12631,5,102000120,1
+12632,5,107000110,1
+12633,5,103000120,1
+12634,5,106000120,1
+12635,5,104000120,1
+12636,5,104000190,1
+12637,5,111000060,1
+12638,5,112000060,1
+12639,5,108000110,1
+12640,5,110000110,1
+12641,5,118000070,1
+12642,1,201000010,8
+12643,1,292000010,8
+12644,1,299000040,8
+12645,1,299000070,8
+12646,1,299000110,8
+12647,1,299000120,8
+12648,1,299000140,8
+12649,2,202000010,8
+12650,2,290000010,8
+12651,2,299000010,8
+12652,2,299000150,8
+12653,2,299000190,8
+12654,2,299000200,8
+12655,2,299000210,8
+12656,3,298000050,8
+12657,3,298000060,8
+12658,3,299000060,8
+12659,3,299000170,8
+12660,3,290000120,8
+12661,3,291000050,8
+12662,3,292000020,8
+12663,4,299000670,8
+12664,4,299000680,8
+12665,4,204000010,8
+12666,4,209000040,8
+12667,4,202000070,8
+12668,4,209000070,8
+12669,4,203000110,8
+12670,5,297000100,8
+12671,5,291000020,8
+12672,5,297000130,8
+12673,5,297000140,8
+12674,5,203000010,8
+12675,5,206000030,8
+12676,5,203000050,8
+12677,5,202000090,8
+12678,5,204000080,8
+12679,3,170004,3
+12680,3,180004,3
+12681,4,140000,3
+12682,5,150010,3
+12683,5,150020,3
+12684,5,150030,3
+12685,5,150040,3
+12687,3,101000050,1
+12688,3,101000060,1
+12689,3,101000080,1
+12690,3,101000040,1
+12691,3,109000060,1
+12692,3,109000070,1
+12693,3,109000080,1
+12694,3,105000060,1
+12695,3,105000070,1
+12696,3,105000080,1
+12697,3,104000050,1
+12698,3,106000050,1
+12699,3,102000060,1
+12700,3,102000070,1
+12701,3,102000080,1
+12702,3,103000050,1
+12703,3,105000050,1
+12704,3,107000060,1
+12705,3,107000070,1
+12706,3,107000080,1
+12707,3,108000050,1
+12708,3,109000050,1
+12709,3,103000060,1
+12710,3,103000070,1
+12711,3,103000080,1
+12712,3,110000050,1
+12713,3,106000060,1
+12714,3,106000070,1
+12715,3,106000080,1
+12716,3,101000070,1
+12717,3,110000060,1
+12718,3,104000060,1
+12719,3,104000070,1
+12720,3,104000080,1
+12721,3,102000050,1
+12722,3,104000170,1
+12723,3,104000260,1
+12724,3,111000010,1
+12725,3,111000020,1
+12726,3,111000030,1
+12727,3,112000020,1
+12728,3,112000030,1
+12729,3,108000060,1
+12730,3,108000070,1
+12731,3,108000080,1
+12732,3,107000050,1
+12733,3,112000010,1
+12734,3,110000070,1
+12735,3,110000080,1
+12736,3,118000020,1
+12737,3,118000030,1
+12738,3,118000040,1
+12739,4,101000090,1
+12740,4,101000100,1
+12741,4,101000110,1
+12742,4,109000100,1
+12743,4,105000100,1
+12744,4,105000110,1
+12745,4,108000090,1
+12746,4,110000090,1
+12747,4,102000100,1
+12748,4,102000110,1
+12749,4,106000090,1
+12750,4,109000090,1
+12751,4,107000100,1
+12752,4,103000090,1
+12753,4,102000090,1
+12754,4,103000100,1
+12755,4,106000100,1
+12756,4,106000110,1
+12757,4,104000090,1
+12758,4,104000100,1
+12759,4,104000110,1
+12760,4,107000090,1
+12761,4,104000180,1
+12762,4,111000040,1
+12763,4,112000040,1
+12764,4,108000100,1
+12765,4,105000090,1
+12766,4,110000100,1
+12767,4,118000050,1
+12768,4,118000060,1
+12769,5,101000120,1
+12770,5,109000110,1
+12771,5,105000120,1
+12772,5,102000120,1
+12773,5,107000110,1
+12774,5,103000120,1
+12775,5,106000120,1
+12776,5,104000120,1
+12777,5,104000190,1
+12778,5,111000060,1
+12779,5,112000060,1
+12780,5,108000110,1
+12781,5,110000110,1
+12782,5,118000070,1
+12783,1,201000010,8
+12784,1,292000010,8
+12785,1,299000040,8
+12786,1,299000070,8
+12787,1,299000110,8
+12788,1,299000120,8
+12789,1,299000140,8
+12790,2,202000010,8
+12791,2,290000010,8
+12792,2,299000010,8
+12793,2,299000150,8
+12794,2,299000190,8
+12795,2,299000200,8
+12796,2,299000210,8
+12797,3,298000050,8
+12798,3,298000060,8
+12799,3,299000060,8
+12800,3,299000170,8
+12801,3,290000120,8
+12802,3,291000050,8
+12803,3,292000020,8
+12804,4,299000670,8
+12805,4,299000680,8
+12806,4,204000010,8
+12807,4,209000040,8
+12808,4,202000070,8
+12809,4,209000070,8
+12810,4,203000110,8
+12811,5,297000100,8
+12812,5,291000020,8
+12813,5,297000130,8
+12814,5,297000140,8
+12815,5,203000010,8
+12816,5,206000030,8
+12817,5,203000050,8
+12818,5,202000090,8
+12819,5,204000080,8
+12820,3,170004,3
+12821,3,180004,3
+12822,4,140000,3
+12823,5,150010,3
+12824,5,150020,3
+12825,5,150030,3
+12826,5,150040,3
+12828,3,101000050,1
+12829,3,101000060,1
+12830,3,101000080,1
+12831,3,101000040,1
+12832,3,109000060,1
+12833,3,109000070,1
+12834,3,109000080,1
+12835,3,105000060,1
+12836,3,105000070,1
+12837,3,105000080,1
+12838,3,104000050,1
+12839,3,106000050,1
+12840,3,102000060,1
+12841,3,102000070,1
+12842,3,102000080,1
+12843,3,103000050,1
+12844,3,105000050,1
+12845,3,107000060,1
+12846,3,107000070,1
+12847,3,107000080,1
+12848,3,108000050,1
+12849,3,109000050,1
+12850,3,103000060,1
+12851,3,103000070,1
+12852,3,103000080,1
+12853,3,110000050,1
+12854,3,106000060,1
+12855,3,106000070,1
+12856,3,106000080,1
+12857,3,101000070,1
+12858,3,110000060,1
+12859,3,104000060,1
+12860,3,104000070,1
+12861,3,104000080,1
+12862,3,102000050,1
+12863,3,104000170,1
+12864,3,104000260,1
+12865,3,111000010,1
+12866,3,111000020,1
+12867,3,111000030,1
+12868,3,112000020,1
+12869,3,112000030,1
+12870,3,108000060,1
+12871,3,108000070,1
+12872,3,108000080,1
+12873,3,107000050,1
+12874,3,112000010,1
+12875,3,110000070,1
+12876,3,110000080,1
+12877,3,118000020,1
+12878,3,118000030,1
+12879,3,118000040,1
+12880,4,101000090,1
+12881,4,101000100,1
+12882,4,101000110,1
+12883,4,109000100,1
+12884,4,105000100,1
+12885,4,105000110,1
+12886,4,108000090,1
+12887,4,110000090,1
+12888,4,102000100,1
+12889,4,102000110,1
+12890,4,106000090,1
+12891,4,109000090,1
+12892,4,107000100,1
+12893,4,103000090,1
+12894,4,102000090,1
+12895,4,103000100,1
+12896,4,106000100,1
+12897,4,106000110,1
+12898,4,104000090,1
+12899,4,104000100,1
+12900,4,104000110,1
+12901,4,107000090,1
+12902,4,104000180,1
+12903,4,111000040,1
+12904,4,112000040,1
+12905,4,108000100,1
+12906,4,105000090,1
+12907,4,110000100,1
+12908,4,118000050,1
+12909,4,118000060,1
+12910,5,101000120,1
+12911,5,109000110,1
+12912,5,105000120,1
+12913,5,102000120,1
+12914,5,107000110,1
+12915,5,103000120,1
+12916,5,106000120,1
+12917,5,104000120,1
+12918,5,104000190,1
+12919,5,111000060,1
+12920,5,112000060,1
+12921,5,108000110,1
+12922,5,110000110,1
+12923,5,118000070,1
+12924,1,201000010,8
+12925,1,292000010,8
+12926,1,299000040,8
+12927,1,299000070,8
+12928,1,299000110,8
+12929,1,299000120,8
+12930,1,299000140,8
+12931,2,202000010,8
+12932,2,290000010,8
+12933,2,299000010,8
+12934,2,299000150,8
+12935,2,299000190,8
+12936,2,299000200,8
+12937,2,299000210,8
+12938,3,298000050,8
+12939,3,298000060,8
+12940,3,299000060,8
+12941,3,299000170,8
+12942,3,290000120,8
+12943,3,291000050,8
+12944,3,292000020,8
+12945,4,299000670,8
+12946,4,299000680,8
+12947,4,204000010,8
+12948,4,209000040,8
+12949,4,202000070,8
+12950,4,209000070,8
+12951,4,203000110,8
+12952,5,297000100,8
+12953,5,291000020,8
+12954,5,297000130,8
+12955,5,297000140,8
+12956,5,203000010,8
+12957,5,206000030,8
+12958,5,203000050,8
+12959,5,202000090,8
+12960,5,204000080,8
+12961,3,170004,3
+12962,3,180004,3
+12963,4,140000,3
+12964,5,150010,3
+12965,5,150020,3
+12966,5,150030,3
+12967,5,150040,3
+12968,5,190000,3
+12969,5,200000,3
+12970,5,210000,3
+12972,3,102000060,1
+12973,3,102000070,1
+12974,3,102000080,1
+12975,3,103000050,1
+12976,3,105000050,1
+12977,3,107000060,1
+12978,3,107000070,1
+12979,3,107000080,1
+12980,3,108000050,1
+12981,3,109000050,1
+12982,3,103000060,1
+12983,3,103000070,1
+12984,3,103000080,1
+12985,3,110000050,1
+12986,4,102000100,1
+12987,4,102000110,1
+12988,4,102000350,1
+12989,4,106000090,1
+12990,4,109000090,1
+12991,4,107000100,1
+12992,4,103000090,1
+12993,4,102000090,1
+12994,4,103000100,1
+12995,5,102000120,1
+12996,5,107000110,1
+12997,5,103000120,1
+12998,1,102000000,2
+12999,2,102000001,2
+13000,3,102000002,2
+13001,4,102000003,2
+13002,5,102000004,2
+13003,1,105000000,2
+13004,2,105000001,2
+13005,3,105000002,2
+13006,4,105000003,2
+13007,5,105000004,2
+13008,1,112000000,2
+13009,2,112000001,2
+13010,3,112000002,2
+13011,4,112000003,2
+13012,5,112000004,2
+13013,3,170004,3
+13014,4,170005,3
+13015,3,180004,3
+13016,4,180005,3
+13017,4,140000,3
+13018,4,150010,3
+13019,4,150020,3
+13020,4,150030,3
+13021,4,150040,3
+13023,3,118000020,1
+13024,3,118000030,1
+13025,3,118000040,1
+13026,3,106000060,1
+13027,3,106000070,1
+13028,3,106000080,1
+13029,3,101000070,1
+13030,3,110000060,1
+13031,3,104000060,1
+13032,3,104000070,1
+13033,3,104000080,1
+13034,3,102000050,1
+13035,3,104000170,1
+13036,3,104000260,1
+13037,4,118000050,1
+13038,4,118000060,1
+13039,4,106000100,1
+13040,4,106000110,1
+13041,4,104000090,1
+13042,4,104000100,1
+13043,4,104000110,1
+13044,4,104000270,1
+13045,4,107000090,1
+13046,4,104000180,1
+13047,5,118000070,1
+13048,5,106000120,1
+13049,5,104000120,1
+13050,5,104000190,1
+13051,1,103000000,2
+13052,2,103000001,2
+13053,3,103000002,2
+13054,4,103000003,2
+13055,5,103000004,2
+13056,1,111000000,2
+13057,2,111000001,2
+13058,3,111000002,2
+13059,4,111000003,2
+13060,5,111000004,2
+13061,1,115000000,2
+13062,2,115000001,2
+13063,3,115000002,2
+13064,4,115000003,2
+13065,5,115000004,2
+13066,4,110024,3
+13067,4,110034,3
+13068,4,110044,3
+13069,4,110054,3
+13070,3,110060,3
+13071,3,110070,3
+13072,3,110080,3
+13073,3,110090,3
+13074,3,110100,3
+13075,3,110110,3
+13076,3,110120,3
+13077,3,110130,3
+13078,3,110140,3
+13079,3,110150,3
+13080,3,110160,3
+13081,3,110170,3
+13082,3,110180,3
+13083,3,110190,3
+13084,3,110200,3
+13085,3,110210,3
+13086,3,110220,3
+13087,3,110230,3
+13088,3,110240,3
+13089,3,110250,3
+13090,3,110260,3
+13091,3,110270,3
+13092,3,110620,3
+13093,3,110670,3
+13094,4,140000,3
+13095,4,150010,3
+13096,4,150020,3
+13097,4,150030,3
+13098,4,150040,3
+13100,3,111000010,1
+13101,3,111000020,1
+13102,3,111000030,1
+13103,3,112000020,1
+13104,3,112000030,1
+13105,3,108000060,1
+13106,3,108000070,1
+13107,3,108000080,1
+13108,3,107000050,1
+13109,3,112000010,1
+13110,3,110000070,1
+13111,3,110000080,1
+13112,4,111000040,1
+13113,4,112000040,1
+13114,4,108000100,1
+13115,4,105000090,1
+13116,4,110000100,1
+13117,5,111000060,1
+13118,5,112000060,1
+13119,5,108000110,1
+13120,5,110000110,1
+13121,1,108000000,2
+13122,2,108000001,2
+13123,3,108000002,2
+13124,4,108000003,2
+13125,5,108000004,2
+13126,1,107000000,2
+13127,2,107000001,2
+13128,3,107000002,2
+13129,4,107000003,2
+13130,5,107000004,2
+13131,1,120000000,2
+13132,2,120000001,2
+13133,3,120000002,2
+13134,4,120000003,2
+13135,5,120000004,2
+13136,4,120024,3
+13137,4,120034,3
+13138,4,120044,3
+13139,4,120054,3
+13140,3,120241,3
+13141,3,120251,3
+13142,3,120261,3
+13143,3,120271,3
+13144,3,120300,3
+13145,3,120310,3
+13146,3,120320,3
+13147,3,120330,3
+13148,3,120340,3
+13149,3,120350,3
+13150,3,120360,3
+13151,3,120370,3
+13152,3,120380,3
+13153,3,120390,3
+13154,3,120400,3
+13155,3,120410,3
+13156,3,120420,3
+13157,3,120430,3
+13158,3,120450,3
+13159,3,120460,3
+13160,3,120550,3
+13161,3,120560,3
+13162,3,120570,3
+13163,3,120990,3
+13164,3,121000,3
+13165,3,121010,3
+13166,3,121020,3
+13167,3,121100,3
+13168,4,140000,3
+13169,4,150010,3
+13170,4,150020,3
+13171,4,150030,3
+13172,4,150040,3
+13174,3,101000050,1
+13175,3,101000060,1
+13176,3,101000080,1
+13177,3,101000040,1
+13178,3,109000060,1
+13179,3,109000070,1
+13180,3,109000080,1
+13181,3,105000060,1
+13182,3,105000070,1
+13183,3,105000080,1
+13184,3,104000050,1
+13185,3,106000050,1
+13186,4,101000090,1
+13187,4,101000100,1
+13188,4,101000110,1
+13189,4,109000100,1
+13190,4,105000100,1
+13191,4,105000110,1
+13192,4,108000090,1
+13193,4,110000090,1
+13194,5,101000120,1
+13195,5,109000110,1
+13196,5,105000120,1
+13197,1,101000000,2
+13198,2,101000001,2
+13199,3,101000002,2
+13200,4,101000008,2
+13201,5,101000004,2
+13202,1,109000000,2
+13203,2,109000001,2
+13204,3,109000002,2
+13205,4,109000003,2
+13206,5,109000004,2
+13207,4,130024,3
+13208,4,130034,3
+13209,4,130044,3
+13210,4,130054,3
+13211,3,130060,3
+13212,3,130070,3
+13213,3,130080,3
+13214,3,130090,3
+13215,3,130100,3
+13216,3,130110,3
+13217,3,130120,3
+13218,3,130130,3
+13219,3,130140,3
+13220,3,130150,3
+13221,3,130160,3
+13222,3,130170,3
+13223,3,130180,3
+13224,3,130190,3
+13225,3,130200,3
+13226,3,130420,3
+13227,3,130510,3
+13228,3,130520,3
+13229,3,130531,3
+13230,3,130540,3
+13231,3,130660,3
+13232,3,130700,3
+13233,3,130790,3
+13234,3,130800,3
+13235,3,131130,3
+13236,4,140000,3
+13237,4,150010,3
+13238,4,150020,3
+13239,4,150030,3
+13240,4,150040,3
+13242,3,101000050,1
+13243,3,101000060,1
+13244,3,101000080,1
+13245,3,101000040,1
+13246,3,109000060,1
+13247,3,109000070,1
+13248,3,109000080,1
+13249,3,105000060,1
+13250,3,105000070,1
+13251,3,105000080,1
+13252,3,104000050,1
+13253,3,106000050,1
+13254,4,101000090,1
+13255,4,101000100,1
+13256,4,101000110,1
+13257,4,109000100,1
+13258,4,105000100,1
+13259,4,105000110,1
+13260,4,108000090,1
+13261,4,110000090,1
+13262,5,101000120,1
+13263,5,109000110,1
+13264,5,105000120,1
+13265,1,101000000,2
+13266,2,101000001,2
+13267,3,101000002,2
+13268,4,101000008,2
+13269,5,101000004,2
+13270,1,109000000,2
+13271,2,109000001,2
+13272,3,109000002,2
+13273,4,109000003,2
+13274,5,109000004,2
+13275,3,170004,3
+13276,4,170005,3
+13277,3,180004,3
+13278,4,180005,3
+13279,4,140000,3
+13280,4,150010,3
+13281,4,150020,3
+13282,4,150030,3
+13283,4,150040,3
+13285,3,102000060,1
+13286,3,102000070,1
+13287,3,102000080,1
+13288,3,103000050,1
+13289,3,105000050,1
+13290,3,107000060,1
+13291,3,107000070,1
+13292,3,107000080,1
+13293,3,108000050,1
+13294,3,109000050,1
+13295,3,103000060,1
+13296,3,103000070,1
+13297,3,103000080,1
+13298,3,110000050,1
+13299,4,102000100,1
+13300,4,102000110,1
+13301,4,102000350,1
+13302,4,106000090,1
+13303,4,109000090,1
+13304,4,107000100,1
+13305,4,103000090,1
+13306,4,102000090,1
+13307,4,103000100,1
+13308,5,102000120,1
+13309,5,107000110,1
+13310,5,103000120,1
+13311,1,102000000,2
+13312,2,102000001,2
+13313,3,102000002,2
+13314,4,102000003,2
+13315,5,102000004,2
+13316,1,105000000,2
+13317,2,105000001,2
+13318,3,105000002,2
+13319,4,105000003,2
+13320,5,105000004,2
+13321,1,112000000,2
+13322,2,112000001,2
+13323,3,112000002,2
+13324,4,112000003,2
+13325,5,112000004,2
+13326,4,110024,3
+13327,4,110034,3
+13328,4,110044,3
+13329,4,110054,3
+13330,3,110060,3
+13331,3,110070,3
+13332,3,110080,3
+13333,3,110090,3
+13334,3,110100,3
+13335,3,110110,3
+13336,3,110120,3
+13337,3,110130,3
+13338,3,110140,3
+13339,3,110150,3
+13340,3,110160,3
+13341,3,110170,3
+13342,3,110180,3
+13343,3,110190,3
+13344,3,110200,3
+13345,3,110210,3
+13346,3,110220,3
+13347,3,110230,3
+13348,3,110240,3
+13349,3,110250,3
+13350,3,110260,3
+13351,3,110270,3
+13352,3,110620,3
+13353,3,110670,3
+13354,4,140000,3
+13355,4,150010,3
+13356,4,150020,3
+13357,4,150030,3
+13358,4,150040,3
+13360,3,118000020,1
+13361,3,118000030,1
+13362,3,118000040,1
+13363,3,106000060,1
+13364,3,106000070,1
+13365,3,106000080,1
+13366,3,101000070,1
+13367,3,110000060,1
+13368,3,104000060,1
+13369,3,104000070,1
+13370,3,104000080,1
+13371,3,102000050,1
+13372,3,104000170,1
+13373,3,104000260,1
+13374,4,118000050,1
+13375,4,118000060,1
+13376,4,106000100,1
+13377,4,106000110,1
+13378,4,104000090,1
+13379,4,104000100,1
+13380,4,104000110,1
+13381,4,104000270,1
+13382,4,107000090,1
+13383,4,104000180,1
+13384,5,118000070,1
+13385,5,106000120,1
+13386,5,104000120,1
+13387,5,104000190,1
+13388,1,103000000,2
+13389,2,103000001,2
+13390,3,103000002,2
+13391,4,103000003,2
+13392,5,103000004,2
+13393,1,111000000,2
+13394,2,111000001,2
+13395,3,111000002,2
+13396,4,111000003,2
+13397,5,111000004,2
+13398,1,115000000,2
+13399,2,115000001,2
+13400,3,115000002,2
+13401,4,115000003,2
+13402,5,115000004,2
+13403,4,120024,3
+13404,4,120034,3
+13405,4,120044,3
+13406,4,120054,3
+13407,3,120241,3
+13408,3,120251,3
+13409,3,120261,3
+13410,3,120271,3
+13411,3,120300,3
+13412,3,120310,3
+13413,3,120320,3
+13414,3,120330,3
+13415,3,120340,3
+13416,3,120350,3
+13417,3,120360,3
+13418,3,120370,3
+13419,3,120380,3
+13420,3,120390,3
+13421,3,120400,3
+13422,3,120410,3
+13423,3,120420,3
+13424,3,120430,3
+13425,3,120450,3
+13426,3,120460,3
+13427,3,120550,3
+13428,3,120560,3
+13429,3,120570,3
+13430,3,120990,3
+13431,3,121000,3
+13432,3,121010,3
+13433,3,121020,3
+13434,3,121100,3
+13435,4,140000,3
+13436,4,150010,3
+13437,4,150020,3
+13438,4,150030,3
+13439,4,150040,3
+13441,3,111000010,1
+13442,3,111000020,1
+13443,3,111000030,1
+13444,3,112000020,1
+13445,3,112000030,1
+13446,3,108000060,1
+13447,3,108000070,1
+13448,3,108000080,1
+13449,3,107000050,1
+13450,3,112000010,1
+13451,3,110000070,1
+13452,3,110000080,1
+13453,4,111000040,1
+13454,4,112000040,1
+13455,4,108000100,1
+13456,4,105000090,1
+13457,4,110000100,1
+13458,5,111000060,1
+13459,5,112000060,1
+13460,5,108000110,1
+13461,5,110000110,1
+13462,1,108000000,2
+13463,2,108000001,2
+13464,3,108000002,2
+13465,4,108000003,2
+13466,5,108000004,2
+13467,1,107000000,2
+13468,2,107000001,2
+13469,3,107000002,2
+13470,4,107000003,2
+13471,5,107000004,2
+13472,1,120000000,2
+13473,2,120000001,2
+13474,3,120000002,2
+13475,4,120000003,2
+13476,5,120000004,2
+13477,4,130024,3
+13478,4,130034,3
+13479,4,130044,3
+13480,4,130054,3
+13481,3,130060,3
+13482,3,130070,3
+13483,3,130080,3
+13484,3,130090,3
+13485,3,130100,3
+13486,3,130110,3
+13487,3,130120,3
+13488,3,130130,3
+13489,3,130140,3
+13490,3,130150,3
+13491,3,130160,3
+13492,3,130170,3
+13493,3,130180,3
+13494,3,130190,3
+13495,3,130200,3
+13496,3,130420,3
+13497,3,130510,3
+13498,3,130520,3
+13499,3,130531,3
+13500,3,130540,3
+13501,3,130660,3
+13502,3,130700,3
+13503,3,130790,3
+13504,3,130800,3
+13505,3,131130,3
+13506,4,140000,3
+13507,4,150010,3
+13508,4,150020,3
+13509,4,150030,3
+13510,4,150040,3
+13512,1,101000010,1
+13513,1,102000010,1
+13514,1,103000010,1
+13515,1,104000010,1
+13516,1,105000010,1
+13517,1,106000010,1
+13518,1,107000010,1
+13519,1,108000010,1
+13520,1,109000010,1
+13521,1,110000010,1
+13522,2,101000020,1
+13523,2,101000030,1
+13524,2,102000020,1
+13525,2,102000030,1
+13526,2,102000040,1
+13527,2,103000020,1
+13528,2,103000030,1
+13529,2,103000040,1
+13530,2,104000020,1
+13531,2,104000030,1
+13532,2,104000040,1
+13533,2,105000020,1
+13534,2,105000030,1
+13535,2,105000040,1
+13536,2,106000020,1
+13537,2,106000030,1
+13538,2,106000040,1
+13539,2,107000020,1
+13540,2,107000030,1
+13541,2,107000040,1
+13542,2,108000020,1
+13543,2,108000030,1
+13544,2,108000040,1
+13545,2,109000020,1
+13546,2,109000030,1
+13547,2,109000040,1
+13548,2,110000020,1
+13549,2,110000030,1
+13550,2,110000040,1
+13551,2,118000010,1
+13552,3,101000050,1
+13553,3,101000060,1
+13554,3,101000080,1
+13555,3,101000040,1
+13556,3,109000060,1
+13557,3,109000070,1
+13558,3,109000080,1
+13559,3,105000060,1
+13560,3,105000070,1
+13561,3,105000080,1
+13562,3,104000050,1
+13563,3,106000050,1
+13564,3,102000060,1
+13565,3,102000070,1
+13566,3,102000080,1
+13567,3,103000050,1
+13568,3,105000050,1
+13569,3,107000060,1
+13570,3,107000070,1
+13571,3,107000080,1
+13572,3,108000050,1
+13573,3,109000050,1
+13574,3,103000060,1
+13575,3,103000070,1
+13576,3,103000080,1
+13577,3,110000050,1
+13578,3,106000060,1
+13579,3,106000070,1
+13580,3,106000080,1
+13581,3,101000070,1
+13582,3,110000060,1
+13583,3,104000060,1
+13584,3,104000070,1
+13585,3,104000080,1
+13586,3,102000050,1
+13587,3,104000170,1
+13588,3,104000260,1
+13589,3,111000010,1
+13590,3,111000020,1
+13591,3,111000030,1
+13592,3,112000020,1
+13593,3,112000030,1
+13594,3,108000060,1
+13595,3,108000070,1
+13596,3,108000080,1
+13597,3,107000050,1
+13598,3,112000010,1
+13599,3,110000070,1
+13600,3,110000080,1
+13601,3,118000020,1
+13602,3,118000030,1
+13603,3,118000040,1
+13604,4,101000090,1
+13605,4,101000100,1
+13606,4,101000110,1
+13607,4,109000100,1
+13608,4,105000100,1
+13609,4,105000110,1
+13610,4,108000090,1
+13611,4,110000090,1
+13612,4,102000100,1
+13613,4,102000110,1
+13614,4,106000090,1
+13615,4,109000090,1
+13616,4,107000100,1
+13617,4,103000090,1
+13618,4,102000090,1
+13619,4,103000100,1
+13620,4,106000100,1
+13621,4,106000110,1
+13622,4,104000090,1
+13623,4,104000100,1
+13624,4,104000110,1
+13625,4,107000090,1
+13626,4,104000180,1
+13627,4,111000040,1
+13628,4,112000040,1
+13629,4,108000100,1
+13630,4,105000090,1
+13631,4,110000100,1
+13632,4,118000050,1
+13633,4,118000060,1
+13634,5,101000120,1
+13635,5,109000110,1
+13636,5,105000120,1
+13637,5,102000120,1
+13638,5,107000110,1
+13639,5,103000120,1
+13640,5,106000120,1
+13641,5,104000120,1
+13642,5,104000190,1
+13643,5,111000060,1
+13644,5,112000060,1
+13645,5,108000110,1
+13646,5,110000110,1
+13647,5,118000070,1
+13648,1,201000010,8
+13649,1,292000010,8
+13650,1,299000040,8
+13651,1,299000070,8
+13652,1,299000110,8
+13653,1,299000120,8
+13654,1,299000140,8
+13655,2,202000010,8
+13656,2,290000010,8
+13657,2,299000010,8
+13658,2,299000150,8
+13659,2,299000190,8
+13660,2,299000200,8
+13661,2,299000210,8
+13662,3,298000050,8
+13663,3,298000060,8
+13664,3,299000060,8
+13665,3,299000170,8
+13666,3,290000120,8
+13667,3,291000050,8
+13668,3,292000020,8
+13669,4,299000670,8
+13670,4,299000680,8
+13671,4,204000010,8
+13672,4,209000040,8
+13673,4,202000070,8
+13674,4,209000070,8
+13675,4,203000110,8
+13676,4,290000110,8
+13677,5,297000100,8
+13678,5,291000020,8
+13679,5,297000130,8
+13680,5,297000140,8
+13681,5,203000010,8
+13682,5,206000030,8
+13683,5,203000050,8
+13684,5,202000090,8
+13685,5,204000080,8
+13686,5,202000150,8
+13687,1,170002,3
+13688,1,180002,3
+13689,2,170003,3
+13690,2,180003,3
+13691,3,170004,3
+13692,3,180004,3
+13693,4,140000,3
+13694,5,150010,3
+13695,5,150020,3
+13696,5,150030,3
+13697,5,150040,3
+13699,1,101000010,1
+13700,1,102000010,1
+13701,1,103000010,1
+13702,1,104000010,1
+13703,1,105000010,1
+13704,1,106000010,1
+13705,1,107000010,1
+13706,1,108000010,1
+13707,1,109000010,1
+13708,1,110000010,1
+13709,2,101000020,1
+13710,2,101000030,1
+13711,2,102000020,1
+13712,2,102000030,1
+13713,2,102000040,1
+13714,2,103000020,1
+13715,2,103000030,1
+13716,2,103000040,1
+13717,2,104000020,1
+13718,2,104000030,1
+13719,2,104000040,1
+13720,2,105000020,1
+13721,2,105000030,1
+13722,2,105000040,1
+13723,2,106000020,1
+13724,2,106000030,1
+13725,2,106000040,1
+13726,2,107000020,1
+13727,2,107000030,1
+13728,2,107000040,1
+13729,2,108000020,1
+13730,2,108000030,1
+13731,2,108000040,1
+13732,2,109000020,1
+13733,2,109000030,1
+13734,2,109000040,1
+13735,2,110000020,1
+13736,2,110000030,1
+13737,2,110000040,1
+13738,2,118000010,1
+13739,3,101000050,1
+13740,3,101000060,1
+13741,3,101000080,1
+13742,3,101000040,1
+13743,3,109000060,1
+13744,3,109000070,1
+13745,3,109000080,1
+13746,3,105000060,1
+13747,3,105000070,1
+13748,3,105000080,1
+13749,3,104000050,1
+13750,3,106000050,1
+13751,3,102000060,1
+13752,3,102000070,1
+13753,3,102000080,1
+13754,3,103000050,1
+13755,3,105000050,1
+13756,3,107000060,1
+13757,3,107000070,1
+13758,3,107000080,1
+13759,3,108000050,1
+13760,3,109000050,1
+13761,3,103000060,1
+13762,3,103000070,1
+13763,3,103000080,1
+13764,3,110000050,1
+13765,3,106000060,1
+13766,3,106000070,1
+13767,3,106000080,1
+13768,3,101000070,1
+13769,3,110000060,1
+13770,3,104000060,1
+13771,3,104000070,1
+13772,3,104000080,1
+13773,3,102000050,1
+13774,3,104000170,1
+13775,3,104000260,1
+13776,3,111000010,1
+13777,3,111000020,1
+13778,3,111000030,1
+13779,3,112000020,1
+13780,3,112000030,1
+13781,3,108000060,1
+13782,3,108000070,1
+13783,3,108000080,1
+13784,3,107000050,1
+13785,3,112000010,1
+13786,3,110000070,1
+13787,3,110000080,1
+13788,3,118000020,1
+13789,3,118000030,1
+13790,3,118000040,1
+13791,4,101000090,1
+13792,4,101000100,1
+13793,4,101000110,1
+13794,4,109000100,1
+13795,4,105000100,1
+13796,4,105000110,1
+13797,4,108000090,1
+13798,4,110000090,1
+13799,4,102000100,1
+13800,4,102000110,1
+13801,4,106000090,1
+13802,4,109000090,1
+13803,4,107000100,1
+13804,4,103000090,1
+13805,4,102000090,1
+13806,4,103000100,1
+13807,4,106000100,1
+13808,4,106000110,1
+13809,4,104000090,1
+13810,4,104000100,1
+13811,4,104000110,1
+13812,4,107000090,1
+13813,4,104000180,1
+13814,4,111000040,1
+13815,4,112000040,1
+13816,4,108000100,1
+13817,4,105000090,1
+13818,4,110000100,1
+13819,4,118000050,1
+13820,4,118000060,1
+13821,5,101000120,1
+13822,5,109000110,1
+13823,5,105000120,1
+13824,5,102000120,1
+13825,5,107000110,1
+13826,5,103000120,1
+13827,5,106000120,1
+13828,5,104000120,1
+13829,5,104000190,1
+13830,5,111000060,1
+13831,5,112000060,1
+13832,5,108000110,1
+13833,5,110000110,1
+13834,5,118000070,1
+13835,1,201000010,8
+13836,1,292000010,8
+13837,1,299000040,8
+13838,1,299000070,8
+13839,1,299000110,8
+13840,1,299000120,8
+13841,1,299000140,8
+13842,2,202000010,8
+13843,2,290000010,8
+13844,2,299000010,8
+13845,2,299000150,8
+13846,2,299000190,8
+13847,2,299000200,8
+13848,2,299000210,8
+13849,3,298000050,8
+13850,3,298000060,8
+13851,3,299000060,8
+13852,3,299000170,8
+13853,3,290000120,8
+13854,3,291000050,8
+13855,3,292000020,8
+13856,4,299000670,8
+13857,4,299000680,8
+13858,4,204000010,8
+13859,4,209000040,8
+13860,4,202000070,8
+13861,4,209000070,8
+13862,4,203000110,8
+13863,4,290000110,8
+13864,5,297000100,8
+13865,5,291000020,8
+13866,5,297000130,8
+13867,5,297000140,8
+13868,5,203000010,8
+13869,5,206000030,8
+13870,5,203000050,8
+13871,5,202000090,8
+13872,5,204000080,8
+13873,5,202000150,8
+13874,2,170003,3
+13875,2,180003,3
+13876,3,170004,3
+13877,3,180004,3
+13878,4,140000,3
+13879,5,150010,3
+13880,5,150020,3
+13881,5,150030,3
+13882,5,150040,3
+13884,3,101000050,1
+13885,3,101000060,1
+13886,3,101000080,1
+13887,3,101000040,1
+13888,3,109000060,1
+13889,3,109000070,1
+13890,3,109000080,1
+13891,3,105000060,1
+13892,3,105000070,1
+13893,3,105000080,1
+13894,3,104000050,1
+13895,3,106000050,1
+13896,3,102000060,1
+13897,3,102000070,1
+13898,3,102000080,1
+13899,3,103000050,1
+13900,3,105000050,1
+13901,3,107000060,1
+13902,3,107000070,1
+13903,3,107000080,1
+13904,3,108000050,1
+13905,3,109000050,1
+13906,3,103000060,1
+13907,3,103000070,1
+13908,3,103000080,1
+13909,3,110000050,1
+13910,3,106000060,1
+13911,3,106000070,1
+13912,3,106000080,1
+13913,3,101000070,1
+13914,3,110000060,1
+13915,3,104000060,1
+13916,3,104000070,1
+13917,3,104000080,1
+13918,3,102000050,1
+13919,3,104000170,1
+13920,3,104000260,1
+13921,3,111000010,1
+13922,3,111000020,1
+13923,3,111000030,1
+13924,3,112000020,1
+13925,3,112000030,1
+13926,3,108000060,1
+13927,3,108000070,1
+13928,3,108000080,1
+13929,3,107000050,1
+13930,3,112000010,1
+13931,3,110000070,1
+13932,3,110000080,1
+13933,3,118000020,1
+13934,3,118000030,1
+13935,3,118000040,1
+13936,4,101000090,1
+13937,4,101000100,1
+13938,4,101000110,1
+13939,4,109000100,1
+13940,4,105000100,1
+13941,4,105000110,1
+13942,4,108000090,1
+13943,4,110000090,1
+13944,4,102000100,1
+13945,4,102000110,1
+13946,4,106000090,1
+13947,4,109000090,1
+13948,4,107000100,1
+13949,4,103000090,1
+13950,4,102000090,1
+13951,4,103000100,1
+13952,4,106000100,1
+13953,4,106000110,1
+13954,4,104000090,1
+13955,4,104000100,1
+13956,4,104000110,1
+13957,4,107000090,1
+13958,4,104000180,1
+13959,4,111000040,1
+13960,4,112000040,1
+13961,4,108000100,1
+13962,4,105000090,1
+13963,4,110000100,1
+13964,4,118000050,1
+13965,4,118000060,1
+13966,5,101000120,1
+13967,5,109000110,1
+13968,5,105000120,1
+13969,5,102000120,1
+13970,5,107000110,1
+13971,5,103000120,1
+13972,5,106000120,1
+13973,5,104000120,1
+13974,5,104000190,1
+13975,5,111000060,1
+13976,5,112000060,1
+13977,5,108000110,1
+13978,5,110000110,1
+13979,5,118000070,1
+13980,1,201000010,8
+13981,1,292000010,8
+13982,1,299000040,8
+13983,1,299000070,8
+13984,1,299000110,8
+13985,1,299000120,8
+13986,1,299000140,8
+13987,2,202000010,8
+13988,2,290000010,8
+13989,2,299000010,8
+13990,2,299000150,8
+13991,2,299000190,8
+13992,2,299000200,8
+13993,2,299000210,8
+13994,3,298000050,8
+13995,3,298000060,8
+13996,3,299000060,8
+13997,3,299000170,8
+13998,3,290000120,8
+13999,3,291000050,8
+14000,3,292000020,8
+14001,4,299000670,8
+14002,4,299000680,8
+14003,4,204000010,8
+14004,4,209000040,8
+14005,4,202000070,8
+14006,4,209000070,8
+14007,4,203000110,8
+14008,4,290000110,8
+14009,5,297000100,8
+14010,5,291000020,8
+14011,5,297000130,8
+14012,5,297000140,8
+14013,5,203000010,8
+14014,5,206000030,8
+14015,5,203000050,8
+14016,5,202000090,8
+14017,5,204000080,8
+14018,5,202000150,8
+14019,3,170004,3
+14020,3,180004,3
+14021,4,140000,3
+14022,5,150010,3
+14023,5,150020,3
+14024,5,150030,3
+14025,5,150040,3
+14027,3,101000050,1
+14028,3,101000060,1
+14029,3,101000080,1
+14030,3,101000040,1
+14031,3,109000060,1
+14032,3,109000070,1
+14033,3,109000080,1
+14034,3,105000060,1
+14035,3,105000070,1
+14036,3,105000080,1
+14037,3,104000050,1
+14038,3,106000050,1
+14039,3,102000060,1
+14040,3,102000070,1
+14041,3,102000080,1
+14042,3,103000050,1
+14043,3,105000050,1
+14044,3,107000060,1
+14045,3,107000070,1
+14046,3,107000080,1
+14047,3,108000050,1
+14048,3,109000050,1
+14049,3,103000060,1
+14050,3,103000070,1
+14051,3,103000080,1
+14052,3,110000050,1
+14053,3,106000060,1
+14054,3,106000070,1
+14055,3,106000080,1
+14056,3,101000070,1
+14057,3,110000060,1
+14058,3,104000060,1
+14059,3,104000070,1
+14060,3,104000080,1
+14061,3,102000050,1
+14062,3,104000170,1
+14063,3,104000260,1
+14064,3,111000010,1
+14065,3,111000020,1
+14066,3,111000030,1
+14067,3,112000020,1
+14068,3,112000030,1
+14069,3,108000060,1
+14070,3,108000070,1
+14071,3,108000080,1
+14072,3,107000050,1
+14073,3,112000010,1
+14074,3,110000070,1
+14075,3,110000080,1
+14076,3,118000020,1
+14077,3,118000030,1
+14078,3,118000040,1
+14079,4,101000090,1
+14080,4,101000100,1
+14081,4,101000110,1
+14082,4,109000100,1
+14083,4,105000100,1
+14084,4,105000110,1
+14085,4,108000090,1
+14086,4,110000090,1
+14087,4,102000100,1
+14088,4,102000110,1
+14089,4,106000090,1
+14090,4,109000090,1
+14091,4,107000100,1
+14092,4,103000090,1
+14093,4,102000090,1
+14094,4,103000100,1
+14095,4,106000100,1
+14096,4,106000110,1
+14097,4,104000090,1
+14098,4,104000100,1
+14099,4,104000110,1
+14100,4,107000090,1
+14101,4,104000180,1
+14102,4,111000040,1
+14103,4,112000040,1
+14104,4,108000100,1
+14105,4,105000090,1
+14106,4,110000100,1
+14107,4,118000050,1
+14108,4,118000060,1
+14109,5,101000120,1
+14110,5,109000110,1
+14111,5,105000120,1
+14112,5,102000120,1
+14113,5,107000110,1
+14114,5,103000120,1
+14115,5,106000120,1
+14116,5,104000120,1
+14117,5,104000190,1
+14118,5,111000060,1
+14119,5,112000060,1
+14120,5,108000110,1
+14121,5,110000110,1
+14122,5,118000070,1
+14123,1,201000010,8
+14124,1,292000010,8
+14125,1,299000040,8
+14126,1,299000070,8
+14127,1,299000110,8
+14128,1,299000120,8
+14129,1,299000140,8
+14130,2,202000010,8
+14131,2,290000010,8
+14132,2,299000010,8
+14133,2,299000150,8
+14134,2,299000190,8
+14135,2,299000200,8
+14136,2,299000210,8
+14137,3,298000050,8
+14138,3,298000060,8
+14139,3,299000060,8
+14140,3,299000170,8
+14141,3,290000120,8
+14142,3,291000050,8
+14143,3,292000020,8
+14144,4,299000670,8
+14145,4,299000680,8
+14146,4,204000010,8
+14147,4,209000040,8
+14148,4,202000070,8
+14149,4,209000070,8
+14150,4,203000110,8
+14151,4,290000110,8
+14152,5,297000100,8
+14153,5,291000020,8
+14154,5,297000130,8
+14155,5,297000140,8
+14156,5,203000010,8
+14157,5,206000030,8
+14158,5,203000050,8
+14159,5,202000090,8
+14160,5,204000080,8
+14161,5,202000150,8
+14162,3,170004,3
+14163,3,180004,3
+14164,4,140000,3
+14165,5,150010,3
+14166,5,150020,3
+14167,5,150030,3
+14168,5,150040,3
+14170,3,101000050,1
+14171,3,101000060,1
+14172,3,101000080,1
+14173,3,101000040,1
+14174,3,109000060,1
+14175,3,109000070,1
+14176,3,109000080,1
+14177,3,105000060,1
+14178,3,105000070,1
+14179,3,105000080,1
+14180,3,104000050,1
+14181,3,106000050,1
+14182,3,102000060,1
+14183,3,102000070,1
+14184,3,102000080,1
+14185,3,103000050,1
+14186,3,105000050,1
+14187,3,107000060,1
+14188,3,107000070,1
+14189,3,107000080,1
+14190,3,108000050,1
+14191,3,109000050,1
+14192,3,103000060,1
+14193,3,103000070,1
+14194,3,103000080,1
+14195,3,110000050,1
+14196,3,106000060,1
+14197,3,106000070,1
+14198,3,106000080,1
+14199,3,101000070,1
+14200,3,110000060,1
+14201,3,104000060,1
+14202,3,104000070,1
+14203,3,104000080,1
+14204,3,102000050,1
+14205,3,104000170,1
+14206,3,104000260,1
+14207,3,111000010,1
+14208,3,111000020,1
+14209,3,111000030,1
+14210,3,112000020,1
+14211,3,112000030,1
+14212,3,108000060,1
+14213,3,108000070,1
+14214,3,108000080,1
+14215,3,107000050,1
+14216,3,112000010,1
+14217,3,110000070,1
+14218,3,110000080,1
+14219,3,118000020,1
+14220,3,118000030,1
+14221,3,118000040,1
+14222,4,101000090,1
+14223,4,101000100,1
+14224,4,101000110,1
+14225,4,109000100,1
+14226,4,105000100,1
+14227,4,105000110,1
+14228,4,108000090,1
+14229,4,110000090,1
+14230,4,102000100,1
+14231,4,102000110,1
+14232,4,106000090,1
+14233,4,109000090,1
+14234,4,107000100,1
+14235,4,103000090,1
+14236,4,102000090,1
+14237,4,103000100,1
+14238,4,106000100,1
+14239,4,106000110,1
+14240,4,104000090,1
+14241,4,104000100,1
+14242,4,104000110,1
+14243,4,107000090,1
+14244,4,104000180,1
+14245,4,111000040,1
+14246,4,112000040,1
+14247,4,108000100,1
+14248,4,105000090,1
+14249,4,110000100,1
+14250,4,118000050,1
+14251,4,118000060,1
+14252,5,101000120,1
+14253,5,109000110,1
+14254,5,105000120,1
+14255,5,102000120,1
+14256,5,107000110,1
+14257,5,103000120,1
+14258,5,106000120,1
+14259,5,104000120,1
+14260,5,104000190,1
+14261,5,111000060,1
+14262,5,112000060,1
+14263,5,108000110,1
+14264,5,110000110,1
+14265,5,118000070,1
+14266,1,201000010,8
+14267,1,292000010,8
+14268,1,299000040,8
+14269,1,299000070,8
+14270,1,299000110,8
+14271,1,299000120,8
+14272,1,299000140,8
+14273,2,202000010,8
+14274,2,290000010,8
+14275,2,299000010,8
+14276,2,299000150,8
+14277,2,299000190,8
+14278,2,299000200,8
+14279,2,299000210,8
+14280,3,298000050,8
+14281,3,298000060,8
+14282,3,299000060,8
+14283,3,299000170,8
+14284,3,290000120,8
+14285,3,291000050,8
+14286,3,292000020,8
+14287,4,299000670,8
+14288,4,299000680,8
+14289,4,204000010,8
+14290,4,209000040,8
+14291,4,202000070,8
+14292,4,209000070,8
+14293,4,203000110,8
+14294,4,290000110,8
+14295,5,297000100,8
+14296,5,291000020,8
+14297,5,297000130,8
+14298,5,297000140,8
+14299,5,203000010,8
+14300,5,206000030,8
+14301,5,203000050,8
+14302,5,202000090,8
+14303,5,204000080,8
+14304,5,202000150,8
+14305,3,170004,3
+14306,3,180004,3
+14307,4,140000,3
+14308,5,150010,3
+14309,5,150020,3
+14310,5,150030,3
+14311,5,150040,3
+14312,5,190000,3
+14313,5,200000,3
+14314,5,210000,3
+14316,1,101000010,1
+14317,1,102000010,1
+14318,1,103000010,1
+14319,1,104000010,1
+14320,1,105000010,1
+14321,1,106000010,1
+14322,1,107000010,1
+14323,1,108000010,1
+14324,1,109000010,1
+14325,1,110000010,1
+14326,2,101000020,1
+14327,2,101000030,1
+14328,2,102000020,1
+14329,2,102000030,1
+14330,2,102000040,1
+14331,2,103000020,1
+14332,2,103000030,1
+14333,2,103000040,1
+14334,2,104000020,1
+14335,2,104000030,1
+14336,2,104000040,1
+14337,2,105000020,1
+14338,2,105000030,1
+14339,2,105000040,1
+14340,2,106000020,1
+14341,2,106000030,1
+14342,2,106000040,1
+14343,2,107000020,1
+14344,2,107000030,1
+14345,2,107000040,1
+14346,2,108000020,1
+14347,2,108000030,1
+14348,2,108000040,1
+14349,2,109000020,1
+14350,2,109000030,1
+14351,2,109000040,1
+14352,2,110000020,1
+14353,2,110000030,1
+14354,2,110000040,1
+14355,2,118000010,1
+14356,3,101000050,1
+14357,3,101000060,1
+14358,3,101000080,1
+14359,3,101000040,1
+14360,3,109000060,1
+14361,3,109000070,1
+14362,3,109000080,1
+14363,3,105000060,1
+14364,3,105000070,1
+14365,3,105000080,1
+14366,3,104000050,1
+14367,3,106000050,1
+14368,3,102000060,1
+14369,3,102000070,1
+14370,3,102000080,1
+14371,3,103000050,1
+14372,3,105000050,1
+14373,3,107000060,1
+14374,3,107000070,1
+14375,3,107000080,1
+14376,3,108000050,1
+14377,3,109000050,1
+14378,3,103000060,1
+14379,3,103000070,1
+14380,3,103000080,1
+14381,3,110000050,1
+14382,3,106000060,1
+14383,3,106000070,1
+14384,3,106000080,1
+14385,3,101000070,1
+14386,3,110000060,1
+14387,3,104000060,1
+14388,3,104000070,1
+14389,3,104000080,1
+14390,3,102000050,1
+14391,3,104000170,1
+14392,3,104000260,1
+14393,3,111000010,1
+14394,3,111000020,1
+14395,3,111000030,1
+14396,3,112000020,1
+14397,3,112000030,1
+14398,3,108000060,1
+14399,3,108000070,1
+14400,3,108000080,1
+14401,3,107000050,1
+14402,3,112000010,1
+14403,3,110000070,1
+14404,3,110000080,1
+14405,3,118000020,1
+14406,3,118000030,1
+14407,3,118000040,1
+14408,4,101000090,1
+14409,4,101000100,1
+14410,4,101000110,1
+14411,4,109000100,1
+14412,4,105000100,1
+14413,4,105000110,1
+14414,4,108000090,1
+14415,4,110000090,1
+14416,4,102000100,1
+14417,4,102000110,1
+14418,4,106000090,1
+14419,4,109000090,1
+14420,4,107000100,1
+14421,4,103000090,1
+14422,4,102000090,1
+14423,4,103000100,1
+14424,4,106000100,1
+14425,4,106000110,1
+14426,4,104000090,1
+14427,4,104000100,1
+14428,4,104000110,1
+14429,4,107000090,1
+14430,4,104000180,1
+14431,4,111000040,1
+14432,4,112000040,1
+14433,4,108000100,1
+14434,4,105000090,1
+14435,4,110000100,1
+14436,4,118000050,1
+14437,4,118000060,1
+14438,5,101000120,1
+14439,5,109000110,1
+14440,5,105000120,1
+14441,5,102000120,1
+14442,5,107000110,1
+14443,5,103000120,1
+14444,5,106000120,1
+14445,5,104000120,1
+14446,5,104000190,1
+14447,5,111000060,1
+14448,5,112000060,1
+14449,5,108000110,1
+14450,5,110000110,1
+14451,5,118000070,1
+14452,1,201000010,8
+14453,1,292000010,8
+14454,1,299000040,8
+14455,1,299000070,8
+14456,1,299000110,8
+14457,1,299000120,8
+14458,1,299000140,8
+14459,2,202000010,8
+14460,2,290000010,8
+14461,2,299000010,8
+14462,2,299000150,8
+14463,2,299000190,8
+14464,2,299000200,8
+14465,2,299000210,8
+14466,3,298000050,8
+14467,3,298000060,8
+14468,3,299000060,8
+14469,3,299000170,8
+14470,3,290000120,8
+14471,3,291000050,8
+14472,3,292000020,8
+14473,4,299000670,8
+14474,4,299000680,8
+14475,4,204000010,8
+14476,4,209000040,8
+14477,4,202000070,8
+14478,4,209000070,8
+14479,4,203000110,8
+14480,4,290000110,8
+14481,4,206000110,8
+14482,5,297000100,8
+14483,5,291000020,8
+14484,5,297000130,8
+14485,5,297000140,8
+14486,5,203000010,8
+14487,5,206000030,8
+14488,5,203000050,8
+14489,5,202000090,8
+14490,5,204000080,8
+14491,5,202000150,8
+14492,5,204000100,8
+14493,1,170002,3
+14494,1,180002,3
+14495,2,170003,3
+14496,2,180003,3
+14497,3,170004,3
+14498,3,180004,3
+14499,4,140000,3
+14500,5,150010,3
+14501,5,150020,3
+14502,5,150030,3
+14503,5,150040,3
+14505,1,101000010,1
+14506,1,102000010,1
+14507,1,103000010,1
+14508,1,104000010,1
+14509,1,105000010,1
+14510,1,106000010,1
+14511,1,107000010,1
+14512,1,108000010,1
+14513,1,109000010,1
+14514,1,110000010,1
+14515,2,101000020,1
+14516,2,101000030,1
+14517,2,102000020,1
+14518,2,102000030,1
+14519,2,102000040,1
+14520,2,103000020,1
+14521,2,103000030,1
+14522,2,103000040,1
+14523,2,104000020,1
+14524,2,104000030,1
+14525,2,104000040,1
+14526,2,105000020,1
+14527,2,105000030,1
+14528,2,105000040,1
+14529,2,106000020,1
+14530,2,106000030,1
+14531,2,106000040,1
+14532,2,107000020,1
+14533,2,107000030,1
+14534,2,107000040,1
+14535,2,108000020,1
+14536,2,108000030,1
+14537,2,108000040,1
+14538,2,109000020,1
+14539,2,109000030,1
+14540,2,109000040,1
+14541,2,110000020,1
+14542,2,110000030,1
+14543,2,110000040,1
+14544,2,118000010,1
+14545,3,101000050,1
+14546,3,101000060,1
+14547,3,101000080,1
+14548,3,101000040,1
+14549,3,109000060,1
+14550,3,109000070,1
+14551,3,109000080,1
+14552,3,105000060,1
+14553,3,105000070,1
+14554,3,105000080,1
+14555,3,104000050,1
+14556,3,106000050,1
+14557,3,102000060,1
+14558,3,102000070,1
+14559,3,102000080,1
+14560,3,103000050,1
+14561,3,105000050,1
+14562,3,107000060,1
+14563,3,107000070,1
+14564,3,107000080,1
+14565,3,108000050,1
+14566,3,109000050,1
+14567,3,103000060,1
+14568,3,103000070,1
+14569,3,103000080,1
+14570,3,110000050,1
+14571,3,106000060,1
+14572,3,106000070,1
+14573,3,106000080,1
+14574,3,101000070,1
+14575,3,110000060,1
+14576,3,104000060,1
+14577,3,104000070,1
+14578,3,104000080,1
+14579,3,102000050,1
+14580,3,104000170,1
+14581,3,104000260,1
+14582,3,111000010,1
+14583,3,111000020,1
+14584,3,111000030,1
+14585,3,112000020,1
+14586,3,112000030,1
+14587,3,108000060,1
+14588,3,108000070,1
+14589,3,108000080,1
+14590,3,107000050,1
+14591,3,112000010,1
+14592,3,110000070,1
+14593,3,110000080,1
+14594,3,118000020,1
+14595,3,118000030,1
+14596,3,118000040,1
+14597,4,101000090,1
+14598,4,101000100,1
+14599,4,101000110,1
+14600,4,109000100,1
+14601,4,105000100,1
+14602,4,105000110,1
+14603,4,108000090,1
+14604,4,110000090,1
+14605,4,102000100,1
+14606,4,102000110,1
+14607,4,106000090,1
+14608,4,109000090,1
+14609,4,107000100,1
+14610,4,103000090,1
+14611,4,102000090,1
+14612,4,103000100,1
+14613,4,106000100,1
+14614,4,106000110,1
+14615,4,104000090,1
+14616,4,104000100,1
+14617,4,104000110,1
+14618,4,107000090,1
+14619,4,104000180,1
+14620,4,111000040,1
+14621,4,112000040,1
+14622,4,108000100,1
+14623,4,105000090,1
+14624,4,110000100,1
+14625,4,118000050,1
+14626,4,118000060,1
+14627,5,101000120,1
+14628,5,109000110,1
+14629,5,105000120,1
+14630,5,102000120,1
+14631,5,107000110,1
+14632,5,103000120,1
+14633,5,106000120,1
+14634,5,104000120,1
+14635,5,104000190,1
+14636,5,111000060,1
+14637,5,112000060,1
+14638,5,108000110,1
+14639,5,110000110,1
+14640,5,118000070,1
+14641,1,201000010,8
+14642,1,292000010,8
+14643,1,299000040,8
+14644,1,299000070,8
+14645,1,299000110,8
+14646,1,299000120,8
+14647,1,299000140,8
+14648,2,202000010,8
+14649,2,290000010,8
+14650,2,299000010,8
+14651,2,299000150,8
+14652,2,299000190,8
+14653,2,299000200,8
+14654,2,299000210,8
+14655,3,298000050,8
+14656,3,298000060,8
+14657,3,299000060,8
+14658,3,299000170,8
+14659,3,290000120,8
+14660,3,291000050,8
+14661,3,292000020,8
+14662,4,299000670,8
+14663,4,299000680,8
+14664,4,204000010,8
+14665,4,209000040,8
+14666,4,202000070,8
+14667,4,209000070,8
+14668,4,203000110,8
+14669,4,290000110,8
+14670,4,206000110,8
+14671,5,297000100,8
+14672,5,291000020,8
+14673,5,297000130,8
+14674,5,297000140,8
+14675,5,203000010,8
+14676,5,206000030,8
+14677,5,203000050,8
+14678,5,202000090,8
+14679,5,204000080,8
+14680,5,202000150,8
+14681,5,204000100,8
+14682,2,170003,3
+14683,2,180003,3
+14684,3,170004,3
+14685,3,180004,3
+14686,4,140000,3
+14687,5,150010,3
+14688,5,150020,3
+14689,5,150030,3
+14690,5,150040,3
+14692,3,101000050,1
+14693,3,101000060,1
+14694,3,101000080,1
+14695,3,101000040,1
+14696,3,109000060,1
+14697,3,109000070,1
+14698,3,109000080,1
+14699,3,105000060,1
+14700,3,105000070,1
+14701,3,105000080,1
+14702,3,104000050,1
+14703,3,106000050,1
+14704,3,102000060,1
+14705,3,102000070,1
+14706,3,102000080,1
+14707,3,103000050,1
+14708,3,105000050,1
+14709,3,107000060,1
+14710,3,107000070,1
+14711,3,107000080,1
+14712,3,108000050,1
+14713,3,109000050,1
+14714,3,103000060,1
+14715,3,103000070,1
+14716,3,103000080,1
+14717,3,110000050,1
+14718,3,106000060,1
+14719,3,106000070,1
+14720,3,106000080,1
+14721,3,101000070,1
+14722,3,110000060,1
+14723,3,104000060,1
+14724,3,104000070,1
+14725,3,104000080,1
+14726,3,102000050,1
+14727,3,104000170,1
+14728,3,104000260,1
+14729,3,111000010,1
+14730,3,111000020,1
+14731,3,111000030,1
+14732,3,112000020,1
+14733,3,112000030,1
+14734,3,108000060,1
+14735,3,108000070,1
+14736,3,108000080,1
+14737,3,107000050,1
+14738,3,112000010,1
+14739,3,110000070,1
+14740,3,110000080,1
+14741,3,118000020,1
+14742,3,118000030,1
+14743,3,118000040,1
+14744,4,101000090,1
+14745,4,101000100,1
+14746,4,101000110,1
+14747,4,109000100,1
+14748,4,105000100,1
+14749,4,105000110,1
+14750,4,108000090,1
+14751,4,110000090,1
+14752,4,102000100,1
+14753,4,102000110,1
+14754,4,106000090,1
+14755,4,109000090,1
+14756,4,107000100,1
+14757,4,103000090,1
+14758,4,102000090,1
+14759,4,103000100,1
+14760,4,106000100,1
+14761,4,106000110,1
+14762,4,104000090,1
+14763,4,104000100,1
+14764,4,104000110,1
+14765,4,107000090,1
+14766,4,104000180,1
+14767,4,111000040,1
+14768,4,112000040,1
+14769,4,108000100,1
+14770,4,105000090,1
+14771,4,110000100,1
+14772,4,118000050,1
+14773,4,118000060,1
+14774,5,101000120,1
+14775,5,109000110,1
+14776,5,105000120,1
+14777,5,102000120,1
+14778,5,107000110,1
+14779,5,103000120,1
+14780,5,106000120,1
+14781,5,104000120,1
+14782,5,104000190,1
+14783,5,111000060,1
+14784,5,112000060,1
+14785,5,108000110,1
+14786,5,110000110,1
+14787,5,118000070,1
+14788,1,201000010,8
+14789,1,292000010,8
+14790,1,299000040,8
+14791,1,299000070,8
+14792,1,299000110,8
+14793,1,299000120,8
+14794,1,299000140,8
+14795,2,202000010,8
+14796,2,290000010,8
+14797,2,299000010,8
+14798,2,299000150,8
+14799,2,299000190,8
+14800,2,299000200,8
+14801,2,299000210,8
+14802,3,298000050,8
+14803,3,298000060,8
+14804,3,299000060,8
+14805,3,299000170,8
+14806,3,290000120,8
+14807,3,291000050,8
+14808,3,292000020,8
+14809,4,299000670,8
+14810,4,299000680,8
+14811,4,204000010,8
+14812,4,209000040,8
+14813,4,202000070,8
+14814,4,209000070,8
+14815,4,203000110,8
+14816,4,290000110,8
+14817,4,206000110,8
+14818,5,297000100,8
+14819,5,291000020,8
+14820,5,297000130,8
+14821,5,297000140,8
+14822,5,203000010,8
+14823,5,206000030,8
+14824,5,203000050,8
+14825,5,202000090,8
+14826,5,204000080,8
+14827,5,202000150,8
+14828,5,204000100,8
+14829,3,170004,3
+14830,3,180004,3
+14831,4,140000,3
+14832,5,150010,3
+14833,5,150020,3
+14834,5,150030,3
+14835,5,150040,3
+14837,3,101000050,1
+14838,3,101000060,1
+14839,3,101000080,1
+14840,3,101000040,1
+14841,3,109000060,1
+14842,3,109000070,1
+14843,3,109000080,1
+14844,3,105000060,1
+14845,3,105000070,1
+14846,3,105000080,1
+14847,3,104000050,1
+14848,3,106000050,1
+14849,3,102000060,1
+14850,3,102000070,1
+14851,3,102000080,1
+14852,3,103000050,1
+14853,3,105000050,1
+14854,3,107000060,1
+14855,3,107000070,1
+14856,3,107000080,1
+14857,3,108000050,1
+14858,3,109000050,1
+14859,3,103000060,1
+14860,3,103000070,1
+14861,3,103000080,1
+14862,3,110000050,1
+14863,3,106000060,1
+14864,3,106000070,1
+14865,3,106000080,1
+14866,3,101000070,1
+14867,3,110000060,1
+14868,3,104000060,1
+14869,3,104000070,1
+14870,3,104000080,1
+14871,3,102000050,1
+14872,3,104000170,1
+14873,3,104000260,1
+14874,3,111000010,1
+14875,3,111000020,1
+14876,3,111000030,1
+14877,3,112000020,1
+14878,3,112000030,1
+14879,3,108000060,1
+14880,3,108000070,1
+14881,3,108000080,1
+14882,3,107000050,1
+14883,3,112000010,1
+14884,3,110000070,1
+14885,3,110000080,1
+14886,3,118000020,1
+14887,3,118000030,1
+14888,3,118000040,1
+14889,4,101000090,1
+14890,4,101000100,1
+14891,4,101000110,1
+14892,4,109000100,1
+14893,4,105000100,1
+14894,4,105000110,1
+14895,4,108000090,1
+14896,4,110000090,1
+14897,4,102000100,1
+14898,4,102000110,1
+14899,4,106000090,1
+14900,4,109000090,1
+14901,4,107000100,1
+14902,4,103000090,1
+14903,4,102000090,1
+14904,4,103000100,1
+14905,4,106000100,1
+14906,4,106000110,1
+14907,4,104000090,1
+14908,4,104000100,1
+14909,4,104000110,1
+14910,4,107000090,1
+14911,4,104000180,1
+14912,4,111000040,1
+14913,4,112000040,1
+14914,4,108000100,1
+14915,4,105000090,1
+14916,4,110000100,1
+14917,4,118000050,1
+14918,4,118000060,1
+14919,5,101000120,1
+14920,5,109000110,1
+14921,5,105000120,1
+14922,5,102000120,1
+14923,5,107000110,1
+14924,5,103000120,1
+14925,5,106000120,1
+14926,5,104000120,1
+14927,5,104000190,1
+14928,5,111000060,1
+14929,5,112000060,1
+14930,5,108000110,1
+14931,5,110000110,1
+14932,5,118000070,1
+14933,1,201000010,8
+14934,1,292000010,8
+14935,1,299000040,8
+14936,1,299000070,8
+14937,1,299000110,8
+14938,1,299000120,8
+14939,1,299000140,8
+14940,2,202000010,8
+14941,2,290000010,8
+14942,2,299000010,8
+14943,2,299000150,8
+14944,2,299000190,8
+14945,2,299000200,8
+14946,2,299000210,8
+14947,3,298000050,8
+14948,3,298000060,8
+14949,3,299000060,8
+14950,3,299000170,8
+14951,3,290000120,8
+14952,3,291000050,8
+14953,3,292000020,8
+14954,4,299000670,8
+14955,4,299000680,8
+14956,4,204000010,8
+14957,4,209000040,8
+14958,4,202000070,8
+14959,4,209000070,8
+14960,4,203000110,8
+14961,4,290000110,8
+14962,4,206000110,8
+14963,5,297000100,8
+14964,5,291000020,8
+14965,5,297000130,8
+14966,5,297000140,8
+14967,5,203000010,8
+14968,5,206000030,8
+14969,5,203000050,8
+14970,5,202000090,8
+14971,5,204000080,8
+14972,5,202000150,8
+14973,5,204000100,8
+14974,3,170004,3
+14975,3,180004,3
+14976,4,140000,3
+14977,5,150010,3
+14978,5,150020,3
+14979,5,150030,3
+14980,5,150040,3
+14982,3,101000050,1
+14983,3,101000060,1
+14984,3,101000080,1
+14985,3,101000040,1
+14986,3,109000060,1
+14987,3,109000070,1
+14988,3,109000080,1
+14989,3,105000060,1
+14990,3,105000070,1
+14991,3,105000080,1
+14992,3,104000050,1
+14993,3,106000050,1
+14994,3,102000060,1
+14995,3,102000070,1
+14996,3,102000080,1
+14997,3,103000050,1
+14998,3,105000050,1
+14999,3,107000060,1
+15000,3,107000070,1
+15001,3,107000080,1
+15002,3,108000050,1
+15003,3,109000050,1
+15004,3,103000060,1
+15005,3,103000070,1
+15006,3,103000080,1
+15007,3,110000050,1
+15008,3,106000060,1
+15009,3,106000070,1
+15010,3,106000080,1
+15011,3,101000070,1
+15012,3,110000060,1
+15013,3,104000060,1
+15014,3,104000070,1
+15015,3,104000080,1
+15016,3,102000050,1
+15017,3,104000170,1
+15018,3,104000260,1
+15019,3,111000010,1
+15020,3,111000020,1
+15021,3,111000030,1
+15022,3,112000020,1
+15023,3,112000030,1
+15024,3,108000060,1
+15025,3,108000070,1
+15026,3,108000080,1
+15027,3,107000050,1
+15028,3,112000010,1
+15029,3,110000070,1
+15030,3,110000080,1
+15031,3,118000020,1
+15032,3,118000030,1
+15033,3,118000040,1
+15034,4,101000090,1
+15035,4,101000100,1
+15036,4,101000110,1
+15037,4,109000100,1
+15038,4,105000100,1
+15039,4,105000110,1
+15040,4,108000090,1
+15041,4,110000090,1
+15042,4,102000100,1
+15043,4,102000110,1
+15044,4,106000090,1
+15045,4,109000090,1
+15046,4,107000100,1
+15047,4,103000090,1
+15048,4,102000090,1
+15049,4,103000100,1
+15050,4,106000100,1
+15051,4,106000110,1
+15052,4,104000090,1
+15053,4,104000100,1
+15054,4,104000110,1
+15055,4,107000090,1
+15056,4,104000180,1
+15057,4,111000040,1
+15058,4,112000040,1
+15059,4,108000100,1
+15060,4,105000090,1
+15061,4,110000100,1
+15062,4,118000050,1
+15063,4,118000060,1
+15064,5,101000120,1
+15065,5,109000110,1
+15066,5,105000120,1
+15067,5,102000120,1
+15068,5,107000110,1
+15069,5,103000120,1
+15070,5,106000120,1
+15071,5,104000120,1
+15072,5,104000190,1
+15073,5,111000060,1
+15074,5,112000060,1
+15075,5,108000110,1
+15076,5,110000110,1
+15077,5,118000070,1
+15078,1,201000010,8
+15079,1,292000010,8
+15080,1,299000040,8
+15081,1,299000070,8
+15082,1,299000110,8
+15083,1,299000120,8
+15084,1,299000140,8
+15085,2,202000010,8
+15086,2,290000010,8
+15087,2,299000010,8
+15088,2,299000150,8
+15089,2,299000190,8
+15090,2,299000200,8
+15091,2,299000210,8
+15092,3,298000050,8
+15093,3,298000060,8
+15094,3,299000060,8
+15095,3,299000170,8
+15096,3,290000120,8
+15097,3,291000050,8
+15098,3,292000020,8
+15099,4,299000670,8
+15100,4,299000680,8
+15101,4,204000010,8
+15102,4,209000040,8
+15103,4,202000070,8
+15104,4,209000070,8
+15105,4,203000110,8
+15106,4,290000110,8
+15107,4,206000110,8
+15108,5,297000100,8
+15109,5,291000020,8
+15110,5,297000130,8
+15111,5,297000140,8
+15112,5,203000010,8
+15113,5,206000030,8
+15114,5,203000050,8
+15115,5,202000090,8
+15116,5,204000080,8
+15117,5,202000150,8
+15118,5,204000100,8
+15119,3,170004,3
+15120,3,180004,3
+15121,4,140000,3
+15122,5,150010,3
+15123,5,150020,3
+15124,5,150030,3
+15125,5,150040,3
+15126,5,190000,3
+15127,5,200000,3
+15128,5,210000,3
+15130,3,111000010,1
+15131,3,111000020,1
+15132,3,111000030,1
+15133,3,112000020,1
+15134,3,112000030,1
+15135,3,108000060,1
+15136,3,108000070,1
+15137,3,108000080,1
+15138,3,107000050,1
+15139,3,112000010,1
+15140,3,110000070,1
+15141,3,110000080,1
+15142,4,111000040,1
+15143,4,112000040,1
+15144,4,108000100,1
+15145,4,105000090,1
+15146,4,110000100,1
+15147,5,111000060,1
+15148,5,112000060,1
+15149,5,108000110,1
+15150,5,110000110,1
+15151,1,108000000,2
+15152,2,108000001,2
+15153,3,108000002,2
+15154,4,108000003,2
+15155,5,108000004,2
+15156,1,107000000,2
+15157,2,107000001,2
+15158,3,107000002,2
+15159,4,107000003,2
+15160,5,107000004,2
+15161,1,120000000,2
+15162,2,120000001,2
+15163,3,120000002,2
+15164,4,120000003,2
+15165,5,120000004,2
+15166,3,170004,3
+15167,4,170005,3
+15168,3,180004,3
+15169,4,180005,3
+15170,4,140000,3
+15171,4,150010,3
+15172,4,150020,3
+15173,4,150030,3
+15174,4,150040,3
+15176,3,101000050,1
+15177,3,101000060,1
+15178,3,101000080,1
+15179,3,101000040,1
+15180,3,109000060,1
+15181,3,109000070,1
+15182,3,109000080,1
+15183,3,105000060,1
+15184,3,105000070,1
+15185,3,105000080,1
+15186,3,104000050,1
+15187,3,106000050,1
+15188,4,101000090,1
+15189,4,101000100,1
+15190,4,101000110,1
+15191,4,109000100,1
+15192,4,105000100,1
+15193,4,105000110,1
+15194,4,108000090,1
+15195,4,110000090,1
+15196,5,101000120,1
+15197,5,109000110,1
+15198,5,105000120,1
+15199,1,101000000,2
+15200,2,101000001,2
+15201,3,101000002,2
+15202,4,101000008,2
+15203,5,101000004,2
+15204,1,109000000,2
+15205,2,109000001,2
+15206,3,109000002,2
+15207,4,109000003,2
+15208,5,109000004,2
+15209,4,110024,3
+15210,4,110034,3
+15211,4,110044,3
+15212,4,110054,3
+15213,3,110060,3
+15214,3,110070,3
+15215,3,110080,3
+15216,3,110090,3
+15217,3,110100,3
+15218,3,110110,3
+15219,3,110120,3
+15220,3,110130,3
+15221,3,110140,3
+15222,3,110150,3
+15223,3,110160,3
+15224,3,110170,3
+15225,3,110180,3
+15226,3,110190,3
+15227,3,110200,3
+15228,3,110210,3
+15229,3,110220,3
+15230,3,110230,3
+15231,3,110240,3
+15232,3,110250,3
+15233,3,110260,3
+15234,3,110270,3
+15235,3,110620,3
+15236,3,110670,3
+15237,4,140000,3
+15238,4,150010,3
+15239,4,150020,3
+15240,4,150030,3
+15241,4,150040,3
+15243,3,102000060,1
+15244,3,102000070,1
+15245,3,102000080,1
+15246,3,103000050,1
+15247,3,105000050,1
+15248,3,107000060,1
+15249,3,107000070,1
+15250,3,107000080,1
+15251,3,108000050,1
+15252,3,109000050,1
+15253,3,103000060,1
+15254,3,103000070,1
+15255,3,103000080,1
+15256,3,110000050,1
+15257,4,102000100,1
+15258,4,102000110,1
+15259,4,102000350,1
+15260,4,106000090,1
+15261,4,109000090,1
+15262,4,107000100,1
+15263,4,103000090,1
+15264,4,102000090,1
+15265,4,103000100,1
+15266,5,102000120,1
+15267,5,107000110,1
+15268,5,103000120,1
+15269,1,102000000,2
+15270,2,102000001,2
+15271,3,102000002,2
+15272,4,102000003,2
+15273,5,102000004,2
+15274,1,105000000,2
+15275,2,105000001,2
+15276,3,105000002,2
+15277,4,105000003,2
+15278,5,105000004,2
+15279,1,112000000,2
+15280,2,112000001,2
+15281,3,112000002,2
+15282,4,112000003,2
+15283,5,112000004,2
+15284,4,120024,3
+15285,4,120034,3
+15286,4,120044,3
+15287,4,120054,3
+15288,3,120241,3
+15289,3,120251,3
+15290,3,120261,3
+15291,3,120271,3
+15292,3,120300,3
+15293,3,120310,3
+15294,3,120320,3
+15295,3,120330,3
+15296,3,120340,3
+15297,3,120350,3
+15298,3,120360,3
+15299,3,120370,3
+15300,3,120380,3
+15301,3,120390,3
+15302,3,120400,3
+15303,3,120410,3
+15304,3,120420,3
+15305,3,120430,3
+15306,3,120450,3
+15307,3,120460,3
+15308,3,120550,3
+15309,3,120560,3
+15310,3,120570,3
+15311,3,120990,3
+15312,3,121000,3
+15313,3,121010,3
+15314,3,121020,3
+15315,3,121100,3
+15316,4,140000,3
+15317,4,150010,3
+15318,4,150020,3
+15319,4,150030,3
+15320,4,150040,3
+15322,3,118000020,1
+15323,3,118000030,1
+15324,3,118000040,1
+15325,3,106000060,1
+15326,3,106000070,1
+15327,3,106000080,1
+15328,3,101000070,1
+15329,3,110000060,1
+15330,3,104000060,1
+15331,3,104000070,1
+15332,3,104000080,1
+15333,3,102000050,1
+15334,3,104000170,1
+15335,3,104000260,1
+15336,4,118000050,1
+15337,4,118000060,1
+15338,4,106000100,1
+15339,4,106000110,1
+15340,4,104000090,1
+15341,4,104000100,1
+15342,4,104000110,1
+15343,4,104000270,1
+15344,4,107000090,1
+15345,4,104000180,1
+15346,5,118000070,1
+15347,5,106000120,1
+15348,5,104000120,1
+15349,5,104000190,1
+15350,1,103000000,2
+15351,2,103000001,2
+15352,3,103000002,2
+15353,4,103000003,2
+15354,5,103000004,2
+15355,1,111000000,2
+15356,2,111000001,2
+15357,3,111000002,2
+15358,4,111000003,2
+15359,5,111000004,2
+15360,1,115000000,2
+15361,2,115000001,2
+15362,3,115000002,2
+15363,4,115000003,2
+15364,5,115000004,2
+15365,4,130024,3
+15366,4,130034,3
+15367,4,130044,3
+15368,4,130054,3
+15369,3,130060,3
+15370,3,130070,3
+15371,3,130080,3
+15372,3,130090,3
+15373,3,130100,3
+15374,3,130110,3
+15375,3,130120,3
+15376,3,130130,3
+15377,3,130140,3
+15378,3,130150,3
+15379,3,130160,3
+15380,3,130170,3
+15381,3,130180,3
+15382,3,130190,3
+15383,3,130200,3
+15384,3,130420,3
+15385,3,130510,3
+15386,3,130520,3
+15387,3,130531,3
+15388,3,130540,3
+15389,3,130660,3
+15390,3,130700,3
+15391,3,130790,3
+15392,3,130800,3
+15393,3,131130,3
+15394,4,140000,3
+15395,4,150010,3
+15396,4,150020,3
+15397,4,150030,3
+15398,4,150040,3
+15400,1,101000010,1
+15401,1,102000010,1
+15402,1,103000010,1
+15403,1,104000010,1
+15404,1,105000010,1
+15405,1,106000010,1
+15406,1,107000010,1
+15407,1,108000010,1
+15408,1,109000010,1
+15409,1,110000010,1
+15410,2,101000020,1
+15411,2,101000030,1
+15412,2,102000020,1
+15413,2,102000030,1
+15414,2,102000040,1
+15415,2,103000020,1
+15416,2,103000030,1
+15417,2,103000040,1
+15418,2,104000020,1
+15419,2,104000030,1
+15420,2,104000040,1
+15421,2,105000020,1
+15422,2,105000030,1
+15423,2,105000040,1
+15424,2,106000020,1
+15425,2,106000030,1
+15426,2,106000040,1
+15427,2,107000020,1
+15428,2,107000030,1
+15429,2,107000040,1
+15430,2,108000020,1
+15431,2,108000030,1
+15432,2,108000040,1
+15433,2,109000020,1
+15434,2,109000030,1
+15435,2,109000040,1
+15436,2,110000020,1
+15437,2,110000030,1
+15438,2,110000040,1
+15439,2,118000010,1
+15440,3,101000050,1
+15441,3,101000060,1
+15442,3,101000080,1
+15443,3,101000040,1
+15444,3,109000060,1
+15445,3,109000070,1
+15446,3,109000080,1
+15447,3,105000060,1
+15448,3,105000070,1
+15449,3,105000080,1
+15450,3,104000050,1
+15451,3,106000050,1
+15452,3,102000060,1
+15453,3,102000070,1
+15454,3,102000080,1
+15455,3,103000050,1
+15456,3,105000050,1
+15457,3,107000060,1
+15458,3,107000070,1
+15459,3,107000080,1
+15460,3,108000050,1
+15461,3,109000050,1
+15462,3,103000060,1
+15463,3,103000070,1
+15464,3,103000080,1
+15465,3,110000050,1
+15466,3,106000060,1
+15467,3,106000070,1
+15468,3,106000080,1
+15469,3,101000070,1
+15470,3,110000060,1
+15471,3,104000060,1
+15472,3,104000070,1
+15473,3,104000080,1
+15474,3,102000050,1
+15475,3,104000170,1
+15476,3,104000260,1
+15477,3,111000010,1
+15478,3,111000020,1
+15479,3,111000030,1
+15480,3,112000020,1
+15481,3,112000030,1
+15482,3,108000060,1
+15483,3,108000070,1
+15484,3,108000080,1
+15485,3,107000050,1
+15486,3,112000010,1
+15487,3,110000070,1
+15488,3,110000080,1
+15489,3,118000020,1
+15490,3,118000030,1
+15491,3,118000040,1
+15492,4,101000090,1
+15493,4,101000100,1
+15494,4,101000110,1
+15495,4,109000100,1
+15496,4,105000100,1
+15497,4,105000110,1
+15498,4,108000090,1
+15499,4,110000090,1
+15500,4,102000100,1
+15501,4,102000110,1
+15502,4,106000090,1
+15503,4,109000090,1
+15504,4,107000100,1
+15505,4,103000090,1
+15506,4,102000090,1
+15507,4,103000100,1
+15508,4,106000100,1
+15509,4,106000110,1
+15510,4,104000090,1
+15511,4,104000100,1
+15512,4,104000110,1
+15513,4,107000090,1
+15514,4,104000180,1
+15515,4,111000040,1
+15516,4,112000040,1
+15517,4,108000100,1
+15518,4,105000090,1
+15519,4,110000100,1
+15520,4,118000050,1
+15521,4,118000060,1
+15522,5,101000120,1
+15523,5,109000110,1
+15524,5,105000120,1
+15525,5,102000120,1
+15526,5,107000110,1
+15527,5,103000120,1
+15528,5,106000120,1
+15529,5,104000120,1
+15530,5,104000190,1
+15531,5,111000060,1
+15532,5,112000060,1
+15533,5,108000110,1
+15534,5,110000110,1
+15535,5,118000070,1
+15536,1,201000010,8
+15537,1,292000010,8
+15538,1,299000040,8
+15539,1,299000070,8
+15540,1,299000110,8
+15541,1,299000120,8
+15542,1,299000140,8
+15543,2,202000010,8
+15544,2,290000010,8
+15545,2,299000010,8
+15546,2,299000150,8
+15547,2,299000190,8
+15548,2,299000200,8
+15549,2,299000210,8
+15550,3,298000050,8
+15551,3,298000060,8
+15552,3,299000060,8
+15553,3,299000170,8
+15554,3,290000120,8
+15555,3,291000050,8
+15556,3,292000020,8
+15557,4,299000670,8
+15558,4,299000680,8
+15559,4,204000010,8
+15560,4,209000040,8
+15561,4,202000070,8
+15562,4,209000070,8
+15563,4,203000110,8
+15564,4,290000110,8
+15565,4,206000110,8
+15566,4,209000160,8
+15567,5,297000100,8
+15568,5,291000020,8
+15569,5,297000130,8
+15570,5,297000140,8
+15571,5,203000010,8
+15572,5,206000030,8
+15573,5,203000050,8
+15574,5,202000090,8
+15575,5,204000080,8
+15576,5,202000150,8
+15577,5,204000100,8
+15578,5,206000170,8
+15579,1,170002,3
+15580,1,180002,3
+15581,2,170003,3
+15582,2,180003,3
+15583,3,170004,3
+15584,3,180004,3
+15585,4,140000,3
+15586,5,150010,3
+15587,5,150020,3
+15588,5,150030,3
+15589,5,150040,3
+15591,1,101000010,1
+15592,1,102000010,1
+15593,1,103000010,1
+15594,1,104000010,1
+15595,1,105000010,1
+15596,1,106000010,1
+15597,1,107000010,1
+15598,1,108000010,1
+15599,1,109000010,1
+15600,1,110000010,1
+15601,2,101000020,1
+15602,2,101000030,1
+15603,2,102000020,1
+15604,2,102000030,1
+15605,2,102000040,1
+15606,2,103000020,1
+15607,2,103000030,1
+15608,2,103000040,1
+15609,2,104000020,1
+15610,2,104000030,1
+15611,2,104000040,1
+15612,2,105000020,1
+15613,2,105000030,1
+15614,2,105000040,1
+15615,2,106000020,1
+15616,2,106000030,1
+15617,2,106000040,1
+15618,2,107000020,1
+15619,2,107000030,1
+15620,2,107000040,1
+15621,2,108000020,1
+15622,2,108000030,1
+15623,2,108000040,1
+15624,2,109000020,1
+15625,2,109000030,1
+15626,2,109000040,1
+15627,2,110000020,1
+15628,2,110000030,1
+15629,2,110000040,1
+15630,2,118000010,1
+15631,3,101000050,1
+15632,3,101000060,1
+15633,3,101000080,1
+15634,3,101000040,1
+15635,3,109000060,1
+15636,3,109000070,1
+15637,3,109000080,1
+15638,3,105000060,1
+15639,3,105000070,1
+15640,3,105000080,1
+15641,3,104000050,1
+15642,3,106000050,1
+15643,3,102000060,1
+15644,3,102000070,1
+15645,3,102000080,1
+15646,3,103000050,1
+15647,3,105000050,1
+15648,3,107000060,1
+15649,3,107000070,1
+15650,3,107000080,1
+15651,3,108000050,1
+15652,3,109000050,1
+15653,3,103000060,1
+15654,3,103000070,1
+15655,3,103000080,1
+15656,3,110000050,1
+15657,3,106000060,1
+15658,3,106000070,1
+15659,3,106000080,1
+15660,3,101000070,1
+15661,3,110000060,1
+15662,3,104000060,1
+15663,3,104000070,1
+15664,3,104000080,1
+15665,3,102000050,1
+15666,3,104000170,1
+15667,3,104000260,1
+15668,3,111000010,1
+15669,3,111000020,1
+15670,3,111000030,1
+15671,3,112000020,1
+15672,3,112000030,1
+15673,3,108000060,1
+15674,3,108000070,1
+15675,3,108000080,1
+15676,3,107000050,1
+15677,3,112000010,1
+15678,3,110000070,1
+15679,3,110000080,1
+15680,3,118000020,1
+15681,3,118000030,1
+15682,3,118000040,1
+15683,4,101000090,1
+15684,4,101000100,1
+15685,4,101000110,1
+15686,4,109000100,1
+15687,4,105000100,1
+15688,4,105000110,1
+15689,4,108000090,1
+15690,4,110000090,1
+15691,4,102000100,1
+15692,4,102000110,1
+15693,4,106000090,1
+15694,4,109000090,1
+15695,4,107000100,1
+15696,4,103000090,1
+15697,4,102000090,1
+15698,4,103000100,1
+15699,4,106000100,1
+15700,4,106000110,1
+15701,4,104000090,1
+15702,4,104000100,1
+15703,4,104000110,1
+15704,4,107000090,1
+15705,4,104000180,1
+15706,4,111000040,1
+15707,4,112000040,1
+15708,4,108000100,1
+15709,4,105000090,1
+15710,4,110000100,1
+15711,4,118000050,1
+15712,4,118000060,1
+15713,5,101000120,1
+15714,5,109000110,1
+15715,5,105000120,1
+15716,5,102000120,1
+15717,5,107000110,1
+15718,5,103000120,1
+15719,5,106000120,1
+15720,5,104000120,1
+15721,5,104000190,1
+15722,5,111000060,1
+15723,5,112000060,1
+15724,5,108000110,1
+15725,5,110000110,1
+15726,5,118000070,1
+15727,1,201000010,8
+15728,1,292000010,8
+15729,1,299000040,8
+15730,1,299000070,8
+15731,1,299000110,8
+15732,1,299000120,8
+15733,1,299000140,8
+15734,2,202000010,8
+15735,2,290000010,8
+15736,2,299000010,8
+15737,2,299000150,8
+15738,2,299000190,8
+15739,2,299000200,8
+15740,2,299000210,8
+15741,3,298000050,8
+15742,3,298000060,8
+15743,3,299000060,8
+15744,3,299000170,8
+15745,3,290000120,8
+15746,3,291000050,8
+15747,3,292000020,8
+15748,4,299000670,8
+15749,4,299000680,8
+15750,4,204000010,8
+15751,4,209000040,8
+15752,4,202000070,8
+15753,4,209000070,8
+15754,4,203000110,8
+15755,4,290000110,8
+15756,4,206000110,8
+15757,4,209000160,8
+15758,5,297000100,8
+15759,5,291000020,8
+15760,5,297000130,8
+15761,5,297000140,8
+15762,5,203000010,8
+15763,5,206000030,8
+15764,5,203000050,8
+15765,5,202000090,8
+15766,5,204000080,8
+15767,5,202000150,8
+15768,5,204000100,8
+15769,5,206000170,8
+15770,2,170003,3
+15771,2,180003,3
+15772,3,170004,3
+15773,3,180004,3
+15774,4,140000,3
+15775,5,150010,3
+15776,5,150020,3
+15777,5,150030,3
+15778,5,150040,3
+15780,3,101000050,1
+15781,3,101000060,1
+15782,3,101000080,1
+15783,3,101000040,1
+15784,3,109000060,1
+15785,3,109000070,1
+15786,3,109000080,1
+15787,3,105000060,1
+15788,3,105000070,1
+15789,3,105000080,1
+15790,3,104000050,1
+15791,3,106000050,1
+15792,3,102000060,1
+15793,3,102000070,1
+15794,3,102000080,1
+15795,3,103000050,1
+15796,3,105000050,1
+15797,3,107000060,1
+15798,3,107000070,1
+15799,3,107000080,1
+15800,3,108000050,1
+15801,3,109000050,1
+15802,3,103000060,1
+15803,3,103000070,1
+15804,3,103000080,1
+15805,3,110000050,1
+15806,3,106000060,1
+15807,3,106000070,1
+15808,3,106000080,1
+15809,3,101000070,1
+15810,3,110000060,1
+15811,3,104000060,1
+15812,3,104000070,1
+15813,3,104000080,1
+15814,3,102000050,1
+15815,3,104000170,1
+15816,3,104000260,1
+15817,3,111000010,1
+15818,3,111000020,1
+15819,3,111000030,1
+15820,3,112000020,1
+15821,3,112000030,1
+15822,3,108000060,1
+15823,3,108000070,1
+15824,3,108000080,1
+15825,3,107000050,1
+15826,3,112000010,1
+15827,3,110000070,1
+15828,3,110000080,1
+15829,3,118000020,1
+15830,3,118000030,1
+15831,3,118000040,1
+15832,4,101000090,1
+15833,4,101000100,1
+15834,4,101000110,1
+15835,4,109000100,1
+15836,4,105000100,1
+15837,4,105000110,1
+15838,4,108000090,1
+15839,4,110000090,1
+15840,4,102000100,1
+15841,4,102000110,1
+15842,4,106000090,1
+15843,4,109000090,1
+15844,4,107000100,1
+15845,4,103000090,1
+15846,4,102000090,1
+15847,4,103000100,1
+15848,4,106000100,1
+15849,4,106000110,1
+15850,4,104000090,1
+15851,4,104000100,1
+15852,4,104000110,1
+15853,4,107000090,1
+15854,4,104000180,1
+15855,4,111000040,1
+15856,4,112000040,1
+15857,4,108000100,1
+15858,4,105000090,1
+15859,4,110000100,1
+15860,4,118000050,1
+15861,4,118000060,1
+15862,5,101000120,1
+15863,5,109000110,1
+15864,5,105000120,1
+15865,5,102000120,1
+15866,5,107000110,1
+15867,5,103000120,1
+15868,5,106000120,1
+15869,5,104000120,1
+15870,5,104000190,1
+15871,5,111000060,1
+15872,5,112000060,1
+15873,5,108000110,1
+15874,5,110000110,1
+15875,5,118000070,1
+15876,1,201000010,8
+15877,1,292000010,8
+15878,1,299000040,8
+15879,1,299000070,8
+15880,1,299000110,8
+15881,1,299000120,8
+15882,1,299000140,8
+15883,2,202000010,8
+15884,2,290000010,8
+15885,2,299000010,8
+15886,2,299000150,8
+15887,2,299000190,8
+15888,2,299000200,8
+15889,2,299000210,8
+15890,3,298000050,8
+15891,3,298000060,8
+15892,3,299000060,8
+15893,3,299000170,8
+15894,3,290000120,8
+15895,3,291000050,8
+15896,3,292000020,8
+15897,4,299000670,8
+15898,4,299000680,8
+15899,4,204000010,8
+15900,4,209000040,8
+15901,4,202000070,8
+15902,4,209000070,8
+15903,4,203000110,8
+15904,4,290000110,8
+15905,4,206000110,8
+15906,4,209000160,8
+15907,5,297000100,8
+15908,5,291000020,8
+15909,5,297000130,8
+15910,5,297000140,8
+15911,5,203000010,8
+15912,5,206000030,8
+15913,5,203000050,8
+15914,5,202000090,8
+15915,5,204000080,8
+15916,5,202000150,8
+15917,5,204000100,8
+15918,5,206000170,8
+15919,3,170004,3
+15920,3,180004,3
+15921,4,140000,3
+15922,5,150010,3
+15923,5,150020,3
+15924,5,150030,3
+15925,5,150040,3
+15927,3,101000050,1
+15928,3,101000060,1
+15929,3,101000080,1
+15930,3,101000040,1
+15931,3,109000060,1
+15932,3,109000070,1
+15933,3,109000080,1
+15934,3,105000060,1
+15935,3,105000070,1
+15936,3,105000080,1
+15937,3,104000050,1
+15938,3,106000050,1
+15939,3,102000060,1
+15940,3,102000070,1
+15941,3,102000080,1
+15942,3,103000050,1
+15943,3,105000050,1
+15944,3,107000060,1
+15945,3,107000070,1
+15946,3,107000080,1
+15947,3,108000050,1
+15948,3,109000050,1
+15949,3,103000060,1
+15950,3,103000070,1
+15951,3,103000080,1
+15952,3,110000050,1
+15953,3,106000060,1
+15954,3,106000070,1
+15955,3,106000080,1
+15956,3,101000070,1
+15957,3,110000060,1
+15958,3,104000060,1
+15959,3,104000070,1
+15960,3,104000080,1
+15961,3,102000050,1
+15962,3,104000170,1
+15963,3,104000260,1
+15964,3,111000010,1
+15965,3,111000020,1
+15966,3,111000030,1
+15967,3,112000020,1
+15968,3,112000030,1
+15969,3,108000060,1
+15970,3,108000070,1
+15971,3,108000080,1
+15972,3,107000050,1
+15973,3,112000010,1
+15974,3,110000070,1
+15975,3,110000080,1
+15976,3,118000020,1
+15977,3,118000030,1
+15978,3,118000040,1
+15979,4,101000090,1
+15980,4,101000100,1
+15981,4,101000110,1
+15982,4,109000100,1
+15983,4,105000100,1
+15984,4,105000110,1
+15985,4,108000090,1
+15986,4,110000090,1
+15987,4,102000100,1
+15988,4,102000110,1
+15989,4,106000090,1
+15990,4,109000090,1
+15991,4,107000100,1
+15992,4,103000090,1
+15993,4,102000090,1
+15994,4,103000100,1
+15995,4,106000100,1
+15996,4,106000110,1
+15997,4,104000090,1
+15998,4,104000100,1
+15999,4,104000110,1
+16000,4,107000090,1
+16001,4,104000180,1
+16002,4,111000040,1
+16003,4,112000040,1
+16004,4,108000100,1
+16005,4,105000090,1
+16006,4,110000100,1
+16007,4,118000050,1
+16008,4,118000060,1
+16009,5,101000120,1
+16010,5,109000110,1
+16011,5,105000120,1
+16012,5,102000120,1
+16013,5,107000110,1
+16014,5,103000120,1
+16015,5,106000120,1
+16016,5,104000120,1
+16017,5,104000190,1
+16018,5,111000060,1
+16019,5,112000060,1
+16020,5,108000110,1
+16021,5,110000110,1
+16022,5,118000070,1
+16023,1,201000010,8
+16024,1,292000010,8
+16025,1,299000040,8
+16026,1,299000070,8
+16027,1,299000110,8
+16028,1,299000120,8
+16029,1,299000140,8
+16030,2,202000010,8
+16031,2,290000010,8
+16032,2,299000010,8
+16033,2,299000150,8
+16034,2,299000190,8
+16035,2,299000200,8
+16036,2,299000210,8
+16037,3,298000050,8
+16038,3,298000060,8
+16039,3,299000060,8
+16040,3,299000170,8
+16041,3,290000120,8
+16042,3,291000050,8
+16043,3,292000020,8
+16044,4,299000670,8
+16045,4,299000680,8
+16046,4,204000010,8
+16047,4,209000040,8
+16048,4,202000070,8
+16049,4,209000070,8
+16050,4,203000110,8
+16051,4,290000110,8
+16052,4,206000110,8
+16053,4,209000160,8
+16054,5,297000100,8
+16055,5,291000020,8
+16056,5,297000130,8
+16057,5,297000140,8
+16058,5,203000010,8
+16059,5,206000030,8
+16060,5,203000050,8
+16061,5,202000090,8
+16062,5,204000080,8
+16063,5,202000150,8
+16064,5,204000100,8
+16065,5,206000170,8
+16066,3,170004,3
+16067,3,180004,3
+16068,4,140000,3
+16069,5,150010,3
+16070,5,150020,3
+16071,5,150030,3
+16072,5,150040,3
+16074,3,101000050,1
+16075,3,101000060,1
+16076,3,101000080,1
+16077,3,101000040,1
+16078,3,109000060,1
+16079,3,109000070,1
+16080,3,109000080,1
+16081,3,105000060,1
+16082,3,105000070,1
+16083,3,105000080,1
+16084,3,104000050,1
+16085,3,106000050,1
+16086,3,102000060,1
+16087,3,102000070,1
+16088,3,102000080,1
+16089,3,103000050,1
+16090,3,105000050,1
+16091,3,107000060,1
+16092,3,107000070,1
+16093,3,107000080,1
+16094,3,108000050,1
+16095,3,109000050,1
+16096,3,103000060,1
+16097,3,103000070,1
+16098,3,103000080,1
+16099,3,110000050,1
+16100,3,106000060,1
+16101,3,106000070,1
+16102,3,106000080,1
+16103,3,101000070,1
+16104,3,110000060,1
+16105,3,104000060,1
+16106,3,104000070,1
+16107,3,104000080,1
+16108,3,102000050,1
+16109,3,104000170,1
+16110,3,104000260,1
+16111,3,111000010,1
+16112,3,111000020,1
+16113,3,111000030,1
+16114,3,112000020,1
+16115,3,112000030,1
+16116,3,108000060,1
+16117,3,108000070,1
+16118,3,108000080,1
+16119,3,107000050,1
+16120,3,112000010,1
+16121,3,110000070,1
+16122,3,110000080,1
+16123,3,118000020,1
+16124,3,118000030,1
+16125,3,118000040,1
+16126,4,101000090,1
+16127,4,101000100,1
+16128,4,101000110,1
+16129,4,109000100,1
+16130,4,105000100,1
+16131,4,105000110,1
+16132,4,108000090,1
+16133,4,110000090,1
+16134,4,102000100,1
+16135,4,102000110,1
+16136,4,106000090,1
+16137,4,109000090,1
+16138,4,107000100,1
+16139,4,103000090,1
+16140,4,102000090,1
+16141,4,103000100,1
+16142,4,106000100,1
+16143,4,106000110,1
+16144,4,104000090,1
+16145,4,104000100,1
+16146,4,104000110,1
+16147,4,107000090,1
+16148,4,104000180,1
+16149,4,111000040,1
+16150,4,112000040,1
+16151,4,108000100,1
+16152,4,105000090,1
+16153,4,110000100,1
+16154,4,118000050,1
+16155,4,118000060,1
+16156,5,101000120,1
+16157,5,109000110,1
+16158,5,105000120,1
+16159,5,102000120,1
+16160,5,107000110,1
+16161,5,103000120,1
+16162,5,106000120,1
+16163,5,104000120,1
+16164,5,104000190,1
+16165,5,111000060,1
+16166,5,112000060,1
+16167,5,108000110,1
+16168,5,110000110,1
+16169,5,118000070,1
+16170,1,201000010,8
+16171,1,292000010,8
+16172,1,299000040,8
+16173,1,299000070,8
+16174,1,299000110,8
+16175,1,299000120,8
+16176,1,299000140,8
+16177,2,202000010,8
+16178,2,290000010,8
+16179,2,299000010,8
+16180,2,299000150,8
+16181,2,299000190,8
+16182,2,299000200,8
+16183,2,299000210,8
+16184,3,298000050,8
+16185,3,298000060,8
+16186,3,299000060,8
+16187,3,299000170,8
+16188,3,290000120,8
+16189,3,291000050,8
+16190,3,292000020,8
+16191,4,299000670,8
+16192,4,299000680,8
+16193,4,204000010,8
+16194,4,209000040,8
+16195,4,202000070,8
+16196,4,209000070,8
+16197,4,203000110,8
+16198,4,290000110,8
+16199,4,206000110,8
+16200,4,209000160,8
+16201,5,297000100,8
+16202,5,291000020,8
+16203,5,297000130,8
+16204,5,297000140,8
+16205,5,203000010,8
+16206,5,206000030,8
+16207,5,203000050,8
+16208,5,202000090,8
+16209,5,204000080,8
+16210,5,202000150,8
+16211,5,204000100,8
+16212,5,206000170,8
+16213,3,170004,3
+16214,3,180004,3
+16215,4,140000,3
+16216,5,150010,3
+16217,5,150020,3
+16218,5,150030,3
+16219,5,150040,3
+16220,5,190000,3
+16221,5,200000,3
+16222,5,210000,3
+16224,1,101000010,1
+16225,1,102000010,1
+16226,1,103000010,1
+16227,1,104000010,1
+16228,1,105000010,1
+16229,1,106000010,1
+16230,1,107000010,1
+16231,1,108000010,1
+16232,1,109000010,1
+16233,1,110000010,1
+16234,2,101000020,1
+16235,2,101000030,1
+16236,2,102000020,1
+16237,2,102000030,1
+16238,2,102000040,1
+16239,2,103000020,1
+16240,2,103000030,1
+16241,2,103000040,1
+16242,2,104000020,1
+16243,2,104000030,1
+16244,2,104000040,1
+16245,2,105000020,1
+16246,2,105000030,1
+16247,2,105000040,1
+16248,2,106000020,1
+16249,2,106000030,1
+16250,2,106000040,1
+16251,2,107000020,1
+16252,2,107000030,1
+16253,2,107000040,1
+16254,2,108000020,1
+16255,2,108000030,1
+16256,2,108000040,1
+16257,2,109000020,1
+16258,2,109000030,1
+16259,2,109000040,1
+16260,2,110000020,1
+16261,2,110000030,1
+16262,2,110000040,1
+16263,2,118000010,1
+16264,3,101000050,1
+16265,3,101000060,1
+16266,3,101000080,1
+16267,3,101000040,1
+16268,3,109000060,1
+16269,3,109000070,1
+16270,3,109000080,1
+16271,3,105000060,1
+16272,3,105000070,1
+16273,3,105000080,1
+16274,3,104000050,1
+16275,3,106000050,1
+16276,3,102000060,1
+16277,3,102000070,1
+16278,3,102000080,1
+16279,3,103000050,1
+16280,3,105000050,1
+16281,3,107000060,1
+16282,3,107000070,1
+16283,3,107000080,1
+16284,3,108000050,1
+16285,3,109000050,1
+16286,3,103000060,1
+16287,3,103000070,1
+16288,3,103000080,1
+16289,3,110000050,1
+16290,3,106000060,1
+16291,3,106000070,1
+16292,3,106000080,1
+16293,3,101000070,1
+16294,3,110000060,1
+16295,3,104000060,1
+16296,3,104000070,1
+16297,3,104000080,1
+16298,3,102000050,1
+16299,3,104000170,1
+16300,3,104000260,1
+16301,3,111000010,1
+16302,3,111000020,1
+16303,3,111000030,1
+16304,3,112000020,1
+16305,3,112000030,1
+16306,3,108000060,1
+16307,3,108000070,1
+16308,3,108000080,1
+16309,3,107000050,1
+16310,3,112000010,1
+16311,3,110000070,1
+16312,3,110000080,1
+16313,3,118000020,1
+16314,3,118000030,1
+16315,3,118000040,1
+16316,4,101000090,1
+16317,4,101000100,1
+16318,4,101000110,1
+16319,4,109000100,1
+16320,4,105000100,1
+16321,4,105000110,1
+16322,4,108000090,1
+16323,4,110000090,1
+16324,4,102000100,1
+16325,4,102000110,1
+16326,4,106000090,1
+16327,4,109000090,1
+16328,4,107000100,1
+16329,4,103000090,1
+16330,4,102000090,1
+16331,4,103000100,1
+16332,4,106000100,1
+16333,4,106000110,1
+16334,4,104000090,1
+16335,4,104000100,1
+16336,4,104000110,1
+16337,4,107000090,1
+16338,4,104000180,1
+16339,4,111000040,1
+16340,4,112000040,1
+16341,4,108000100,1
+16342,4,105000090,1
+16343,4,110000100,1
+16344,4,118000050,1
+16345,4,118000060,1
+16346,5,101000120,1
+16347,5,109000110,1
+16348,5,105000120,1
+16349,5,102000120,1
+16350,5,107000110,1
+16351,5,103000120,1
+16352,5,106000120,1
+16353,5,104000120,1
+16354,5,104000190,1
+16355,5,111000060,1
+16356,5,112000060,1
+16357,5,108000110,1
+16358,5,110000110,1
+16359,5,118000070,1
+16360,1,201000010,8
+16361,1,292000010,8
+16362,1,299000040,8
+16363,1,299000070,8
+16364,1,299000110,8
+16365,1,299000120,8
+16366,1,299000140,8
+16367,2,202000010,8
+16368,2,290000010,8
+16369,2,299000010,8
+16370,2,299000150,8
+16371,2,299000190,8
+16372,2,299000200,8
+16373,2,299000210,8
+16374,3,298000050,8
+16375,3,298000060,8
+16376,3,299000060,8
+16377,3,299000170,8
+16378,3,290000120,8
+16379,3,291000050,8
+16380,3,292000020,8
+16381,4,299000670,8
+16382,4,299000680,8
+16383,4,204000010,8
+16384,4,209000040,8
+16385,4,202000070,8
+16386,4,209000070,8
+16387,4,203000110,8
+16388,4,290000110,8
+16389,4,206000110,8
+16390,4,209000160,8
+16391,4,209000190,8
+16392,5,297000100,8
+16393,5,291000020,8
+16394,5,297000130,8
+16395,5,297000140,8
+16396,5,203000010,8
+16397,5,206000030,8
+16398,5,203000050,8
+16399,5,202000090,8
+16400,5,204000080,8
+16401,5,202000150,8
+16402,5,204000100,8
+16403,5,206000170,8
+16404,5,204000200,8
+16405,1,170002,3
+16406,1,180002,3
+16407,2,170003,3
+16408,2,180003,3
+16409,3,170004,3
+16410,3,180004,3
+16411,4,140000,3
+16412,5,150010,3
+16413,5,150020,3
+16414,5,150030,3
+16415,5,150040,3
+16417,1,101000010,1
+16418,1,102000010,1
+16419,1,103000010,1
+16420,1,104000010,1
+16421,1,105000010,1
+16422,1,106000010,1
+16423,1,107000010,1
+16424,1,108000010,1
+16425,1,109000010,1
+16426,1,110000010,1
+16427,2,101000020,1
+16428,2,101000030,1
+16429,2,102000020,1
+16430,2,102000030,1
+16431,2,102000040,1
+16432,2,103000020,1
+16433,2,103000030,1
+16434,2,103000040,1
+16435,2,104000020,1
+16436,2,104000030,1
+16437,2,104000040,1
+16438,2,105000020,1
+16439,2,105000030,1
+16440,2,105000040,1
+16441,2,106000020,1
+16442,2,106000030,1
+16443,2,106000040,1
+16444,2,107000020,1
+16445,2,107000030,1
+16446,2,107000040,1
+16447,2,108000020,1
+16448,2,108000030,1
+16449,2,108000040,1
+16450,2,109000020,1
+16451,2,109000030,1
+16452,2,109000040,1
+16453,2,110000020,1
+16454,2,110000030,1
+16455,2,110000040,1
+16456,2,118000010,1
+16457,3,101000050,1
+16458,3,101000060,1
+16459,3,101000080,1
+16460,3,101000040,1
+16461,3,109000060,1
+16462,3,109000070,1
+16463,3,109000080,1
+16464,3,105000060,1
+16465,3,105000070,1
+16466,3,105000080,1
+16467,3,104000050,1
+16468,3,106000050,1
+16469,3,102000060,1
+16470,3,102000070,1
+16471,3,102000080,1
+16472,3,103000050,1
+16473,3,105000050,1
+16474,3,107000060,1
+16475,3,107000070,1
+16476,3,107000080,1
+16477,3,108000050,1
+16478,3,109000050,1
+16479,3,103000060,1
+16480,3,103000070,1
+16481,3,103000080,1
+16482,3,110000050,1
+16483,3,106000060,1
+16484,3,106000070,1
+16485,3,106000080,1
+16486,3,101000070,1
+16487,3,110000060,1
+16488,3,104000060,1
+16489,3,104000070,1
+16490,3,104000080,1
+16491,3,102000050,1
+16492,3,104000170,1
+16493,3,104000260,1
+16494,3,111000010,1
+16495,3,111000020,1
+16496,3,111000030,1
+16497,3,112000020,1
+16498,3,112000030,1
+16499,3,108000060,1
+16500,3,108000070,1
+16501,3,108000080,1
+16502,3,107000050,1
+16503,3,112000010,1
+16504,3,110000070,1
+16505,3,110000080,1
+16506,3,118000020,1
+16507,3,118000030,1
+16508,3,118000040,1
+16509,4,101000090,1
+16510,4,101000100,1
+16511,4,101000110,1
+16512,4,109000100,1
+16513,4,105000100,1
+16514,4,105000110,1
+16515,4,108000090,1
+16516,4,110000090,1
+16517,4,102000100,1
+16518,4,102000110,1
+16519,4,106000090,1
+16520,4,109000090,1
+16521,4,107000100,1
+16522,4,103000090,1
+16523,4,102000090,1
+16524,4,103000100,1
+16525,4,106000100,1
+16526,4,106000110,1
+16527,4,104000090,1
+16528,4,104000100,1
+16529,4,104000110,1
+16530,4,107000090,1
+16531,4,104000180,1
+16532,4,111000040,1
+16533,4,112000040,1
+16534,4,108000100,1
+16535,4,105000090,1
+16536,4,110000100,1
+16537,4,118000050,1
+16538,4,118000060,1
+16539,5,101000120,1
+16540,5,109000110,1
+16541,5,105000120,1
+16542,5,102000120,1
+16543,5,107000110,1
+16544,5,103000120,1
+16545,5,106000120,1
+16546,5,104000120,1
+16547,5,104000190,1
+16548,5,111000060,1
+16549,5,112000060,1
+16550,5,108000110,1
+16551,5,110000110,1
+16552,5,118000070,1
+16553,1,201000010,8
+16554,1,292000010,8
+16555,1,299000040,8
+16556,1,299000070,8
+16557,1,299000110,8
+16558,1,299000120,8
+16559,1,299000140,8
+16560,2,202000010,8
+16561,2,290000010,8
+16562,2,299000010,8
+16563,2,299000150,8
+16564,2,299000190,8
+16565,2,299000200,8
+16566,2,299000210,8
+16567,3,298000050,8
+16568,3,298000060,8
+16569,3,299000060,8
+16570,3,299000170,8
+16571,3,290000120,8
+16572,3,291000050,8
+16573,3,292000020,8
+16574,4,299000670,8
+16575,4,299000680,8
+16576,4,204000010,8
+16577,4,209000040,8
+16578,4,202000070,8
+16579,4,209000070,8
+16580,4,203000110,8
+16581,4,290000110,8
+16582,4,206000110,8
+16583,4,209000160,8
+16584,4,209000190,8
+16585,5,297000100,8
+16586,5,291000020,8
+16587,5,297000130,8
+16588,5,297000140,8
+16589,5,203000010,8
+16590,5,206000030,8
+16591,5,203000050,8
+16592,5,202000090,8
+16593,5,204000080,8
+16594,5,202000150,8
+16595,5,204000100,8
+16596,5,206000170,8
+16597,5,204000200,8
+16598,2,170003,3
+16599,2,180003,3
+16600,3,170004,3
+16601,3,180004,3
+16602,4,140000,3
+16603,5,150010,3
+16604,5,150020,3
+16605,5,150030,3
+16606,5,150040,3
+16608,3,101000050,1
+16609,3,101000060,1
+16610,3,101000080,1
+16611,3,101000040,1
+16612,3,109000060,1
+16613,3,109000070,1
+16614,3,109000080,1
+16615,3,105000060,1
+16616,3,105000070,1
+16617,3,105000080,1
+16618,3,104000050,1
+16619,3,106000050,1
+16620,3,102000060,1
+16621,3,102000070,1
+16622,3,102000080,1
+16623,3,103000050,1
+16624,3,105000050,1
+16625,3,107000060,1
+16626,3,107000070,1
+16627,3,107000080,1
+16628,3,108000050,1
+16629,3,109000050,1
+16630,3,103000060,1
+16631,3,103000070,1
+16632,3,103000080,1
+16633,3,110000050,1
+16634,3,106000060,1
+16635,3,106000070,1
+16636,3,106000080,1
+16637,3,101000070,1
+16638,3,110000060,1
+16639,3,104000060,1
+16640,3,104000070,1
+16641,3,104000080,1
+16642,3,102000050,1
+16643,3,104000170,1
+16644,3,104000260,1
+16645,3,111000010,1
+16646,3,111000020,1
+16647,3,111000030,1
+16648,3,112000020,1
+16649,3,112000030,1
+16650,3,108000060,1
+16651,3,108000070,1
+16652,3,108000080,1
+16653,3,107000050,1
+16654,3,112000010,1
+16655,3,110000070,1
+16656,3,110000080,1
+16657,3,118000020,1
+16658,3,118000030,1
+16659,3,118000040,1
+16660,4,101000090,1
+16661,4,101000100,1
+16662,4,101000110,1
+16663,4,109000100,1
+16664,4,105000100,1
+16665,4,105000110,1
+16666,4,108000090,1
+16667,4,110000090,1
+16668,4,102000100,1
+16669,4,102000110,1
+16670,4,106000090,1
+16671,4,109000090,1
+16672,4,107000100,1
+16673,4,103000090,1
+16674,4,102000090,1
+16675,4,103000100,1
+16676,4,106000100,1
+16677,4,106000110,1
+16678,4,104000090,1
+16679,4,104000100,1
+16680,4,104000110,1
+16681,4,107000090,1
+16682,4,104000180,1
+16683,4,111000040,1
+16684,4,112000040,1
+16685,4,108000100,1
+16686,4,105000090,1
+16687,4,110000100,1
+16688,4,118000050,1
+16689,4,118000060,1
+16690,5,101000120,1
+16691,5,109000110,1
+16692,5,105000120,1
+16693,5,102000120,1
+16694,5,107000110,1
+16695,5,103000120,1
+16696,5,106000120,1
+16697,5,104000120,1
+16698,5,104000190,1
+16699,5,111000060,1
+16700,5,112000060,1
+16701,5,108000110,1
+16702,5,110000110,1
+16703,5,118000070,1
+16704,1,201000010,8
+16705,1,292000010,8
+16706,1,299000040,8
+16707,1,299000070,8
+16708,1,299000110,8
+16709,1,299000120,8
+16710,1,299000140,8
+16711,2,202000010,8
+16712,2,290000010,8
+16713,2,299000010,8
+16714,2,299000150,8
+16715,2,299000190,8
+16716,2,299000200,8
+16717,2,299000210,8
+16718,3,298000050,8
+16719,3,298000060,8
+16720,3,299000060,8
+16721,3,299000170,8
+16722,3,290000120,8
+16723,3,291000050,8
+16724,3,292000020,8
+16725,4,299000670,8
+16726,4,299000680,8
+16727,4,204000010,8
+16728,4,209000040,8
+16729,4,202000070,8
+16730,4,209000070,8
+16731,4,203000110,8
+16732,4,290000110,8
+16733,4,206000110,8
+16734,4,209000160,8
+16735,4,209000190,8
+16736,5,297000100,8
+16737,5,291000020,8
+16738,5,297000130,8
+16739,5,297000140,8
+16740,5,203000010,8
+16741,5,206000030,8
+16742,5,203000050,8
+16743,5,202000090,8
+16744,5,204000080,8
+16745,5,202000150,8
+16746,5,204000100,8
+16747,5,206000170,8
+16748,5,204000200,8
+16749,3,170004,3
+16750,3,180004,3
+16751,4,140000,3
+16752,5,150010,3
+16753,5,150020,3
+16754,5,150030,3
+16755,5,150040,3
+16757,3,101000050,1
+16758,3,101000060,1
+16759,3,101000080,1
+16760,3,101000040,1
+16761,3,109000060,1
+16762,3,109000070,1
+16763,3,109000080,1
+16764,3,105000060,1
+16765,3,105000070,1
+16766,3,105000080,1
+16767,3,104000050,1
+16768,3,106000050,1
+16769,3,102000060,1
+16770,3,102000070,1
+16771,3,102000080,1
+16772,3,103000050,1
+16773,3,105000050,1
+16774,3,107000060,1
+16775,3,107000070,1
+16776,3,107000080,1
+16777,3,108000050,1
+16778,3,109000050,1
+16779,3,103000060,1
+16780,3,103000070,1
+16781,3,103000080,1
+16782,3,110000050,1
+16783,3,106000060,1
+16784,3,106000070,1
+16785,3,106000080,1
+16786,3,101000070,1
+16787,3,110000060,1
+16788,3,104000060,1
+16789,3,104000070,1
+16790,3,104000080,1
+16791,3,102000050,1
+16792,3,104000170,1
+16793,3,104000260,1
+16794,3,111000010,1
+16795,3,111000020,1
+16796,3,111000030,1
+16797,3,112000020,1
+16798,3,112000030,1
+16799,3,108000060,1
+16800,3,108000070,1
+16801,3,108000080,1
+16802,3,107000050,1
+16803,3,112000010,1
+16804,3,110000070,1
+16805,3,110000080,1
+16806,3,118000020,1
+16807,3,118000030,1
+16808,3,118000040,1
+16809,4,101000090,1
+16810,4,101000100,1
+16811,4,101000110,1
+16812,4,109000100,1
+16813,4,105000100,1
+16814,4,105000110,1
+16815,4,108000090,1
+16816,4,110000090,1
+16817,4,102000100,1
+16818,4,102000110,1
+16819,4,106000090,1
+16820,4,109000090,1
+16821,4,107000100,1
+16822,4,103000090,1
+16823,4,102000090,1
+16824,4,103000100,1
+16825,4,106000100,1
+16826,4,106000110,1
+16827,4,104000090,1
+16828,4,104000100,1
+16829,4,104000110,1
+16830,4,107000090,1
+16831,4,104000180,1
+16832,4,111000040,1
+16833,4,112000040,1
+16834,4,108000100,1
+16835,4,105000090,1
+16836,4,110000100,1
+16837,4,118000050,1
+16838,4,118000060,1
+16839,5,101000120,1
+16840,5,109000110,1
+16841,5,105000120,1
+16842,5,102000120,1
+16843,5,107000110,1
+16844,5,103000120,1
+16845,5,106000120,1
+16846,5,104000120,1
+16847,5,104000190,1
+16848,5,111000060,1
+16849,5,112000060,1
+16850,5,108000110,1
+16851,5,110000110,1
+16852,5,118000070,1
+16853,1,201000010,8
+16854,1,292000010,8
+16855,1,299000040,8
+16856,1,299000070,8
+16857,1,299000110,8
+16858,1,299000120,8
+16859,1,299000140,8
+16860,2,202000010,8
+16861,2,290000010,8
+16862,2,299000010,8
+16863,2,299000150,8
+16864,2,299000190,8
+16865,2,299000200,8
+16866,2,299000210,8
+16867,3,298000050,8
+16868,3,298000060,8
+16869,3,299000060,8
+16870,3,299000170,8
+16871,3,290000120,8
+16872,3,291000050,8
+16873,3,292000020,8
+16874,4,299000670,8
+16875,4,299000680,8
+16876,4,204000010,8
+16877,4,209000040,8
+16878,4,202000070,8
+16879,4,209000070,8
+16880,4,203000110,8
+16881,4,290000110,8
+16882,4,206000110,8
+16883,4,209000160,8
+16884,4,209000190,8
+16885,5,297000100,8
+16886,5,291000020,8
+16887,5,297000130,8
+16888,5,297000140,8
+16889,5,203000010,8
+16890,5,206000030,8
+16891,5,203000050,8
+16892,5,202000090,8
+16893,5,204000080,8
+16894,5,202000150,8
+16895,5,204000100,8
+16896,5,206000170,8
+16897,5,204000200,8
+16898,3,170004,3
+16899,3,180004,3
+16900,4,140000,3
+16901,5,150010,3
+16902,5,150020,3
+16903,5,150030,3
+16904,5,150040,3
+16906,3,101000050,1
+16907,3,101000060,1
+16908,3,101000080,1
+16909,3,101000040,1
+16910,3,109000060,1
+16911,3,109000070,1
+16912,3,109000080,1
+16913,3,105000060,1
+16914,3,105000070,1
+16915,3,105000080,1
+16916,3,104000050,1
+16917,3,106000050,1
+16918,3,102000060,1
+16919,3,102000070,1
+16920,3,102000080,1
+16921,3,103000050,1
+16922,3,105000050,1
+16923,3,107000060,1
+16924,3,107000070,1
+16925,3,107000080,1
+16926,3,108000050,1
+16927,3,109000050,1
+16928,3,103000060,1
+16929,3,103000070,1
+16930,3,103000080,1
+16931,3,110000050,1
+16932,3,106000060,1
+16933,3,106000070,1
+16934,3,106000080,1
+16935,3,101000070,1
+16936,3,110000060,1
+16937,3,104000060,1
+16938,3,104000070,1
+16939,3,104000080,1
+16940,3,102000050,1
+16941,3,104000170,1
+16942,3,104000260,1
+16943,3,111000010,1
+16944,3,111000020,1
+16945,3,111000030,1
+16946,3,112000020,1
+16947,3,112000030,1
+16948,3,108000060,1
+16949,3,108000070,1
+16950,3,108000080,1
+16951,3,107000050,1
+16952,3,112000010,1
+16953,3,110000070,1
+16954,3,110000080,1
+16955,3,118000020,1
+16956,3,118000030,1
+16957,3,118000040,1
+16958,4,101000090,1
+16959,4,101000100,1
+16960,4,101000110,1
+16961,4,109000100,1
+16962,4,105000100,1
+16963,4,105000110,1
+16964,4,108000090,1
+16965,4,110000090,1
+16966,4,102000100,1
+16967,4,102000110,1
+16968,4,106000090,1
+16969,4,109000090,1
+16970,4,107000100,1
+16971,4,103000090,1
+16972,4,102000090,1
+16973,4,103000100,1
+16974,4,106000100,1
+16975,4,106000110,1
+16976,4,104000090,1
+16977,4,104000100,1
+16978,4,104000110,1
+16979,4,107000090,1
+16980,4,104000180,1
+16981,4,111000040,1
+16982,4,112000040,1
+16983,4,108000100,1
+16984,4,105000090,1
+16985,4,110000100,1
+16986,4,118000050,1
+16987,4,118000060,1
+16988,5,101000120,1
+16989,5,109000110,1
+16990,5,105000120,1
+16991,5,102000120,1
+16992,5,107000110,1
+16993,5,103000120,1
+16994,5,106000120,1
+16995,5,104000120,1
+16996,5,104000190,1
+16997,5,111000060,1
+16998,5,112000060,1
+16999,5,108000110,1
+17000,5,110000110,1
+17001,5,118000070,1
+17002,1,201000010,8
+17003,1,292000010,8
+17004,1,299000040,8
+17005,1,299000070,8
+17006,1,299000110,8
+17007,1,299000120,8
+17008,1,299000140,8
+17009,2,202000010,8
+17010,2,290000010,8
+17011,2,299000010,8
+17012,2,299000150,8
+17013,2,299000190,8
+17014,2,299000200,8
+17015,2,299000210,8
+17016,3,298000050,8
+17017,3,298000060,8
+17018,3,299000060,8
+17019,3,299000170,8
+17020,3,290000120,8
+17021,3,291000050,8
+17022,3,292000020,8
+17023,4,299000670,8
+17024,4,299000680,8
+17025,4,204000010,8
+17026,4,209000040,8
+17027,4,202000070,8
+17028,4,209000070,8
+17029,4,203000110,8
+17030,4,290000110,8
+17031,4,206000110,8
+17032,4,209000160,8
+17033,4,209000190,8
+17034,5,297000100,8
+17035,5,291000020,8
+17036,5,297000130,8
+17037,5,297000140,8
+17038,5,203000010,8
+17039,5,206000030,8
+17040,5,203000050,8
+17041,5,202000090,8
+17042,5,204000080,8
+17043,5,202000150,8
+17044,5,204000100,8
+17045,5,206000170,8
+17046,5,204000200,8
+17047,3,170004,3
+17048,3,180004,3
+17049,4,140000,3
+17050,5,150010,3
+17051,5,150020,3
+17052,5,150030,3
+17053,5,150040,3
+17054,5,190000,3
+17055,5,200000,3
+17057,3,118000020,1
+17058,3,118000030,1
+17059,3,118000040,1
+17060,3,106000060,1
+17061,3,106000070,1
+17062,3,106000080,1
+17063,3,101000070,1
+17064,3,110000060,1
+17065,3,104000060,1
+17066,3,104000070,1
+17067,3,104000080,1
+17068,3,102000050,1
+17069,3,104000170,1
+17070,3,104000260,1
+17071,4,118000050,1
+17072,4,118000060,1
+17073,4,106000100,1
+17074,4,106000110,1
+17075,4,104000090,1
+17076,4,104000100,1
+17077,4,104000110,1
+17078,4,104000270,1
+17079,4,107000090,1
+17080,4,104000180,1
+17081,5,118000070,1
+17082,5,106000120,1
+17083,5,104000120,1
+17084,5,104000190,1
+17085,1,103000000,2
+17086,2,103000001,2
+17087,3,103000002,2
+17088,4,103000003,2
+17089,5,103000004,2
+17090,1,111000000,2
+17091,2,111000001,2
+17092,3,111000002,2
+17093,4,111000003,2
+17094,5,111000004,2
+17095,1,115000000,2
+17096,2,115000001,2
+17097,3,115000002,2
+17098,4,115000003,2
+17099,5,115000004,2
+17100,3,170004,3
+17101,4,170005,3
+17102,3,180004,3
+17103,4,180005,3
+17104,4,140000,3
+17105,4,150010,3
+17106,4,150020,3
+17107,4,150030,3
+17108,4,150040,3
+17110,3,111000010,1
+17111,3,111000020,1
+17112,3,111000030,1
+17113,3,112000020,1
+17114,3,112000030,1
+17115,3,108000060,1
+17116,3,108000070,1
+17117,3,108000080,1
+17118,3,107000050,1
+17119,3,112000010,1
+17120,3,110000070,1
+17121,3,110000080,1
+17122,4,111000040,1
+17123,4,112000040,1
+17124,4,108000100,1
+17125,4,105000090,1
+17126,4,110000100,1
+17127,5,111000060,1
+17128,5,112000060,1
+17129,5,108000110,1
+17130,5,110000110,1
+17131,1,108000000,2
+17132,2,108000001,2
+17133,3,108000002,2
+17134,4,108000003,2
+17135,5,108000004,2
+17136,1,107000000,2
+17137,2,107000001,2
+17138,3,107000002,2
+17139,4,107000003,2
+17140,5,107000004,2
+17141,1,120000000,2
+17142,2,120000001,2
+17143,3,120000002,2
+17144,4,120000003,2
+17145,5,120000004,2
+17146,4,110024,3
+17147,4,110034,3
+17148,4,110044,3
+17149,4,110054,3
+17150,3,110060,3
+17151,3,110070,3
+17152,3,110080,3
+17153,3,110090,3
+17154,3,110100,3
+17155,3,110110,3
+17156,3,110120,3
+17157,3,110130,3
+17158,3,110140,3
+17159,3,110150,3
+17160,3,110160,3
+17161,3,110170,3
+17162,3,110180,3
+17163,3,110190,3
+17164,3,110200,3
+17165,3,110210,3
+17166,3,110220,3
+17167,3,110230,3
+17168,3,110240,3
+17169,3,110250,3
+17170,3,110260,3
+17171,3,110270,3
+17172,3,110620,3
+17173,3,110670,3
+17174,4,140000,3
+17175,4,150010,3
+17176,4,150020,3
+17177,4,150030,3
+17178,4,150040,3
+17180,3,101000050,1
+17181,3,101000060,1
+17182,3,101000080,1
+17183,3,101000040,1
+17184,3,109000060,1
+17185,3,109000070,1
+17186,3,109000080,1
+17187,3,105000060,1
+17188,3,105000070,1
+17189,3,105000080,1
+17190,3,104000050,1
+17191,3,106000050,1
+17192,4,101000090,1
+17193,4,101000100,1
+17194,4,101000110,1
+17195,4,109000100,1
+17196,4,105000100,1
+17197,4,105000110,1
+17198,4,108000090,1
+17199,4,110000090,1
+17200,5,101000120,1
+17201,5,109000110,1
+17202,5,105000120,1
+17203,1,101000000,2
+17204,2,101000001,2
+17205,3,101000002,2
+17206,4,101000008,2
+17207,5,101000004,2
+17208,1,109000000,2
+17209,2,109000001,2
+17210,3,109000002,2
+17211,4,109000003,2
+17212,5,109000004,2
+17213,4,120024,3
+17214,4,120034,3
+17215,4,120044,3
+17216,4,120054,3
+17217,3,120241,3
+17218,3,120251,3
+17219,3,120261,3
+17220,3,120271,3
+17221,3,120300,3
+17222,3,120310,3
+17223,3,120320,3
+17224,3,120330,3
+17225,3,120340,3
+17226,3,120350,3
+17227,3,120360,3
+17228,3,120370,3
+17229,3,120380,3
+17230,3,120390,3
+17231,3,120400,3
+17232,3,120410,3
+17233,3,120420,3
+17234,3,120430,3
+17235,3,120450,3
+17236,3,120460,3
+17237,3,120550,3
+17238,3,120560,3
+17239,3,120570,3
+17240,3,120990,3
+17241,3,121000,3
+17242,3,121010,3
+17243,3,121020,3
+17244,3,121100,3
+17245,4,140000,3
+17246,4,150010,3
+17247,4,150020,3
+17248,4,150030,3
+17249,4,150040,3
+17251,3,102000060,1
+17252,3,102000070,1
+17253,3,102000080,1
+17254,3,103000050,1
+17255,3,105000050,1
+17256,3,107000060,1
+17257,3,107000070,1
+17258,3,107000080,1
+17259,3,108000050,1
+17260,3,109000050,1
+17261,3,103000060,1
+17262,3,103000070,1
+17263,3,103000080,1
+17264,3,110000050,1
+17265,4,102000100,1
+17266,4,102000110,1
+17267,4,102000350,1
+17268,4,106000090,1
+17269,4,109000090,1
+17270,4,107000100,1
+17271,4,103000090,1
+17272,4,102000090,1
+17273,4,103000100,1
+17274,5,102000120,1
+17275,5,107000110,1
+17276,5,103000120,1
+17277,1,102000000,2
+17278,2,102000001,2
+17279,3,102000002,2
+17280,4,102000003,2
+17281,5,102000004,2
+17282,1,105000000,2
+17283,2,105000001,2
+17284,3,105000002,2
+17285,4,105000003,2
+17286,5,105000004,2
+17287,1,112000000,2
+17288,2,112000001,2
+17289,3,112000002,2
+17290,4,112000003,2
+17291,5,112000004,2
+17292,4,130024,3
+17293,4,130034,3
+17294,4,130044,3
+17295,4,130054,3
+17296,3,130060,3
+17297,3,130070,3
+17298,3,130080,3
+17299,3,130090,3
+17300,3,130100,3
+17301,3,130110,3
+17302,3,130120,3
+17303,3,130130,3
+17304,3,130140,3
+17305,3,130150,3
+17306,3,130160,3
+17307,3,130170,3
+17308,3,130180,3
+17309,3,130190,3
+17310,3,130200,3
+17311,3,130420,3
+17312,3,130510,3
+17313,3,130520,3
+17314,3,130531,3
+17315,3,130540,3
+17316,3,130660,3
+17317,3,130700,3
+17318,3,130790,3
+17319,3,130800,3
+17320,3,131130,3
+17321,4,140000,3
+17322,4,150010,3
+17323,4,150020,3
+17324,4,150030,3
+17325,4,150040,3
+17327,4,101000250,1
+17328,4,102000260,1
+17329,4,103000220,1
+17330,4,104000250,1
+17331,4,105000210,1
+17332,4,106000210,1
+17333,4,107000140,1
+17334,4,108000150,1
+17335,4,109000230,1
+17336,4,110000170,1
+17337,4,111000140,1
+17338,4,112000110,1
+17339,4,118000140,1
+17340,5,101000300,1
+17341,5,102000360,1
+17342,5,103000310,1
+17343,5,104000370,1
+17344,5,109000290,1
+17345,5,101000310,1
+17346,5,102000410,1
+17347,1,201000010,8
+17348,1,292000010,8
+17349,1,299000040,8
+17350,1,299000070,8
+17351,1,299000110,8
+17352,1,299000120,8
+17353,1,299000140,8
+17354,2,202000010,8
+17355,2,290000010,8
+17356,2,299000010,8
+17357,2,299000150,8
+17358,2,299000190,8
+17359,2,299000200,8
+17360,2,299000210,8
+17361,3,290000120,8
+17362,3,291000050,8
+17363,3,292000020,8
+17364,3,298000050,8
+17365,3,298000060,8
+17366,3,299000060,8
+17367,3,299000170,8
+17368,4,201000170,8
+17369,4,202000070,8
+17370,4,202000370,8
+17371,4,202000400,8
+17372,4,202000440,8
+17373,4,203000110,8
+17374,4,203000270,8
+17375,4,203000350,8
+17376,4,204000010,8
+17377,4,204000370,8
+17378,4,205000220,8
+17379,4,206000110,8
+17380,4,206000240,8
+17381,4,206000270,8
+17382,4,209000040,8
+17383,4,209000070,8
+17384,4,209000160,8
+17385,4,209000190,8
+17386,4,209000240,8
+17387,4,215000150,8
+17388,4,290000110,8
+17389,4,290000130,8
+17390,4,298000120,8
+17391,4,299000670,8
+17392,4,299000680,8
+17393,4,201000090,8
+17394,4,202000160,8
+17395,4,203000150,8
+17396,4,204000110,8
+17397,4,205000110,8
+17398,4,206000120,8
+17399,4,211000060,8
+17400,4,212000050,8
+17401,4,299000440,8
+17402,4,299000450,8
+17403,4,299000460,8
+17404,4,299000470,8
+17405,4,299000480,8
+17406,4,299000550,8
+17407,4,299000560,8
+17408,4,299000570,8
+17409,4,299000580,8
+17410,4,299000590,8
+17411,4,299000600,8
+17412,4,299000610,8
+17413,4,299000620,8
+17414,4,299000630,8
+17415,4,299000640,8
+17416,4,299000650,8
+17417,4,299000230,8
+17418,4,299000240,8
+17419,4,299000250,8
+17420,4,299000260,8
+17421,4,299000270,8
+17422,4,299000280,8
+17423,4,299000290,8
+17424,4,299000300,8
+17425,4,299000310,8
+17426,4,299000320,8
+17427,4,299000330,8
+17428,4,299000340,8
+17429,4,299000350,8
+17430,4,299000360,8
+17431,4,299000370,8
+17432,4,299000380,8
+17433,4,299000390,8
+17434,4,299000400,8
+17435,4,215000050,8
+17436,4,216000060,8
+17437,4,217000020,8
+17438,4,218000030,8
+17439,4,299000500,8
+17440,4,299000510,8
+17441,4,299000520,8
+17442,4,299000530,8
+17443,4,299000540,8
+17444,4,299000660,8
+17445,5,202000090,8
+17446,5,202000150,8
+17447,5,203000010,8
+17448,5,203000050,8
+17449,5,203000260,8
+17450,5,204000080,8
+17451,5,204000100,8
+17452,5,204000200,8
+17453,5,204000270,8
+17454,5,206000030,8
+17455,5,206000170,8
+17456,5,209000320,8
+17457,5,220000080,8
+17458,5,290000160,8
+17459,5,291000020,8
+17460,5,297000100,8
+17461,5,297000130,8
+17462,5,297000140,8
+17463,5,298000110,8
+17464,5,202000290,8
+17465,5,203000240,8
+17466,5,204000210,8
+17467,5,205000150,8
+17468,5,206000200,8
+17469,5,211000090,8
+17470,5,212000060,8
+17471,5,299000800,8
+17472,5,299000810,8
+17473,5,299000820,8
+17474,5,299000840,8
+17475,5,299000850,8
+17476,5,299000860,8
+17477,5,299000870,8
+17478,5,299000880,8
+17479,5,299000890,8
+17480,5,201000120,8
+17481,5,202000240,8
+17482,5,211000080,8
+17483,5,299000730,8
+17484,5,299000740,8
+17485,5,299000750,8
+17486,5,299000760,8
+17487,5,299000770,8
+17488,5,201000130,8
+17489,5,299000830,8
+17490,5,202000280,8
+17491,5,204000220,8
+17492,5,201000150,8
+17493,5,202000350,8
+17494,5,205000200,8
+17495,5,299001050,8
+17496,5,299001060,8
+17497,5,201000200,8
+17498,5,202000430,8
+17499,5,211000150,8
+17500,5,299001170,8
+17501,5,299001180,8
+17502,5,202000270,8
+17503,5,206000190,8
+17504,5,220000060,8
+17505,5,201000140,8
+17506,5,203000230,8
+17507,5,205000160,8
+17508,5,204000230,8
+17509,5,209000200,8
+17510,5,299000900,8
+17511,5,202000340,8
+17512,5,203000280,8
+17513,5,205000190,8
+17514,5,208000040,8
+17515,5,211000110,8
+17516,5,220000070,8
+17517,5,202000420,8
+17518,5,203000340,8
+17519,5,204000360,8
+17520,5,211000140,8
+17521,5,212000090,8
+17522,5,299000920,8
+17523,5,299000930,8
+17524,5,299000940,8
+17525,5,299000950,8
+17526,5,299000960,8
+17527,5,298000130,8
+17528,5,202000380,8
+17529,5,203000300,8
+17530,5,204000320,8
+17531,5,205000230,8
+17532,5,206000250,8
+17533,5,209000280,8
+17534,5,210000030,8
+17535,5,211000120,8
+17536,5,212000070,8
+17537,5,215000130,8
+17538,5,216000130,8
+17539,5,217000080,8
+17540,5,218000090,8
+17541,5,299001070,8
+17542,5,299001080,8
+17543,5,299001090,8
+17544,5,215000120,8
+17545,5,202000390,8
+17546,5,203000310,8
+17547,5,204000330,8
+17548,5,205000240,8
+17549,5,206000260,8
+17550,5,209000290,8
+17551,5,210000040,8
+17552,5,211000130,8
+17553,5,212000080,8
+17554,5,215000140,8
+17555,5,216000140,8
+17556,5,217000090,8
+17557,5,218000100,8
+17558,5,220000090,8
+17559,5,299001100,8
+17560,5,299001110,8
+17561,5,299001120,8
+17562,5,299001130,8
+17563,5,299001140,8
+17564,5,299001150,8
+17565,5,299000430,8
+17566,5,299000690,8
+17567,5,299000710,8
+17568,5,299000720,8
+17569,5,215000100,8
+17570,5,216000090,8
+17571,5,217000070,8
+17572,5,218000080,8
+17573,5,299000970,8
+17574,5,299000980,8
+17575,5,299000990,8
+17576,5,299001000,8
+17577,5,299001010,8
+17578,5,299001020,8
+17579,5,299001030,8
+17580,5,299001040,8
+17581,3,101000006,2
+17582,3,103000005,2
+17583,4,101000003,2
+17584,4,102000005,2
+17585,4,107000005,2
+17586,4,112000006,2
+17587,5,101000009,2
+17588,5,101000011,2
+17589,5,101000012,2
+17590,5,101000013,2
+17591,5,101000014,2
+17592,5,101000015,2
+17593,5,101000016,2
+17594,5,101000017,2
+17595,5,101000018,2
+17596,5,102000008,2
+17597,5,102000009,2
+17598,5,107000007,2
+17599,5,109000008,2
+17600,5,111000007,2
+17601,5,111000008,2
+17602,5,112000008,2
+17603,5,120000008,2
+17605,2,118000010,1
+17606,3,118000020,1
+17607,3,118000030,1
+17608,3,118000040,1
+17609,4,118000050,1
+17610,4,118000060,1
+17611,5,118000070,1
+17612,1,101000000,2
+17613,3,101000006,2
+17614,3,103000005,2
+17615,4,101000003,2
+17616,4,102000005,2
+17617,4,107000005,2
+17618,4,112000006,2
+17619,5,101000009,2
+17620,5,101000011,2
+17621,5,101000012,2
+17622,5,101000013,2
+17623,5,101000014,2
+17624,5,101000015,2
+17625,5,101000016,2
+17626,5,101000017,2
+17627,5,101000018,2
+17628,5,102000008,2
+17629,5,102000009,2
+17630,5,107000007,2
+17631,5,109000008,2
+17632,5,111000007,2
+17633,5,111000008,2
+17634,5,112000008,2
+17635,5,120000008,2
+17636,3,110540,3
+17637,3,110680,3
+17638,3,110790,3
+17639,3,110800,3
+17640,3,120440,3
+17641,5,110055,3
+17642,5,110241,3
+17643,5,110251,3
+17644,5,110261,3
+17645,5,110271,3
+17646,5,110730,3
+17647,5,111020,3
+17648,5,111100,3
+17649,5,111160,3
+17650,5,120551,3
+17651,5,121160,3
\ No newline at end of file
diff --git a/titles/sao/database.py b/titles/sao/database.py
new file mode 100644
index 0000000..b7026fb
--- /dev/null
+++ b/titles/sao/database.py
@@ -0,0 +1,13 @@
+from core.data import Data
+from core.config import CoreConfig
+
+from .schema import *
+
+
+class SaoData(Data):
+ def __init__(self, cfg: CoreConfig) -> None:
+ super().__init__(cfg)
+
+ self.item = SaoItemData(cfg, self.session)
+ self.profile = SaoProfileData(cfg, self.session)
+ self.static = SaoStaticData(cfg, self.session)
\ No newline at end of file
diff --git a/titles/sao/handlers/__init__.py b/titles/sao/handlers/__init__.py
new file mode 100644
index 0000000..90a6b4e
--- /dev/null
+++ b/titles/sao/handlers/__init__.py
@@ -0,0 +1 @@
+from titles.sao.handlers.base import *
\ No newline at end of file
diff --git a/titles/sao/handlers/base.py b/titles/sao/handlers/base.py
new file mode 100644
index 0000000..93d0589
--- /dev/null
+++ b/titles/sao/handlers/base.py
@@ -0,0 +1,2747 @@
+import struct
+from datetime import datetime
+from construct import *
+import sys
+import csv
+from csv import *
+
+class SaoBaseRequest:
+ def __init__(self, data: bytes) -> None:
+ self.cmd = struct.unpack_from("!H", bytes)[0]
+ # TODO: The rest of the request header
+
+class SaoBaseResponse:
+ def __init__(self, cmd_id: int) -> None:
+ self.cmd = cmd_id
+ self.err_status = 0
+ self.error_type = 0
+ self.vendor_id = 5
+ self.game_id = 1
+ self.version_id = 1
+ self.length = 1
+
+ def make(self) -> bytes:
+ return struct.pack("!HHIIIII", self.cmd, self.err_status, self.error_type, self.vendor_id, self.game_id, self.version_id, self.length)
+
+class SaoNoopResponse(SaoBaseResponse):
+ def __init__(self, cmd: int) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.length = 5
+
+ def make(self) -> bytes:
+ return super().make() + struct.pack("!bI", self.result, 0)
+
+class SaoGetMaintRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+ # TODO: The rest of the mait info request
+
+class SaoGetMaintResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.maint_begin = datetime.fromtimestamp(0)
+ self.maint_begin_int_ct = 6
+ self.maint_end = datetime.fromtimestamp(0)
+ self.maint_end_int_ct = 6
+ self.dt_format = "%Y%m%d%H%M%S"
+
+ def make(self) -> bytes:
+ maint_begin_list = [x for x in datetime.strftime(self.maint_begin, self.dt_format)]
+ maint_end_list = [x for x in datetime.strftime(self.maint_end, self.dt_format)]
+ self.maint_begin_int_ct = len(maint_begin_list) * 2
+ self.maint_end_int_ct = len(maint_end_list) * 2
+
+ maint_begin_bytes = b""
+ maint_end_bytes = b""
+
+ for x in maint_begin_list:
+ maint_begin_bytes += struct.pack(" None:
+ super().__init__(data)
+
+class SaoCommonAcCabinetBootNotificationResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoMasterDataVersionCheckRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoMasterDataVersionCheckResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.update_flag = 0
+ self.data_version = 100
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "update_flag" / Int8ul, # result is either 0 or 1
+ "data_version" / Int32ub,
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ update_flag=self.update_flag,
+ data_version=self.data_version,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoCommonGetAppVersionsRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoCommonGetAppVersionsRequest(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.data_list_size = 1 # Number of arrays
+
+ self.version_app_id = 1
+ self.applying_start_date = "20230520193000"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "data_list_size" / Int32ub,
+
+ "version_app_id" / Int32ub,
+ "applying_start_date_size" / Int32ub, # big endian
+ "applying_start_date" / Int16ul[len(self.applying_start_date)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ data_list_size=self.data_list_size,
+
+ version_app_id=self.version_app_id,
+ applying_start_date_size=len(self.applying_start_date) * 2,
+ applying_start_date=[ord(x) for x in self.applying_start_date],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoCommonPayingPlayStartRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoCommonPayingPlayStartRequest(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.paying_session_id = "1"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "paying_session_id_size" / Int32ub, # big endian
+ "paying_session_id" / Int16ul[len(self.paying_session_id)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ paying_session_id_size=len(self.paying_session_id) * 2,
+ paying_session_id=[ord(x) for x in self.paying_session_id],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetAuthCardDataRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetAuthCardDataResponse(SaoBaseResponse): #GssSite.dll / GssSiteSystem / GameConnectProt / public class get_auth_card_data_R : GameConnect.GssProtocolBase
+ def __init__(self, cmd, profile_data) -> None:
+ super().__init__(cmd)
+
+ self.result = 1
+ self.unused_card_flag = ""
+ self.first_play_flag = 0
+ self.tutorial_complete_flag = 1
+ self.nick_name = profile_data['nick_name'] # nick_name field #4
+ self.personal_id = str(profile_data['user'])
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "unused_card_flag_size" / Int32ub, # big endian
+ "unused_card_flag" / Int16ul[len(self.unused_card_flag)],
+ "first_play_flag" / Int8ul, # result is either 0 or 1
+ "tutorial_complete_flag" / Int8ul, # result is either 0 or 1
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "personal_id_size" / Int32ub, # big endian
+ "personal_id" / Int16ul[len(self.personal_id)]
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ unused_card_flag_size=len(self.unused_card_flag) * 2,
+ unused_card_flag=[ord(x) for x in self.unused_card_flag],
+ first_play_flag=self.first_play_flag,
+ tutorial_complete_flag=self.tutorial_complete_flag,
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ personal_id_size=len(self.personal_id) * 2,
+ personal_id=[ord(x) for x in self.personal_id]
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoHomeCheckAcLoginBonusRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoHomeCheckAcLoginBonusResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.reward_get_flag = 1
+ self.get_ac_login_bonus_id_list_size = 2 # Array
+
+ self.get_ac_login_bonus_id_1 = 1 # "2020年7月9日~(アニメ&リコリス記念)"
+ self.get_ac_login_bonus_id_2 = 2 # "2020年10月6日~(秋のデビュー&カムバックCP)"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "reward_get_flag" / Int8ul, # result is either 0 or 1
+ "get_ac_login_bonus_id_list_size" / Int32ub,
+
+ "get_ac_login_bonus_id_1" / Int32ub,
+ "get_ac_login_bonus_id_2" / Int32ub,
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ reward_get_flag=self.reward_get_flag,
+ get_ac_login_bonus_id_list_size=self.get_ac_login_bonus_id_list_size,
+
+ get_ac_login_bonus_id_1=self.get_ac_login_bonus_id_1,
+ get_ac_login_bonus_id_2=self.get_ac_login_bonus_id_2,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetQuestSceneMultiPlayPhotonServerRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetQuestSceneMultiPlayPhotonServerResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.application_id = "7df3a2f6-d69d-4073-aafe-810ee61e1cea"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "application_id_size" / Int32ub, # big endian
+ "application_id" / Int16ul[len(self.application_id)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ application_id_size=len(self.application_id) * 2,
+ application_id=[ord(x) for x in self.application_id],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoTicketRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoTicketResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = "1"
+ self.ticket_id = "9" #up to 18
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result_size" / Int32ub, # big endian
+ "result" / Int16ul[len(self.result)],
+ "ticket_id_size" / Int32ub, # big endian
+ "ticket_id" / Int16ul[len(self.result)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result_size=len(self.result) * 2,
+ result=[ord(x) for x in self.result],
+ ticket_id_size=len(self.ticket_id) * 2,
+ ticket_id=[ord(x) for x in self.ticket_id],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoCommonLoginRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoCommonLoginResponse(SaoBaseResponse):
+ def __init__(self, cmd, profile_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.user_id = str(profile_data['user'])
+ self.first_play_flag = 0
+ self.grantable_free_ticket_flag = 1
+ self.login_reward_vp = 99
+ self.today_paying_flag = 1
+
+ def make(self) -> bytes:
+ # create a resp struct
+ '''
+ bool = Int8ul
+ short = Int16ub
+ int = Int32ub
+ '''
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "user_id_size" / Int32ub, # big endian
+ "user_id" / Int16ul[len(self.user_id)],
+ "first_play_flag" / Int8ul, # result is either 0 or 1
+ "grantable_free_ticket_flag" / Int8ul, # result is either 0 or 1
+ "login_reward_vp" / Int16ub,
+ "today_paying_flag" / Int8ul, # result is either 0 or 1
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ user_id_size=len(self.user_id) * 2,
+ user_id=[ord(x) for x in self.user_id],
+ first_play_flag=self.first_play_flag,
+ grantable_free_ticket_flag=self.grantable_free_ticket_flag,
+ login_reward_vp=self.login_reward_vp,
+ today_paying_flag=self.today_paying_flag,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoCheckComebackEventRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoCheckComebackEventRequest(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.get_flag_ = 1
+ self.get_comeback_event_id_list = "" # Array of events apparently
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "get_flag_" / Int8ul, # result is either 0 or 1
+ "get_comeback_event_id_list_size" / Int32ub, # big endian
+ "get_comeback_event_id_list" / Int16ul[len(self.get_comeback_event_id_list)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ get_flag_=self.get_flag_,
+ get_comeback_event_id_list_size=len(self.get_comeback_event_id_list) * 2,
+ get_comeback_event_id_list=[ord(x) for x in self.get_comeback_event_id_list],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetUserBasicDataRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetUserBasicDataResponse(SaoBaseResponse):
+ def __init__(self, cmd, profile_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.user_basic_data_size = 1 # Number of arrays
+ self.user_type = profile_data['user_type']
+ self.nick_name = profile_data['nick_name']
+ self.rank_num = profile_data['rank_num']
+ self.rank_exp = profile_data['rank_exp']
+ self.own_col = profile_data['own_col']
+ self.own_vp = profile_data['own_vp']
+ self.own_yui_medal = profile_data['own_yui_medal']
+ self.setting_title_id = profile_data['setting_title_id']
+ self.favorite_user_hero_log_id = ""
+ self.favorite_user_support_log_id = ""
+ self.my_store_id = "1"
+ self.my_store_name = "ARTEMiS"
+ self.user_reg_date = "20230101120000"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ '''
+ bool = Int8ul
+ short = Int16ub
+ int = Int32ub
+ '''
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "user_basic_data_size" / Int32ub,
+
+ "user_type" / Int16ub,
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "rank_num" / Int16ub,
+ "rank_exp" / Int32ub,
+ "own_col" / Int32ub,
+ "own_vp" / Int32ub,
+ "own_yui_medal" / Int32ub,
+ "setting_title_id" / Int32ub,
+ "favorite_user_hero_log_id_size" / Int32ub, # big endian
+ "favorite_user_hero_log_id" / Int16ul[len(str(self.favorite_user_hero_log_id))],
+ "favorite_user_support_log_id_size" / Int32ub, # big endian
+ "favorite_user_support_log_id" / Int16ul[len(str(self.favorite_user_support_log_id))],
+ "my_store_id_size" / Int32ub, # big endian
+ "my_store_id" / Int16ul[len(str(self.my_store_id))],
+ "my_store_name_size" / Int32ub, # big endian
+ "my_store_name" / Int16ul[len(str(self.my_store_name))],
+ "user_reg_date_size" / Int32ub, # big endian
+ "user_reg_date" / Int16ul[len(self.user_reg_date)]
+
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ user_basic_data_size=self.user_basic_data_size,
+
+ user_type=self.user_type,
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ rank_num=self.rank_num,
+ rank_exp=self.rank_exp,
+ own_col=self.own_col,
+ own_vp=self.own_vp,
+ own_yui_medal=self.own_yui_medal,
+ setting_title_id=self.setting_title_id,
+ favorite_user_hero_log_id_size=len(self.favorite_user_hero_log_id) * 2,
+ favorite_user_hero_log_id=[ord(x) for x in str(self.favorite_user_hero_log_id)],
+ favorite_user_support_log_id_size=len(self.favorite_user_support_log_id) * 2,
+ favorite_user_support_log_id=[ord(x) for x in str(self.favorite_user_support_log_id)],
+ my_store_id_size=len(self.my_store_id) * 2,
+ my_store_id=[ord(x) for x in str(self.my_store_id)],
+ my_store_name_size=len(self.my_store_name) * 2,
+ my_store_name=[ord(x) for x in str(self.my_store_name)],
+ user_reg_date_size=len(self.user_reg_date) * 2,
+ user_reg_date=[ord(x) for x in self.user_reg_date],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetHeroLogUserDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetHeroLogUserDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, hero_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ self.user_hero_log_id = []
+ self.log_level = []
+ self.max_log_level_extended_num = []
+ self.log_exp = []
+ self.last_set_skill_slot1_skill_id = []
+ self.last_set_skill_slot2_skill_id = []
+ self.last_set_skill_slot3_skill_id = []
+ self.last_set_skill_slot4_skill_id = []
+ self.last_set_skill_slot5_skill_id = []
+
+ for i in range(len(hero_data)):
+
+ # Calculate level based off experience and the CSV list
+ with open(r'titles/sao/data/HeroLogLevel.csv') as csv_file:
+ csv_reader = csv.reader(csv_file, delimiter=',')
+ line_count = 0
+ data = []
+ rowf = False
+ for row in csv_reader:
+ if rowf==False:
+ rowf=True
+ else:
+ data.append(row)
+
+ exp = hero_data[i][4]
+
+ for e in range(0,len(data)):
+ if exp>=int(data[e][1]) and exp bytes:
+ #new stuff
+
+ hero_log_user_data_list_struct = Struct(
+ "user_hero_log_id_size" / Int32ub, # big endian
+ "user_hero_log_id" / Int16ul[9], #string
+ "hero_log_id" / Int32ub, #int
+ "log_level" / Int16ub, #short
+ "max_log_level_extended_num" / Int16ub, #short
+ "log_exp" / Int32ub, #int
+ "possible_awakening_flag" / Int8ul, # result is either 0 or 1
+ "awakening_stage" / Int16ub, #short
+ "awakening_exp" / Int32ub, #int
+ "skill_slot_correction_value" / Int8ul, # result is either 0 or 1
+ "last_set_skill_slot1_skill_id" / Int16ub, #short
+ "last_set_skill_slot2_skill_id" / Int16ub, #short
+ "last_set_skill_slot3_skill_id" / Int16ub, #short
+ "last_set_skill_slot4_skill_id" / Int16ub, #short
+ "last_set_skill_slot5_skill_id" / Int16ub, #short
+ "property1_property_id" / Int32ub,
+ "property1_value1" / Int32ub,
+ "property1_value2" / Int32ub,
+ "property2_property_id" / Int32ub,
+ "property2_value1" / Int32ub,
+ "property2_value2" / Int32ub,
+ "property3_property_id" / Int32ub,
+ "property3_value1" / Int32ub,
+ "property3_value2" / Int32ub,
+ "property4_property_id" / Int32ub,
+ "property4_value1" / Int32ub,
+ "property4_value2" / Int32ub,
+ "converted_card_num" / Int16ub,
+ "shop_purchase_flag" / Int8ul, # result is either 0 or 1
+ "protect_flag" / Int8ul, # result is either 0 or 1
+ "get_date_size" / Int32ub, # big endian
+ "get_date" / Int16ul[len(self.get_date)],
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "hero_log_user_data_list_size" / Rebuild(Int32ub, len_(this.hero_log_user_data_list)), # big endian
+ "hero_log_user_data_list" / Array(this.hero_log_user_data_list_size, hero_log_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ hero_log_user_data_list_size=0,
+ hero_log_user_data_list=[],
+ )))
+
+ for i in range(len(self.hero_log_id)):
+ hero_data = dict(
+ user_hero_log_id_size=len(self.user_hero_log_id[i]) * 2,
+ user_hero_log_id=[ord(x) for x in self.user_hero_log_id[i]],
+ hero_log_id=self.hero_log_id[i],
+ log_level=self.log_level[i],
+ max_log_level_extended_num=self.max_log_level_extended_num[i],
+ log_exp=self.log_exp[i],
+ possible_awakening_flag=self.possible_awakening_flag,
+ awakening_stage=self.awakening_stage,
+ awakening_exp=self.awakening_exp,
+ skill_slot_correction_value=self.skill_slot_correction_value,
+ last_set_skill_slot1_skill_id=self.last_set_skill_slot1_skill_id[i],
+ last_set_skill_slot2_skill_id=self.last_set_skill_slot2_skill_id[i],
+ last_set_skill_slot3_skill_id=self.last_set_skill_slot3_skill_id[i],
+ last_set_skill_slot4_skill_id=self.last_set_skill_slot4_skill_id[i],
+ last_set_skill_slot5_skill_id=self.last_set_skill_slot5_skill_id[i],
+ property1_property_id=self.property1_property_id,
+ property1_value1=self.property1_value1,
+ property1_value2=self.property1_value2,
+ property2_property_id=self.property2_property_id,
+ property2_value1=self.property2_value1,
+ property2_value2=self.property2_value2,
+ property3_property_id=self.property3_property_id,
+ property3_value1=self.property3_value1,
+ property3_value2=self.property3_value2,
+ property4_property_id=self.property4_property_id,
+ property4_value1=self.property4_value1,
+ property4_value2=self.property4_value2,
+ converted_card_num=self.converted_card_num,
+ shop_purchase_flag=self.shop_purchase_flag,
+ protect_flag=self.protect_flag,
+ get_date_size=len(self.get_date) * 2,
+ get_date=[ord(x) for x in self.get_date],
+
+ )
+
+ resp_data.hero_log_user_data_list.append(hero_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetEquipmentUserDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetEquipmentUserDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, equipment_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ self.user_equipment_id = []
+ self.enhancement_value = []
+ self.max_enhancement_value_extended_num = []
+ self.enhancement_exp = []
+ self.awakening_stage = []
+ self.awakening_exp = []
+ self.possible_awakening_flag = []
+ equipment_level = 0
+
+ for i in range(len(equipment_data)):
+
+ # Calculate level based off experience and the CSV list
+ with open(r'titles/sao/data/EquipmentLevel.csv') as csv_file:
+ csv_reader = csv.reader(csv_file, delimiter=',')
+ line_count = 0
+ data = []
+ rowf = False
+ for row in csv_reader:
+ if rowf==False:
+ rowf=True
+ else:
+ data.append(row)
+
+ exp = equipment_data[i][4]
+
+ for e in range(0,len(data)):
+ if exp>=int(data[e][1]) and exp bytes:
+
+ equipment_user_data_list_struct = Struct(
+ "user_equipment_id_size" / Int32ub, # big endian
+ "user_equipment_id" / Int16ul[9], #string
+ "equipment_id" / Int32ub, #int
+ "enhancement_value" / Int16ub, #short
+ "max_enhancement_value_extended_num" / Int16ub, #short
+ "enhancement_exp" / Int32ub, #int
+ "possible_awakening_flag" / Int8ul, # result is either 0 or 1
+ "awakening_stage" / Int16ub, #short
+ "awakening_exp" / Int32ub, #int
+ "property1_property_id" / Int32ub,
+ "property1_value1" / Int32ub,
+ "property1_value2" / Int32ub,
+ "property2_property_id" / Int32ub,
+ "property2_value1" / Int32ub,
+ "property2_value2" / Int32ub,
+ "property3_property_id" / Int32ub,
+ "property3_value1" / Int32ub,
+ "property3_value2" / Int32ub,
+ "property4_property_id" / Int32ub,
+ "property4_value1" / Int32ub,
+ "property4_value2" / Int32ub,
+ "converted_card_num" / Int16ub,
+ "shop_purchase_flag" / Int8ul, # result is either 0 or 1
+ "protect_flag" / Int8ul, # result is either 0 or 1
+ "get_date_size" / Int32ub, # big endian
+ "get_date" / Int16ul[len(self.get_date)],
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "equipment_user_data_list_size" / Rebuild(Int32ub, len_(this.equipment_user_data_list)), # big endian
+ "equipment_user_data_list" / Array(this.equipment_user_data_list_size, equipment_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ equipment_user_data_list_size=0,
+ equipment_user_data_list=[],
+ )))
+
+ for i in range(len(self.equipment_id)):
+ equipment_data = dict(
+ user_equipment_id_size=len(self.user_equipment_id[i]) * 2,
+ user_equipment_id=[ord(x) for x in self.user_equipment_id[i]],
+ equipment_id=self.equipment_id[i],
+ enhancement_value=self.enhancement_value[i],
+ max_enhancement_value_extended_num=self.max_enhancement_value_extended_num[i],
+ enhancement_exp=self.enhancement_exp[i],
+ possible_awakening_flag=self.possible_awakening_flag[i],
+ awakening_stage=self.awakening_stage[i],
+ awakening_exp=self.awakening_exp[i],
+ property1_property_id=self.property1_property_id,
+ property1_value1=self.property1_value1,
+ property1_value2=self.property1_value2,
+ property2_property_id=self.property2_property_id,
+ property2_value1=self.property2_value1,
+ property2_value2=self.property2_value2,
+ property3_property_id=self.property3_property_id,
+ property3_value1=self.property3_value1,
+ property3_value2=self.property3_value2,
+ property4_property_id=self.property4_property_id,
+ property4_value1=self.property4_value1,
+ property4_value2=self.property4_value2,
+ converted_card_num=self.converted_card_num,
+ shop_purchase_flag=self.shop_purchase_flag,
+ protect_flag=self.protect_flag,
+ get_date_size=len(self.get_date) * 2,
+ get_date=[ord(x) for x in self.get_date],
+
+ )
+
+ resp_data.equipment_user_data_list.append(equipment_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetItemUserDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetItemUserDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, item_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ self.user_item_id = []
+
+ for i in range(len(item_data)):
+ self.user_item_id.append(item_data[i][2])
+
+ # item_user_data_list
+ self.user_item_id = list(map(str,self.user_item_id)) #str
+ self.item_id = list(map(int,self.user_item_id)) #int
+ self.protect_flag = 0 #byte
+ self.get_date = "20230101120000" #str
+
+ def make(self) -> bytes:
+ #new stuff
+
+ item_user_data_list_struct = Struct(
+ "user_item_id_size" / Int32ub, # big endian
+ "user_item_id" / Int16ul[6], #string but this will not work with 10000 IDs... only with 6 digits
+ "item_id" / Int32ub, #int
+ "protect_flag" / Int8ul, # result is either 0 or 1
+ "get_date_size" / Int32ub, # big endian
+ "get_date" / Int16ul[len(self.get_date)],
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "item_user_data_list_size" / Rebuild(Int32ub, len_(this.item_user_data_list)), # big endian
+ "item_user_data_list" / Array(this.item_user_data_list_size, item_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ item_user_data_list_size=0,
+ item_user_data_list=[],
+ )))
+
+ for i in range(len(self.item_id)):
+ item_data = dict(
+ user_item_id_size=len(self.user_item_id[i]) * 2,
+ user_item_id=[ord(x) for x in self.user_item_id[i]],
+ item_id=self.item_id[i],
+ protect_flag=self.protect_flag,
+ get_date_size=len(self.get_date) * 2,
+ get_date=[ord(x) for x in self.get_date],
+
+ )
+
+ resp_data.item_user_data_list.append(item_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetSupportLogUserDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetSupportLogUserDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, supportIdsData) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ # support_log_user_data_list
+ self.user_support_log_id = list(map(str,supportIdsData)) #str
+ self.support_log_id = supportIdsData #int
+ self.possible_awakening_flag = 0
+ self.awakening_stage = 0
+ self.awakening_exp = 0
+ self.converted_card_num = 0
+ self.shop_purchase_flag = 0
+ self.protect_flag = 0 #byte
+ self.get_date = "20230101120000" #str
+
+ def make(self) -> bytes:
+ support_log_user_data_list_struct = Struct(
+ "user_support_log_id_size" / Int32ub, # big endian
+ "user_support_log_id" / Int16ul[9],
+ "support_log_id" / Int32ub, #int
+ "possible_awakening_flag" / Int8ul, # result is either 0 or 1
+ "awakening_stage" / Int16ub, #short
+ "awakening_exp" / Int32ub, # int
+ "converted_card_num" / Int16ub, #short
+ "shop_purchase_flag" / Int8ul, # result is either 0 or 1
+ "protect_flag" / Int8ul, # result is either 0 or 1
+ "get_date_size" / Int32ub, # big endian
+ "get_date" / Int16ul[len(self.get_date)],
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "support_log_user_data_list_size" / Rebuild(Int32ub, len_(this.support_log_user_data_list)), # big endian
+ "support_log_user_data_list" / Array(this.support_log_user_data_list_size, support_log_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ support_log_user_data_list_size=0,
+ support_log_user_data_list=[],
+ )))
+
+ for i in range(len(self.support_log_id)):
+ support_data = dict(
+ user_support_log_id_size=len(self.user_support_log_id[i]) * 2,
+ user_support_log_id=[ord(x) for x in self.user_support_log_id[i]],
+ support_log_id=self.support_log_id[i],
+ possible_awakening_flag=self.possible_awakening_flag,
+ awakening_stage=self.awakening_stage,
+ awakening_exp=self.awakening_exp,
+ converted_card_num=self.converted_card_num,
+ shop_purchase_flag=self.shop_purchase_flag,
+ protect_flag=self.protect_flag,
+ get_date_size=len(self.get_date) * 2,
+ get_date=[ord(x) for x in self.get_date],
+
+ )
+
+ resp_data.support_log_user_data_list.append(support_data)
+
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetTitleUserDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetTitleUserDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, titleIdsData) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ # title_user_data_list
+ self.user_title_id = list(map(str,titleIdsData)) #str
+ self.title_id = titleIdsData #int
+
+ def make(self) -> bytes:
+ title_user_data_list_struct = Struct(
+ "user_title_id_size" / Int32ub, # big endian
+ "user_title_id" / Int16ul[6], #string
+ "title_id" / Int32ub, #int
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "title_user_data_list_size" / Rebuild(Int32ub, len_(this.title_user_data_list)), # big endian
+ "title_user_data_list" / Array(this.title_user_data_list_size, title_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ title_user_data_list_size=0,
+ title_user_data_list=[],
+ )))
+
+ for i in range(len(self.title_id)):
+ title_data = dict(
+ user_title_id_size=len(self.user_title_id[i]) * 2,
+ user_title_id=[ord(x) for x in self.user_title_id[i]],
+ title_id=self.title_id[i],
+ )
+
+ resp_data.title_user_data_list.append(title_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetEpisodeAppendDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetEpisodeAppendDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, profile_data) -> None:
+ super().__init__(cmd)
+ self.length = None
+ self.result = 1
+
+ self.user_episode_append_id_list = ["10001", "10002", "10003", "10004", "10005"]
+ self.user_id_list = [str(profile_data["user"]), str(profile_data["user"]), str(profile_data["user"]), str(profile_data["user"]), str(profile_data["user"])]
+ self.episode_append_id_list = [10001, 10002, 10003, 10004, 10005]
+ self.own_num_list = [3, 3, 3, 3 ,3]
+
+ def make(self) -> bytes:
+ episode_data_struct = Struct(
+ "user_episode_append_id_size" / Rebuild(Int32ub, len_(this.user_episode_append_id) * 2), # calculates the length of the user_episode_append_id
+ "user_episode_append_id" / PaddedString(this.user_episode_append_id_size, "utf_16_le"), # user_episode_append_id is a (zero) padded string
+ "user_id_size" / Rebuild(Int32ub, len_(this.user_id) * 2), # calculates the length of the user_id
+ "user_id" / PaddedString(this.user_id_size, "utf_16_le"), # user_id is a (zero) padded string
+ "episode_append_id" / Int32ub,
+ "own_num" / Int32ub,
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "episode_append_data_list_size" / Rebuild(Int32ub, len_(this.episode_append_data_list)), # big endian
+ "episode_append_data_list" / Array(this.episode_append_data_list_size, episode_data_struct),
+ )
+
+ # really dump to parse the build resp, but that creates a new object
+ # and is nicer to twork with
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ episode_append_data_list_size=0,
+ episode_append_data_list=[],
+ )))
+
+ if len(self.user_episode_append_id_list) != len(self.user_id_list) != len(self.episode_append_id_list) != len(self.own_num_list):
+ raise ValueError("all lists must be of the same length")
+
+ for i in range(len(self.user_id_list)):
+ # add the episode_data_struct to the resp_struct.episode_append_data_list
+ resp_data.episode_append_data_list.append(dict(
+ user_episode_append_id=self.user_episode_append_id_list[i],
+ user_id=self.user_id_list[i],
+ episode_append_id=self.episode_append_id_list[i],
+ own_num=self.own_num_list[i],
+ ))
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetPartyDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetPartyDataListResponse(SaoBaseResponse): # Default party
+ def __init__(self, cmd, hero1_data, hero2_data, hero3_data) -> None:
+ super().__init__(cmd)
+
+ self.result = 1
+ self.party_data_list_size = 1 # Number of arrays
+
+ self.user_party_id = "0"
+ self.team_no = 0
+ self.party_team_data_list_size = 3 # Number of arrays
+
+ self.user_party_team_id_1 = "0"
+ self.arrangement_num_1 = 0
+ self.user_hero_log_id_1 = str(hero1_data[2])
+ self.main_weapon_user_equipment_id_1 = str(hero1_data[5])
+ self.sub_equipment_user_equipment_id_1 = str(hero1_data[6])
+ self.skill_slot1_skill_id_1 = hero1_data[7]
+ self.skill_slot2_skill_id_1 = hero1_data[8]
+ self.skill_slot3_skill_id_1 = hero1_data[9]
+ self.skill_slot4_skill_id_1 = hero1_data[10]
+ self.skill_slot5_skill_id_1 = hero1_data[11]
+
+ self.user_party_team_id_2 = "0"
+ self.arrangement_num_2 = 0
+ self.user_hero_log_id_2 = str(hero2_data[2])
+ self.main_weapon_user_equipment_id_2 = str(hero2_data[5])
+ self.sub_equipment_user_equipment_id_2 = str(hero2_data[6])
+ self.skill_slot1_skill_id_2 = hero2_data[7]
+ self.skill_slot2_skill_id_2 = hero2_data[8]
+ self.skill_slot3_skill_id_2 = hero2_data[9]
+ self.skill_slot4_skill_id_2 = hero2_data[10]
+ self.skill_slot5_skill_id_2 = hero2_data[11]
+
+ self.user_party_team_id_3 = "0"
+ self.arrangement_num_3 = 0
+ self.user_hero_log_id_3 = str(hero3_data[2])
+ self.main_weapon_user_equipment_id_3 = str(hero3_data[5])
+ self.sub_equipment_user_equipment_id_3 = str(hero3_data[6])
+ self.skill_slot1_skill_id_3 = hero3_data[7]
+ self.skill_slot2_skill_id_3 = hero3_data[8]
+ self.skill_slot3_skill_id_3 = hero3_data[9]
+ self.skill_slot4_skill_id_3 = hero3_data[10]
+ self.skill_slot5_skill_id_3 = hero3_data[11]
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "party_data_list_size" / Int32ub, # big endian
+
+ "user_party_id_size" / Int32ub, # big endian
+ "user_party_id" / Int16ul[len(self.user_party_id)],
+ "team_no" / Int8ul, # result is either 0 or 1
+ "party_team_data_list_size" / Int32ub, # big endian
+
+ "user_party_team_id_1_size" / Int32ub, # big endian
+ "user_party_team_id_1" / Int16ul[len(self.user_party_team_id_1)],
+ "arrangement_num_1" / Int8ul, # big endian
+ "user_hero_log_id_1_size" / Int32ub, # big endian
+ "user_hero_log_id_1" / Int16ul[len(self.user_hero_log_id_1)],
+ "main_weapon_user_equipment_id_1_size" / Int32ub, # big endian
+ "main_weapon_user_equipment_id_1" / Int16ul[len(self.main_weapon_user_equipment_id_1)],
+ "sub_equipment_user_equipment_id_1_size" / Int32ub, # big endian
+ "sub_equipment_user_equipment_id_1" / Int16ul[len(self.sub_equipment_user_equipment_id_1)],
+ "skill_slot1_skill_id_1" / Int32ub,
+ "skill_slot2_skill_id_1" / Int32ub,
+ "skill_slot3_skill_id_1" / Int32ub,
+ "skill_slot4_skill_id_1" / Int32ub,
+ "skill_slot5_skill_id_1" / Int32ub,
+
+ "user_party_team_id_2_size" / Int32ub, # big endian
+ "user_party_team_id_2" / Int16ul[len(self.user_party_team_id_2)],
+ "arrangement_num_2" / Int8ul, # result is either 0 or 1
+ "user_hero_log_id_2_size" / Int32ub, # big endian
+ "user_hero_log_id_2" / Int16ul[len(self.user_hero_log_id_2)],
+ "main_weapon_user_equipment_id_2_size" / Int32ub, # big endian
+ "main_weapon_user_equipment_id_2" / Int16ul[len(self.main_weapon_user_equipment_id_2)],
+ "sub_equipment_user_equipment_id_2_size" / Int32ub, # big endian
+ "sub_equipment_user_equipment_id_2" / Int16ul[len(self.sub_equipment_user_equipment_id_2)],
+ "skill_slot1_skill_id_2" / Int32ub,
+ "skill_slot2_skill_id_2" / Int32ub,
+ "skill_slot3_skill_id_2" / Int32ub,
+ "skill_slot4_skill_id_2" / Int32ub,
+ "skill_slot5_skill_id_2" / Int32ub,
+
+ "user_party_team_id_3_size" / Int32ub, # big endian
+ "user_party_team_id_3" / Int16ul[len(self.user_party_team_id_3)],
+ "arrangement_num_3" / Int8ul, # result is either 0 or 1
+ "user_hero_log_id_3_size" / Int32ub, # big endian
+ "user_hero_log_id_3" / Int16ul[len(self.user_hero_log_id_3)],
+ "main_weapon_user_equipment_id_3_size" / Int32ub, # big endian
+ "main_weapon_user_equipment_id_3" / Int16ul[len(self.main_weapon_user_equipment_id_3)],
+ "sub_equipment_user_equipment_id_3_size" / Int32ub, # big endian
+ "sub_equipment_user_equipment_id_3" / Int16ul[len(self.sub_equipment_user_equipment_id_3)],
+ "skill_slot1_skill_id_3" / Int32ub,
+ "skill_slot2_skill_id_3" / Int32ub,
+ "skill_slot3_skill_id_3" / Int32ub,
+ "skill_slot4_skill_id_3" / Int32ub,
+ "skill_slot5_skill_id_3" / Int32ub,
+
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ party_data_list_size=self.party_data_list_size,
+
+ user_party_id_size=len(self.user_party_id) * 2,
+ user_party_id=[ord(x) for x in self.user_party_id],
+ team_no=self.team_no,
+ party_team_data_list_size=self.party_team_data_list_size,
+
+ user_party_team_id_1_size=len(self.user_party_team_id_1) * 2,
+ user_party_team_id_1=[ord(x) for x in self.user_party_team_id_1],
+ arrangement_num_1=self.arrangement_num_1,
+ user_hero_log_id_1_size=len(self.user_hero_log_id_1) * 2,
+ user_hero_log_id_1=[ord(x) for x in self.user_hero_log_id_1],
+ main_weapon_user_equipment_id_1_size=len(self.main_weapon_user_equipment_id_1) * 2,
+ main_weapon_user_equipment_id_1=[ord(x) for x in self.main_weapon_user_equipment_id_1],
+ sub_equipment_user_equipment_id_1_size=len(self.sub_equipment_user_equipment_id_1) * 2,
+ sub_equipment_user_equipment_id_1=[ord(x) for x in self.sub_equipment_user_equipment_id_1],
+ skill_slot1_skill_id_1=self.skill_slot1_skill_id_1,
+ skill_slot2_skill_id_1=self.skill_slot2_skill_id_1,
+ skill_slot3_skill_id_1=self.skill_slot3_skill_id_1,
+ skill_slot4_skill_id_1=self.skill_slot4_skill_id_1,
+ skill_slot5_skill_id_1=self.skill_slot5_skill_id_1,
+
+ user_party_team_id_2_size=len(self.user_party_team_id_2) * 2,
+ user_party_team_id_2=[ord(x) for x in self.user_party_team_id_2],
+ arrangement_num_2=self.arrangement_num_2,
+ user_hero_log_id_2_size=len(self.user_hero_log_id_2) * 2,
+ user_hero_log_id_2=[ord(x) for x in self.user_hero_log_id_2],
+ main_weapon_user_equipment_id_2_size=len(self.main_weapon_user_equipment_id_2) * 2,
+ main_weapon_user_equipment_id_2=[ord(x) for x in self.main_weapon_user_equipment_id_2],
+ sub_equipment_user_equipment_id_2_size=len(self.sub_equipment_user_equipment_id_2) * 2,
+ sub_equipment_user_equipment_id_2=[ord(x) for x in self.sub_equipment_user_equipment_id_2],
+ skill_slot1_skill_id_2=self.skill_slot1_skill_id_2,
+ skill_slot2_skill_id_2=self.skill_slot2_skill_id_2,
+ skill_slot3_skill_id_2=self.skill_slot3_skill_id_2,
+ skill_slot4_skill_id_2=self.skill_slot4_skill_id_2,
+ skill_slot5_skill_id_2=self.skill_slot5_skill_id_2,
+
+ user_party_team_id_3_size=len(self.user_party_team_id_3) * 2,
+ user_party_team_id_3=[ord(x) for x in self.user_party_team_id_3],
+ arrangement_num_3=self.arrangement_num_3,
+ user_hero_log_id_3_size=len(self.user_hero_log_id_3) * 2,
+ user_hero_log_id_3=[ord(x) for x in self.user_hero_log_id_3],
+ main_weapon_user_equipment_id_3_size=len(self.main_weapon_user_equipment_id_3) * 2,
+ main_weapon_user_equipment_id_3=[ord(x) for x in self.main_weapon_user_equipment_id_3],
+ sub_equipment_user_equipment_id_3_size=len(self.sub_equipment_user_equipment_id_3) * 2,
+ sub_equipment_user_equipment_id_3=[ord(x) for x in self.sub_equipment_user_equipment_id_3],
+ skill_slot1_skill_id_3=self.skill_slot1_skill_id_3,
+ skill_slot2_skill_id_3=self.skill_slot2_skill_id_3,
+ skill_slot3_skill_id_3=self.skill_slot3_skill_id_3,
+ skill_slot4_skill_id_3=self.skill_slot4_skill_id_3,
+ skill_slot5_skill_id_3=self.skill_slot5_skill_id_3,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetQuestScenePrevScanProfileCardRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetQuestScenePrevScanProfileCardResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.profile_card_data = 1 # number of arrays
+
+ self.profile_card_code = ""
+ self.nick_name = ""
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "profile_card_data" / Int32ub, # big endian
+
+ "profile_card_code_size" / Int32ub, # big endian
+ "profile_card_code" / Int16ul[len(self.profile_card_code)],
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "rank_num" / Int16ub, #short
+ "setting_title_id" / Int32ub, # int
+ "skill_id" / Int16ub, # short
+ "hero_log_hero_log_id" / Int32ub, # int
+ "hero_log_log_level" / Int16ub, # short
+ "hero_log_awakening_stage" / Int16ub, # short
+ "hero_log_property1_property_id" / Int32ub, # int
+ "hero_log_property1_value1" / Int32ub, # int
+ "hero_log_property1_value2" / Int32ub, # int
+ "hero_log_property2_property_id" / Int32ub, # int
+ "hero_log_property2_value1" / Int32ub, # int
+ "hero_log_property2_value2" / Int32ub, # int
+ "hero_log_property3_property_id" / Int32ub, # int
+ "hero_log_property3_value1" / Int32ub, # int
+ "hero_log_property3_value2" / Int32ub, # int
+ "hero_log_property4_property_id" / Int32ub, # int
+ "hero_log_property4_value1" / Int32ub, # int
+ "hero_log_property4_value2" / Int32ub, # int
+ "main_weapon_equipment_id" / Int32ub, # int
+ "main_weapon_enhancement_value" / Int16ub, # short
+ "main_weapon_awakening_stage" / Int16ub, # short
+ "main_weapon_property1_property_id" / Int32ub, # int
+ "main_weapon_property1_value1" / Int32ub, # int
+ "main_weapon_property1_value2" / Int32ub, # int
+ "main_weapon_property2_property_id" / Int32ub, # int
+ "main_weapon_property2_value1" / Int32ub, # int
+ "main_weapon_property2_value2" / Int32ub, # int
+ "main_weapon_property3_property_id" / Int32ub, # int
+ "main_weapon_property3_value1" / Int32ub, # int
+ "main_weapon_property3_value2" / Int32ub, # int
+ "main_weapon_property4_property_id" / Int32ub, # int
+ "main_weapon_property4_value1" / Int32ub, # int
+ "main_weapon_property4_value2" / Int32ub, # int
+ "sub_equipment_equipment_id" / Int32ub, # int
+ "sub_equipment_enhancement_value" / Int16ub, # short
+ "sub_equipment_awakening_stage" / Int16ub, # short
+ "sub_equipment_property1_property_id" / Int32ub, # int
+ "sub_equipment_property1_value1" / Int32ub, # int
+ "sub_equipment_property1_value2" / Int32ub, # int
+ "sub_equipment_property2_property_id" / Int32ub, # int
+ "sub_equipment_property2_value1" / Int32ub, # int
+ "sub_equipment_property2_value2" / Int32ub, # int
+ "sub_equipment_property3_property_id" / Int32ub, # int
+ "sub_equipment_property3_value1" / Int32ub, # int
+ "sub_equipment_property3_value2" / Int32ub, # int
+ "sub_equipment_property4_property_id" / Int32ub, # int
+ "sub_equipment_property4_value1" / Int32ub, # int
+ "sub_equipment_property4_value2" / Int32ub, # int
+ "holographic_flag" / Int8ul, # result is either 0 or 1
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ profile_card_data=self.profile_card_data,
+
+ profile_card_code_size=len(self.profile_card_code) * 2,
+ profile_card_code=[ord(x) for x in self.profile_card_code],
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ rank_num=0,
+ setting_title_id=0,
+ skill_id=0,
+ hero_log_hero_log_id=0,
+ hero_log_log_level=0,
+ hero_log_awakening_stage=0,
+ hero_log_property1_property_id=0,
+ hero_log_property1_value1=0,
+ hero_log_property1_value2=0,
+ hero_log_property2_property_id=0,
+ hero_log_property2_value1=0,
+ hero_log_property2_value2=0,
+ hero_log_property3_property_id=0,
+ hero_log_property3_value1=0,
+ hero_log_property3_value2=0,
+ hero_log_property4_property_id=0,
+ hero_log_property4_value1=0,
+ hero_log_property4_value2=0,
+ main_weapon_equipment_id=0,
+ main_weapon_enhancement_value=0,
+ main_weapon_awakening_stage=0,
+ main_weapon_property1_property_id=0,
+ main_weapon_property1_value1=0,
+ main_weapon_property1_value2=0,
+ main_weapon_property2_property_id=0,
+ main_weapon_property2_value1=0,
+ main_weapon_property2_value2=0,
+ main_weapon_property3_property_id=0,
+ main_weapon_property3_value1=0,
+ main_weapon_property3_value2=0,
+ main_weapon_property4_property_id=0,
+ main_weapon_property4_value1=0,
+ main_weapon_property4_value2=0,
+ sub_equipment_equipment_id=0,
+ sub_equipment_enhancement_value=0,
+ sub_equipment_awakening_stage=0,
+ sub_equipment_property1_property_id=0,
+ sub_equipment_property1_value1=0,
+ sub_equipment_property1_value2=0,
+ sub_equipment_property2_property_id=0,
+ sub_equipment_property2_value1=0,
+ sub_equipment_property2_value2=0,
+ sub_equipment_property3_property_id=0,
+ sub_equipment_property3_value1=0,
+ sub_equipment_property3_value2=0,
+ sub_equipment_property4_property_id=0,
+ sub_equipment_property4_value1=0,
+ sub_equipment_property4_value2=0,
+ holographic_flag=0,
+
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetResourcePathInfoRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetResourcePathInfoResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.resource_base_url = "http://localhost:9000/SDEW/100/"
+ self.gasha_base_dir = "a"
+ self.ad_base_dir = "b"
+ self.event_base_dir = "c"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "resource_base_url_size" / Int32ub, # big endian
+ "resource_base_url" / Int16ul[len(self.resource_base_url)],
+ "gasha_base_dir_size" / Int32ub, # big endian
+ "gasha_base_dir" / Int16ul[len(self.gasha_base_dir)],
+ "ad_base_dir_size" / Int32ub, # big endian
+ "ad_base_dir" / Int16ul[len(self.ad_base_dir)],
+ "event_base_dir_size" / Int32ub, # big endian
+ "event_base_dir" / Int16ul[len(self.event_base_dir)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ resource_base_url_size=len(self.resource_base_url) * 2,
+ resource_base_url=[ord(x) for x in self.resource_base_url],
+ gasha_base_dir_size=len(self.gasha_base_dir) * 2,
+ gasha_base_dir=[ord(x) for x in self.gasha_base_dir],
+ ad_base_dir_size=len(self.ad_base_dir) * 2,
+ ad_base_dir=[ord(x) for x in self.ad_base_dir],
+ event_base_dir_size=len(self.event_base_dir) * 2,
+ event_base_dir=[ord(x) for x in self.event_base_dir],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoEpisodePlayStartRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoEpisodePlayStartResponse(SaoBaseResponse):
+ def __init__(self, cmd, profile_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.play_start_response_data_size = 1 # Number of arrays (minimum 1 mandatory)
+ self.multi_play_start_response_data_size = 0 # Number of arrays (set 0 due to single play)
+
+ self.appearance_player_trace_data_list_size = 1
+
+ self.user_quest_scene_player_trace_id = "1003"
+ self.nick_name = profile_data["nick_name"]
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "play_start_response_data_size" / Int32ub,
+ "multi_play_start_response_data_size" / Int32ub,
+
+ "appearance_player_trace_data_list_size" / Int32ub,
+
+ "user_quest_scene_player_trace_id_size" / Int32ub, # big endian
+ "user_quest_scene_player_trace_id" / Int16ul[len(self.user_quest_scene_player_trace_id)],
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ play_start_response_data_size=self.play_start_response_data_size,
+ multi_play_start_response_data_size=self.multi_play_start_response_data_size,
+
+ appearance_player_trace_data_list_size=self.appearance_player_trace_data_list_size,
+
+ user_quest_scene_player_trace_id_size=len(self.user_quest_scene_player_trace_id) * 2,
+ user_quest_scene_player_trace_id=[ord(x) for x in self.user_quest_scene_player_trace_id],
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoEpisodePlayEndRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoEpisodePlayEndResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.play_end_response_data_size = 1 # Number of arrays
+ self.multi_play_end_response_data_size = 1 # Unused on solo play
+
+ self.dummy_1 = 0
+ self.dummy_2 = 0
+ self.dummy_3 = 0
+
+ self.rarity_up_occurrence_flag = 0
+ self.adventure_ex_area_occurrences_flag = 0
+ self.ex_bonus_data_list_size = 1 # Number of arrays
+ self.play_end_player_trace_reward_data_list_size = 0 # Number of arrays
+
+ self.ex_bonus_table_id = 0 # ExBonusTable.csv values, dont care for now
+ self.achievement_status = 1
+
+ self.common_reward_data_size = 1 # Number of arrays
+
+ self.common_reward_type = 0 # dummy values from 2,101000000,1 from RewardTable.csv
+ self.common_reward_id = 0
+ self.common_reward_num = 0
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "play_end_response_data_size" / Int32ub, # big endian
+
+ "rarity_up_occurrence_flag" / Int8ul, # result is either 0 or 1
+ "adventure_ex_area_occurrences_flag" / Int8ul, # result is either 0 or 1
+ "ex_bonus_data_list_size" / Int32ub, # big endian
+ "play_end_player_trace_reward_data_list_size" / Int32ub, # big endian
+
+ # ex_bonus_data_list
+ "ex_bonus_table_id" / Int32ub,
+ "achievement_status" / Int8ul, # result is either 0 or 1
+
+ # play_end_player_trace_reward_data_list
+ "common_reward_data_size" / Int32ub,
+
+ # common_reward_data
+ "common_reward_type" / Int16ub, # short
+ "common_reward_id" / Int32ub,
+ "common_reward_num" / Int32ub,
+
+ "multi_play_end_response_data_size" / Int32ub, # big endian
+
+ # multi_play_end_response_data
+ "dummy_1" / Int8ul, # result is either 0 or 1
+ "dummy_2" / Int8ul, # result is either 0 or 1
+ "dummy_3" / Int8ul, # result is either 0 or 1
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ play_end_response_data_size=self.play_end_response_data_size,
+
+ rarity_up_occurrence_flag=self.rarity_up_occurrence_flag,
+ adventure_ex_area_occurrences_flag=self.adventure_ex_area_occurrences_flag,
+ ex_bonus_data_list_size=self.ex_bonus_data_list_size,
+ play_end_player_trace_reward_data_list_size=self.play_end_player_trace_reward_data_list_size,
+
+ ex_bonus_table_id=self.ex_bonus_table_id,
+ achievement_status=self.achievement_status,
+
+ common_reward_data_size=self.common_reward_data_size,
+
+ common_reward_type=self.common_reward_type,
+ common_reward_id=self.common_reward_id,
+ common_reward_num=self.common_reward_num,
+
+ multi_play_end_response_data_size=self.multi_play_end_response_data_size,
+
+ dummy_1=self.dummy_1,
+ dummy_2=self.dummy_2,
+ dummy_3=self.dummy_3,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoTrialTowerPlayEndRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoTrialTowerPlayEndResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.play_end_response_data_size = 1 # Number of arrays
+ self.multi_play_end_response_data_size = 1 # Unused on solo play
+ self.trial_tower_play_end_updated_notification_data_size = 1 # Number of arrays
+ self.treasure_hunt_play_end_response_data_size = 1 # Number of arrays
+
+ self.dummy_1 = 0
+ self.dummy_2 = 0
+ self.dummy_3 = 0
+
+ self.rarity_up_occurrence_flag = 0
+ self.adventure_ex_area_occurrences_flag = 0
+ self.ex_bonus_data_list_size = 1 # Number of arrays
+ self.play_end_player_trace_reward_data_list_size = 0 # Number of arrays
+
+ self.ex_bonus_table_id = 0 # ExBonusTable.csv values, dont care for now
+ self.achievement_status = 1
+
+ self.common_reward_data_size = 1 # Number of arrays
+
+ self.common_reward_type = 0 # dummy values from 2,101000000,1 from RewardTable.csv
+ self.common_reward_id = 0
+ self.common_reward_num = 0
+
+ self.store_best_score_clear_time_flag = 0
+ self.store_best_score_combo_num_flag = 0
+ self.store_best_score_total_damage_flag = 0
+ self.store_best_score_concurrent_destroying_num_flag = 0
+ self.store_reaching_trial_tower_rank = 0
+
+ self.get_event_point = 0
+ self.total_event_point = 0
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "play_end_response_data_size" / Int32ub, # big endian
+
+ "rarity_up_occurrence_flag" / Int8ul, # result is either 0 or 1
+ "adventure_ex_area_occurrences_flag" / Int8ul, # result is either 0 or 1
+ "ex_bonus_data_list_size" / Int32ub, # big endian
+ "play_end_player_trace_reward_data_list_size" / Int32ub, # big endian
+
+ # ex_bonus_data_list
+ "ex_bonus_table_id" / Int32ub,
+ "achievement_status" / Int8ul, # result is either 0 or 1
+
+ # play_end_player_trace_reward_data_list
+ "common_reward_data_size" / Int32ub,
+
+ # common_reward_data
+ "common_reward_type" / Int16ub, # short
+ "common_reward_id" / Int32ub,
+ "common_reward_num" / Int32ub,
+
+ "multi_play_end_response_data_size" / Int32ub, # big endian
+
+ # multi_play_end_response_data
+ "dummy_1" / Int8ul, # result is either 0 or 1
+ "dummy_2" / Int8ul, # result is either 0 or 1
+ "dummy_3" / Int8ul, # result is either 0 or 1
+
+ "trial_tower_play_end_updated_notification_data_size" / Int32ub, # big endian
+
+ #trial_tower_play_end_updated_notification_data
+ "store_best_score_clear_time_flag" / Int8ul, # result is either 0 or 1
+ "store_best_score_combo_num_flag" / Int8ul, # result is either 0 or 1
+ "store_best_score_total_damage_flag" / Int8ul, # result is either 0 or 1
+ "store_best_score_concurrent_destroying_num_flag" / Int8ul, # result is either 0 or 1
+ "store_reaching_trial_tower_rank" / Int32ub,
+
+ "treasure_hunt_play_end_response_data_size" / Int32ub, # big endian
+
+ #treasure_hunt_play_end_response_data
+ "get_event_point" / Int32ub,
+ "total_event_point" / Int32ub,
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ play_end_response_data_size=self.play_end_response_data_size,
+
+ rarity_up_occurrence_flag=self.rarity_up_occurrence_flag,
+ adventure_ex_area_occurrences_flag=self.adventure_ex_area_occurrences_flag,
+ ex_bonus_data_list_size=self.ex_bonus_data_list_size,
+ play_end_player_trace_reward_data_list_size=self.play_end_player_trace_reward_data_list_size,
+
+ ex_bonus_table_id=self.ex_bonus_table_id,
+ achievement_status=self.achievement_status,
+
+ common_reward_data_size=self.common_reward_data_size,
+
+ common_reward_type=self.common_reward_type,
+ common_reward_id=self.common_reward_id,
+ common_reward_num=self.common_reward_num,
+
+ multi_play_end_response_data_size=self.multi_play_end_response_data_size,
+
+ dummy_1=self.dummy_1,
+ dummy_2=self.dummy_2,
+ dummy_3=self.dummy_3,
+
+ trial_tower_play_end_updated_notification_data_size=self.trial_tower_play_end_updated_notification_data_size,
+ store_best_score_clear_time_flag=self.store_best_score_clear_time_flag,
+ store_best_score_combo_num_flag=self.store_best_score_combo_num_flag,
+ store_best_score_total_damage_flag=self.store_best_score_total_damage_flag,
+ store_best_score_concurrent_destroying_num_flag=self.store_best_score_concurrent_destroying_num_flag,
+ store_reaching_trial_tower_rank=self.store_reaching_trial_tower_rank,
+
+ treasure_hunt_play_end_response_data_size=self.treasure_hunt_play_end_response_data_size,
+
+ get_event_point=self.get_event_point,
+ total_event_point=self.total_event_point,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoEpisodePlayEndUnanalyzedLogFixedRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoEpisodePlayEndUnanalyzedLogFixedResponse(SaoBaseResponse):
+ def __init__(self, cmd, end_session_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ self.unanalyzed_log_grade_id = []
+
+ self.common_reward_type = []
+ self.common_reward_id = []
+ self.common_reward_num = 1
+
+ for x in range(len(end_session_data)):
+ self.common_reward_id.append(end_session_data[x])
+
+ with open('titles/sao/data/RewardTable.csv', 'r') as f:
+ keys_unanalyzed = next(f).strip().split(',')
+ data_unanalyzed = list(DictReader(f, fieldnames=keys_unanalyzed))
+
+ for i in range(len(data_unanalyzed)):
+ if int(data_unanalyzed[i]["CommonRewardId"]) == int(end_session_data[x]):
+ self.unanalyzed_log_grade_id.append(int(data_unanalyzed[i]["UnanalyzedLogGradeId"]))
+ self.common_reward_type.append(int(data_unanalyzed[i]["CommonRewardType"]))
+ break
+
+ self.unanalyzed_log_grade_id = list(map(int,self.unanalyzed_log_grade_id)) #int
+ self.common_reward_type = list(map(int,self.common_reward_type)) #int
+ self.common_reward_id = list(map(int,self.common_reward_id)) #int
+
+ def make(self) -> bytes:
+ #new stuff
+ common_reward_data_struct = Struct(
+ "common_reward_type" / Int16ub,
+ "common_reward_id" / Int32ub,
+ "common_reward_num" / Int32ub,
+ )
+
+ play_end_unanalyzed_log_reward_data_list_struct = Struct(
+ "unanalyzed_log_grade_id" / Int32ub,
+ "common_reward_data_size" / Rebuild(Int32ub, len_(this.common_reward_data)), # big endian
+ "common_reward_data" / Array(this.common_reward_data_size, common_reward_data_struct),
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "play_end_unanalyzed_log_reward_data_list_size" / Rebuild(Int32ub, len_(this.play_end_unanalyzed_log_reward_data_list)), # big endian
+ "play_end_unanalyzed_log_reward_data_list" / Array(this.play_end_unanalyzed_log_reward_data_list_size, play_end_unanalyzed_log_reward_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ play_end_unanalyzed_log_reward_data_list_size=0,
+ play_end_unanalyzed_log_reward_data_list=[],
+ )))
+
+ for i in range(len(self.common_reward_id)):
+ reward_resp_data = dict(
+ unanalyzed_log_grade_id=self.unanalyzed_log_grade_id[i],
+ common_reward_data_size=0,
+ common_reward_data=[],
+ )
+
+ reward_resp_data["common_reward_data"].append(dict(
+ common_reward_type=self.common_reward_type[i],
+ common_reward_id=self.common_reward_id[i],
+ common_reward_num=self.common_reward_num,
+ ))
+
+ resp_data.play_end_unanalyzed_log_reward_data_list.append(reward_resp_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetQuestSceneUserDataListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetQuestSceneUserDataListResponse(SaoBaseResponse):
+ def __init__(self, cmd, quest_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ # quest_scene_user_data_list_size
+ self.quest_type = []
+ self.quest_scene_id = []
+ self.clear_flag = []
+
+ # quest_scene_best_score_user_data
+ self.clear_time = []
+ self.combo_num = []
+ self.total_damage = [] #string
+ self.concurrent_destroying_num = []
+
+ for i in range(len(quest_data)):
+ self.quest_type.append(1)
+ self.quest_scene_id.append(quest_data[i][2])
+ self.clear_flag.append(int(quest_data[i][3]))
+
+ self.clear_time.append(quest_data[i][4])
+ self.combo_num.append(quest_data[i][5])
+ self.total_damage.append(0) #totally absurd but Int16ul[1] is a big problem due to different lenghts...
+ self.concurrent_destroying_num.append(quest_data[i][7])
+
+ # quest_scene_ex_bonus_user_data_list
+ self.achievement_flag = [1,1,1]
+ self.ex_bonus_table_id = [1,2,3]
+
+
+ self.quest_type = list(map(int,self.quest_type)) #int
+ self.quest_scene_id = list(map(int,self.quest_scene_id)) #int
+ self.clear_flag = list(map(int,self.clear_flag)) #int
+ self.clear_time = list(map(int,self.clear_time)) #int
+ self.combo_num = list(map(int,self.combo_num)) #int
+ self.total_damage = list(map(str,self.total_damage)) #string
+ self.concurrent_destroying_num = list(map(int,self.combo_num)) #int
+
+ def make(self) -> bytes:
+ #new stuff
+ quest_scene_ex_bonus_user_data_list_struct = Struct(
+ "ex_bonus_table_id" / Int32ub, # big endian
+ "achievement_flag" / Int8ul, # result is either 0 or 1
+ )
+
+ quest_scene_best_score_user_data_struct = Struct(
+ "clear_time" / Int32ub, # big endian
+ "combo_num" / Int32ub, # big endian
+ "total_damage_size" / Int32ub, # big endian
+ "total_damage" / Int16ul[1],
+ "concurrent_destroying_num" / Int16ub,
+ )
+
+ quest_scene_user_data_list_struct = Struct(
+ "quest_type" / Int8ul, # result is either 0 or 1
+ "quest_scene_id" / Int16ub, #short
+ "clear_flag" / Int8ul, # result is either 0 or 1
+ "quest_scene_best_score_user_data_size" / Rebuild(Int32ub, len_(this.quest_scene_best_score_user_data)), # big endian
+ "quest_scene_best_score_user_data" / Array(this.quest_scene_best_score_user_data_size, quest_scene_best_score_user_data_struct),
+ "quest_scene_ex_bonus_user_data_list_size" / Rebuild(Int32ub, len_(this.quest_scene_ex_bonus_user_data_list)), # big endian
+ "quest_scene_ex_bonus_user_data_list" / Array(this.quest_scene_ex_bonus_user_data_list_size, quest_scene_ex_bonus_user_data_list_struct),
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "quest_scene_user_data_list_size" / Rebuild(Int32ub, len_(this.quest_scene_user_data_list)), # big endian
+ "quest_scene_user_data_list" / Array(this.quest_scene_user_data_list_size, quest_scene_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ quest_scene_user_data_list_size=0,
+ quest_scene_user_data_list=[],
+ )))
+
+ for i in range(len(self.quest_scene_id)):
+ quest_resp_data = dict(
+ quest_type=self.quest_type[i],
+ quest_scene_id=self.quest_scene_id[i],
+ clear_flag=self.clear_flag[i],
+
+ quest_scene_best_score_user_data_size=0,
+ quest_scene_best_score_user_data=[],
+ quest_scene_ex_bonus_user_data_list_size=0,
+ quest_scene_ex_bonus_user_data_list=[],
+ )
+
+ quest_resp_data["quest_scene_best_score_user_data"].append(dict(
+ clear_time=self.clear_time[i],
+ combo_num=self.combo_num[i],
+ total_damage_size=len(self.total_damage[i]) * 2,
+ total_damage=[ord(x) for x in self.total_damage[i]],
+ concurrent_destroying_num=self.concurrent_destroying_num[i],
+ ))
+
+ resp_data.quest_scene_user_data_list.append(quest_resp_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoCheckYuiMedalGetConditionRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoCheckYuiMedalGetConditionResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.get_flag = 1
+ self.elapsed_days = 0
+ self.get_yui_medal_num = 0
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "get_flag" / Int8ul, # result is either 0 or 1
+ "elapsed_days" / Int16ub, #short
+ "get_yui_medal_num" / Int16ub, #short
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ get_flag=self.get_flag,
+ elapsed_days=self.elapsed_days,
+ get_yui_medal_num=self.get_yui_medal_num,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetYuiMedalBonusUserDataRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetYuiMedalBonusUserDataResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.data_size = 1 # number of arrays
+
+ self.elapsed_days = 1
+ self.loop_num = 1
+ self.last_check_date = "20230520193000"
+ self.last_get_date = "20230520193000"
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "data_size" / Int32ub, # big endian
+
+ "elapsed_days" / Int32ub, # big endian
+ "loop_num" / Int32ub, # big endian
+ "last_check_date_size" / Int32ub, # big endian
+ "last_check_date" / Int16ul[len(self.last_check_date)],
+ "last_get_date_size" / Int32ub, # big endian
+ "last_get_date" / Int16ul[len(self.last_get_date)],
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ data_size=self.data_size,
+
+ elapsed_days=self.elapsed_days,
+ loop_num=self.loop_num,
+ last_check_date_size=len(self.last_check_date) * 2,
+ last_check_date=[ord(x) for x in self.last_check_date],
+ last_get_date_size=len(self.last_get_date) * 2,
+ last_get_date=[ord(x) for x in self.last_get_date],
+
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoCheckProfileCardUsedRewardRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoCheckProfileCardUsedRewardResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.get_flag = 1
+ self.used_num = 0
+ self.get_vp = 1
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "get_flag" / Int8ul, # result is either 0 or 1
+ "used_num" / Int32ub, # big endian
+ "get_vp" / Int32ub, # big endian
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ get_flag=self.get_flag,
+ used_num=self.used_num,
+ get_vp=self.get_vp,
+
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoSynthesizeEnhancementHeroLogRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoSynthesizeEnhancementHeroLogResponse(SaoBaseResponse):
+ def __init__(self, cmd, hero_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ # Calculate level based off experience and the CSV list
+ with open(r'titles/sao/data/HeroLogLevel.csv') as csv_file:
+ csv_reader = csv.reader(csv_file, delimiter=',')
+ line_count = 0
+ data = []
+ rowf = False
+ for row in csv_reader:
+ if rowf==False:
+ rowf=True
+ else:
+ data.append(row)
+
+ exp = hero_data[4]
+
+ for e in range(0,len(data)):
+ if exp>=int(data[e][1]) and exp bytes:
+ #new stuff
+
+ hero_log_user_data_list_struct = Struct(
+ "user_hero_log_id_size" / Int32ub, # big endian
+ "user_hero_log_id" / Int16ul[9], #string
+ "hero_log_id" / Int32ub, #int
+ "log_level" / Int16ub, #short
+ "max_log_level_extended_num" / Int16ub, #short
+ "log_exp" / Int32ub, #int
+ "possible_awakening_flag" / Int8ul, # result is either 0 or 1
+ "awakening_stage" / Int16ub, #short
+ "awakening_exp" / Int32ub, #int
+ "skill_slot_correction_value" / Int8ul, # result is either 0 or 1
+ "last_set_skill_slot1_skill_id" / Int16ub, #short
+ "last_set_skill_slot2_skill_id" / Int16ub, #short
+ "last_set_skill_slot3_skill_id" / Int16ub, #short
+ "last_set_skill_slot4_skill_id" / Int16ub, #short
+ "last_set_skill_slot5_skill_id" / Int16ub, #short
+ "property1_property_id" / Int32ub,
+ "property1_value1" / Int32ub,
+ "property1_value2" / Int32ub,
+ "property2_property_id" / Int32ub,
+ "property2_value1" / Int32ub,
+ "property2_value2" / Int32ub,
+ "property3_property_id" / Int32ub,
+ "property3_value1" / Int32ub,
+ "property3_value2" / Int32ub,
+ "property4_property_id" / Int32ub,
+ "property4_value1" / Int32ub,
+ "property4_value2" / Int32ub,
+ "converted_card_num" / Int16ub,
+ "shop_purchase_flag" / Int8ul, # result is either 0 or 1
+ "protect_flag" / Int8ul, # result is either 0 or 1
+ "get_date_size" / Int32ub, # big endian
+ "get_date" / Int16ul[len(self.get_date)],
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "hero_log_user_data_list_size" / Rebuild(Int32ub, len_(this.hero_log_user_data_list)), # big endian
+ "hero_log_user_data_list" / Array(this.hero_log_user_data_list_size, hero_log_user_data_list_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ hero_log_user_data_list_size=0,
+ hero_log_user_data_list=[],
+ )))
+
+ hero_data = dict(
+ user_hero_log_id_size=len(self.user_hero_log_id) * 2,
+ user_hero_log_id=[ord(x) for x in self.user_hero_log_id],
+ hero_log_id=self.hero_log_id,
+ log_level=self.log_level,
+ max_log_level_extended_num=self.max_log_level_extended_num,
+ log_exp=self.log_exp,
+ possible_awakening_flag=self.possible_awakening_flag,
+ awakening_stage=self.awakening_stage,
+ awakening_exp=self.awakening_exp,
+ skill_slot_correction_value=self.skill_slot_correction_value,
+ last_set_skill_slot1_skill_id=self.last_set_skill_slot1_skill_id,
+ last_set_skill_slot2_skill_id=self.last_set_skill_slot2_skill_id,
+ last_set_skill_slot3_skill_id=self.last_set_skill_slot3_skill_id,
+ last_set_skill_slot4_skill_id=self.last_set_skill_slot4_skill_id,
+ last_set_skill_slot5_skill_id=self.last_set_skill_slot5_skill_id,
+ property1_property_id=self.property1_property_id,
+ property1_value1=self.property1_value1,
+ property1_value2=self.property1_value2,
+ property2_property_id=self.property2_property_id,
+ property2_value1=self.property2_value1,
+ property2_value2=self.property2_value2,
+ property3_property_id=self.property3_property_id,
+ property3_value1=self.property3_value1,
+ property3_value2=self.property3_value2,
+ property4_property_id=self.property4_property_id,
+ property4_value1=self.property4_value1,
+ property4_value2=self.property4_value2,
+ converted_card_num=self.converted_card_num,
+ shop_purchase_flag=self.shop_purchase_flag,
+ protect_flag=self.protect_flag,
+ get_date_size=len(self.get_date) * 2,
+ get_date=[ord(x) for x in self.get_date],
+
+ )
+
+ resp_data.hero_log_user_data_list.append(hero_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoSynthesizeEnhancementEquipment(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoSynthesizeEnhancementEquipmentResponse(SaoBaseResponse):
+ def __init__(self, cmd, synthesize_equipment_data) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ equipment_level = 0
+
+ # Calculate level based off experience and the CSV list
+ with open(r'titles/sao/data/EquipmentLevel.csv') as csv_file:
+ csv_reader = csv.reader(csv_file, delimiter=',')
+ line_count = 0
+ data = []
+ rowf = False
+ for row in csv_reader:
+ if rowf==False:
+ rowf=True
+ else:
+ data.append(row)
+
+ exp = synthesize_equipment_data[4]
+
+ for e in range(0,len(data)):
+ if exp>=int(data[e][1]) and exp bytes:
+
+ after_equipment_user_data_struct = Struct(
+ "user_equipment_id_size" / Int32ub, # big endian
+ "user_equipment_id" / Int16ul[9], #string
+ "equipment_id" / Int32ub, #int
+ "enhancement_value" / Int16ub, #short
+ "max_enhancement_value_extended_num" / Int16ub, #short
+ "enhancement_exp" / Int32ub, #int
+ "possible_awakening_flag" / Int8ul, # result is either 0 or 1
+ "awakening_stage" / Int16ub, #short
+ "awakening_exp" / Int32ub, #int
+ "property1_property_id" / Int32ub,
+ "property1_value1" / Int32ub,
+ "property1_value2" / Int32ub,
+ "property2_property_id" / Int32ub,
+ "property2_value1" / Int32ub,
+ "property2_value2" / Int32ub,
+ "property3_property_id" / Int32ub,
+ "property3_value1" / Int32ub,
+ "property3_value2" / Int32ub,
+ "property4_property_id" / Int32ub,
+ "property4_value1" / Int32ub,
+ "property4_value2" / Int32ub,
+ "converted_card_num" / Int16ub,
+ "shop_purchase_flag" / Int8ul, # result is either 0 or 1
+ "protect_flag" / Int8ul, # result is either 0 or 1
+ "get_date_size" / Int32ub, # big endian
+ "get_date" / Int16ul[len(self.get_date)],
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "after_equipment_user_data_size" / Rebuild(Int32ub, len_(this.after_equipment_user_data)), # big endian
+ "after_equipment_user_data" / Array(this.after_equipment_user_data_size, after_equipment_user_data_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ after_equipment_user_data_size=0,
+ after_equipment_user_data=[],
+ )))
+
+ synthesize_equipment_data = dict(
+ user_equipment_id_size=len(self.user_equipment_id) * 2,
+ user_equipment_id=[ord(x) for x in self.user_equipment_id],
+ equipment_id=self.equipment_id,
+ enhancement_value=self.enhancement_value,
+ max_enhancement_value_extended_num=self.max_enhancement_value_extended_num,
+ enhancement_exp=self.enhancement_exp,
+ possible_awakening_flag=self.possible_awakening_flag,
+ awakening_stage=self.awakening_stage,
+ awakening_exp=self.awakening_exp,
+ property1_property_id=self.property1_property_id,
+ property1_value1=self.property1_value1,
+ property1_value2=self.property1_value2,
+ property2_property_id=self.property2_property_id,
+ property2_value1=self.property2_value1,
+ property2_value2=self.property2_value2,
+ property3_property_id=self.property3_property_id,
+ property3_value1=self.property3_value1,
+ property3_value2=self.property3_value2,
+ property4_property_id=self.property4_property_id,
+ property4_value1=self.property4_value1,
+ property4_value2=self.property4_value2,
+ converted_card_num=self.converted_card_num,
+ shop_purchase_flag=self.shop_purchase_flag,
+ protect_flag=self.protect_flag,
+ get_date_size=len(self.get_date) * 2,
+ get_date=[ord(x) for x in self.get_date],
+
+ )
+
+ resp_data.after_equipment_user_data.append(synthesize_equipment_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetDefragMatchBasicDataRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetDefragMatchBasicDataResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.defrag_match_basic_user_data_size = 1 # number of arrays
+
+ self.seed_flag = 1
+ self.ad_confirm_flag = 1
+ self.total_league_point = 0
+ self.have_league_score = 0
+ self.class_num = 1 # 1 to 6
+ self.hall_of_fame_confirm_flag = 0
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "defrag_match_basic_user_data_size" / Int32ub, # big endian
+
+ "seed_flag" / Int16ub, #short
+ "ad_confirm_flag" / Int8ul, # result is either 0 or 1
+ "total_league_point" / Int32ub, #int
+ "have_league_score" / Int16ub, #short
+ "class_num" / Int16ub, #short
+ "hall_of_fame_confirm_flag" / Int8ul, # result is either 0 or 1
+
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ defrag_match_basic_user_data_size=self.defrag_match_basic_user_data_size,
+
+ seed_flag=self.seed_flag,
+ ad_confirm_flag=self.ad_confirm_flag,
+ total_league_point=self.total_league_point,
+ have_league_score=self.have_league_score,
+ class_num=self.class_num,
+ hall_of_fame_confirm_flag=self.hall_of_fame_confirm_flag,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetDefragMatchRankingUserDataRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetDefragMatchRankingUserDataResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.ranking_user_data_size = 1 # number of arrays
+
+ self.league_point_rank = 1
+ self.league_score_rank = 1
+ self.nick_name = "PLAYER"
+ self.setting_title_id = 20005 # Default saved during profile creation, no changing for those atm
+ self.favorite_hero_log_id = 101000010 # Default saved during profile creation
+ self.favorite_hero_log_awakening_stage = 0
+ self.favorite_support_log_id = 0
+ self.favorite_support_log_awakening_stage = 0
+ self.total_league_point = 1
+ self.have_league_score = 1
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "ranking_user_data_size" / Int32ub, # big endian
+
+ "league_point_rank" / Int32ub, #int
+ "league_score_rank" / Int32ub, #int
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "setting_title_id" / Int32ub, #int
+ "favorite_hero_log_id" / Int32ub, #int
+ "favorite_hero_log_awakening_stage" / Int16ub, #short
+ "favorite_support_log_id" / Int32ub, #int
+ "favorite_support_log_awakening_stage" / Int16ub, #short
+ "total_league_point" / Int32ub, #int
+ "have_league_score" / Int16ub, #short
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ ranking_user_data_size=self.ranking_user_data_size,
+
+ league_point_rank=self.league_point_rank,
+ league_score_rank=self.league_score_rank,
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ setting_title_id=self.setting_title_id,
+ favorite_hero_log_id=self.favorite_hero_log_id,
+ favorite_hero_log_awakening_stage=self.favorite_hero_log_awakening_stage,
+ favorite_support_log_id=self.favorite_support_log_id,
+ favorite_support_log_awakening_stage=self.favorite_support_log_awakening_stage,
+ total_league_point=self.total_league_point,
+ have_league_score=self.have_league_score,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetDefragMatchLeaguePointRankingListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetDefragMatchLeaguePointRankingListResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.ranking_user_data_size = 1 # number of arrays
+
+ self.rank = 1
+ self.user_id = "1"
+ self.store_id = "123"
+ self.store_name = "ARTEMiS"
+ self.nick_name = "PLAYER"
+ self.setting_title_id = 20005
+ self.favorite_hero_log_id = 101000010
+ self.favorite_hero_log_awakening_stage = 0
+ self.favorite_support_log_id = 0
+ self.favorite_support_log_awakening_stage = 0
+ self.class_num = 1
+ self.total_league_point = 1
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "ranking_user_data_size" / Int32ub, # big endian
+
+ "rank" / Int32ub, #int
+ "user_id_size" / Int32ub, # big endian
+ "user_id" / Int16ul[len(self.user_id)],
+ "store_id_size" / Int32ub, # big endian
+ "store_id" / Int16ul[len(self.store_id)],
+ "store_name_size" / Int32ub, # big endian
+ "store_name" / Int16ul[len(self.store_name)],
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "setting_title_id" / Int32ub, #int
+ "favorite_hero_log_id" / Int32ub, #int
+ "favorite_hero_log_awakening_stage" / Int16ub, #short
+ "favorite_support_log_id" / Int32ub, #int
+ "favorite_support_log_awakening_stage" / Int16ub, #short
+ "class_num" / Int16ub, #short
+ "total_league_point" / Int32ub, #int
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ ranking_user_data_size=self.ranking_user_data_size,
+
+ rank=self.rank,
+ user_id_size=len(self.user_id) * 2,
+ user_id=[ord(x) for x in self.user_id],
+ store_id_size=len(self.store_id) * 2,
+ store_id=[ord(x) for x in self.store_id],
+ store_name_size=len(self.store_name) * 2,
+ store_name=[ord(x) for x in self.store_name],
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ setting_title_id=self.setting_title_id,
+ favorite_hero_log_id=self.favorite_hero_log_id,
+ favorite_hero_log_awakening_stage=self.favorite_hero_log_awakening_stage,
+ favorite_support_log_id=self.favorite_support_log_id,
+ favorite_support_log_awakening_stage=self.favorite_support_log_awakening_stage,
+ class_num=self.class_num,
+ total_league_point=self.total_league_point,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoGetDefragMatchLeagueScoreRankingListRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoGetDefragMatchLeagueScoreRankingListResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+ self.ranking_user_data_size = 1 # number of arrays
+
+ self.rank = 1
+ self.user_id = "1"
+ self.store_id = "123"
+ self.store_name = "ARTEMiS"
+ self.nick_name = "PLAYER"
+ self.setting_title_id = 20005
+ self.favorite_hero_log_id = 101000010
+ self.favorite_hero_log_awakening_stage = 0
+ self.favorite_support_log_id = 0
+ self.favorite_support_log_awakening_stage = 0
+ self.class_num = 1
+ self.have_league_score = 1
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "ranking_user_data_size" / Int32ub, # big endian
+
+ "rank" / Int32ub, #int
+ "user_id_size" / Int32ub, # big endian
+ "user_id" / Int16ul[len(self.user_id)],
+ "store_id_size" / Int32ub, # big endian
+ "store_id" / Int16ul[len(self.store_id)],
+ "store_name_size" / Int32ub, # big endian
+ "store_name" / Int16ul[len(self.store_name)],
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "setting_title_id" / Int32ub, #int
+ "favorite_hero_log_id" / Int32ub, #int
+ "favorite_hero_log_awakening_stage" / Int16ub, #short
+ "favorite_support_log_id" / Int32ub, #int
+ "favorite_support_log_awakening_stage" / Int16ub, #short
+ "class_num" / Int16ub, #short
+ "have_league_score" / Int16ub, #short
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ ranking_user_data_size=self.ranking_user_data_size,
+
+ rank=self.rank,
+ user_id_size=len(self.user_id) * 2,
+ user_id=[ord(x) for x in self.user_id],
+ store_id_size=len(self.store_id) * 2,
+ store_id=[ord(x) for x in self.store_id],
+ store_name_size=len(self.store_name) * 2,
+ store_name=[ord(x) for x in self.store_name],
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+ setting_title_id=self.setting_title_id,
+ favorite_hero_log_id=self.favorite_hero_log_id,
+ favorite_hero_log_awakening_stage=self.favorite_hero_log_awakening_stage,
+ favorite_support_log_id=self.favorite_support_log_id,
+ favorite_support_log_awakening_stage=self.favorite_support_log_awakening_stage,
+ class_num=self.class_num,
+ have_league_score=self.have_league_score,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoBnidSerialCodeCheckRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoBnidSerialCodeCheckResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+
+ self.result = 1
+ self.bnid_item_id = "130050"
+ self.use_status = 0
+
+ def make(self) -> bytes:
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "bnid_item_id_size" / Int32ub, # big endian
+ "bnid_item_id" / Int16ul[len(self.bnid_item_id)],
+ "use_status" / Int8ul, # result is either 0 or 1
+ )
+
+ resp_data = resp_struct.build(dict(
+ result=self.result,
+ bnid_item_id_size=len(self.bnid_item_id) * 2,
+ bnid_item_id=[ord(x) for x in self.bnid_item_id],
+ use_status=self.use_status,
+ ))
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
+
+class SaoScanQrQuestProfileCardRequest(SaoBaseRequest):
+ def __init__(self, data: bytes) -> None:
+ super().__init__(data)
+
+class SaoScanQrQuestProfileCardResponse(SaoBaseResponse):
+ def __init__(self, cmd) -> None:
+ super().__init__(cmd)
+ self.result = 1
+
+ # read_profile_card_data
+ self.profile_card_code = "1234123412341234123" # ID of the QR code
+ self.nick_name = "PLAYER"
+ self.rank_num = 1 #short
+ self.setting_title_id = 20005 #int
+ self.skill_id = 0 #short
+ self.hero_log_hero_log_id = 118000230 #int
+ self.hero_log_log_level = 1 #short
+ self.hero_log_awakening_stage = 1 #short
+
+ self.hero_log_property1_property_id = 0 #int
+ self.hero_log_property1_value1 = 0 #int
+ self.hero_log_property1_value2 = 0 #int
+ self.hero_log_property2_property_id = 0 #int
+ self.hero_log_property2_value1 = 0 #int
+ self.hero_log_property2_value2 = 0 #int
+ self.hero_log_property3_property_id = 0 #int
+ self.hero_log_property3_value1 = 0 #int
+ self.hero_log_property3_value2 = 0 #int
+ self.hero_log_property4_property_id = 0 #int
+ self.hero_log_property4_value1 = 0 #int
+ self.hero_log_property4_value2 = 0 #int
+
+ self.main_weapon_equipment_id = 0 #int
+ self.main_weapon_enhancement_value = 0 #short
+ self.main_weapon_awakening_stage = 0 #short
+
+ self.main_weapon_property1_property_id = 0 #int
+ self.main_weapon_property1_value1 = 0 #int
+ self.main_weapon_property1_value2 = 0 #int
+ self.main_weapon_property2_property_id = 0 #int
+ self.main_weapon_property2_value1 = 0 #int
+ self.main_weapon_property2_value2 = 0 #int
+ self.main_weapon_property3_property_id = 0 #int
+ self.main_weapon_property3_value1 = 0 #int
+ self.main_weapon_property3_value2 = 0 #int
+ self.main_weapon_property4_property_id = 0 #int
+ self.main_weapon_property4_value1 = 0 #int
+ self.main_weapon_property4_value2 = 0 #int
+
+ self.sub_equipment_equipment_id = 0 #int
+ self.sub_equipment_enhancement_value = 0 #short
+ self.sub_equipment_awakening_stage = 0 #short
+
+ self.sub_equipment_property1_property_id = 0 #int
+ self.sub_equipment_property1_value1 = 0 #int
+ self.sub_equipment_property1_value2 = 0 #int
+ self.sub_equipment_property2_property_id = 0 #int
+ self.sub_equipment_property2_value1 = 0 #int
+ self.sub_equipment_property2_value2 = 0 #int
+ self.sub_equipment_property3_property_id = 0 #int
+ self.sub_equipment_property3_value1 = 0 #int
+ self.sub_equipment_property3_value2 = 0 #int
+ self.sub_equipment_property4_property_id = 0 #int
+ self.sub_equipment_property4_value1 = 0 #int
+ self.sub_equipment_property4_value2 = 0 #int
+
+ self.holographic_flag = 1 #byte
+
+ def make(self) -> bytes:
+ #new stuff
+
+ read_profile_card_data_struct = Struct(
+ "profile_card_code_size" / Int32ub, # big endian
+ "profile_card_code" / Int16ul[len(self.profile_card_code)],
+ "nick_name_size" / Int32ub, # big endian
+ "nick_name" / Int16ul[len(self.nick_name)],
+ "rank_num" / Int16ub, #short
+ "setting_title_id" / Int32ub, #int
+ "skill_id" / Int16ub, #short
+ "hero_log_hero_log_id" / Int32ub, #int
+ "hero_log_log_level" / Int16ub, #short
+ "hero_log_awakening_stage" / Int16ub, #short
+
+ "hero_log_property1_property_id" / Int32ub, #int
+ "hero_log_property1_value1" / Int32ub, #int
+ "hero_log_property1_value2" / Int32ub, #int
+ "hero_log_property2_property_id" / Int32ub, #int
+ "hero_log_property2_value1" / Int32ub, #int
+ "hero_log_property2_value2" / Int32ub, #int
+ "hero_log_property3_property_id" / Int32ub, #int
+ "hero_log_property3_value1" / Int32ub, #int
+ "hero_log_property3_value2" / Int32ub, #int
+ "hero_log_property4_property_id" / Int32ub, #int
+ "hero_log_property4_value1" / Int32ub, #int
+ "hero_log_property4_value2" / Int32ub, #int
+
+ "main_weapon_equipment_id" / Int32ub, #int
+ "main_weapon_enhancement_value" / Int16ub, #short
+ "main_weapon_awakening_stage" / Int16ub, #short
+
+ "main_weapon_property1_property_id" / Int32ub, #int
+ "main_weapon_property1_value1" / Int32ub, #int
+ "main_weapon_property1_value2" / Int32ub, #int
+ "main_weapon_property2_property_id" / Int32ub, #int
+ "main_weapon_property2_value1" / Int32ub, #int
+ "main_weapon_property2_value2" / Int32ub, #int
+ "main_weapon_property3_property_id" / Int32ub, #int
+ "main_weapon_property3_value1" / Int32ub, #int
+ "main_weapon_property3_value2" / Int32ub, #int
+ "main_weapon_property4_property_id" / Int32ub, #int
+ "main_weapon_property4_value1" / Int32ub, #int
+ "main_weapon_property4_value2" / Int32ub, #int
+
+ "sub_equipment_equipment_id" / Int32ub, #int
+ "sub_equipment_enhancement_value" / Int16ub, #short
+ "sub_equipment_awakening_stage" / Int16ub, #short
+
+ "sub_equipment_property1_property_id" / Int32ub, #int
+ "sub_equipment_property1_value1" / Int32ub, #int
+ "sub_equipment_property1_value2" / Int32ub, #int
+ "sub_equipment_property2_property_id" / Int32ub, #int
+ "sub_equipment_property2_value1" / Int32ub, #int
+ "sub_equipment_property2_value2" / Int32ub, #int
+ "sub_equipment_property3_property_id" / Int32ub, #int
+ "sub_equipment_property3_value1" / Int32ub, #int
+ "sub_equipment_property3_value2" / Int32ub, #int
+ "sub_equipment_property4_property_id" / Int32ub, #int
+ "sub_equipment_property4_value1" / Int32ub, #int
+ "sub_equipment_property4_value2" / Int32ub, #int
+
+ "holographic_flag" / Int8ul, # result is either 0 or 1
+
+ )
+
+ # create a resp struct
+ resp_struct = Struct(
+ "result" / Int8ul, # result is either 0 or 1
+ "read_profile_card_data_size" / Rebuild(Int32ub, len_(this.read_profile_card_data)), # big endian
+ "read_profile_card_data" / Array(this.read_profile_card_data_size, read_profile_card_data_struct),
+ )
+
+ resp_data = resp_struct.parse(resp_struct.build(dict(
+ result=self.result,
+ read_profile_card_data_size=0,
+ read_profile_card_data=[],
+ )))
+
+ hero_data = dict(
+ profile_card_code_size=len(self.profile_card_code) * 2,
+ profile_card_code=[ord(x) for x in self.profile_card_code],
+ nick_name_size=len(self.nick_name) * 2,
+ nick_name=[ord(x) for x in self.nick_name],
+
+ rank_num=self.rank_num,
+ setting_title_id=self.setting_title_id,
+ skill_id=self.skill_id,
+ hero_log_hero_log_id=self.hero_log_hero_log_id,
+ hero_log_log_level=self.hero_log_log_level,
+ hero_log_awakening_stage=self.hero_log_awakening_stage,
+
+ hero_log_property1_property_id=self.hero_log_property1_property_id,
+ hero_log_property1_value1=self.hero_log_property1_value1,
+ hero_log_property1_value2=self.hero_log_property1_value2,
+ hero_log_property2_property_id=self.hero_log_property2_property_id,
+ hero_log_property2_value1=self.hero_log_property2_value1,
+ hero_log_property2_value2=self.hero_log_property2_value2,
+ hero_log_property3_property_id=self.hero_log_property3_property_id,
+ hero_log_property3_value1=self.hero_log_property3_value1,
+ hero_log_property3_value2=self.hero_log_property3_value2,
+ hero_log_property4_property_id=self.hero_log_property4_property_id,
+ hero_log_property4_value1=self.hero_log_property4_value1,
+ hero_log_property4_value2=self.hero_log_property4_value2,
+
+ main_weapon_equipment_id=self.main_weapon_equipment_id,
+ main_weapon_enhancement_value=self.main_weapon_enhancement_value,
+ main_weapon_awakening_stage=self.main_weapon_awakening_stage,
+
+ main_weapon_property1_property_id=self.main_weapon_property1_property_id,
+ main_weapon_property1_value1=self.main_weapon_property1_value1,
+ main_weapon_property1_value2=self.main_weapon_property1_value2,
+ main_weapon_property2_property_id=self.main_weapon_property2_property_id,
+ main_weapon_property2_value1=self.main_weapon_property2_value1,
+ main_weapon_property2_value2=self.main_weapon_property2_value2,
+ main_weapon_property3_property_id=self.main_weapon_property3_property_id,
+ main_weapon_property3_value1=self.main_weapon_property3_value1,
+ main_weapon_property3_value2=self.main_weapon_property3_value2,
+ main_weapon_property4_property_id=self.main_weapon_property4_property_id,
+ main_weapon_property4_value1=self.main_weapon_property4_value1,
+ main_weapon_property4_value2=self.main_weapon_property4_value2,
+
+ sub_equipment_equipment_id=self.sub_equipment_equipment_id,
+ sub_equipment_enhancement_value=self.sub_equipment_enhancement_value,
+ sub_equipment_awakening_stage=self.sub_equipment_awakening_stage,
+
+ sub_equipment_property1_property_id=self.sub_equipment_property1_property_id,
+ sub_equipment_property1_value1=self.sub_equipment_property1_value1,
+ sub_equipment_property1_value2=self.sub_equipment_property1_value2,
+ sub_equipment_property2_property_id=self.sub_equipment_property2_property_id,
+ sub_equipment_property2_value1=self.sub_equipment_property2_value1,
+ sub_equipment_property2_value2=self.sub_equipment_property2_value2,
+ sub_equipment_property3_property_id=self.sub_equipment_property3_property_id,
+ sub_equipment_property3_value1=self.sub_equipment_property3_value1,
+ sub_equipment_property3_value2=self.sub_equipment_property3_value2,
+ sub_equipment_property4_property_id=self.sub_equipment_property4_property_id,
+ sub_equipment_property4_value1=self.sub_equipment_property4_value1,
+ sub_equipment_property4_value2=self.sub_equipment_property4_value2,
+
+ holographic_flag=self.holographic_flag,
+ )
+
+ resp_data.read_profile_card_data.append(hero_data)
+
+ # finally, rebuild the resp_data
+ resp_data = resp_struct.build(resp_data)
+
+ self.length = len(resp_data)
+ return super().make() + resp_data
\ No newline at end of file
diff --git a/titles/sao/index.py b/titles/sao/index.py
new file mode 100644
index 0000000..ef0bf89
--- /dev/null
+++ b/titles/sao/index.py
@@ -0,0 +1,117 @@
+from typing import Tuple
+from twisted.web.http import Request
+from twisted.web import resource
+import json, ast
+from datetime import datetime
+import yaml
+import logging, coloredlogs
+from logging.handlers import TimedRotatingFileHandler
+import inflection
+from os import path
+
+from core import CoreConfig, Utils
+from titles.sao.config import SaoConfig
+from titles.sao.const import SaoConstants
+from titles.sao.base import SaoBase
+from titles.sao.handlers.base import *
+
+
+class SaoServlet(resource.Resource):
+ def __init__(self, core_cfg: CoreConfig, cfg_dir: str) -> None:
+ self.isLeaf = True
+ self.core_cfg = core_cfg
+ self.config_dir = cfg_dir
+ self.game_cfg = SaoConfig()
+ if path.exists(f"{cfg_dir}/sao.yaml"):
+ self.game_cfg.update(yaml.safe_load(open(f"{cfg_dir}/sao.yaml")))
+
+ self.logger = logging.getLogger("sao")
+ if not hasattr(self.logger, "inited"):
+ log_fmt_str = "[%(asctime)s] SAO | %(levelname)s | %(message)s"
+ log_fmt = logging.Formatter(log_fmt_str)
+ fileHandler = TimedRotatingFileHandler(
+ "{0}/{1}.log".format(self.core_cfg.server.log_dir, "sao"),
+ encoding="utf8",
+ when="d",
+ backupCount=10,
+ )
+
+ fileHandler.setFormatter(log_fmt)
+
+ consoleHandler = logging.StreamHandler()
+ consoleHandler.setFormatter(log_fmt)
+
+ self.logger.addHandler(fileHandler)
+ self.logger.addHandler(consoleHandler)
+
+ self.logger.setLevel(self.game_cfg.server.loglevel)
+ coloredlogs.install(
+ level=self.game_cfg.server.loglevel, logger=self.logger, fmt=log_fmt_str
+ )
+ self.logger.inited = True
+
+ self.base = SaoBase(core_cfg, self.game_cfg)
+
+ @classmethod
+ def get_allnet_info(
+ cls, game_code: str, core_cfg: CoreConfig, cfg_dir: str
+ ) -> Tuple[bool, str, str]:
+ game_cfg = SaoConfig()
+
+ if path.exists(f"{cfg_dir}/{SaoConstants.CONFIG_NAME}"):
+ game_cfg.update(
+ yaml.safe_load(open(f"{cfg_dir}/{SaoConstants.CONFIG_NAME}"))
+ )
+
+ if not game_cfg.server.enable:
+ return (False, "", "")
+
+ return (
+ True,
+ f"http://{game_cfg.server.hostname}:{game_cfg.server.port}/{game_code}/$v/",
+ f"{game_cfg.server.hostname}/SDEW/$v/",
+ )
+
+ @classmethod
+ def get_mucha_info(
+ cls, core_cfg: CoreConfig, cfg_dir: str
+ ) -> Tuple[bool, str, str]:
+ game_cfg = SaoConfig()
+
+ if path.exists(f"{cfg_dir}/{SaoConstants.CONFIG_NAME}"):
+ game_cfg.update(
+ yaml.safe_load(open(f"{cfg_dir}/{SaoConstants.CONFIG_NAME}"))
+ )
+
+ if not game_cfg.server.enable:
+ return (False, "")
+
+ return (True, "SAO1")
+
+ def setup(self) -> None:
+ pass
+
+ def render_POST(
+ self, request: Request, version: int = 0, endpoints: str = ""
+ ) -> bytes:
+ req_url = request.uri.decode()
+ if req_url == "/matching":
+ self.logger.info("Matching request")
+
+ request.responseHeaders.addRawHeader(b"content-type", b"text/html; charset=utf-8")
+
+ sao_request = request.content.getvalue().hex()
+
+ handler = getattr(self.base, f"handle_{sao_request[:4]}", None)
+ if handler is None:
+ self.logger.info(f"Generic Handler for {req_url} - {sao_request[:4]}")
+ self.logger.debug(f"Request: {request.content.getvalue().hex()}")
+ resp = SaoNoopResponse(int.from_bytes(bytes.fromhex(sao_request[:4]), "big")+1)
+ self.logger.debug(f"Response: {resp.make().hex()}")
+ return resp.make()
+
+ self.logger.info(f"Handler {req_url} - {sao_request[:4]} request")
+ self.logger.debug(f"Request: {request.content.getvalue().hex()}")
+ resp = handler(sao_request)
+ self.logger.debug(f"Response: {resp.hex()}")
+ return resp
\ No newline at end of file
diff --git a/titles/sao/read.py b/titles/sao/read.py
new file mode 100644
index 0000000..649fa02
--- /dev/null
+++ b/titles/sao/read.py
@@ -0,0 +1,254 @@
+from typing import Optional, Dict, List
+from os import walk, path
+import urllib
+import csv
+
+from read import BaseReader
+from core.config import CoreConfig
+from titles.sao.database import SaoData
+from titles.sao.const import SaoConstants
+
+
+class SaoReader(BaseReader):
+ def __init__(
+ self,
+ config: CoreConfig,
+ version: int,
+ bin_arg: Optional[str],
+ opt_arg: Optional[str],
+ extra: Optional[str],
+ ) -> None:
+ super().__init__(config, version, bin_arg, opt_arg, extra)
+ self.data = SaoData(config)
+
+ try:
+ self.logger.info(
+ f"Start importer for {SaoConstants.game_ver_to_string(version)}"
+ )
+ except IndexError:
+ self.logger.error(f"Invalid project SAO version {version}")
+ exit(1)
+
+ def read(self) -> None:
+ pull_bin_ram = True
+
+ if not path.exists(f"{self.bin_dir}"):
+ self.logger.warn(f"Couldn't find csv file in {self.bin_dir}, skipping")
+ pull_bin_ram = False
+
+ if pull_bin_ram:
+ self.read_csv(f"{self.bin_dir}")
+
+ def read_csv(self, bin_dir: str) -> None:
+ self.logger.info(f"Read csv from {bin_dir}")
+
+ self.logger.info("Now reading QuestScene.csv")
+ try:
+ fullPath = bin_dir + "/QuestScene.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ questSceneId = row["QuestSceneId"]
+ sortNo = row["SortNo"]
+ name = row["Name"]
+ enabled = True
+
+ self.logger.info(f"Added quest {questSceneId} | Name: {name}")
+
+ try:
+ self.data.static.put_quest(
+ questSceneId,
+ 0,
+ sortNo,
+ name,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
+
+ self.logger.info("Now reading HeroLog.csv")
+ try:
+ fullPath = bin_dir + "/HeroLog.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ heroLogId = row["HeroLogId"]
+ name = row["Name"]
+ nickname = row["Nickname"]
+ rarity = row["Rarity"]
+ skillTableSubId = row["SkillTableSubId"]
+ awakeningExp = row["AwakeningExp"]
+ flavorText = row["FlavorText"]
+ enabled = True
+
+ self.logger.info(f"Added hero {heroLogId} | Name: {name}")
+
+ try:
+ self.data.static.put_hero(
+ 0,
+ heroLogId,
+ name,
+ nickname,
+ rarity,
+ skillTableSubId,
+ awakeningExp,
+ flavorText,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
+
+ self.logger.info("Now reading Equipment.csv")
+ try:
+ fullPath = bin_dir + "/Equipment.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ equipmentId = row["EquipmentId"]
+ equipmentType = row["EquipmentType"]
+ weaponTypeId = row["WeaponTypeId"]
+ name = row["Name"]
+ rarity = row["Rarity"]
+ flavorText = row["FlavorText"]
+ enabled = True
+
+ self.logger.info(f"Added equipment {equipmentId} | Name: {name}")
+
+ try:
+ self.data.static.put_equipment(
+ 0,
+ equipmentId,
+ name,
+ equipmentType,
+ weaponTypeId,
+ rarity,
+ flavorText,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
+
+ self.logger.info("Now reading Item.csv")
+ try:
+ fullPath = bin_dir + "/Item.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ itemId = row["ItemId"]
+ itemTypeId = row["ItemTypeId"]
+ name = row["Name"]
+ rarity = row["Rarity"]
+ flavorText = row["FlavorText"]
+ enabled = True
+
+ self.logger.info(f"Added item {itemId} | Name: {name}")
+
+ try:
+ self.data.static.put_item(
+ 0,
+ itemId,
+ name,
+ itemTypeId,
+ rarity,
+ flavorText,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
+
+ self.logger.info("Now reading SupportLog.csv")
+ try:
+ fullPath = bin_dir + "/SupportLog.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ supportLogId = row["SupportLogId"]
+ charaId = row["CharaId"]
+ name = row["Name"]
+ rarity = row["Rarity"]
+ salePrice = row["SalePrice"]
+ skillName = row["SkillName"]
+ enabled = True
+
+ self.logger.info(f"Added support log {supportLogId} | Name: {name}")
+
+ try:
+ self.data.static.put_support_log(
+ 0,
+ supportLogId,
+ charaId,
+ name,
+ rarity,
+ salePrice,
+ skillName,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
+
+ self.logger.info("Now reading Title.csv")
+ try:
+ fullPath = bin_dir + "/Title.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ titleId = row["TitleId"]
+ displayName = row["DisplayName"]
+ requirement = row["Requirement"]
+ rank = row["Rank"]
+ imageFilePath = row["ImageFilePath"]
+ enabled = True
+
+ self.logger.info(f"Added title {titleId} | Name: {displayName}")
+
+ if len(titleId) > 5:
+ try:
+ self.data.static.put_title(
+ 0,
+ titleId,
+ displayName,
+ requirement,
+ rank,
+ imageFilePath,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ elif len(titleId) < 6: # current server code cannot have multiple lengths for the id
+ continue
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
+
+ self.logger.info("Now reading RareDropTable.csv")
+ try:
+ fullPath = bin_dir + "/RareDropTable.csv"
+ with open(fullPath, encoding="UTF-8") as fp:
+ reader = csv.DictReader(fp)
+ for row in reader:
+ questRareDropId = row["QuestRareDropId"]
+ commonRewardId = row["CommonRewardId"]
+ enabled = True
+
+ self.logger.info(f"Added rare drop {questRareDropId} | Reward: {commonRewardId}")
+
+ try:
+ self.data.static.put_rare_drop(
+ 0,
+ questRareDropId,
+ commonRewardId,
+ enabled
+ )
+ except Exception as err:
+ print(err)
+ except Exception:
+ self.logger.warn(f"Couldn't read csv file in {self.bin_dir}, skipping")
diff --git a/titles/sao/schema/__init__.py b/titles/sao/schema/__init__.py
new file mode 100644
index 0000000..3e75fc0
--- /dev/null
+++ b/titles/sao/schema/__init__.py
@@ -0,0 +1,3 @@
+from .profile import SaoProfileData
+from .static import SaoStaticData
+from .item import SaoItemData
\ No newline at end of file
diff --git a/titles/sao/schema/item.py b/titles/sao/schema/item.py
new file mode 100644
index 0000000..11adf27
--- /dev/null
+++ b/titles/sao/schema/item.py
@@ -0,0 +1,506 @@
+from typing import Optional, Dict, List
+from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_, case
+from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON
+from sqlalchemy.schema import ForeignKey
+from sqlalchemy.sql import func, select, update, delete
+from sqlalchemy.engine import Row
+from sqlalchemy.dialects.mysql import insert
+
+from core.data.schema import BaseData, metadata
+
+equipment_data = Table(
+ "sao_equipment_data",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("equipment_id", Integer, nullable=False),
+ Column("enhancement_value", Integer, nullable=False),
+ Column("enhancement_exp", Integer, nullable=False),
+ Column("awakening_exp", Integer, nullable=False),
+ Column("awakening_stage", Integer, nullable=False),
+ Column("possible_awakening_flag", Integer, nullable=False),
+ Column("get_date", TIMESTAMP, nullable=False, server_default=func.now()),
+ UniqueConstraint("user", "equipment_id", name="sao_equipment_data_uk"),
+ mysql_charset="utf8mb4",
+)
+
+item_data = Table(
+ "sao_item_data",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("item_id", Integer, nullable=False),
+ Column("get_date", TIMESTAMP, nullable=False, server_default=func.now()),
+ UniqueConstraint("user", "item_id", name="sao_item_data_uk"),
+ mysql_charset="utf8mb4",
+)
+
+hero_log_data = Table(
+ "sao_hero_log_data",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("user_hero_log_id", Integer, nullable=False),
+ Column("log_level", Integer, nullable=False),
+ Column("log_exp", Integer, nullable=False),
+ Column("main_weapon", Integer, nullable=False),
+ Column("sub_equipment", Integer, nullable=False),
+ Column("skill_slot1_skill_id", Integer, nullable=False),
+ Column("skill_slot2_skill_id", Integer, nullable=False),
+ Column("skill_slot3_skill_id", Integer, nullable=False),
+ Column("skill_slot4_skill_id", Integer, nullable=False),
+ Column("skill_slot5_skill_id", Integer, nullable=False),
+ Column("get_date", TIMESTAMP, nullable=False, server_default=func.now()),
+ UniqueConstraint("user", "user_hero_log_id", name="sao_hero_log_data_uk"),
+ mysql_charset="utf8mb4",
+)
+
+hero_party = Table(
+ "sao_hero_party",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("user_party_team_id", Integer, nullable=False),
+ Column("user_hero_log_id_1", Integer, nullable=False),
+ Column("user_hero_log_id_2", Integer, nullable=False),
+ Column("user_hero_log_id_3", Integer, nullable=False),
+ UniqueConstraint("user", "user_party_team_id", name="sao_hero_party_uk"),
+ mysql_charset="utf8mb4",
+)
+
+quest = Table(
+ "sao_player_quest",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("episode_id", Integer, nullable=False),
+ Column("quest_clear_flag", Boolean, nullable=False),
+ Column("clear_time", Integer, nullable=False),
+ Column("combo_num", Integer, nullable=False),
+ Column("total_damage", Integer, nullable=False),
+ Column("concurrent_destroying_num", Integer, nullable=False),
+ Column("play_date", TIMESTAMP, nullable=False, server_default=func.now()),
+ UniqueConstraint("user", "episode_id", name="sao_player_quest_uk"),
+ mysql_charset="utf8mb4",
+)
+
+sessions = Table(
+ "sao_play_sessions",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("user_party_team_id", Integer, nullable=False),
+ Column("episode_id", Integer, nullable=False),
+ Column("play_mode", Integer, nullable=False),
+ Column("quest_drop_boost_apply_flag", Integer, nullable=False),
+ Column("play_date", TIMESTAMP, nullable=False, server_default=func.now()),
+ UniqueConstraint("user", "user_party_team_id", "play_date", name="sao_play_sessions_uk"),
+ mysql_charset="utf8mb4",
+)
+
+end_sessions = Table(
+ "sao_end_sessions",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ ),
+ Column("quest_id", Integer, nullable=False),
+ Column("play_result_flag", Boolean, nullable=False),
+ Column("reward_data", JSON, nullable=True),
+ Column("play_date", TIMESTAMP, nullable=False, server_default=func.now()),
+ mysql_charset="utf8mb4",
+)
+
+class SaoItemData(BaseData):
+ def create_session(self, user_id: int, user_party_team_id: int, episode_id: int, play_mode: int, quest_drop_boost_apply_flag: int) -> Optional[int]:
+ sql = insert(sessions).values(
+ user=user_id,
+ user_party_team_id=user_party_team_id,
+ episode_id=episode_id,
+ play_mode=play_mode,
+ quest_drop_boost_apply_flag=quest_drop_boost_apply_flag
+ )
+
+ conflict = sql.on_duplicate_key_update(user=user_id)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(f"Failed to create SAO session for user {user_id}!")
+ return None
+ return result.lastrowid
+
+ def create_end_session(self, user_id: int, quest_id: int, play_result_flag: bool, reward_data: JSON) -> Optional[int]:
+ sql = insert(end_sessions).values(
+ user=user_id,
+ quest_id=quest_id,
+ play_result_flag=play_result_flag,
+ reward_data=reward_data,
+ )
+
+ conflict = sql.on_duplicate_key_update(user=user_id)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(f"Failed to create SAO end session for user {user_id}!")
+ return None
+ return result.lastrowid
+
+ def put_item(self, user_id: int, item_id: int) -> Optional[int]:
+ sql = insert(item_data).values(
+ user=user_id,
+ item_id=item_id,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ item_id=item_id,
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to insert item! user: {user_id}, item_id: {item_id}"
+ )
+ return None
+
+ return result.lastrowid
+
+ def put_equipment_data(self, user_id: int, equipment_id: int, enhancement_value: int, enhancement_exp: int, awakening_exp: int, awakening_stage: int, possible_awakening_flag: int) -> Optional[int]:
+ sql = insert(equipment_data).values(
+ user=user_id,
+ equipment_id=equipment_id,
+ enhancement_value=enhancement_value,
+ enhancement_exp=enhancement_exp,
+ awakening_exp=awakening_exp,
+ awakening_stage=awakening_stage,
+ possible_awakening_flag=possible_awakening_flag,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ enhancement_value=enhancement_value,
+ enhancement_exp=enhancement_exp,
+ awakening_exp=awakening_exp,
+ awakening_stage=awakening_stage,
+ possible_awakening_flag=possible_awakening_flag,
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to insert equipment! user: {user_id}, equipment_id: {equipment_id}"
+ )
+ return None
+
+ return result.lastrowid
+
+ def put_hero_log(self, user_id: int, user_hero_log_id: int, log_level: int, log_exp: int, main_weapon: int, sub_equipment: int, skill_slot1_skill_id: int, skill_slot2_skill_id: int, skill_slot3_skill_id: int, skill_slot4_skill_id: int, skill_slot5_skill_id: int) -> Optional[int]:
+ sql = insert(hero_log_data).values(
+ user=user_id,
+ user_hero_log_id=user_hero_log_id,
+ log_level=log_level,
+ log_exp=log_exp,
+ main_weapon=main_weapon,
+ sub_equipment=sub_equipment,
+ skill_slot1_skill_id=skill_slot1_skill_id,
+ skill_slot2_skill_id=skill_slot2_skill_id,
+ skill_slot3_skill_id=skill_slot3_skill_id,
+ skill_slot4_skill_id=skill_slot4_skill_id,
+ skill_slot5_skill_id=skill_slot5_skill_id,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ log_level=log_level,
+ log_exp=log_exp,
+ main_weapon=main_weapon,
+ sub_equipment=sub_equipment,
+ skill_slot1_skill_id=skill_slot1_skill_id,
+ skill_slot2_skill_id=skill_slot2_skill_id,
+ skill_slot3_skill_id=skill_slot3_skill_id,
+ skill_slot4_skill_id=skill_slot4_skill_id,
+ skill_slot5_skill_id=skill_slot5_skill_id,
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to insert hero! user: {user_id}, user_hero_log_id: {user_hero_log_id}"
+ )
+ return None
+
+ return result.lastrowid
+
+ def put_hero_party(self, user_id: int, user_party_team_id: int, user_hero_log_id_1: int, user_hero_log_id_2: int, user_hero_log_id_3: int) -> Optional[int]:
+ sql = insert(hero_party).values(
+ user=user_id,
+ user_party_team_id=user_party_team_id,
+ user_hero_log_id_1=user_hero_log_id_1,
+ user_hero_log_id_2=user_hero_log_id_2,
+ user_hero_log_id_3=user_hero_log_id_3,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ user_hero_log_id_1=user_hero_log_id_1,
+ user_hero_log_id_2=user_hero_log_id_2,
+ user_hero_log_id_3=user_hero_log_id_3,
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to insert hero party! user: {user_id}, user_party_team_id: {user_party_team_id}"
+ )
+ return None
+
+ return result.lastrowid
+
+ def put_player_quest(self, user_id: int, episode_id: int, quest_clear_flag: bool, clear_time: int, combo_num: int, total_damage: int, concurrent_destroying_num: int) -> Optional[int]:
+ sql = insert(quest).values(
+ user=user_id,
+ episode_id=episode_id,
+ quest_clear_flag=quest_clear_flag,
+ clear_time=clear_time,
+ combo_num=combo_num,
+ total_damage=total_damage,
+ concurrent_destroying_num=concurrent_destroying_num
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ quest_clear_flag=quest_clear_flag,
+ clear_time=clear_time,
+ combo_num=combo_num,
+ total_damage=total_damage,
+ concurrent_destroying_num=concurrent_destroying_num
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to insert quest! user: {user_id}, episode_id: {episode_id}"
+ )
+ return None
+
+ return result.lastrowid
+
+ def get_user_equipment(self, user_id: int, equipment_id: int) -> Optional[Dict]:
+ sql = equipment_data.select(equipment_data.c.user == user_id and equipment_data.c.equipment_id == equipment_id)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_user_equipments(
+ self, user_id: int
+ ) -> Optional[List[Row]]:
+ """
+ A catch-all equipments lookup given a profile
+ """
+ sql = equipment_data.select(
+ and_(
+ equipment_data.c.user == user_id,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
+ def get_user_items(
+ self, user_id: int
+ ) -> Optional[List[Row]]:
+ """
+ A catch-all items lookup given a profile
+ """
+ sql = item_data.select(
+ and_(
+ item_data.c.user == user_id,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
+ def get_hero_log(
+ self, user_id: int, user_hero_log_id: int = None
+ ) -> Optional[List[Row]]:
+ """
+ A catch-all hero lookup given a profile and user_party_team_id and ID specifiers
+ """
+ sql = hero_log_data.select(
+ and_(
+ hero_log_data.c.user == user_id,
+ hero_log_data.c.user_hero_log_id == user_hero_log_id if user_hero_log_id is not None else True,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_hero_logs(
+ self, user_id: int
+ ) -> Optional[List[Row]]:
+ """
+ A catch-all hero lookup given a profile
+ """
+ sql = hero_log_data.select(
+ and_(
+ hero_log_data.c.user == user_id,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
+ def get_hero_party(
+ self, user_id: int, user_party_team_id: int = None
+ ) -> Optional[List[Row]]:
+ sql = hero_party.select(
+ and_(
+ hero_party.c.user == user_id,
+ hero_party.c.user_party_team_id == user_party_team_id if user_party_team_id is not None else True,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_quest_log(
+ self, user_id: int, episode_id: int = None
+ ) -> Optional[List[Row]]:
+ """
+ A catch-all quest lookup given a profile and episode_id
+ """
+ sql = quest.select(
+ and_(
+ quest.c.user == user_id,
+ quest.c.episode_id == episode_id if episode_id is not None else True,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_quest_logs(
+ self, user_id: int
+ ) -> Optional[List[Row]]:
+ """
+ A catch-all quest lookup given a profile
+ """
+ sql = quest.select(
+ and_(
+ quest.c.user == user_id,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchall()
+
+ def get_session(
+ self, user_id: int = None
+ ) -> Optional[List[Row]]:
+ sql = sessions.select(
+ and_(
+ sessions.c.user == user_id,
+ )
+ ).order_by(
+ sessions.c.play_date.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_end_session(
+ self, user_id: int = None
+ ) -> Optional[List[Row]]:
+ sql = end_sessions.select(
+ and_(
+ end_sessions.c.user == user_id,
+ )
+ ).order_by(
+ end_sessions.c.play_date.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def remove_hero_log(self, user_id: int, user_hero_log_id: int) -> None:
+ sql = hero_log_data.delete(
+ and_(
+ hero_log_data.c.user == user_id,
+ hero_log_data.c.user_hero_log_id == user_hero_log_id,
+ )
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to remove hero log! profile: {user_id}, user_hero_log_id: {user_hero_log_id}"
+ )
+ return None
+
+ def remove_equipment(self, user_id: int, equipment_id: int) -> None:
+ sql = equipment_data.delete(
+ and_(equipment_data.c.user == user_id, equipment_data.c.equipment_id == equipment_id)
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to remove equipment! profile: {user_id}, equipment_id: {equipment_id}"
+ )
+ return None
+
+ def remove_item(self, user_id: int, item_id: int) -> None:
+ sql = item_data.delete(
+ and_(item_data.c.user == user_id, item_data.c.item_id == item_id)
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to remove item! profile: {user_id}, item_id: {item_id}"
+ )
+ return None
\ No newline at end of file
diff --git a/titles/sao/schema/profile.py b/titles/sao/schema/profile.py
new file mode 100644
index 0000000..b125717
--- /dev/null
+++ b/titles/sao/schema/profile.py
@@ -0,0 +1,80 @@
+from typing import Optional, Dict, List
+from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_, case
+from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON
+from sqlalchemy.schema import ForeignKey
+from sqlalchemy.sql import func, select, update, delete
+from sqlalchemy.engine import Row
+from sqlalchemy.dialects.mysql import insert
+
+from core.data.schema import BaseData, metadata
+from ..const import SaoConstants
+
+profile = Table(
+ "sao_profile",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column(
+ "user",
+ ForeignKey("aime_user.id", ondelete="cascade", onupdate="cascade"),
+ nullable=False,
+ unique=True,
+ ),
+ Column("user_type", Integer, server_default="1"),
+ Column("nick_name", String(16), server_default="PLAYER"),
+ Column("rank_num", Integer, server_default="1"),
+ Column("rank_exp", Integer, server_default="0"),
+ Column("own_col", Integer, server_default="0"),
+ Column("own_vp", Integer, server_default="0"),
+ Column("own_yui_medal", Integer, server_default="0"),
+ Column("setting_title_id", Integer, server_default="20005"),
+)
+
+class SaoProfileData(BaseData):
+ def create_profile(self, user_id: int) -> Optional[int]:
+ sql = insert(profile).values(user=user_id)
+ conflict = sql.on_duplicate_key_update(user=user_id)
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(f"Failed to create SAO profile for user {user_id}!")
+ return None
+ return result.lastrowid
+
+ def put_profile(self, user_id: int, user_type: int, nick_name: str, rank_num: int, rank_exp: int, own_col: int, own_vp: int, own_yui_medal: int, setting_title_id: int) -> Optional[int]:
+ sql = insert(profile).values(
+ user=user_id,
+ user_type=user_type,
+ nick_name=nick_name,
+ rank_num=rank_num,
+ rank_exp=rank_exp,
+ own_col=own_col,
+ own_vp=own_vp,
+ own_yui_medal=own_yui_medal,
+ setting_title_id=setting_title_id
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ rank_num=rank_num,
+ rank_exp=rank_exp,
+ own_col=own_col,
+ own_vp=own_vp,
+ own_yui_medal=own_yui_medal,
+ setting_title_id=setting_title_id
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ self.logger.error(
+ f"{__name__} failed to insert profile! user: {user_id}"
+ )
+ return None
+
+ print(result.lastrowid)
+ return result.lastrowid
+
+ def get_profile(self, user_id: int) -> Optional[Row]:
+ sql = profile.select(profile.c.user == user_id)
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
\ No newline at end of file
diff --git a/titles/sao/schema/static.py b/titles/sao/schema/static.py
new file mode 100644
index 0000000..ce9a6a9
--- /dev/null
+++ b/titles/sao/schema/static.py
@@ -0,0 +1,368 @@
+from typing import Dict, List, Optional
+from sqlalchemy import Table, Column, UniqueConstraint, PrimaryKeyConstraint, and_
+from sqlalchemy.types import Integer, String, TIMESTAMP, Boolean, JSON, Float
+from sqlalchemy.engine.base import Connection
+from sqlalchemy.engine import Row
+from sqlalchemy.schema import ForeignKey
+from sqlalchemy.sql import func, select
+from sqlalchemy.dialects.mysql import insert
+
+from core.data.schema import BaseData, metadata
+
+quest = Table(
+ "sao_static_quest",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("questSceneId", Integer),
+ Column("sortNo", Integer),
+ Column("name", String(255)),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "questSceneId", name="sao_static_quest_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+hero = Table(
+ "sao_static_hero_list",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("heroLogId", Integer),
+ Column("name", String(255)),
+ Column("nickname", String(255)),
+ Column("rarity", Integer),
+ Column("skillTableSubId", Integer),
+ Column("awakeningExp", Integer),
+ Column("flavorText", String(255)),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "heroLogId", name="sao_static_hero_list_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+equipment = Table(
+ "sao_static_equipment_list",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("equipmentId", Integer),
+ Column("equipmentType", Integer),
+ Column("weaponTypeId", Integer),
+ Column("name", String(255)),
+ Column("rarity", Integer),
+ Column("flavorText", String(255)),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "equipmentId", name="sao_static_equipment_list_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+item = Table(
+ "sao_static_item_list",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("itemId", Integer),
+ Column("itemTypeId", Integer),
+ Column("name", String(255)),
+ Column("rarity", Integer),
+ Column("flavorText", String(255)),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "itemId", name="sao_static_item_list_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+support = Table(
+ "sao_static_support_log_list",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("supportLogId", Integer),
+ Column("charaId", Integer),
+ Column("name", String(255)),
+ Column("rarity", Integer),
+ Column("salePrice", Integer),
+ Column("skillName", String(255)),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "supportLogId", name="sao_static_support_log_list_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+rare_drop = Table(
+ "sao_static_rare_drop_list",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("questRareDropId", Integer),
+ Column("commonRewardId", Integer),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "questRareDropId", "commonRewardId", name="sao_static_rare_drop_list_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+title = Table(
+ "sao_static_title_list",
+ metadata,
+ Column("id", Integer, primary_key=True, nullable=False),
+ Column("version", Integer),
+ Column("titleId", Integer),
+ Column("displayName", String(255)),
+ Column("requirement", Integer),
+ Column("rank", Integer),
+ Column("imageFilePath", String(255)),
+ Column("enabled", Boolean),
+ UniqueConstraint(
+ "version", "titleId", name="sao_static_title_list_uk"
+ ),
+ mysql_charset="utf8mb4",
+)
+
+class SaoStaticData(BaseData):
+ def put_quest( self, questSceneId: int, version: int, sortNo: int, name: str, enabled: bool ) -> Optional[int]:
+ sql = insert(quest).values(
+ questSceneId=questSceneId,
+ version=version,
+ sortNo=sortNo,
+ name=name,
+ tutorial=tutorial,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ name=name, questSceneId=questSceneId, version=version
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def put_hero( self, version: int, heroLogId: int, name: str, nickname: str, rarity: int, skillTableSubId: int, awakeningExp: int, flavorText: str, enabled: bool ) -> Optional[int]:
+ sql = insert(hero).values(
+ version=version,
+ heroLogId=heroLogId,
+ name=name,
+ nickname=nickname,
+ rarity=rarity,
+ skillTableSubId=skillTableSubId,
+ awakeningExp=awakeningExp,
+ flavorText=flavorText,
+ enabled=enabled
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ name=name, heroLogId=heroLogId
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def put_equipment( self, version: int, equipmentId: int, name: str, equipmentType: int, weaponTypeId:int, rarity: int, flavorText: str, enabled: bool ) -> Optional[int]:
+ sql = insert(equipment).values(
+ version=version,
+ equipmentId=equipmentId,
+ name=name,
+ equipmentType=equipmentType,
+ weaponTypeId=weaponTypeId,
+ rarity=rarity,
+ flavorText=flavorText,
+ enabled=enabled
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ name=name, equipmentId=equipmentId
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def put_item( self, version: int, itemId: int, name: str, itemTypeId: int, rarity: int, flavorText: str, enabled: bool ) -> Optional[int]:
+ sql = insert(item).values(
+ version=version,
+ itemId=itemId,
+ name=name,
+ itemTypeId=itemTypeId,
+ rarity=rarity,
+ flavorText=flavorText,
+ enabled=enabled
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ name=name, itemId=itemId
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def put_support_log( self, version: int, supportLogId: int, charaId: int, name: str, rarity: int, salePrice: int, skillName: str, enabled: bool ) -> Optional[int]:
+ sql = insert(support).values(
+ version=version,
+ supportLogId=supportLogId,
+ charaId=charaId,
+ name=name,
+ rarity=rarity,
+ salePrice=salePrice,
+ skillName=skillName,
+ enabled=enabled
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ name=name, supportLogId=supportLogId
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def put_rare_drop( self, version: int, questRareDropId: int, commonRewardId: int, enabled: bool ) -> Optional[int]:
+ sql = insert(rare_drop).values(
+ version=version,
+ questRareDropId=questRareDropId,
+ commonRewardId=commonRewardId,
+ enabled=enabled,
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ questRareDropId=questRareDropId, commonRewardId=commonRewardId, version=version
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def put_title( self, version: int, titleId: int, displayName: str, requirement: int, rank: int, imageFilePath: str, enabled: bool ) -> Optional[int]:
+ sql = insert(title).values(
+ version=version,
+ titleId=titleId,
+ displayName=displayName,
+ requirement=requirement,
+ rank=rank,
+ imageFilePath=imageFilePath,
+ enabled=enabled
+ )
+
+ conflict = sql.on_duplicate_key_update(
+ displayName=displayName, titleId=titleId
+ )
+
+ result = self.execute(conflict)
+ if result is None:
+ return None
+ return result.lastrowid
+
+ def get_quests_id(self, sortNo: int) -> Optional[Dict]:
+ sql = quest.select(quest.c.sortNo == sortNo)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_quests_ids(self, version: int, enabled: bool) -> Optional[List[Dict]]:
+ sql = quest.select(quest.c.version == version and quest.c.enabled == enabled).order_by(
+ quest.c.questSceneId.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return [list[2] for list in result.fetchall()]
+
+ def get_hero_id(self, heroLogId: int) -> Optional[Dict]:
+ sql = hero.select(hero.c.heroLogId == heroLogId)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_hero_ids(self, version: int, enabled: bool) -> Optional[List[Dict]]:
+ sql = hero.select(hero.c.version == version and hero.c.enabled == enabled).order_by(
+ hero.c.heroLogId.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return [list[2] for list in result.fetchall()]
+
+ def get_equipment_id(self, equipmentId: int) -> Optional[Dict]:
+ sql = equipment.select(equipment.c.equipmentId == equipmentId)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_equipment_ids(self, version: int, enabled: bool) -> Optional[List[Dict]]:
+ sql = equipment.select(equipment.c.version == version and equipment.c.enabled == enabled).order_by(
+ equipment.c.equipmentId.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return [list[2] for list in result.fetchall()]
+
+ def get_item_id(self, itemId: int) -> Optional[Dict]:
+ sql = item.select(item.c.itemId == itemId)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_rare_drop_id(self, questRareDropId: int) -> Optional[Dict]:
+ sql = rare_drop.select(rare_drop.c.questRareDropId == questRareDropId)
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return result.fetchone()
+
+ def get_item_ids(self, version: int, enabled: bool) -> Optional[List[Dict]]:
+ sql = item.select(item.c.version == version and item.c.enabled == enabled).order_by(
+ item.c.itemId.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return [list[2] for list in result.fetchall()]
+
+ def get_support_log_ids(self, version: int, enabled: bool) -> Optional[List[Dict]]:
+ sql = support.select(support.c.version == version and support.c.enabled == enabled).order_by(
+ support.c.supportLogId.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return [list[2] for list in result.fetchall()]
+
+ def get_title_ids(self, version: int, enabled: bool) -> Optional[List[Dict]]:
+ sql = title.select(title.c.version == version and title.c.enabled == enabled).order_by(
+ title.c.titleId.asc()
+ )
+
+ result = self.execute(sql)
+ if result is None:
+ return None
+ return [list[2] for list in result.fetchall()]
\ No newline at end of file
diff --git a/titles/wacca/base.py b/titles/wacca/base.py
index ada40c6..2351001 100644
--- a/titles/wacca/base.py
+++ b/titles/wacca/base.py
@@ -426,7 +426,7 @@ class WaccaBase:
elif item["type"] == WaccaConstants.ITEM_TYPES["note_sound"]:
resp.userItems.noteSounds.append(itm_send)
- except:
+ except Exception:
self.logger.error(
f"{__name__} Failed to load item {item['item_id']} for user {profile['user']}"
)
@@ -624,10 +624,10 @@ class WaccaBase:
current_wp = profile["wp"]
tickets = self.data.item.get_tickets(user_id)
- new_tickets = []
+ new_tickets: List[TicketItem] = []
for ticket in tickets:
- new_tickets.append([ticket["id"], ticket["ticket_id"], 9999999999])
+ new_tickets.append(TicketItem(ticket["id"], ticket["ticket_id"], 9999999999))
for item in req.itemsUsed:
if (
@@ -645,11 +645,11 @@ class WaccaBase:
and not self.game_config.mods.infinite_tickets
):
for x in range(len(new_tickets)):
- if new_tickets[x][1] == item.itemId:
+ if new_tickets[x].ticketId == item.itemId:
self.logger.debug(
- f"Remove ticket ID {new_tickets[x][0]} type {new_tickets[x][1]} from {user_id}"
+ f"Remove ticket ID {new_tickets[x].userTicketId} type {new_tickets[x].ticketId} from {user_id}"
)
- self.data.item.spend_ticket(new_tickets[x][0])
+ self.data.item.spend_ticket(new_tickets[x].userTicketId)
new_tickets.pop(x)
break
@@ -1074,17 +1074,17 @@ class WaccaBase:
old_score = self.data.score.get_best_score(
user_id, item.itemId, item.quantity
)
- if not old_score:
- self.data.score.put_best_score(
- user_id,
- item.itemId,
- item.quantity,
- 0,
- [0] * 5,
- [0] * 13,
- 0,
- 0,
- )
+ if not old_score:
+ self.data.score.put_best_score(
+ user_id,
+ item.itemId,
+ item.quantity,
+ 0,
+ [0] * 5,
+ [0] * 13,
+ 0,
+ 0,
+ )
if item.quantity == 0:
item.quantity = WaccaConstants.Difficulty.HARD.value
diff --git a/titles/wacca/const.py b/titles/wacca/const.py
index 284d236..b25d3ac 100644
--- a/titles/wacca/const.py
+++ b/titles/wacca/const.py
@@ -221,5 +221,5 @@ class WaccaConstants:
cls.Region.YAMANASHI,
cls.Region.WAKAYAMA,
][region]
- except:
+ except Exception:
return None
diff --git a/titles/wacca/frontend.py b/titles/wacca/frontend.py
index 69ab1ee..cc40644 100644
--- a/titles/wacca/frontend.py
+++ b/titles/wacca/frontend.py
@@ -2,8 +2,9 @@ import yaml
import jinja2
from twisted.web.http import Request
from os import path
+from twisted.web.server import Session
-from core.frontend import FE_Base
+from core.frontend import FE_Base, IUserSession
from core.config import CoreConfig
from titles.wacca.database import WaccaData
from titles.wacca.config import WaccaConfig
@@ -27,7 +28,11 @@ class WaccaFrontend(FE_Base):
template = self.environment.get_template(
"titles/wacca/frontend/wacca_index.jinja"
)
+ sesh: Session = request.getSession()
+ usr_sesh = IUserSession(sesh)
+
return template.render(
title=f"{self.core_config.server.name} | {self.nav_name}",
game_list=self.environment.globals["game_list"],
+ sesh=vars(usr_sesh)
).encode("utf-16")
diff --git a/titles/wacca/handlers/advertise.py b/titles/wacca/handlers/advertise.py
index 56186eb..47c8406 100644
--- a/titles/wacca/handlers/advertise.py
+++ b/titles/wacca/handlers/advertise.py
@@ -8,12 +8,12 @@ from titles.wacca.handlers.helpers import Notice
class GetNewsResponseV1(BaseResponse):
def __init__(self) -> None:
super().__init__()
- self.notices: list[Notice] = []
- self.copywrightListings: list[str] = []
- self.stoppedSongs: list[int] = []
- self.stoppedJackets: list[int] = []
- self.stoppedMovies: list[int] = []
- self.stoppedIcons: list[int] = []
+ self.notices: List[Notice] = []
+ self.copywrightListings: List[str] = []
+ self.stoppedSongs: List[int] = []
+ self.stoppedJackets: List[int] = []
+ self.stoppedMovies: List[int] = []
+ self.stoppedIcons: List[int] = []
def make(self) -> Dict:
note = []
@@ -34,7 +34,7 @@ class GetNewsResponseV1(BaseResponse):
class GetNewsResponseV2(GetNewsResponseV1):
- stoppedProducts: list[int] = []
+ stoppedProducts: List[int] = []
def make(self) -> Dict:
super().make()
@@ -44,8 +44,8 @@ class GetNewsResponseV2(GetNewsResponseV1):
class GetNewsResponseV3(GetNewsResponseV2):
- stoppedNavs: list[int] = []
- stoppedNavVoices: list[int] = []
+ stoppedNavs: List[int] = []
+ stoppedNavVoices: List[int] = []
def make(self) -> Dict:
super().make()
diff --git a/titles/wacca/handlers/user_music.py b/titles/wacca/handlers/user_music.py
index a8c80bf..26c2167 100644
--- a/titles/wacca/handlers/user_music.py
+++ b/titles/wacca/handlers/user_music.py
@@ -93,13 +93,10 @@ class UserMusicUnlockRequest(BaseRequest):
class UserMusicUnlockResponse(BaseResponse):
- def __init__(self, current_wp: int = 0, tickets_remaining: List = []) -> None:
+ def __init__(self, current_wp: int = 0, tickets_remaining: List[TicketItem] = []) -> None:
super().__init__()
self.wp = current_wp
- self.tickets: List[TicketItem] = []
-
- for ticket in tickets_remaining:
- self.tickets.append(TicketItem(ticket[0], ticket[1], ticket[2]))
+ self.tickets = tickets_remaining
def make(self) -> Dict:
tickets = []
diff --git a/titles/wacca/index.py b/titles/wacca/index.py
index a59cda1..e36c295 100644
--- a/titles/wacca/index.py
+++ b/titles/wacca/index.py
@@ -93,7 +93,7 @@ class WaccaServlet:
try:
req_json = json.loads(request.content.getvalue())
version_full = Version(req_json["appVersion"])
- except:
+ except Exception:
self.logger.error(
f"Failed to parse request to {url_path} -> {request.content.getvalue()}"
)
diff --git a/titles/wacca/lily.py b/titles/wacca/lily.py
index 6ac60de..3ac03fa 100644
--- a/titles/wacca/lily.py
+++ b/titles/wacca/lily.py
@@ -424,7 +424,7 @@ class WaccaLily(WaccaS):
elif item["type"] == WaccaConstants.ITEM_TYPES["note_sound"]:
resp.userItems.noteSounds.append(itm_send)
- except:
+ except Exception:
self.logger.error(
f"{__name__} Failed to load item {item['item_id']} for user {profile['user']}"
)
diff --git a/titles/wacca/reverse.py b/titles/wacca/reverse.py
index 1711013..728ef0a 100644
--- a/titles/wacca/reverse.py
+++ b/titles/wacca/reverse.py
@@ -289,7 +289,7 @@ class WaccaReverse(WaccaLilyR):
elif item["type"] == WaccaConstants.ITEM_TYPES["note_sound"]:
resp.userItems.noteSounds.append(itm_send)
- except:
+ except Exception:
self.logger.error(
f"{__name__} Failed to load item {item['item_id']} for user {profile['user']}"
)