[
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: [kinnay]\n"
  },
  {
    "path": ".github/workflows/testing.yml",
    "content": "name: Pytest\n\non:\n  push:\n    branches: [master, main]\n  pull_request:\n    branches: [master, main]\n\njobs:\n  pytest:\n    runs-on: ubuntu-latest\n    name: Check code with Pytest\n\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Install Python\n        uses: actions/setup-python@v5\n        with:\n          python-version: \"3.11\"\n\n      - name: Install dependencies\n        run: |\n          python -m pip install --upgrade pip\n          pip install pytest trio\n          pip install .\n\n      - name: Run Pytest\n        run: pytest\n"
  },
  {
    "path": ".gitignore",
    "content": "\n/*.egg-info/\n__pycache__/\n/build/\n/dist/\n/site/\n\n/private/\n/*.bin\n/*.jpg\n"
  },
  {
    "path": ".readthedocs.yml",
    "content": "# Read the Docs configuration file for MkDocs projects\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details\n\n# Required\nversion: 2\n\n# Set the version of Python and other tools you might need\nbuild:\n  os: ubuntu-22.04\n  tools:\n    python: \"3.11\"\n\nmkdocs:\n  configuration: mkdocs.yml\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2017 Yannik Marchand\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "# Nintendo Clients\n> :warning: Keep in mind that Nintendo bans Switch devices that show suspicious behavior. This package tries to mimic the behavior of a real Switch as closely as possible, but using it is at your own risk. Make sure that you know what you are doing.\n\nThis package implements a client for various 3DS, Wii U and Switch servers. Check out the [documentation](https://nintendoclients.readthedocs.io) for the list of servers that are currently supported.\n\nFor Switch servers, the latest system version that is currently supported is **22.1.0**.\n\nFor talk about research, feel free to join the [Discord server](https://discord.gg/x8np6Hhxwk) or open a [discussion](https://github.com/kinnay/NintendoClients/discussions) on GitHub.\n\n### Installation\nThis package requires Python 3.8 or later and can be installed with pip: `pip install nintendoclients`. This package uses [semantic versioning](https://semver.org/).\n\n### Documentation\n* [Nintendo's servers and protocols](https://github.com/Kinnay/NintendoClients/wiki)\n* [The classes and functions in this package](https://nintendoclients.readthedocs.io)\n\n### Example scripts\n* **switch/**\n    * **smm2_level.py:** Downloads a Super Mario Maker 2 level and its thumbnails, and prints information about both the level and its creator.\n    * **smm2_ninji.py:** Requests the list of ninji courses and downloads a replay file.\n    * **animalcrossing.py:** Searches for an island by dodo code and prints information about it.\n    * **system_update.py:** Downloads the latest system update and unpacks it into exefs and romfs.\n    <br><br>\n* **wiiu/**\n    * **donkeykong.py:** Downloads DKC Tropical Freeze rankings and the replay file of the world record.\n    * **mariokart.py:** Downloads Mario Kart 8 rankings and the replay file of whoever is in 500th place.\n    * **miis.py:** Requests all kinds of information about the primary mii associated with a NNID.\n    * **friends.py:** Requests your friend list, incoming and outgoing friend requests, and blacklist.\n    <br><br>\n* **3ds/**\n    * **friends.py:** Changes your comment to 'Hello World'.\n    <br><br>\n* **custom/**\n    * **server.py:** Shows how to create a simple game server with both an authentication server and a secure server.\n    * **server_login.py:** Logs in on a game server and disconnects immediately. This can be used to test custom servers.\n\n### Sponsorship\nConsider becoming a [sponsor](https://github.com/sponsors/kinnay) if you would like to support this project.\n\nIf you become a sponsor, I will be able to spend more time on this project, which will lead to faster updates. In addition, you will be given priority for personal support and feature suggestions.\n"
  },
  {
    "path": "docs/changelog.md",
    "content": "\n## Changelog\n\n### 4.4.0\n* Added support for Switch system version 22.0.0 and 22.1.0.\n\n*Released on 2026-04-14*\n\n### 4.3.0\n* Added support for Switch system version 21.2.0.\n\n*Released on 2026-01-15*\n\n### 4.2.0\n* **Bug fix:** fix `MatchmakeSession` structure being parsed incorrectly on Nintendo Switch.\n* **Bug fix:** make a distinction between `AnyDataHolder` and `GatheringHolder` structures in NEX.\n* Added support for Switch system version 20.5.0 up to 21.1.0.\n* Added names for previously unknown fields in the `SimpleSearchObject` structure of MK8D.\n\n*Released on 2026-01-02*\n\n### 4.1.0\n* Added support for Switch system version 20.2.0 up to 20.4.0.\n* Added support for the matchmaking protocol of Monster Hunter XX (3DS).\n* Implemented RankingClient::GetScorePack for MK8D.\n* Minor bug fixes.\n\n*Released on 2025-09-19*\n\n### 4.0.2\n* Disable `device_token` and `edge_token` on system version 20.0.0 and later to avoid accidental usage.\n\n*Released on 2025-06-21*\n\n### 4.0.1\n* **Bug fix:** using `device_token` or `edge_token` on system version 20.0.0 and later would send an invalid request to the server. This is now fixed.\n\n<span style=\"color:red\">**NOTE:**</span> It is recommended to use one of the `preload_*` functions or the `DAuthCache` class on system version 20.0.0 and later, to mimic the behavior of a real Switch.\n\n*Released on 2025-06-21*\n\n### 4.0.0\n* **Breaking change:** some unknown fields in the `nintendo.nex.friends` module were given a name. If you were using the placeholder names in your code, update your code to use the new names.\n* Added support for Switch system version 20.0.0 up to 20.1.5.\n* Added various client ids for dauth, such as `er`, `sprofile` and `penne`.\n* Implemented a dauth cache that mimics the preloading behavior that was introduced in 20.0.0.\n* Added support for the ranking and matchmaking protocols of Mario Kart 8 (Wii U).\n\n*Released on 2025-06-21*\n\n### 3.0.3\n* **Bug fix:** fixed typo, changed `BANNED_DEIVCE` to `BANNED_DEVICE` in `DAuthError` class.\n\n*Released on 2024-12-28*\n\n### 3.0.2\n* **Bug fix:** fixed base64 decoding of dauth challenge. This fixes a bug that caused dauth to fail after a recent server update.\n\n*Released on 2024-12-26*\n\n### 3.0.1\n* **Bug fix:** 19.0.1 support was missing in the previous release.\n\n*Released on 2024-12-02*\n\n### 3.0.0\n* **Breaking change:** replaced `pkg_resources` by `importlib.resources`. This increases the minimum Python version to 3.11.\n* **Bug fix**: removed ampersand before `device_auth_token` parameter in aauth challenge requests for 18.0.0+.\n* **Bug fix**: added missing `naCountry` parameter to baas login requests for 18.0.0+.\n* Added support for system version 19.0.0 and 19.0.1.\n\n*Released on 2024-12-02*\n\n### 2.2.1\n* Fixed the header order in the dauth flow for system version 18.0.0 and later.\n\n*Released on 2024-08-06*\n\n### 2.2.0\n* Added support for system version 18.1.0.\n\n*Released on 2024-06-29*\n\n### 2.1.0\n* Added support for system version 17.0.1, 18.0.0 and 18.0.1.\n* Added support for Switch gamecard authentication.\n* Added support for the data store protocol of Miitopia 3DS.\n\n*Released on 2024-05-04*\n\n### 2.0.1\n* **Bug fix**: added `nintendo.switch` to setup.py. The whole `nintendo.switch` folder was missing in the previous release.\n\n*Released on 2023-11-12*\n\n### 2.0.0\n* **Breaking change:** moved all Switch-related clients into their own namespace. For example, `nintendo.dauth` is now `nintendo.switch.dauth`.\n* **Breaking change:** dauth client ids are now global constants instead of members of `DAuthClient`.\n* Implemented a client for the sun server (system update metadata).\n* Implemented a client for the atumn server (system update content).\n\n*Released on 2023-10-29*\n\n### 1.1.0\n* Added support for system version 17.0.0.\n* Added default values to `RankingOrderParam.offset` and `RankingOrderParam.count`.\n\n*Released on 2023-10-19*\n\n### 1.0.0\nFirst release with a changelog. Currently, the package implements everything that is required to communicate with NEX servers.\n\n*Released on 2023-10-13*\n"
  },
  {
    "path": "docs/index.md",
    "content": "\n## Welcome to NintendoClients\n\nThis package lets you communicate with various 3DS, Wii U and Switch servers. For documentation about the servers and protocols click [here](https://github.com/kinnay/nintendo/wiki).\n\n* [Features](#features)\n* [Contributing](#contributing)\n* [API Reference](#api-reference)\n* [Changelog](changelog.md)\n\n## Features\nThis package is able to do everything that's required to access a game server. It also provides a framework to host your own game servers. For example scripts, check out the [github repository](https://github.com/kinnay/nintendo). The following servers are currently supported:\n\n* Switch:\n\t* Game servers (`nex`)\n\t* https://dauth-lp1.ndas.srv.nintendo.net\n\t* https://aauth-lp1.ndas.srv.nintendo.net\n\t* https://aauth.hac.lp1.ndas.srv.nintendo.net\n\t* https://dragons.hac.lp1.dragons.nintendo.net\n\t* https://e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com\n\t* https://app.lp1.five.nintendo.net\n\t* https://sun.hac.lp1.d4c.nintendo.net\n\t* https://atumn.hac.lp1.d4c.nintendo.net\n* Wii U:\n\t* Game servers (`nex`)\n\t* https://account.nintendo.net\n* 3DS:\n\t* Game servers (`nex`)\n\t* https://nasc.nintendowifi.net\n\n## Contributing\nFeel free to open a pull request or issue on [github](https://github.com/kinnay/nintendo). If you open a pull request, please try to follow the current code style as much as possible, and consider writing a test for new features and bug fixes.\n\n## API Reference\n\n* nex\n\t* [aauser](reference/nex/aauser.md)\n\t* [account](reference/nex/account.md)\n\t* [authentication](reference/nex/authentication.md)\n\t* [backend](reference/nex/backend.md)\n\t* [common](reference/nex/common.md)\n\t* [datastore](reference/nex/datastore.md)\n\t* [datastore_smm](reference/nex/datastore_smm.md)\n\t* [datastore_smm2](reference/nex/datastore_smm2.md)\n\t* [debug](reference/nex/debug.md)\n\t* [errors](reference/nex/errors.md)\n\t* [friends](reference/nex/friends.md)\n\t* [health](reference/nex/health.md)\n\t* [hpp](reference/nex/hpp.md)\n\t* [kerberos](reference/nex/kerberos.md)\n\t* [matchmaking](reference/nex/matchmaking.md)\n\t* [matchmaking_eagle](reference/nex/matchmaking_eagle.md)\n\t* [messaging](reference/nex/messaging.md)\n\t* [monitoring](reference/nex/monitoring.md)\n\t* [nattraversal](reference/nex/nattraversal.md)\n\t* [nintendonotification](reference/nex/nintendonotification.md)\n\t* [notification](reference/nex/notification.md)\n\t* [prudp](reference/nex/prudp.md)\n\t* [ranking](reference/nex/ranking.md)\n\t* [ranking2](reference/nex/ranking2.md)\n\t* [remotelog](reference/nex/remotelog.md)\n\t* [rmc](reference/nex/rmc.md)\n\t* [screening](reference/nex/screening.md)\n\t* [secure](reference/nex/secure.md)\n\t* [streams](reference/nex/streams.md)\n\t* [subscriber](reference/nex/subscriber.md)\n\t* [utility](reference/nex/utility.md)\n* [switch](reference/switch.md)\n\t* [aauth](reference/switch/aauth.md)\n\t* [atumn](reference/switch/atumn.md)\n\t* [baas](reference/switch/baas.md)\n\t* [dauth](reference/switch/dauth.md)\n\t* [dragons](reference/switch/dragons.md)\n\t* [five](reference/switch/five.md)\n\t* [sun](reference/switch/sun.md)\n* [miis](reference/miis.md)\n* [nasc](reference/nasc.md)\n* [nnas](reference/nnas.md)\n"
  },
  {
    "path": "docs/reference/miis.md",
    "content": "\r\n# Module: <code>nintendo.miis</code>\r\n\r\nProvides a parser for FFL mii data.\r\n\r\n<code>**class** [MiiData](#miidata)</code><br>\r\n<span class=\"docs\">The mii data class.</span>\r\n\r\n## MiiData\r\n`birth_platform: int`<br>\r\n`mii_version: int`<br>\r\n`font_region: int`<br>\r\n`region_move: int`<br>\r\n`copyable: bool`<br>\r\n`local_only: bool`<br>\r\n`author_id: list[int]`<br>\r\n`mii_id: list[int]`<br>\r\n\r\n`color: int`<br>\r\n`birth_day: int`<br>\r\n`birth_month: int`<br>\r\n`gender: bool`<br>\r\n`mii_name: str`<br>\r\n`creator_name: str`<br>\r\n`size: int`<br>\r\n`fatness: int`<br>\r\n\r\n`blush_type: int`<br>\r\n`face_style: int`<br>\r\n`face_color: int`<br>\r\n`face_type: int`<br>\r\n\r\n`hair_mirrored: bool`<br>\r\n`hair_color: int`<br>\r\n`hair_type: int`\r\n\r\n`eye_thickness: int`<br>\r\n`eye_scale: int`<br>\r\n`eye_color: int`<br>\r\n`eye_type: int`<br>\r\n`eye_height: int`<br>\r\n`eye_distance: int`<br>\r\n`eye_rotation: int`\r\n\r\n`eyebrow_thickness: int`<br>\r\n`eyebrow_scale: int`<br>\r\n`eyebrow_color: int`<br>\r\n`eyebrow_type: int`<br>\r\n`eyebrow_height: int`<br>\r\n`eyebrow_distance: int`<br>\r\n`eyebrow_rotation: int`\r\n\r\n`nose_height: int`<br>\r\n`nose_scale: int`<br>\r\n`nose_type: int`\r\n\r\n`mouth_thickness: int`<br>\r\n`mouth_scale: int`<br>\r\n`mouth_color: int`<br>\r\n`mouth_type: int`<br>\r\n`mouth_height: int`\r\n\r\n`mustache_type: int`<br>\r\n`mustache_height: int`<br>\r\n`mustache_scale: int`\r\n\r\n`beard_color: int`<br>\r\n`beard_type: int`\r\n\r\n`glass_height: int`<br>\r\n`glass_scale: int`<br>\r\n`glass_color: int`<br>\r\n`glass_type: int`\r\n\r\n`mole_ypos: int`<br>\r\n`mole_xpos: int`<br>\r\n`mole_scale: int`<br>\r\n`mole_enabled: bool`\r\n\r\n<code>**def _\\_init__**()</code><br>\r\n<span class=\"docs\">Creates a new mii instance.</span>\r\n\r\n<code>**def build**() -> bytes</code><br>\r\n<span class=\"docs\">Encodes the mii data.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def parse**(data: bytes) -> [MiiData](#miidata)</code><br>\r\n<span class=\"docs\">Parses the given mii data.</span>\r\n"
  },
  {
    "path": "docs/reference/nasc.md",
    "content": "\n# Module: <code>nintendo.nasc</code>\n\nProvides a client for [nasc.nintendowifi.net](https://github.com/kinnay/nintendo/wiki/NASC-Server).\n\n<code>**class** [NASCError](#nascerror)(Exception)</code><br>\n<span class=\"docs\">Raised when the server returns an error code.</span>\n\n<code>**class** [NASCClient](#nascclient)</code><br>\n<span class=\"docs\">The NASC client.</span>\n\n## Global Constants\n`MEDIA_TYPE_SYSTEM = 0`<br>\n`MEDIA_TYPE_DIGITAL = 1`<br>\n`MEDIA_TYPE_CARTRIDGE = 2`\n\n## NASCError\nThis exception is raised when the server returns an error code.\n\n`status_code: int`<br>\n`return_code: int | None`<br>\n`retry: bool`<br>\n`datetime: datetime.datetime`\n\n## NASCClient\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new NASC client.</span>\n\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo CA - G3`, and `CTR Common Prod 1` is used as the client certificate.</span>\n\n<code>**def set_url**(url: str) -> None</code><br>\n<span class=\"docs\">Changes the server to which requests are sent. The default is `nasc.nintendowifi.net`.</span>\n\n<code>**def set_environment**(environment: str) -> None</code><br>\n<span class=\"docs\">Changes the `servertype` parameter. The default is `\"L1\"` (production).</span>\n\n<code>**def set_title**(title_id: int, title_version: int, product_code: str = \"----\", maker_code: str = \"00\", media_type: int = MEDIA_TYPE_SYSTEM, rom_id: bytes = None) -> None</code><br>\n<span class=\"docs\">Configures the current title. The `rom_id` is required only for cartridges. This is required for calls to `login`.</span>\n\n<code>**def set_device**(serial_number: str, mac_address: str, fcd_cert: bytes, name: str = \"\", unit_code: str = \"2\") -> None</code><br>\n<span class=\"docs\">Configures the device. This is required for calls to `login`.</span>\n\n<code>**def set_network**(bss_id: str, ap_info: str) -> None</code><br>\n<span class=\"docs\">Changes the `bssid` and `ap_info` parameters. By default, the `bssid` is random and `ap_info` is `01:0000000000`.</span>\n\n<code>**def set_locale**(region: int, language: int) -> None</code><br>\n<span class=\"docs\">Changes the `region` and `language` parameters.</span>\n\n<code>**def set_user**(pid: int, pid_hmac: str) -> None</code><br>\n<span class=\"docs\">Configures the user for logging in. Either `set_user` or `set_password` must be called before `login`.</span>\n\n<code>**def set_password**(password: str) -> None</code><br>\n<span class=\"docs\">Configures the `passwd` parameter. Either `set_user` or `set_password` must be called before `login`.</span>\n\n<code>**def set_sdk_version**(major_version: int, minor_version: int) -> None</code><br>\n<span class=\"docs\">Changes the content of the `sdkver` parameter. The default is `000000`.</span>\n\n<code>**def set_fpd_version**(version: int) -> None</code><br>\n<span class=\"docs\">Changes the content of the `fpdver` parameter and user agent. The default is `15`.</span>\n\n<code>**async def login**(game_server_id: int, nickname: str = \"\") -> [LoginResponse](#loginresponse)</code><br>\n<span class=\"docs\">Calls the `LOGIN` action on the server and returns the response or raises an exception.</span>\n\n## LoginResponse\n`host: str`<br>\n`port: int`<br>\n`token: str`<br>\n`datetime: datetime.datetime`\n"
  },
  {
    "path": "docs/reference/nex/aauser.md",
    "content": "\n# Module: <code>nintendo.nex.aauser</code>\n\nProvides a client and server for the `AAUserProtocol`. This page was generated automatically from `aauser.proto`.\n\n<code>**class** [AAUserClient](#aauserclient)</code><br>\n<span class=\"docs\">The client for the `AAUserProtocol`.</span>\n\n<code>**class** [AAUserServer](#aauserserver)</code><br>\n<span class=\"docs\">The server for the `AAUserProtocol`.</span>\n\n<code>**class** [ApplicationInfo](#applicationinfo)([Structure](common.md))</code><br>\n\n## AAUserClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`AAUserClient`](#aauserclient).</span>\n\n<code>**async def register_application**(title_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def unregister_application**(title_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def set_application_info**(application_info: list[[ApplicationInfo](#applicationinfo)]) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_application_info**() -> list[[ApplicationInfo](#applicationinfo)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n## AAUserServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`AAUserServer`](#aauserserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register_application**(client: [RMCClient](rmc.md#rmcclient), title_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_application**(client: [RMCClient](rmc.md#rmcclient), title_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def set_application_info**(client: [RMCClient](rmc.md#rmcclient), application_info: list[[ApplicationInfo](#applicationinfo)]) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_application_info**(client: [RMCClient](rmc.md#rmcclient)) -> list[[ApplicationInfo](#applicationinfo)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n## ApplicationInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ApplicationInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>title_id: int</code><br>\n<code>title_version: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/account.md",
    "content": "\n# Module: <code>nintendo.nex.account</code>\n\nProvides a client and server for the `AccountProtocol`. This page was generated automatically from `account.proto`.\n\n<code>**class** [AccountClient](#accountclient)</code><br>\n<span class=\"docs\">The client for the `AccountProtocol`.</span>\n\n<code>**class** [AccountServer](#accountserver)</code><br>\n<span class=\"docs\">The server for the `AccountProtocol`.</span>\n\n<code>**class** [AccountData](#accountdata)([Structure](common.md))</code><br>\n<code>**class** [BasicAccountInfo](#basicaccountinfo)([Structure](common.md))</code><br>\n\n## AccountClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`AccountClient`](#accountclient).</span>\n\n<code>**async def create_account**(name: str, key: str, groups: int, email: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def delete_account**(pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def disable_account**(pid: int, until: [DateTime](common.md#datetime), message: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def change_password**(new_key: str) -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def test_capability**(capability: int) -> bool</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_name**(pid: int) -> str</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_account_data**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `7` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>data: [AccountData](#accountdata)</code><br>\n</span>\n</span>\n\n<code>**async def get_private_data**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `8` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>data: [Data](common.md)</code><br>\n</span>\n</span>\n\n<code>**async def get_public_data**(pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>data: [Data](common.md)</code><br>\n</span>\n</span>\n\n<code>**async def get_multiple_public_data**(pids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `10` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>data: list[[Data](common.md)]</code><br>\n</span>\n</span>\n\n<code>**async def update_account_name**(name: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def update_account_email**(email: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def update_custom_data**(public_data: [Data](common.md), private_data: [Data](common.md)) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def find_by_name_regex**(groups: int, regex: str, range: [ResultRange](common.md#resultrange)) -> list[[BasicAccountInfo](#basicaccountinfo)]</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def update_account_expiry_date**(pid: int, expiry: [DateTime](common.md#datetime), message: str) -> None</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def update_account_effective_date**(pid: int, effective_from: [DateTime](common.md#datetime), message: str) -> None</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def update_status**(status: str) -> None</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def get_status**(pid: int) -> str</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def get_last_connection_stats**(pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `19` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>last_session_login: [DateTime](common.md#datetime)</code><br>\n<code>last_session_logout: [DateTime](common.md#datetime)</code><br>\n<code>current_session_login: [DateTime](common.md#datetime)</code><br>\n</span>\n</span>\n\n<code>**async def reset_password**() -> bool</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def create_account_with_custom_data**(name: str, key: str, groups: int, email: str, public_data: [Data](common.md), private_data: [Data](common.md)) -> None</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def retrieve_account**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `22` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>account_data: [AccountData](#accountdata)</code><br>\n<code>public_data: [Data](common.md)</code><br>\n<code>private_data: [Data](common.md)</code><br>\n</span>\n</span>\n\n<code>**async def update_account**(key: str, email: str, public_data: [Data](common.md), private_data: [Data](common.md)) -> None</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def change_password_by_guest**(name: str, email: str, key: str) -> None</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def find_by_name_like**(groups: int, like: str, range: [ResultRange](common.md#resultrange)) -> list[[BasicAccountInfo](#basicaccountinfo)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def custom_create_account**(name: str, key: str, groups: int, email: str, auth_data: [Data](common.md)) -> int</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def nintendo_create_account**(name: str, key: str, groups: int, email: str, auth_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `27` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>pid_hmac: str</code><br>\n</span>\n</span>\n\n<code>**async def lookup_or_create_account**(name: str, key: str, groups: int, email: str, auth_data: [Data](common.md)) -> int</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def disconnect_principal**(pid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `29` on the server.</span>\n\n<code>**async def disconnect_all_principals**() -> bool</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n## AccountServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`AccountServer`](#accountserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def create_account**(client: [RMCClient](rmc.md#rmcclient), name: str, key: str, groups: int, email: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_account**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def disable_account**(client: [RMCClient](rmc.md#rmcclient), pid: int, until: [DateTime](common.md#datetime), message: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_password**(client: [RMCClient](rmc.md#rmcclient), new_key: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def test_capability**(client: [RMCClient](rmc.md#rmcclient), capability: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_name**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_account_data**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>data: [AccountData](#accountdata)</code><br>\n</span>\n</span>\n\n<code>**async def get_private_data**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>data: [Data](common.md)</code><br>\n</span>\n</span>\n\n<code>**async def get_public_data**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>data: [Data](common.md)</code><br>\n</span>\n</span>\n\n<code>**async def get_multiple_public_data**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>data: list[[Data](common.md)]</code><br>\n</span>\n</span>\n\n<code>**async def update_account_name**(client: [RMCClient](rmc.md#rmcclient), name: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_account_email**(client: [RMCClient](rmc.md#rmcclient), email: str) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_custom_data**(client: [RMCClient](rmc.md#rmcclient), public_data: [Data](common.md), private_data: [Data](common.md)) -> [Result](common.md#result)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_name_regex**(client: [RMCClient](rmc.md#rmcclient), groups: int, regex: str, range: [ResultRange](common.md#resultrange)) -> list[[BasicAccountInfo](#basicaccountinfo)]</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_account_expiry_date**(client: [RMCClient](rmc.md#rmcclient), pid: int, expiry: [DateTime](common.md#datetime), message: str) -> None</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_account_effective_date**(client: [RMCClient](rmc.md#rmcclient), pid: int, effective_from: [DateTime](common.md#datetime), message: str) -> None</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_status**(client: [RMCClient](rmc.md#rmcclient), status: str) -> None</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_status**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_last_connection_stats**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>last_session_login: [DateTime](common.md#datetime)</code><br>\n<code>last_session_logout: [DateTime](common.md#datetime)</code><br>\n<code>current_session_login: [DateTime](common.md#datetime)</code><br>\n</span>\n</span>\n\n<code>**async def reset_password**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_account_with_custom_data**(client: [RMCClient](rmc.md#rmcclient), name: str, key: str, groups: int, email: str, public_data: [Data](common.md), private_data: [Data](common.md)) -> None</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def retrieve_account**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>account_data: [AccountData](#accountdata)</code><br>\n<code>public_data: [Data](common.md)</code><br>\n<code>private_data: [Data](common.md)</code><br>\n</span>\n</span>\n\n<code>**async def update_account**(client: [RMCClient](rmc.md#rmcclient), key: str, email: str, public_data: [Data](common.md), private_data: [Data](common.md)) -> None</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_password_by_guest**(client: [RMCClient](rmc.md#rmcclient), name: str, email: str, key: str) -> None</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_name_like**(client: [RMCClient](rmc.md#rmcclient), groups: int, like: str, range: [ResultRange](common.md#resultrange)) -> list[[BasicAccountInfo](#basicaccountinfo)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def custom_create_account**(client: [RMCClient](rmc.md#rmcclient), name: str, key: str, groups: int, email: str, auth_data: [Data](common.md)) -> int</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def nintendo_create_account**(client: [RMCClient](rmc.md#rmcclient), name: str, key: str, groups: int, email: str, auth_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>pid_hmac: str</code><br>\n</span>\n</span>\n\n<code>**async def lookup_or_create_account**(client: [RMCClient](rmc.md#rmcclient), name: str, key: str, groups: int, email: str, auth_data: [Data](common.md)) -> int</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def disconnect_principal**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass.</span>\n\n<code>**async def disconnect_all_principals**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n## AccountData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AccountData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>groups: int</code><br>\n<code>email: str</code><br>\n<code>creation_date: [DateTime](common.md#datetime)</code><br>\n<code>effective_date: [DateTime](common.md#datetime)</code><br>\n<code>not_effective_message: str</code><br>\n<code>expiry_date: [DateTime](common.md#datetime)</code><br>\n<code>expired_message: str</code><br>\n</span><br>\n\n## BasicAccountInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `BasicAccountInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/authentication.md",
    "content": "\n# Module: <code>nintendo.nex.authentication</code>\n\nProvides a client and server for the `AuthenticationProtocol` and `AuthenticationProtocolNX`. This page was generated automatically from `authentication.proto`.\n\n<code>**class** [AuthenticationClient](#authenticationclient)</code><br>\n<span class=\"docs\">The client for the `AuthenticationProtocol`.</span>\n\n<code>**class** [AuthenticationClientNX](#authenticationclientnx)</code><br>\n<span class=\"docs\">The client for the `AuthenticationProtocolNX`.</span>\n\n<code>**class** [AuthenticationServer](#authenticationserver)</code><br>\n<span class=\"docs\">The server for the `AuthenticationProtocol`.</span>\n\n<code>**class** [AuthenticationServerNX](#authenticationservernx)</code><br>\n<span class=\"docs\">The server for the `AuthenticationProtocolNX`.</span>\n\n<code>**class** [AuthenticationInfo](#authenticationinfo)([Data](common.md))</code><br>\n<code>**class** [RVConnectionData](#rvconnectiondata)([Structure](common.md))</code><br>\n<code>**class** [ValidateAndRequestTicketParam](#validateandrequestticketparam)([Structure](common.md))</code><br>\n<code>**class** [ValidateAndRequestTicketResult](#validateandrequestticketresult)([Structure](common.md))</code><br>\n\n## AuthenticationClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`AuthenticationClient`](#authenticationclient).</span>\n\n<code>**async def login**(username: str) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `1` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n</span>\n</span>\n\n<code>**async def login_ex**(username: str, extra_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `2` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n</span>\n</span>\n\n<code>**async def request_ticket**(source: int, target: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `3` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>ticket: bytes</code><br>\n</span>\n</span>\n\n<code>**async def get_pid**(username: str) -> int</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_name**(pid: int) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def login_with_context**(login_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n</span>\n</span>\n\n## AuthenticationClientNX\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`AuthenticationClientNX`](#authenticationclientnx).</span>\n\n<code>**async def validate_and_request_ticket**(username: str) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `1` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n</span>\n</span>\n\n<code>**async def validate_and_request_ticket_with_custom_data**(username: str, extra_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `2` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n<code>source_key: str</code><br>\n</span>\n</span>\n\n<code>**async def request_ticket**(source: int, target: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `3` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>ticket: bytes</code><br>\n<code>key: str</code><br>\n</span>\n</span>\n\n<code>**async def get_pid**(username: str) -> int</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_name**(pid: int) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def validate_and_request_ticket_with_param**(param: [ValidateAndRequestTicketParam](#validateandrequestticketparam)) -> [ValidateAndRequestTicketResult](#validateandrequestticketresult)</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n## AuthenticationServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`AuthenticationServer`](#authenticationserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def login**(client: [RMCClient](rmc.md#rmcclient), username: str) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n</span>\n</span>\n\n<code>**async def login_ex**(client: [RMCClient](rmc.md#rmcclient), username: str, extra_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n</span>\n</span>\n\n<code>**async def request_ticket**(client: [RMCClient](rmc.md#rmcclient), source: int, target: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>ticket: bytes</code><br>\n</span>\n</span>\n\n<code>**async def get_pid**(client: [RMCClient](rmc.md#rmcclient), username: str) -> int</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_name**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def login_with_context**(client: [RMCClient](rmc.md#rmcclient), login_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n</span>\n</span>\n\n## AuthenticationServerNX\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`AuthenticationServerNX`](#authenticationservernx).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def validate_and_request_ticket**(client: [RMCClient](rmc.md#rmcclient), username: str) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n</span>\n</span>\n\n<code>**async def validate_and_request_ticket_with_custom_data**(client: [RMCClient](rmc.md#rmcclient), username: str, extra_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>connection_data: [RVConnectionData](#rvconnectiondata)</code><br>\n<code>server_name: str</code><br>\n<code>source_key: str</code><br>\n</span>\n</span>\n\n<code>**async def request_ticket**(client: [RMCClient](rmc.md#rmcclient), source: int, target: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>ticket: bytes</code><br>\n<code>key: str</code><br>\n</span>\n</span>\n\n<code>**async def get_pid**(client: [RMCClient](rmc.md#rmcclient), username: str) -> int</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_name**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def validate_and_request_ticket_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [ValidateAndRequestTicketParam](#validateandrequestticketparam)) -> [ValidateAndRequestTicketResult](#validateandrequestticketresult)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n## AuthenticationInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AuthenticationInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>token: str</code><br>\n<code>ngs_version: int = 3</code><br>\n<code>token_type: int = 1</code><br>\n<code>server_version: int = 0</code><br>\n</span><br>\n\n## RVConnectionData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RVConnectionData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>main_station: [StationURL](common.md#stationurl) = \"prudp:/\"</code><br>\n<code>special_protocols: list[int] = []</code><br>\n<code>special_station: [StationURL](common.md#stationurl) = \"prudp:/\"</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>server_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n</span><br>\n</span><br>\n\n## ValidateAndRequestTicketParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ValidateAndRequestTicketParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>platform: int = 3</code><br>\n<code>username: str</code><br>\n<code>data: [Data](common.md)</code><br>\n<code>skip_version_check: bool = False</code><br>\n<code>nex_version: int</code><br>\n<code>client_version: int</code><br>\n</span><br>\n\n## ValidateAndRequestTicketResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ValidateAndRequestTicketResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>ticket: bytes</code><br>\n<code>server_url: [StationURL](common.md#stationurl)</code><br>\n<code>server_time: [DateTime](common.md#datetime)</code><br>\n<code>server_name: str</code><br>\n<code>source_key: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/backend.md",
    "content": "\r\n# Module: <code>nintendo.nex.backend</code>\r\n\r\nProvides a client for game servers.\r\n\r\n<code>**class** [BackEndClient](#backendclient)</code><br>\r\n<span class=\"docs\">The game server client.</span>\r\n\r\n<code>**async with connect**(settings: [Settings](settings.md#settings), host: str, port: int) -> [BackEndClient](#backendclient)</code><br>\r\n<span class=\"docs\">Establishes a connection with the authentication server at the given address. Blocks until the connection is ready.</span>\r\n\r\n## BackEndClient\r\n<code>auth_client: [RMCClient](rmc.md#rmcclient)</code><br>\r\n<span class=\"docs\">The RMC client that is connected to the authentication server.</span>\r\n\r\n<code>**async with login**(username: str, password: str = None, auth_info: [Data](common.md) = None, servers: list[object] = []) -> [RMCClient](rmc.md#rmcclient)</code><br>\r\n<span class=\"docs\">Requests a ticket from the authentication server and establishes a connection with the secure server. The returned RMC client can be used to call methods on the secure server. `servers` must be a list of protocol server objects that should be defined in an external protocol file. These servers are registered on the secure client.</span>\r\n\r\n<code>**async with login_guest**() -> [RMCClient](rmc.md#rmcclient)</code><br>\r\n<span class=\"docs\">Logs in as guest. On most servers the guest account is disabled.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/common.md",
    "content": "\r\n# Module: <code>nintendo.nex.common</code>\r\n\r\nProvides classes that are used by various `nex` modules.\r\n\r\n<code>**class** [RMCError](#rmcerror)(Exception)</code><br>\r\n<span class=\"docs\">Raised when the server returns an error code.</span>\r\n\r\n<code>**class** [Result](#result)</code><br>\r\n<span class=\"docs\">Holds the result of a remote method call.</span>\r\n\r\n<code>**class** Structure</code><br>\r\n<span class=\"docs\">Base class for `nex` structures. This class should not be subclassed manually. Instead, structures should be defined in a protocol file.</span>\r\n\r\n<code>**class** Data(Structure)</code><br>\r\n<span class=\"docs\">Base class for structures that can be held by a data holder. This class should not be subclassed manually. Instead, data structures should be defined in a protocol file.</span>\r\n\r\n<code>**class** NullData(Data)</code><br>\r\n<span class=\"docs\">The `NullData` structure. This class does not define any fields.</span>\r\n\r\n<code>**class** [StationURL](#stationurl)</code><br>\r\n<span class=\"docs\">A station url (`nn::nex::StationURL`).</span>\r\n\r\n<code>**class** [DateTime](#datetime)</code><br>\r\n<span class=\"docs\">A date time object (`nn::nex::DateTime`).</span>\r\n\r\n<code>**class** [ResultRange](#resultrange)(Structure)</code><br>\r\n<span class=\"docs\">A result range (`nn::nex::ResultRange`). This structure limits database queries to a specific range.</span>\r\n\r\n## RMCError\r\n<code>**def _\\_init__**(code: str = \"Core::Unknown)</code><br>\r\n<span class=\"docs\">Creates a new RMCError from the given error description.</span>\r\n\r\n<code>**def _\\_init__**(code: int = 0x10001)</code><br>\r\n<span class=\"docs\">Creates a new RMCError from the given error code.</span>\r\n\r\n<code>**def code**() -> int</code><br>\r\n<span class=\"docs\">Returns the error code.</span>\r\n\r\n<code>**def name**() -> str</code><br>\r\n<span class=\"docs\">Returns a description of the error. If the error code is unknown, this method returns `\"unknown error\"`.</span>\r\n\r\n<code>**def result**() -> [Result](#result)</code><br>\r\n<span class=\"docs\">Returns a result object that represents the error.</span>\r\n\r\n## Result\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def success**(code: str = \"Core::Unknown\") -> [Result](#result)</code><br>\r\n<span class=\"docs\">Creates a new [`Result`](#result) object that indicates success.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def success**(code: int = 0x10001) -> [Result](#result)</code><br>\r\n<span class=\"docs\">Creates a new [`Result`](#result) object that indicates success.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def error**(code: str = \"Core::Unknown\") -> [Result](#result)</code><br>\r\n<span class=\"docs\">Creates a new [`Result`](#result) object that indicates an error.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def error**(code: int = 0x10001) -> [Result](#result)</code><br>\r\n<span class=\"docs\">Creates a new [`Result`](#result) object that indicates an error.</span>\r\n\r\n<code>**def is_success**() -> bool</code><br>\r\n<span class=\"docs\">Returns `True` if the result indicates success.</span>\r\n\r\n<code>**def is_error**() -> bool</code><br>\r\n<span class=\"docs\">Returns `True` if the result indicates an error.</span>\r\n\r\n<code>**def code**() -> int</code><br>\r\n<span class=\"docs\">Returns the error code of the result. Errors are indicated by bit `1 << 31`.</span>\r\n\r\n<code>**def name**() -> str</code><br>\r\n<span class=\"docs\">Returns a description of the result. If the result indicates success, this method always returns `\"success\"`, regardless of the error code. If the error bit is set but the error code is unknown, this method returns `\"unknown error\"`.</span>\r\n\r\n<code>**def raise_if_error**() -> None</code><br>\r\n<span class=\"docs\">Raises an `RMCError` if the error bit is set.</span>\r\n\r\n## StationURL\r\nA station url consists of an url scheme and a bunch of parameters. The following parameters are currently valid:<br>\r\n<span class=\"docs\">`address`, `Rsa`, `port`, `stream`, `sid`, `PID`, `CID`, `type`, `RVCID`, `natm`, `natf`, `upnp`, `pmp`, `probeinit`, `PRID` and `Rsp`.</span>\r\n\r\n<code>**def _\\_init__**(scheme: str = \"prudp\", \\**kwargs)</code><br>\r\n<span class=\"docs\">Creates a new station url with the given url scheme. Additional parameters may be provided in `kwargs`.</span>\r\n\r\n<code>**def _\\_repr__**() -> str</code><br>\r\n<span class=\"docs\">Returns the string representation of the station url.</span>\r\n\r\n<code>**def _\\_getitem__**(name: str) -> object</code><br>\r\n<span class=\"docs\">Returns a specific parameter, either as `str` or `int`. Returns a default value if the parameter name is valid but not defined in the station url. Raises `KeyError` if the parameter name is invalid.</span>\r\n\r\n<code>**def _\\_setitem__**(name: str, value: object) -> None</code><br>\r\n<span class=\"docs\">Changes a specific parameter. The given `value` is automatically converted to string.</span>\r\n\r\n<code>**def scheme**() -> str</code><br>\r\n<span class=\"docs\">Returns the url scheme.</span>\r\n\r\n<code>**def address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the address of the station url as a tuple: `(address, port)`.</span>\r\n\r\n<code>**def is_public**() -> bool</code><br>\r\n<span class=\"docs\">Returns `True` if the `type` field indicates that the station address is public.</span>\r\n\r\n<code>**def is_behind_nat**() -> bool</code><br>\r\n<span class=\"docs\">Returns `True` if the `type` field indicates that the station is behind a nat device.</span>\r\n\r\n<code>**def is_global**() -> bool</code><br>\r\n<span class=\"docs\">Returns `True` if the `type` field indicates that the station address is global (i.e. public and not behind a nat device).</span>\r\n\r\n<code>**def copy**() -> [StationURL](#stationurl)</code><br>\r\n<span class=\"docs\">Returns a copy of the station url.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def parse**(string: str) -> [StationURL](#stationurl)</code><br>\r\n<span class=\"docs\">Parses the given station url string. If `string` is empty, the station url is created with the `\"prudp\"` scheme and without parameters.</span>\r\n\r\n## DateTime\r\nA `DateTime` object always represents UTC time.\r\n\r\n<code>** def _\\_init__**(value: int)</code><br>\r\n<span class=\"docs\">Creates a new [`DateTime`](#datetime) object from the given value.</span>\r\n\r\n<code>**def value**() -> int</code><br>\r\n<span class=\"docs\">Returns value of the [`DateTime`](#datetime) object, as encoded by `nex`.</span>\r\n\r\n<code>**def second**() -> int</code><br>\r\n<span class=\"docs\">Returns the seconds (0 - 59)</span><br>\r\n<code>**def minute**() -> int</code><br>\r\n<span class=\"docs\">Returns the minutes (0 - 59)</span><br>\r\n<code>**def hour**() -> int</code><br>\r\n<span class=\"docs\">Returns the hours (0 - 23)</span><br>\r\n<code>**def day**() -> int</code><br>\r\n<span class=\"docs\">Returns the day of the month (1 - 31).</span><br>\r\n<code>**def month**() -> int</code><br>\r\n<span class=\"docs\">Returns the month (1 - 12)</span><br>\r\n<code>**def year**() -> int</code><br>\r\n<span class=\"docs\">Returns the year.</span>\r\n\r\n<code>**def standard_datetime**() -> datetime.datetime</code><br>\r\n<span class=\"docs\">Converts the [`DateTime`](#datetime) object to a standard `datetime.datetime` object.</span>\r\n\r\n<code>**def timestamp**() -> int</code><br>\r\n<span class=\"docs\">Returns a posix timestamp.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def make**(year: int, month: int = 1, day: int = 1, hour: int = 0, minute: int = 0, second: int = 0) -> [DateTime](#datetime)</code><br>\r\n<span class=\"docs\">Creates a new [`DateTime`](#datetime) object for the given date.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def fromtimestamp**(timestamp: int) -> [DateTime](#datetime)</code><br>\r\n<span class=\"docs\">Creates a new [`DateTime`](#datetime) object from the given posix timestamp.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def now**() -> [DateTime](#datetime)</code><br>\r\n<span class=\"docs\">Creates a new [`DateTime`](#datetime) object for the current time.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def never**() -> [DateTime](#datetime)</code><br>\r\n<span class=\"docs\">Creates a special [`DateTime`](#datetime) object that represents 'never'.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def future**() -> [DateTime](#datetime)</code><br>\r\n<span class=\"docs\">Creates a special [`DateTime`](#datetime) object that represents 'future'.</span>\r\n\r\n## ResultRange\r\n`offset: int`<br>\r\n`size: int`\r\n\r\n<code>**def _\\_init__**(offset: int = 0, size: int = 10)</code><br>\r\n<span class=\"docs\">Creates a new result range.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/datastore.md",
    "content": "\n# Module: <code>nintendo.nex.datastore</code>\n\nProvides a client and server for the `DataStoreProtocol`. This page was generated automatically from `datastore.proto`.\n\n<code>**class** [DataStoreClient](#datastoreclient)</code><br>\n<span class=\"docs\">The client for the `DataStoreProtocol`.</span>\n\n<code>**class** [DataStoreServer](#datastoreserver)</code><br>\n<span class=\"docs\">The server for the `DataStoreProtocol`.</span>\n\n<code>**class** [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParam](#datastorechangemetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParam](#datastorecompletepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreDeleteParam](#datastoredeleteparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetMetaParam](#datastoregetmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreKeyValue](#datastorekeyvalue)([Structure](common.md))</code><br>\n<code>**class** [DataStoreMetaInfo](#datastoremetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotification](#datastorenotification)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotificationV1](#datastorenotificationv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePasswordInfo](#datastorepasswordinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePermission](#datastorepermission)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInfo](#datastorepersistenceinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInitParam](#datastorepersistenceinitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceTarget](#datastorepersistencetarget)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParam](#datastorepreparegetparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParam](#datastorepreparepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParamV1](#datastorepreparepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRateObjectParam](#datastorerateobjectparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfo](#datastoreratinginfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParam](#datastoreratinginitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingLog](#datastoreratinglog)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingTarget](#datastoreratingtarget)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfo](#datastorereqgetinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfoV1](#datastorereqgetinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfo](#datastorereqpostinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfoV1](#datastorereqpostinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqUpdateInfo](#datastorerequpdateinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchParam](#datastoresearchparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchResult](#datastoresearchresult)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfo](#datastorespecificmetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreTouchObjectParam](#datastoretouchobjectparam)([Structure](common.md))</code><br>\n\n## DataStoreClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`DataStoreClient`](#datastoreclient).</span>\n\n<code>**async def prepare_get_object_v1**(param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def prepare_post_object_v1**(param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def complete_post_object_v1**(param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def delete_object**(param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_objects**(param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def change_meta_v1**(param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_metas_v1**(data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_meta**(param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_metas**(data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def complete_update_object**(param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def search_object**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_notification_url**(param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `14` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def get_ratings**(data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `17` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def reset_ratings**(data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def get_specific_meta_v1**(param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def post_meta_binary**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def touch_object**(param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def get_rating_with_log**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `23` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def prepare_get_object**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def complete_post_object**(param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def get_new_arrived_notifications**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `27` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def get_persistence_info**(owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Calls method `29` on the server.</span>\n\n<code>**async def get_persistence_infos**(owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `30` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def unperpetuate_object**(persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `33` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def get_password_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `35` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `36` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def change_meta**(param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def change_metas**(data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def rate_objects**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `40` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def rate_object_with_posting**(target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def rate_objects_with_posting**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `44` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `45` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n## DataStoreServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`DataStoreServer`](#datastoreserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_objects**(client: [RMCClient](rmc.md#rmcclient), param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas_v1**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_notification_url**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_specific_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def touch_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating_with_log**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_info**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_infos**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def unperpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(client: [RMCClient](rmc.md#rmcclient), data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_password_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(client: [RMCClient](rmc.md#rmcclient), params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_object_with_posting**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects_with_posting**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n## DataStoreChangeMetaCompareParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaCompareParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>comparison_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n</span><br>\n\n## DataStoreChangeMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n<code>compare_param: [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam) = [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)()</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n</span><br>\n\n## DataStoreChangeMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreCompletePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompletePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompleteUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompleteUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>version: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreDeleteParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreDeleteParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreGetMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>access_password: int = 0</code><br>\n</span><br>\n\n## DataStoreGetNewArrivedNotificationsParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNewArrivedNotificationsParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>last_notification_id: int</code><br>\n<code>limit: int</code><br>\n</span><br>\n\n## DataStoreGetNotificationUrlParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNotificationUrlParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>previous_url: str</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreKeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreKeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: str</code><br>\n<code>value: str</code><br>\n</span><br>\n\n## DataStoreMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>create_time: [DateTime](common.md#datetime)</code><br>\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n<code>period: int</code><br>\n<code>status: int</code><br>\n<code>referred_count: int</code><br>\n<code>refer_data_id: int</code><br>\n<code>flag: int</code><br>\n<code>referred_time: [DateTime](common.md#datetime)</code><br>\n<code>expire_time: [DateTime](common.md#datetime)</code><br>\n<code>tags: list[str]</code><br>\n<code>ratings: list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]</code><br>\n</span><br>\n\n## DataStoreNotification\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotification` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStoreNotificationV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotificationV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePasswordInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePasswordInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>access_password: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStorePermission\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePermission` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>permission: int = 3</code><br>\n<code>recipients: list[int] = []</code><br>\n</span><br>\n\n## DataStorePersistenceInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>slot_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePersistenceInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>persistence_id: int = 65535</code><br>\n<code>delete_last_object: bool = True</code><br>\n</span><br>\n\n## DataStorePersistenceTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int = 0</code><br>\n<code>persistence_id: int = 65535</code><br>\n</span><br>\n\n## DataStorePrepareGetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>lock_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>access_password: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str] = []</code><br>\n</span><br>\n</span><br>\n\n## DataStorePrepareGetParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int = 0</code><br>\n</span><br>\n\n## DataStorePreparePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)] = []</code><br>\n<code>persistence_init_param: [DataStorePersistenceInitParam](#datastorepersistenceinitparam) = [DataStorePersistenceInitParam](#datastorepersistenceinitparam)()</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str]</code><br>\n</span><br>\n</span><br>\n\n## DataStorePreparePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int = 0</code><br>\n<code>meta_binary: bytes = b\"\"</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str]</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)]</code><br>\n</span><br>\n\n## DataStorePrepareUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>size: int</code><br>\n<code>update_password: int</code><br>\n<code>extra_data: list[str]</code><br>\n</span><br>\n\n## DataStoreRateObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRateObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rating_value: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n## DataStoreRatingInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_value: int</code><br>\n<code>count: int</code><br>\n<code>initial_value: int</code><br>\n</span><br>\n\n## DataStoreRatingInfoWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfoWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>info: [DataStoreRatingInfo](#datastoreratinginfo) = [DataStoreRatingInfo](#datastoreratinginfo)()</code><br>\n</span><br>\n\n## DataStoreRatingInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flag: int</code><br>\n<code>internal_flag: int</code><br>\n<code>lock_type: int</code><br>\n<code>initial_value: int</code><br>\n<code>range_min: int</code><br>\n<code>range_max: int</code><br>\n<code>period_hour: int</code><br>\n<code>period_duration: int</code><br>\n</span><br>\n\n## DataStoreRatingInitParamWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParamWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>param: [DataStoreRatingInitParam](#datastoreratinginitparam) = [DataStoreRatingInitParam](#datastoreratinginitparam)()</code><br>\n</span><br>\n\n## DataStoreRatingLog\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingLog` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>is_rated: bool</code><br>\n<code>pid: int</code><br>\n<code>rating_value: int</code><br>\n<code>lock_expiration_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## DataStoreRatingTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>slot: int</code><br>\n</span><br>\n\n## DataStoreReqGetAdditionalMeta\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetAdditionalMeta` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n<code>meta_binary: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n</span><br>\n</span><br>\n\n## DataStoreReqGetInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetNotificationUrlInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetNotificationUrlInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>key: str</code><br>\n<code>query: str</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqUpdateInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqUpdateInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>version: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>search_target: int = 1</code><br>\n<code>owner_ids: list[int] = []</code><br>\n<code>owner_type: int = 0</code><br>\n<code>destination_ids: list[int] = []</code><br>\n<code>data_type: int = 65535</code><br>\n<code>created_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>created_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>result_order_column: int = 0</code><br>\n<code>result_order: int = 0</code><br>\n<code>result_range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>minimal_rating_frequency: int = 0</code><br>\n<code>use_cache: bool = False</code><br>\n<code>total_count_enabled: bool = True</code><br>\n<code>data_types: list[int] = []</code><br>\n</span><br>\n\n## DataStoreSearchResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_count: int</code><br>\n<code>result: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>total_count_type: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreTouchObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreTouchObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/datastore_miitopia_3ds.md",
    "content": "\n# Module: <code>nintendo.nex.datastore_miitopia_3ds</code>\n\nProvides a client and server for the `DataStoreProtocolMiitopia3DS`. This page was generated automatically from `datastore_miitopia_3ds.proto`.\n\n<code>**class** [DataStoreClientMiitopia3DS](#datastoreclientmiitopia3ds)</code><br>\n<span class=\"docs\">The client for the `DataStoreProtocolMiitopia3DS`.</span>\n\n<code>**class** [DataStoreServerMiitopia3DS](#datastoreservermiitopia3ds)</code><br>\n<span class=\"docs\">The server for the `DataStoreProtocolMiitopia3DS`.</span>\n\n<code>**class** [Category](#category)</code><br>\n<code>**class** [Gender](#gender)</code><br>\n\n<code>**class** [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParam](#datastorechangemetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParam](#datastorecompletepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreDeleteParam](#datastoredeleteparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetMetaParam](#datastoregetmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreKeyValue](#datastorekeyvalue)([Structure](common.md))</code><br>\n<code>**class** [DataStoreMetaInfo](#datastoremetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotification](#datastorenotification)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotificationV1](#datastorenotificationv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePasswordInfo](#datastorepasswordinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePermission](#datastorepermission)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInfo](#datastorepersistenceinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInitParam](#datastorepersistenceinitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceTarget](#datastorepersistencetarget)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParam](#datastorepreparegetparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParam](#datastorepreparepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParamV1](#datastorepreparepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRateObjectParam](#datastorerateobjectparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfo](#datastoreratinginfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParam](#datastoreratinginitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingLog](#datastoreratinglog)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingTarget](#datastoreratingtarget)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfo](#datastorereqgetinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfoV1](#datastorereqgetinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfo](#datastorereqpostinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfoV1](#datastorereqpostinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqUpdateInfo](#datastorerequpdateinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchParam](#datastoresearchparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchResult](#datastoresearchresult)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfo](#datastorespecificmetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreTouchObjectParam](#datastoretouchobjectparam)([Structure](common.md))</code><br>\n<code>**class** [MiiTubeMiiInfo](#miitubemiiinfo)([Structure](common.md))</code><br>\n<code>**class** [MiiTubeSearchParam](#miitubesearchparam)([Structure](common.md))</code><br>\n<code>**class** [MiiTubeSearchResult](#miitubesearchresult)([Structure](common.md))</code><br>\n\n## DataStoreClientMiitopia3DS\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`DataStoreClientMiitopia3DS`](#datastoreclientmiitopia3ds).</span>\n\n<code>**async def prepare_get_object_v1**(param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def prepare_post_object_v1**(param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def complete_post_object_v1**(param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def delete_object**(param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_objects**(param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def change_meta_v1**(param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_metas_v1**(data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_meta**(param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_metas**(data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def complete_update_object**(param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def search_object**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_notification_url**(param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `14` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def get_ratings**(data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `17` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def reset_ratings**(data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def get_specific_meta_v1**(param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def post_meta_binary**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def touch_object**(param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def get_rating_with_log**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `23` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def prepare_get_object**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def complete_post_object**(param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def get_new_arrived_notifications**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `27` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def get_persistence_info**(owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Calls method `29` on the server.</span>\n\n<code>**async def get_persistence_infos**(owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `30` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def unperpetuate_object**(persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `33` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def get_password_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `35` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `36` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def change_meta**(param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def change_metas**(data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def rate_objects**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `40` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def rate_object_with_posting**(target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def rate_objects_with_posting**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `44` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `45` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def search_mii**(param: [MiiTubeSearchParam](#miitubesearchparam)) -> [MiiTubeSearchResult](#miitubesearchresult)</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n## DataStoreServerMiitopia3DS\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`DataStoreServerMiitopia3DS`](#datastoreservermiitopia3ds).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_objects**(client: [RMCClient](rmc.md#rmcclient), param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas_v1**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_notification_url**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_specific_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def touch_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating_with_log**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_info**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_infos**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def unperpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(client: [RMCClient](rmc.md#rmcclient), data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_password_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(client: [RMCClient](rmc.md#rmcclient), params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_object_with_posting**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects_with_posting**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_mii**(client: [RMCClient](rmc.md#rmcclient), param: [MiiTubeSearchParam](#miitubesearchparam)) -> [MiiTubeSearchResult](#miitubesearchresult)</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n## Category\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`SINGING = 0`<br>\n`SPORT = 1`<br>\n`ACTING = 2`<br>\n`COMEDY = 3`<br>\n`MUSIC = 4`<br>\n`MARTIAL_ARTS = 5`<br>\n`DANCING = 6`<br>\n`ADVENTURING = 7`<br>\n`FILM_DIRECTING = 8`<br>\n`COOKING = 9`<br>\n`CHATTING = 10`<br>\n`PUBLIC_SPEAKING = 11`<br>\n`CRAFTWORK = 12`<br>\n`DRAWING = 13`<br>\n`STUDYING = 14`<br>\n`WRITING = 15`<br>\n`FASHION = 16`<br>\n`DINING = 17`<br>\n`NOT_TELLING = 18`<br>\n`ANY = 255`<br>\n</span>\n\n## Gender\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`MALE = 0`<br>\n`FEMALE = 1`<br>\n`ANY = 2`<br>\n</span>\n\n## DataStoreChangeMetaCompareParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaCompareParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>comparison_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n</span><br>\n\n## DataStoreChangeMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n<code>compare_param: [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam) = [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)()</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n</span><br>\n\n## DataStoreChangeMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreCompletePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompletePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompleteUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompleteUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>version: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreDeleteParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreDeleteParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreGetMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>access_password: int = 0</code><br>\n</span><br>\n\n## DataStoreGetNewArrivedNotificationsParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNewArrivedNotificationsParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>last_notification_id: int</code><br>\n<code>limit: int</code><br>\n</span><br>\n\n## DataStoreGetNotificationUrlParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNotificationUrlParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>previous_url: str</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreKeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreKeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: str</code><br>\n<code>value: str</code><br>\n</span><br>\n\n## DataStoreMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>create_time: [DateTime](common.md#datetime)</code><br>\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n<code>period: int</code><br>\n<code>status: int</code><br>\n<code>referred_count: int</code><br>\n<code>refer_data_id: int</code><br>\n<code>flag: int</code><br>\n<code>referred_time: [DateTime](common.md#datetime)</code><br>\n<code>expire_time: [DateTime](common.md#datetime)</code><br>\n<code>tags: list[str]</code><br>\n<code>ratings: list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]</code><br>\n</span><br>\n\n## DataStoreNotification\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotification` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStoreNotificationV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotificationV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePasswordInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePasswordInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>access_password: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStorePermission\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePermission` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>permission: int = 3</code><br>\n<code>recipients: list[int] = []</code><br>\n</span><br>\n\n## DataStorePersistenceInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>slot_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePersistenceInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>persistence_id: int = 65535</code><br>\n<code>delete_last_object: bool = True</code><br>\n</span><br>\n\n## DataStorePersistenceTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int = 0</code><br>\n<code>persistence_id: int = 65535</code><br>\n</span><br>\n\n## DataStorePrepareGetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>lock_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>access_password: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str] = []</code><br>\n</span><br>\n</span><br>\n\n## DataStorePrepareGetParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int = 0</code><br>\n</span><br>\n\n## DataStorePreparePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)] = []</code><br>\n<code>persistence_init_param: [DataStorePersistenceInitParam](#datastorepersistenceinitparam) = [DataStorePersistenceInitParam](#datastorepersistenceinitparam)()</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str]</code><br>\n</span><br>\n</span><br>\n\n## DataStorePreparePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int = 0</code><br>\n<code>meta_binary: bytes = b\"\"</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str]</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)]</code><br>\n</span><br>\n\n## DataStorePrepareUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>size: int</code><br>\n<code>update_password: int</code><br>\n<code>extra_data: list[str]</code><br>\n</span><br>\n\n## DataStoreRateObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRateObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rating_value: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n## DataStoreRatingInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_value: int</code><br>\n<code>count: int</code><br>\n<code>initial_value: int</code><br>\n</span><br>\n\n## DataStoreRatingInfoWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfoWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>info: [DataStoreRatingInfo](#datastoreratinginfo) = [DataStoreRatingInfo](#datastoreratinginfo)()</code><br>\n</span><br>\n\n## DataStoreRatingInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flag: int</code><br>\n<code>internal_flag: int</code><br>\n<code>lock_type: int</code><br>\n<code>initial_value: int</code><br>\n<code>range_min: int</code><br>\n<code>range_max: int</code><br>\n<code>period_hour: int</code><br>\n<code>period_duration: int</code><br>\n</span><br>\n\n## DataStoreRatingInitParamWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParamWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>param: [DataStoreRatingInitParam](#datastoreratinginitparam) = [DataStoreRatingInitParam](#datastoreratinginitparam)()</code><br>\n</span><br>\n\n## DataStoreRatingLog\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingLog` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>is_rated: bool</code><br>\n<code>pid: int</code><br>\n<code>rating_value: int</code><br>\n<code>lock_expiration_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## DataStoreRatingTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>slot: int</code><br>\n</span><br>\n\n## DataStoreReqGetAdditionalMeta\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetAdditionalMeta` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n<code>meta_binary: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n</span><br>\n</span><br>\n\n## DataStoreReqGetInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetNotificationUrlInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetNotificationUrlInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>key: str</code><br>\n<code>query: str</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqUpdateInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqUpdateInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>version: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>search_target: int = 1</code><br>\n<code>owner_ids: list[int] = []</code><br>\n<code>owner_type: int = 0</code><br>\n<code>destination_ids: list[int] = []</code><br>\n<code>data_type: int = 65535</code><br>\n<code>created_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>created_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>result_order_column: int = 0</code><br>\n<code>result_order: int = 0</code><br>\n<code>result_range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>minimal_rating_frequency: int = 0</code><br>\n<code>use_cache: bool = False</code><br>\n<code>total_count_enabled: bool = True</code><br>\n<code>data_types: list[int] = []</code><br>\n</span><br>\n\n## DataStoreSearchResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_count: int</code><br>\n<code>result: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>total_count_type: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreTouchObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreTouchObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n## MiiTubeMiiInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MiiTubeMiiInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>meta_info: [DataStoreMetaInfo](#datastoremetainfo) = [DataStoreMetaInfo](#datastoremetainfo)()</code><br>\n<code>category: int</code><br>\n<code>ranking_type: int</code><br>\n</span><br>\n\n## MiiTubeSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MiiTubeSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n<code>page: int = 0</code><br>\n<code>category: int = 255</code><br>\n<code>gender: int = 2</code><br>\n<code>country: int</code><br>\n<code>search_type: int = 0</code><br>\n<code>result_option: int = 0</code><br>\n</span><br>\n\n## MiiTubeSearchResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MiiTubeSearchResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>result: list[[MiiTubeMiiInfo](#miitubemiiinfo)]</code><br>\n<code>count: int</code><br>\n<code>page: int</code><br>\n<code>has_next: bool</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/datastore_smm.md",
    "content": "\n# Module: <code>nintendo.nex.datastore_smm</code>\n\nProvides a client and server for the `DataStoreProtocolSMM`. This page was generated automatically from `datastore_smm.proto`.\n\n<code>**class** [DataStoreClientSMM](#datastoreclientsmm)</code><br>\n<span class=\"docs\">The client for the `DataStoreProtocolSMM`.</span>\n\n<code>**class** [DataStoreServerSMM](#datastoreserversmm)</code><br>\n<span class=\"docs\">The server for the `DataStoreProtocolSMM`.</span>\n\n<code>**class** [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParam](#datastorechangemetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParam](#datastorecompletepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreDeleteParam](#datastoredeleteparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetMetaParam](#datastoregetmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreKeyValue](#datastorekeyvalue)([Structure](common.md))</code><br>\n<code>**class** [DataStoreMetaInfo](#datastoremetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotification](#datastorenotification)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotificationV1](#datastorenotificationv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePasswordInfo](#datastorepasswordinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePermission](#datastorepermission)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInfo](#datastorepersistenceinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInitParam](#datastorepersistenceinitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceTarget](#datastorepersistencetarget)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParam](#datastorepreparegetparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParam](#datastorepreparepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParamV1](#datastorepreparepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRateObjectParam](#datastorerateobjectparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfo](#datastoreratinginfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParam](#datastoreratinginitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingLog](#datastoreratinglog)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingTarget](#datastoreratingtarget)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfo](#datastorereqgetinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfoV1](#datastorereqgetinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfo](#datastorereqpostinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfoV1](#datastorereqpostinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqUpdateInfo](#datastorerequpdateinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchParam](#datastoresearchparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchResult](#datastoresearchresult)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfo](#datastorespecificmetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreTouchObjectParam](#datastoretouchobjectparam)([Structure](common.md))</code><br>\n\n## DataStoreClientSMM\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`DataStoreClientSMM`](#datastoreclientsmm).</span>\n\n<code>**async def prepare_get_object_v1**(param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def prepare_post_object_v1**(param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def complete_post_object_v1**(param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def delete_object**(param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_objects**(param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def change_meta_v1**(param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_metas_v1**(data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_meta**(param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_metas**(data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def complete_update_object**(param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def search_object**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_notification_url**(param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `14` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def get_ratings**(data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `17` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def reset_ratings**(data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def get_specific_meta_v1**(param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def post_meta_binary**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def touch_object**(param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def get_rating_with_log**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `23` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def prepare_get_object**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def complete_post_object**(param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def get_new_arrived_notifications**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `27` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def get_persistence_info**(owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Calls method `29` on the server.</span>\n\n<code>**async def get_persistence_infos**(owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `30` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def unperpetuate_object**(persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `33` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def get_password_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `35` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `36` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def change_meta**(param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def change_metas**(data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def rate_objects**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `40` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def rate_object_with_posting**(target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def rate_objects_with_posting**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `44` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `45` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def get_application_config**(id: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `61` on the server.</span>\n\n<code>**async def get_application_config_string**(id: int) -> list[str]</code><br>\n<span class=\"docs\">Calls method `74` on the server.</span>\n\n## DataStoreServerSMM\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`DataStoreServerSMM`](#datastoreserversmm).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_objects**(client: [RMCClient](rmc.md#rmcclient), param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas_v1**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_notification_url**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_specific_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def touch_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating_with_log**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_info**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_infos**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def unperpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(client: [RMCClient](rmc.md#rmcclient), data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_password_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(client: [RMCClient](rmc.md#rmcclient), params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_object_with_posting**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects_with_posting**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_application_config**(client: [RMCClient](rmc.md#rmcclient), id: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `61`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_application_config_string**(client: [RMCClient](rmc.md#rmcclient), id: int) -> list[str]</code><br>\n<span class=\"docs\">Handler for method `74`. This method should be overridden by a subclass.</span>\n\n## DataStoreChangeMetaCompareParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaCompareParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>comparison_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n</span><br>\n\n## DataStoreChangeMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n<code>compare_param: [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam) = [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)()</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n</span><br>\n\n## DataStoreChangeMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreCompletePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompletePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompleteUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompleteUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>version: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreDeleteParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreDeleteParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreGetMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>access_password: int = 0</code><br>\n</span><br>\n\n## DataStoreGetNewArrivedNotificationsParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNewArrivedNotificationsParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>last_notification_id: int</code><br>\n<code>limit: int</code><br>\n</span><br>\n\n## DataStoreGetNotificationUrlParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNotificationUrlParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>previous_url: str</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreKeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreKeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: str</code><br>\n<code>value: str</code><br>\n</span><br>\n\n## DataStoreMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>create_time: [DateTime](common.md#datetime)</code><br>\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n<code>period: int</code><br>\n<code>status: int</code><br>\n<code>referred_count: int</code><br>\n<code>refer_data_id: int</code><br>\n<code>flag: int</code><br>\n<code>referred_time: [DateTime](common.md#datetime)</code><br>\n<code>expire_time: [DateTime](common.md#datetime)</code><br>\n<code>tags: list[str]</code><br>\n<code>ratings: list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]</code><br>\n</span><br>\n\n## DataStoreNotification\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotification` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStoreNotificationV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotificationV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePasswordInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePasswordInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>access_password: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStorePermission\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePermission` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>permission: int = 3</code><br>\n<code>recipients: list[int] = []</code><br>\n</span><br>\n\n## DataStorePersistenceInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>slot_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePersistenceInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>persistence_id: int = 65535</code><br>\n<code>delete_last_object: bool = True</code><br>\n</span><br>\n\n## DataStorePersistenceTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int = 0</code><br>\n<code>persistence_id: int = 65535</code><br>\n</span><br>\n\n## DataStorePrepareGetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>lock_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>access_password: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str] = []</code><br>\n</span><br>\n</span><br>\n\n## DataStorePrepareGetParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int = 0</code><br>\n</span><br>\n\n## DataStorePreparePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)] = []</code><br>\n<code>persistence_init_param: [DataStorePersistenceInitParam](#datastorepersistenceinitparam) = [DataStorePersistenceInitParam](#datastorepersistenceinitparam)()</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str]</code><br>\n</span><br>\n</span><br>\n\n## DataStorePreparePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int = 0</code><br>\n<code>meta_binary: bytes = b\"\"</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str]</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)]</code><br>\n</span><br>\n\n## DataStorePrepareUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>size: int</code><br>\n<code>update_password: int</code><br>\n<code>extra_data: list[str]</code><br>\n</span><br>\n\n## DataStoreRateObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRateObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rating_value: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n## DataStoreRatingInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_value: int</code><br>\n<code>count: int</code><br>\n<code>initial_value: int</code><br>\n</span><br>\n\n## DataStoreRatingInfoWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfoWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>info: [DataStoreRatingInfo](#datastoreratinginfo) = [DataStoreRatingInfo](#datastoreratinginfo)()</code><br>\n</span><br>\n\n## DataStoreRatingInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flag: int</code><br>\n<code>internal_flag: int</code><br>\n<code>lock_type: int</code><br>\n<code>initial_value: int</code><br>\n<code>range_min: int</code><br>\n<code>range_max: int</code><br>\n<code>period_hour: int</code><br>\n<code>period_duration: int</code><br>\n</span><br>\n\n## DataStoreRatingInitParamWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParamWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>param: [DataStoreRatingInitParam](#datastoreratinginitparam) = [DataStoreRatingInitParam](#datastoreratinginitparam)()</code><br>\n</span><br>\n\n## DataStoreRatingLog\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingLog` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>is_rated: bool</code><br>\n<code>pid: int</code><br>\n<code>rating_value: int</code><br>\n<code>lock_expiration_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## DataStoreRatingTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>slot: int</code><br>\n</span><br>\n\n## DataStoreReqGetAdditionalMeta\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetAdditionalMeta` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n<code>meta_binary: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n</span><br>\n</span><br>\n\n## DataStoreReqGetInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetNotificationUrlInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetNotificationUrlInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>key: str</code><br>\n<code>query: str</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqUpdateInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqUpdateInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>version: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>search_target: int = 1</code><br>\n<code>owner_ids: list[int] = []</code><br>\n<code>owner_type: int = 0</code><br>\n<code>destination_ids: list[int] = []</code><br>\n<code>data_type: int = 65535</code><br>\n<code>created_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>created_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>result_order_column: int = 0</code><br>\n<code>result_order: int = 0</code><br>\n<code>result_range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>minimal_rating_frequency: int = 0</code><br>\n<code>use_cache: bool = False</code><br>\n<code>total_count_enabled: bool = True</code><br>\n<code>data_types: list[int] = []</code><br>\n</span><br>\n\n## DataStoreSearchResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_count: int</code><br>\n<code>result: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>total_count_type: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreTouchObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreTouchObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/datastore_smm2.md",
    "content": "\n# Module: <code>nintendo.nex.datastore_smm2</code>\n\nProvides a client and server for the `DataStoreProtocolSMM2`. This page was generated automatically from `datastore_smm2.proto`.\n\n<code>**class** [DataStoreClientSMM2](#datastoreclientsmm2)</code><br>\n<span class=\"docs\">The client for the `DataStoreProtocolSMM2`.</span>\n\n<code>**class** [DataStoreServerSMM2](#datastoreserversmm2)</code><br>\n<span class=\"docs\">The server for the `DataStoreProtocolSMM2`.</span>\n\n<code>**class** [ClearCondition](#clearcondition)</code><br>\n<code>**class** [CourseDifficulty](#coursedifficulty)</code><br>\n<code>**class** [CourseOption](#courseoption)</code><br>\n<code>**class** [CourseTag](#coursetag)</code><br>\n<code>**class** [CourseTheme](#coursetheme)</code><br>\n<code>**class** [EventCourseOption](#eventcourseoption)</code><br>\n<code>**class** [GameStyle](#gamestyle)</code><br>\n<code>**class** [MultiplayerStatsKeys](#multiplayerstatskeys)</code><br>\n<code>**class** [PlayStatsKeys](#playstatskeys)</code><br>\n<code>**class** [UserOption](#useroption)</code><br>\n\n<code>**class** [BadgeInfo](#badgeinfo)([Structure](common.md))</code><br>\n<code>**class** [CommentInfo](#commentinfo)([Structure](common.md))</code><br>\n<code>**class** [CommentPictureReqGetInfoWithoutHeaders](#commentpicturereqgetinfowithoutheaders)([Structure](common.md))</code><br>\n<code>**class** [CourseInfo](#courseinfo)([Structure](common.md))</code><br>\n<code>**class** [CourseTimeStats](#coursetimestats)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParam](#datastorechangemetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParam](#datastorecompletepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreDeleteParam](#datastoredeleteparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetMetaParam](#datastoregetmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreKeyValue](#datastorekeyvalue)([Structure](common.md))</code><br>\n<code>**class** [DataStoreMetaInfo](#datastoremetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotification](#datastorenotification)([Structure](common.md))</code><br>\n<code>**class** [DataStoreNotificationV1](#datastorenotificationv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePasswordInfo](#datastorepasswordinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePermission](#datastorepermission)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInfo](#datastorepersistenceinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceInitParam](#datastorepersistenceinitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePersistenceTarget](#datastorepersistencetarget)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParam](#datastorepreparegetparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParam](#datastorepreparepostparam)([Structure](common.md))</code><br>\n<code>**class** [DataStorePreparePostParamV1](#datastorepreparepostparamv1)([Structure](common.md))</code><br>\n<code>**class** [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRateObjectParam](#datastorerateobjectparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfo](#datastoreratinginfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParam](#datastoreratinginitparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingLog](#datastoreratinglog)([Structure](common.md))</code><br>\n<code>**class** [DataStoreRatingTarget](#datastoreratingtarget)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfo](#datastorereqgetinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetInfoV1](#datastorereqgetinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfo](#datastorereqpostinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqPostInfoV1](#datastorereqpostinfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreReqUpdateInfo](#datastorerequpdateinfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchParam](#datastoresearchparam)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSearchResult](#datastoresearchresult)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfo](#datastorespecificmetainfo)([Structure](common.md))</code><br>\n<code>**class** [DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)([Structure](common.md))</code><br>\n<code>**class** [DataStoreTouchObjectParam](#datastoretouchobjectparam)([Structure](common.md))</code><br>\n<code>**class** [DeathPositionInfo](#deathpositioninfo)([Structure](common.md))</code><br>\n<code>**class** [EventCourseGhostInfo](#eventcourseghostinfo)([Structure](common.md))</code><br>\n<code>**class** [EventCourseHistogram](#eventcoursehistogram)([Structure](common.md))</code><br>\n<code>**class** [EventCourseInfo](#eventcourseinfo)([Structure](common.md))</code><br>\n<code>**class** [EventCourseStatusInfo](#eventcoursestatusinfo)([Structure](common.md))</code><br>\n<code>**class** [EventCourseThumbnail](#eventcoursethumbnail)([Structure](common.md))</code><br>\n<code>**class** [GetCoursesEventParam](#getcourseseventparam)([Structure](common.md))</code><br>\n<code>**class** [GetCoursesParam](#getcoursesparam)([Structure](common.md))</code><br>\n<code>**class** [GetEventCourseGhostParam](#geteventcourseghostparam)([Structure](common.md))</code><br>\n<code>**class** [GetEventCourseHistogramParam](#geteventcoursehistogramparam)([Structure](common.md))</code><br>\n<code>**class** [GetUserOrCourseParam](#getuserorcourseparam)([Structure](common.md))</code><br>\n<code>**class** [GetUsersParam](#getusersparam)([Structure](common.md))</code><br>\n<code>**class** [GetWorldMapParam](#getworldmapparam)([Structure](common.md))</code><br>\n<code>**class** [RegisterUserParam](#registeruserparam)([Structure](common.md))</code><br>\n<code>**class** [RelationObjectReqGetInfo](#relationobjectreqgetinfo)([Structure](common.md))</code><br>\n<code>**class** [ReqGetInfoHeadersInfo](#reqgetinfoheadersinfo)([Structure](common.md))</code><br>\n<code>**class** [SearchCommentsInOrderParam](#searchcommentsinorderparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesBestTimeParam](#searchcoursesbesttimeparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesEndlessModeParam](#searchcoursesendlessmodeparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesEventParam](#searchcourseseventparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesFirstClearParam](#searchcoursesfirstclearparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesLatestParam](#searchcourseslatestparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesPlayedByParam](#searchcoursesplayedbyparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesPointRankingParam](#searchcoursespointrankingparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesPositiveRatedByParam](#searchcoursespositiveratedbyparam)([Structure](common.md))</code><br>\n<code>**class** [SearchCoursesPostedByParam](#searchcoursespostedbyparam)([Structure](common.md))</code><br>\n<code>**class** [SearchUsersClearedCourseParam](#searchusersclearedcourseparam)([Structure](common.md))</code><br>\n<code>**class** [SearchUsersPlayedCourseParam](#searchusersplayedcourseparam)([Structure](common.md))</code><br>\n<code>**class** [SearchUsersPositiveRatedCourseParam](#searchuserspositiveratedcourseparam)([Structure](common.md))</code><br>\n<code>**class** [SearchUsersUserPointParam](#searchusersuserpointparam)([Structure](common.md))</code><br>\n<code>**class** [SearchWorldMapPickUpParam](#searchworldmappickupparam)([Structure](common.md))</code><br>\n<code>**class** [SearchWorldMapPlayedByParam](#searchworldmapplayedbyparam)([Structure](common.md))</code><br>\n<code>**class** [SyncUserProfileParam](#syncuserprofileparam)([Structure](common.md))</code><br>\n<code>**class** [SyncUserProfileResult](#syncuserprofileresult)([Structure](common.md))</code><br>\n<code>**class** [UnknownStruct1](#unknownstruct1)([Structure](common.md))</code><br>\n<code>**class** [UnknownStruct3](#unknownstruct3)([Structure](common.md))</code><br>\n<code>**class** [UnknownStruct6](#unknownstruct6)([Structure](common.md))</code><br>\n<code>**class** [UserInfo](#userinfo)([Structure](common.md))</code><br>\n<code>**class** [WorldMapInfo](#worldmapinfo)([Structure](common.md))</code><br>\n\n## DataStoreClientSMM2\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`DataStoreClientSMM2`](#datastoreclientsmm2).</span>\n\n<code>**async def prepare_get_object_v1**(param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def prepare_post_object_v1**(param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def complete_post_object_v1**(param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def delete_object**(param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_objects**(param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def change_meta_v1**(param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_metas_v1**(data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_meta**(param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_metas**(data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def complete_update_object**(param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def search_object**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_notification_url**(param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `14` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def get_ratings**(data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `17` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def reset_ratings**(data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def get_specific_meta_v1**(param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def post_meta_binary**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def touch_object**(param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def get_rating_with_log**(target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `23` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def prepare_get_object**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def complete_post_object**(param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def get_new_arrived_notifications**(param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `27` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def get_persistence_info**(owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Calls method `29` on the server.</span>\n\n<code>**async def get_persistence_infos**(owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `30` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def unperpetuate_object**(persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `33` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def get_password_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `35` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `36` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def change_meta**(param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def change_metas**(data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def rate_objects**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `40` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def rate_object_with_posting**(target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def rate_objects_with_posting**(targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `44` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `45` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def register_user**(param: [RegisterUserParam](#registeruserparam)) -> None</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n<code>**async def get_users**(param: [GetUsersParam](#getusersparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `48` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>users: list[[UserInfo](#userinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def sync_user_profile**(param: [SyncUserProfileParam](#syncuserprofileparam)) -> [SyncUserProfileResult](#syncuserprofileresult)</code><br>\n<span class=\"docs\">Calls method `49` on the server.</span>\n\n<code>**async def search_users_user_point**(param: [SearchUsersUserPointParam](#searchusersuserpointparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `50` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>users: list[[UserInfo](#userinfo)]</code><br>\n<code>ranks: list[int]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_users_played_course**(param: [SearchUsersPlayedCourseParam](#searchusersplayedcourseparam)) -> list[[UserInfo](#userinfo)]</code><br>\n<span class=\"docs\">Calls method `53` on the server.</span>\n\n<code>**async def search_users_cleared_course**(param: [SearchUsersClearedCourseParam](#searchusersclearedcourseparam)) -> list[[UserInfo](#userinfo)]</code><br>\n<span class=\"docs\">Calls method `54` on the server.</span>\n\n<code>**async def search_users_positive_rated_course**(param: [SearchUsersPositiveRatedCourseParam](#searchuserspositiveratedcourseparam)) -> list[[UserInfo](#userinfo)]</code><br>\n<span class=\"docs\">Calls method `55` on the server.</span>\n\n<code>**async def update_last_login_time**() -> None</code><br>\n<span class=\"docs\">Calls method `59` on the server.</span>\n\n<code>**async def get_username_ng_type**() -> int</code><br>\n<span class=\"docs\">Calls method `65` on the server.</span>\n\n<code>**async def get_courses**(param: [GetCoursesParam](#getcoursesparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `70` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_point_ranking**(param: [SearchCoursesPointRankingParam](#searchcoursespointrankingparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `71` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>ranks: list[int]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_latest**(param: [SearchCoursesLatestParam](#searchcourseslatestparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `73` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_posted_by**(param: [SearchCoursesPostedByParam](#searchcoursespostedbyparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `74` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_positive_rated_by**(param: [SearchCoursesPositiveRatedByParam](#searchcoursespositiveratedbyparam)) -> list[[CourseInfo](#courseinfo)]</code><br>\n<span class=\"docs\">Calls method `75` on the server.</span>\n\n<code>**async def search_courses_played_by**(param: [SearchCoursesPlayedByParam](#searchcoursesplayedbyparam)) -> list[[CourseInfo](#courseinfo)]</code><br>\n<span class=\"docs\">Calls method `76` on the server.</span>\n\n<code>**async def search_courses_endless_mode**(param: [SearchCoursesEndlessModeParam](#searchcoursesendlessmodeparam)) -> list[[CourseInfo](#courseinfo)]</code><br>\n<span class=\"docs\">Calls method `79` on the server.</span>\n\n<code>**async def search_courses_first_clear**(param: [SearchCoursesFirstClearParam](#searchcoursesfirstclearparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `80` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_best_time**(param: [SearchCoursesBestTimeParam](#searchcoursesbesttimeparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `81` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_courses_event**(param: [GetCoursesParam](#getcoursesparam), dummy: [GetCoursesEventParam](#getcourseseventparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `85` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[EventCourseInfo](#eventcourseinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_event**(param: [SearchCoursesEventParam](#searchcourseseventparam)) -> list[[EventCourseInfo](#eventcourseinfo)]</code><br>\n<span class=\"docs\">Calls method `86` on the server.</span>\n\n<code>**async def search_comments_in_order**(param: [SearchCommentsInOrderParam](#searchcommentsinorderparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `94` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>comments: list[[CommentInfo](#commentinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_comments**(data_id: int) -> list[[CommentInfo](#commentinfo)]</code><br>\n<span class=\"docs\">Calls method `95` on the server.</span>\n\n<code>**async def get_death_positions**(data_id: int) -> list[[DeathPositionInfo](#deathpositioninfo)]</code><br>\n<span class=\"docs\">Calls method `103` on the server.</span>\n\n<code>**async def get_user_or_course**(param: [GetUserOrCourseParam](#getuserorcourseparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `131` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>user: [UserInfo](#userinfo)</code><br>\n<code>course: [CourseInfo](#courseinfo)</code><br>\n</span>\n</span>\n\n<code>**async def get_req_get_info_headers_info**(type: int) -> [ReqGetInfoHeadersInfo](#reqgetinfoheadersinfo)</code><br>\n<span class=\"docs\">Calls method `134` on the server.</span>\n\n<code>**async def get_event_course_stamp**() -> int</code><br>\n<span class=\"docs\">Calls method `153` on the server.</span>\n\n<code>**async def get_event_course_status**() -> [EventCourseStatusInfo](#eventcoursestatusinfo)</code><br>\n<span class=\"docs\">Calls method `154` on the server.</span>\n\n<code>**async def get_event_course_histogram**(param: [GetEventCourseHistogramParam](#geteventcoursehistogramparam)) -> [EventCourseHistogram](#eventcoursehistogram)</code><br>\n<span class=\"docs\">Calls method `156` on the server.</span>\n\n<code>**async def get_event_course_ghost**(param: [GetEventCourseGhostParam](#geteventcourseghostparam)) -> list[[EventCourseGhostInfo](#eventcourseghostinfo)]</code><br>\n<span class=\"docs\">Calls method `157` on the server.</span>\n\n<code>**async def get_world_map**(param: [GetWorldMapParam](#getworldmapparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `160` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>maps: list[[WorldMapInfo](#worldmapinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_world_map_pick_up**(param: [SearchWorldMapPickUpParam](#searchworldmappickupparam)) -> list[[WorldMapInfo](#worldmapinfo)]</code><br>\n<span class=\"docs\">Calls method `162` on the server.</span>\n\n## DataStoreServerSMM2\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`DataStoreServerSMM2`](#datastoreserversmm2).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParamV1](#datastorepreparegetparamv1)) -> [DataStoreReqGetInfoV1](#datastorereqgetinfov1)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParamV1](#datastorepreparepostparamv1)) -> [DataStoreReqPostInfoV1](#datastorereqpostinfov1)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParamV1](#datastorecompletepostparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreDeleteParam](#datastoredeleteparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_objects**(client: [RMCClient](rmc.md#rmcclient), param: list[[DataStoreDeleteParam](#datastoredeleteparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas_v1**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParamV1](#datastorechangemetaparamv1)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [DataStoreMetaInfo](#datastoremetainfo)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: [DataStoreGetMetaParam](#datastoregetmetaparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>info: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def prepare_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareUpdateParam](#datastoreprepareupdateparam)) -> [DataStoreReqUpdateInfo](#datastorerequpdateinfo)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_update_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompleteUpdateParam](#datastorecompleteupdateparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_notification_url**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNotificationUrlParam](#datastoregetnotificationurlparam)) -> [DataStoreReqGetNotificationUrlInfo](#datastorereqgetnotificationurlinfo)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotificationV1](#datastorenotificationv1)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def rate_object**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), param: [DataStoreRateObjectParam](#datastorerateobjectparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def reset_rating**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), update_password: int) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_ratings**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_specific_meta_v1**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParamV1](#datastoregetspecificmetaparamv1)) -> list[[DataStoreSpecificMetaInfoV1](#datastorespecificmetainfov1)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def touch_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreTouchObjectParam](#datastoretouchobjectparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_rating_with_log**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), access_password: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>rating: [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<code>log: [DataStoreRatingLog](#datastoreratinglog)</code><br>\n</span>\n</span>\n\n<code>**async def prepare_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> [DataStoreReqPostInfo](#datastorereqpostinfo)</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def complete_post_object**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreCompletePostParam](#datastorecompletepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_new_arrived_notifications**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetNewArrivedNotificationsParam](#datastoregetnewarrivednotificationsparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: list[[DataStoreNotification](#datastorenotification)]</code><br>\n<code>has_next: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_specific_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreGetSpecificMetaParam](#datastoregetspecificmetaparam)) -> list[[DataStoreSpecificMetaInfo](#datastorespecificmetainfo)]</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_info**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_id: int) -> [DataStorePersistenceInfo](#datastorepersistenceinfo)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_persistence_infos**(client: [RMCClient](rmc.md#rmcclient), owner_id: int, slot_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePersistenceInfo](#datastorepersistenceinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def perpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, data_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def unperpetuate_object**(client: [RMCClient](rmc.md#rmcclient), persistence_slot_id: int, delete_last_object: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def prepare_get_object_or_meta_binary**(client: [RMCClient](rmc.md#rmcclient), param: [DataStorePrepareGetParam](#datastorepreparegetparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo)</code><br>\n<code>additional_meta: [DataStoreReqGetAdditionalMeta](#datastorereqgetadditionalmeta)</code><br>\n</span>\n</span>\n\n<code>**async def get_password_info**(client: [RMCClient](rmc.md#rmcclient), data_id: int) -> [DataStorePasswordInfo](#datastorepasswordinfo)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_password_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStorePasswordInfo](#datastorepasswordinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_metas_multiple_param**(client: [RMCClient](rmc.md#rmcclient), params: list[[DataStoreGetMetaParam](#datastoregetmetaparam)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def complete_post_objects**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_meta**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreChangeMetaParam](#datastorechangemetaparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_metas**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStoreChangeMetaParam](#datastorechangemetaparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def post_meta_binary_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_id: int, param: [DataStorePreparePostParam](#datastorepreparepostparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def post_meta_binaries_with_data_id**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int], param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool) -> list[[Result](common.md#result)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_object_with_posting**(client: [RMCClient](rmc.md#rmcclient), target: [DataStoreRatingTarget](#datastoreratingtarget), rate_param: [DataStoreRateObjectParam](#datastorerateobjectparam), post_param: [DataStorePreparePostParam](#datastorepreparepostparam), fetch_ratings: bool) -> [DataStoreRatingInfo](#datastoreratinginfo)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def rate_objects_with_posting**(client: [RMCClient](rmc.md#rmcclient), targets: list[[DataStoreRatingTarget](#datastoreratingtarget)], rate_param: list[[DataStoreRateObjectParam](#datastorerateobjectparam)], post_param: list[[DataStorePreparePostParam](#datastorepreparepostparam)], transactional: bool, fetch_ratings: bool) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>ratings: list[[DataStoreRatingInfo](#datastoreratinginfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_object_infos**(client: [RMCClient](rmc.md#rmcclient), data_ids: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>infos: list[[DataStoreReqGetInfo](#datastorereqgetinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_object_light**(client: [RMCClient](rmc.md#rmcclient), param: [DataStoreSearchParam](#datastoresearchparam)) -> [DataStoreSearchResult](#datastoresearchresult)</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_user**(client: [RMCClient](rmc.md#rmcclient), param: [RegisterUserParam](#registeruserparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_users**(client: [RMCClient](rmc.md#rmcclient), param: [GetUsersParam](#getusersparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `48`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>users: list[[UserInfo](#userinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def sync_user_profile**(client: [RMCClient](rmc.md#rmcclient), param: [SyncUserProfileParam](#syncuserprofileparam)) -> [SyncUserProfileResult](#syncuserprofileresult)</code><br>\n<span class=\"docs\">Handler for method `49`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_users_user_point**(client: [RMCClient](rmc.md#rmcclient), param: [SearchUsersUserPointParam](#searchusersuserpointparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `50`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>users: list[[UserInfo](#userinfo)]</code><br>\n<code>ranks: list[int]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_users_played_course**(client: [RMCClient](rmc.md#rmcclient), param: [SearchUsersPlayedCourseParam](#searchusersplayedcourseparam)) -> list[[UserInfo](#userinfo)]</code><br>\n<span class=\"docs\">Handler for method `53`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_users_cleared_course**(client: [RMCClient](rmc.md#rmcclient), param: [SearchUsersClearedCourseParam](#searchusersclearedcourseparam)) -> list[[UserInfo](#userinfo)]</code><br>\n<span class=\"docs\">Handler for method `54`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_users_positive_rated_course**(client: [RMCClient](rmc.md#rmcclient), param: [SearchUsersPositiveRatedCourseParam](#searchuserspositiveratedcourseparam)) -> list[[UserInfo](#userinfo)]</code><br>\n<span class=\"docs\">Handler for method `55`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_last_login_time**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `59`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_username_ng_type**(client: [RMCClient](rmc.md#rmcclient)) -> int</code><br>\n<span class=\"docs\">Handler for method `65`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_courses**(client: [RMCClient](rmc.md#rmcclient), param: [GetCoursesParam](#getcoursesparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `70`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_point_ranking**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesPointRankingParam](#searchcoursespointrankingparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `71`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>ranks: list[int]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_latest**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesLatestParam](#searchcourseslatestparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `73`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_posted_by**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesPostedByParam](#searchcoursespostedbyparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `74`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_positive_rated_by**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesPositiveRatedByParam](#searchcoursespositiveratedbyparam)) -> list[[CourseInfo](#courseinfo)]</code><br>\n<span class=\"docs\">Handler for method `75`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_courses_played_by**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesPlayedByParam](#searchcoursesplayedbyparam)) -> list[[CourseInfo](#courseinfo)]</code><br>\n<span class=\"docs\">Handler for method `76`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_courses_endless_mode**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesEndlessModeParam](#searchcoursesendlessmodeparam)) -> list[[CourseInfo](#courseinfo)]</code><br>\n<span class=\"docs\">Handler for method `79`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_courses_first_clear**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesFirstClearParam](#searchcoursesfirstclearparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `80`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_best_time**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesBestTimeParam](#searchcoursesbesttimeparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `81`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[CourseInfo](#courseinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def get_courses_event**(client: [RMCClient](rmc.md#rmcclient), param: [GetCoursesParam](#getcoursesparam), dummy: [GetCoursesEventParam](#getcourseseventparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `85`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>courses: list[[EventCourseInfo](#eventcourseinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_courses_event**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCoursesEventParam](#searchcourseseventparam)) -> list[[EventCourseInfo](#eventcourseinfo)]</code><br>\n<span class=\"docs\">Handler for method `86`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_comments_in_order**(client: [RMCClient](rmc.md#rmcclient), param: [SearchCommentsInOrderParam](#searchcommentsinorderparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `94`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>comments: list[[CommentInfo](#commentinfo)]</code><br>\n<code>result: bool</code><br>\n</span>\n</span>\n\n<code>**async def search_comments**(client: [RMCClient](rmc.md#rmcclient), data_id: int) -> list[[CommentInfo](#commentinfo)]</code><br>\n<span class=\"docs\">Handler for method `95`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_death_positions**(client: [RMCClient](rmc.md#rmcclient), data_id: int) -> list[[DeathPositionInfo](#deathpositioninfo)]</code><br>\n<span class=\"docs\">Handler for method `103`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_user_or_course**(client: [RMCClient](rmc.md#rmcclient), param: [GetUserOrCourseParam](#getuserorcourseparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `131`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>user: [UserInfo](#userinfo)</code><br>\n<code>course: [CourseInfo](#courseinfo)</code><br>\n</span>\n</span>\n\n<code>**async def get_req_get_info_headers_info**(client: [RMCClient](rmc.md#rmcclient), type: int) -> [ReqGetInfoHeadersInfo](#reqgetinfoheadersinfo)</code><br>\n<span class=\"docs\">Handler for method `134`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_event_course_stamp**(client: [RMCClient](rmc.md#rmcclient)) -> int</code><br>\n<span class=\"docs\">Handler for method `153`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_event_course_status**(client: [RMCClient](rmc.md#rmcclient)) -> [EventCourseStatusInfo](#eventcoursestatusinfo)</code><br>\n<span class=\"docs\">Handler for method `154`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_event_course_histogram**(client: [RMCClient](rmc.md#rmcclient), param: [GetEventCourseHistogramParam](#geteventcoursehistogramparam)) -> [EventCourseHistogram](#eventcoursehistogram)</code><br>\n<span class=\"docs\">Handler for method `156`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_event_course_ghost**(client: [RMCClient](rmc.md#rmcclient), param: [GetEventCourseGhostParam](#geteventcourseghostparam)) -> list[[EventCourseGhostInfo](#eventcourseghostinfo)]</code><br>\n<span class=\"docs\">Handler for method `157`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_world_map**(client: [RMCClient](rmc.md#rmcclient), param: [GetWorldMapParam](#getworldmapparam)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `160`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>maps: list[[WorldMapInfo](#worldmapinfo)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def search_world_map_pick_up**(client: [RMCClient](rmc.md#rmcclient), param: [SearchWorldMapPickUpParam](#searchworldmappickupparam)) -> list[[WorldMapInfo](#worldmapinfo)]</code><br>\n<span class=\"docs\">Handler for method `162`. This method should be overridden by a subclass.</span>\n\n## ClearCondition\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`NORMAL = 0`<br>\n`COLLECT_COINS = 4116396131`<br>\n`KILL_SKIPSQUEAKS = 4042480826`<br>\n</span>\n\n## CourseDifficulty\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`EASY = 0`<br>\n`STANDARD = 1`<br>\n`EXPERT = 2`<br>\n`SUPER_EXPERT = 3`<br>\n</span>\n\n## CourseOption\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`PLAY_STATS = 1`<br>\n`RATINGS = 2`<br>\n`TIME_STATS = 4`<br>\n`COMMENT_STATS = 8`<br>\n`UNK9 = 16`<br>\n`UNK10 = 32`<br>\n`UNK8 = 64`<br>\n`ONE_SCREEN_THUMBNAIL = 128`<br>\n`ENTIRE_THUMBNAIL = 256`<br>\n`ALL = 511`<br>\n</span>\n\n## CourseTag\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`NONE = 0`<br>\n`STANDARD = 1`<br>\n`PUZZLE_SOLVING = 2`<br>\n`SPEEDRUN = 3`<br>\n`AUTOSCROLL = 4`<br>\n`AUTO_MARIO = 5`<br>\n`SHORT_AND_SWEET = 6`<br>\n`MULTIPLAYER_VS = 7`<br>\n`THEMED = 8`<br>\n`MUSIC = 9`<br>\n</span>\n\n## CourseTheme\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GROUND = 0`<br>\n`UNDERGROUND = 1`<br>\n`CASTLE = 2`<br>\n`AIRSHIP = 3`<br>\n`UNDERWATER = 4`<br>\n`GHOST_HOUSE = 5`<br>\n`SNOW = 6`<br>\n`DESERT = 7`<br>\n`SKY = 8`<br>\n`FOREST = 9`<br>\n</span>\n\n## EventCourseOption\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`UNK3 = 1`<br>\n`GET_INFO = 2`<br>\n`BEST_TIME = 8`<br>\n`ONE_SCREEN_THUMBNAIL = 16`<br>\n`ENTIRE_THUMBNAIL = 32`<br>\n`UNK1 = 64`<br>\n`MEDAL_TIME = 256`<br>\n`GHOST = 512`<br>\n`ALL = 1023`<br>\n</span>\n\n## GameStyle\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`SMB1 = 0`<br>\n`SMB3 = 1`<br>\n`SMW = 2`<br>\n`NSMBU = 3`<br>\n`SM3DW = 4`<br>\n</span>\n\n## MultiplayerStatsKeys\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`MULTIPLAYER_SCORE = 0`<br>\n`VERSUS_PLAYS = 2`<br>\n`VERSUS_WINS = 3`<br>\n`COOP_PLAYS = 10`<br>\n`COOP_WINS = 11`<br>\n</span>\n\n## PlayStatsKeys\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`PLAYS = 0`<br>\n`CLEARS = 1`<br>\n`ATTEMPTS = 2`<br>\n`DEATHS = 3`<br>\n</span>\n\n## UserOption\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`PLAY_STATS = 1`<br>\n`MAKER_STATS = 2`<br>\n`UNK2 = 4`<br>\n`ENDLESS_MODE = 8`<br>\n`MULTIPLAYER_STATS = 16`<br>\n`BADGE_INFO = 32`<br>\n`UNK8 = 64`<br>\n`UNK9 = 128`<br>\n`UNK1 = 512`<br>\n`UNK7 = 1024`<br>\n`UNK11 = 4096`<br>\n`UNK13 = 8192`<br>\n`UNK15 = 32768`<br>\n`ALL = 65535`<br>\n</span>\n\n## BadgeInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `BadgeInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n</span><br>\n\n## CommentInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CommentInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: str</code><br>\n<code>unk3: int</code><br>\n<code>unk4: int</code><br>\n<code>unk5: int</code><br>\n<code>unk6: int</code><br>\n<code>unk7: int</code><br>\n<code>unk8: int</code><br>\n<code>unk9: int</code><br>\n<code>unk10: int</code><br>\n<code>unk11: bool</code><br>\n<code>unk12: bool</code><br>\n<code>unk13: [DateTime](common.md#datetime)</code><br>\n<code>unk14: bytes</code><br>\n<code>unk15: str</code><br>\n<code>picture: [CommentPictureReqGetInfoWithoutHeaders](#commentpicturereqgetinfowithoutheaders) = [CommentPictureReqGetInfoWithoutHeaders](#commentpicturereqgetinfowithoutheaders)()</code><br>\n<code>unk16: int</code><br>\n<code>unk17: int</code><br>\n</span><br>\n\n## CommentPictureReqGetInfoWithoutHeaders\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CommentPictureReqGetInfoWithoutHeaders` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>data_type: int</code><br>\n<code>unk1: int</code><br>\n<code>unk2: bytes</code><br>\n<code>filename: str</code><br>\n</span><br>\n\n## CourseInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CourseInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>code: str</code><br>\n<code>owner_id: int</code><br>\n<code>name: str</code><br>\n<code>description: str</code><br>\n<code>game_style: int</code><br>\n<code>course_theme: int</code><br>\n<code>upload_time: [DateTime](common.md#datetime)</code><br>\n<code>difficulty: int</code><br>\n<code>tag1: int</code><br>\n<code>tag2: int</code><br>\n<code>unk1: int</code><br>\n<code>clear_condition: int</code><br>\n<code>clear_condition_magnitude: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: bytes</code><br>\n<code>play_stats: dict[int, int]</code><br>\n<code>ratings: dict[int, int]</code><br>\n<code>unk4: dict[int, int]</code><br>\n<code>time_stats: [CourseTimeStats](#coursetimestats) = [CourseTimeStats](#coursetimestats)()</code><br>\n<code>comment_stats: dict[int, int]</code><br>\n<code>unk9: int</code><br>\n<code>unk10: int</code><br>\n<code>unk11: int</code><br>\n<code>unk12: int</code><br>\n<code>one_screen_thumbnail: [RelationObjectReqGetInfo](#relationobjectreqgetinfo) = [RelationObjectReqGetInfo](#relationobjectreqgetinfo)()</code><br>\n<code>entire_thumbnail: [RelationObjectReqGetInfo](#relationobjectreqgetinfo) = [RelationObjectReqGetInfo](#relationobjectreqgetinfo)()</code><br>\n</span><br>\n\n## CourseTimeStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CourseTimeStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>first_completion: int</code><br>\n<code>world_record_holder: int</code><br>\n<code>world_record: int</code><br>\n<code>upload_time: int</code><br>\n</span><br>\n\n## DataStoreChangeMetaCompareParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaCompareParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>comparison_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n</span><br>\n\n## DataStoreChangeMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n<code>referred_count: int</code><br>\n<code>data_type: int</code><br>\n<code>status: int</code><br>\n<code>compare_param: [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam) = [DataStoreChangeMetaCompareParam](#datastorechangemetacompareparam)()</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n</span><br>\n\n## DataStoreChangeMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreChangeMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>modifies_flag: int</code><br>\n<code>name: str</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>period: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>tags: list[str]</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreCompletePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompletePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompletePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreCompleteUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreCompleteUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>version: int</code><br>\n<code>success: bool</code><br>\n</span><br>\n\n## DataStoreDeleteParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreDeleteParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStoreGetMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>access_password: int = 0</code><br>\n</span><br>\n\n## DataStoreGetNewArrivedNotificationsParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNewArrivedNotificationsParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>last_notification_id: int</code><br>\n<code>limit: int</code><br>\n</span><br>\n\n## DataStoreGetNotificationUrlParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetNotificationUrlParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>previous_url: str</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreGetSpecificMetaParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreGetSpecificMetaParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n</span><br>\n\n## DataStoreKeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreKeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: str</code><br>\n<code>value: str</code><br>\n</span><br>\n\n## DataStoreMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>create_time: [DateTime](common.md#datetime)</code><br>\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n<code>period: int</code><br>\n<code>status: int</code><br>\n<code>referred_count: int</code><br>\n<code>refer_data_id: int</code><br>\n<code>flag: int</code><br>\n<code>referred_time: [DateTime](common.md#datetime)</code><br>\n<code>expire_time: [DateTime](common.md#datetime)</code><br>\n<code>tags: list[str]</code><br>\n<code>ratings: list[[DataStoreRatingInfoWithSlot](#datastoreratinginfowithslot)]</code><br>\n</span><br>\n\n## DataStoreNotification\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotification` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStoreNotificationV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreNotificationV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>notification_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePasswordInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePasswordInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>access_password: int</code><br>\n<code>update_password: int</code><br>\n</span><br>\n\n## DataStorePermission\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePermission` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>permission: int = 3</code><br>\n<code>recipients: list[int] = []</code><br>\n</span><br>\n\n## DataStorePersistenceInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>slot_id: int</code><br>\n<code>data_id: int</code><br>\n</span><br>\n\n## DataStorePersistenceInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>persistence_id: int = 65535</code><br>\n<code>delete_last_object: bool = True</code><br>\n</span><br>\n\n## DataStorePersistenceTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePersistenceTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int = 0</code><br>\n<code>persistence_id: int = 65535</code><br>\n</span><br>\n\n## DataStorePrepareGetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int = 0</code><br>\n<code>lock_id: int = 0</code><br>\n<code>persistence_target: [DataStorePersistenceTarget](#datastorepersistencetarget) = [DataStorePersistenceTarget](#datastorepersistencetarget)()</code><br>\n<code>access_password: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str] = []</code><br>\n</span><br>\n</span><br>\n\n## DataStorePrepareGetParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareGetParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int = 0</code><br>\n</span><br>\n\n## DataStorePreparePostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int</code><br>\n<code>meta_binary: bytes</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)] = []</code><br>\n<code>persistence_init_param: [DataStorePersistenceInitParam](#datastorepersistenceinitparam) = [DataStorePersistenceInitParam](#datastorepersistenceinitparam)()</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>extra_data: list[str]</code><br>\n</span><br>\n</span><br>\n\n## DataStorePreparePostParamV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePreparePostParamV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>size: int</code><br>\n<code>name: str</code><br>\n<code>data_type: int = 0</code><br>\n<code>meta_binary: bytes = b\"\"</code><br>\n<code>permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>delete_permission: [DataStorePermission](#datastorepermission) = [DataStorePermission](#datastorepermission)()</code><br>\n<code>flag: int</code><br>\n<code>period: int</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str]</code><br>\n<code>rating_init_param: list[[DataStoreRatingInitParamWithSlot](#datastoreratinginitparamwithslot)]</code><br>\n</span><br>\n\n## DataStorePrepareUpdateParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStorePrepareUpdateParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>size: int</code><br>\n<code>update_password: int</code><br>\n<code>extra_data: list[str]</code><br>\n</span><br>\n\n## DataStoreRateObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRateObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rating_value: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n## DataStoreRatingInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_value: int</code><br>\n<code>count: int</code><br>\n<code>initial_value: int</code><br>\n</span><br>\n\n## DataStoreRatingInfoWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInfoWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>info: [DataStoreRatingInfo](#datastoreratinginfo) = [DataStoreRatingInfo](#datastoreratinginfo)()</code><br>\n</span><br>\n\n## DataStoreRatingInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flag: int</code><br>\n<code>internal_flag: int</code><br>\n<code>lock_type: int</code><br>\n<code>initial_value: int</code><br>\n<code>range_min: int</code><br>\n<code>range_max: int</code><br>\n<code>period_hour: int</code><br>\n<code>period_duration: int</code><br>\n</span><br>\n\n## DataStoreRatingInitParamWithSlot\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingInitParamWithSlot` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>slot: int</code><br>\n<code>param: [DataStoreRatingInitParam](#datastoreratinginitparam) = [DataStoreRatingInitParam](#datastoreratinginitparam)()</code><br>\n</span><br>\n\n## DataStoreRatingLog\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingLog` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>is_rated: bool</code><br>\n<code>pid: int</code><br>\n<code>rating_value: int</code><br>\n<code>lock_expiration_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## DataStoreRatingTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreRatingTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>slot: int</code><br>\n</span><br>\n\n## DataStoreReqGetAdditionalMeta\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetAdditionalMeta` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>owner_id: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n<code>meta_binary: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n</span><br>\n</span><br>\n\n## DataStoreReqGetInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>size: int</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqGetNotificationUrlInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqGetNotificationUrlInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>key: str</code><br>\n<code>query: str</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqPostInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqPostInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreReqUpdateInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreReqUpdateInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>version: int</code><br>\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>form: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>root_ca_cert: bytes</code><br>\n</span><br>\n\n## DataStoreSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>search_target: int = 1</code><br>\n<code>owner_ids: list[int] = []</code><br>\n<code>owner_type: int = 0</code><br>\n<code>destination_ids: list[int] = []</code><br>\n<code>data_type: int = 65535</code><br>\n<code>created_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>created_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_after: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>updated_before: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).future()</code><br>\n<code>refer_data_id: int = 0</code><br>\n<code>tags: list[str] = []</code><br>\n<code>result_order_column: int = 0</code><br>\n<code>result_order: int = 0</code><br>\n<code>result_range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>result_option: int = 0</code><br>\n<code>minimal_rating_frequency: int = 0</code><br>\n<code>use_cache: bool = False</code><br>\n<code>total_count_enabled: bool = True</code><br>\n<code>data_types: list[int] = []</code><br>\n</span><br>\n\n## DataStoreSearchResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSearchResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>total_count: int</code><br>\n<code>result: list[[DataStoreMetaInfo](#datastoremetainfo)]</code><br>\n<code>total_count_type: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreSpecificMetaInfoV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreSpecificMetaInfoV1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>owner_id: int</code><br>\n<code>size: int</code><br>\n<code>data_type: int</code><br>\n<code>version: int</code><br>\n</span><br>\n\n## DataStoreTouchObjectParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DataStoreTouchObjectParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>lock_id: int</code><br>\n<code>access_password: int</code><br>\n</span><br>\n\n## DeathPositionInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DeathPositionInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>x: int</code><br>\n<code>y: int</code><br>\n<code>is_subworld: bool</code><br>\n</span><br>\n\n## EventCourseGhostInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `EventCourseGhostInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>replay_file: [RelationObjectReqGetInfo](#relationobjectreqgetinfo) = [RelationObjectReqGetInfo](#relationobjectreqgetinfo)()</code><br>\n<code>time: int</code><br>\n<code>pid: int</code><br>\n</span><br>\n\n## EventCourseHistogram\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `EventCourseHistogram` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: int</code><br>\n<code>values: list[int]</code><br>\n<code>medals: dict[int, int]</code><br>\n<code>unk4: int</code><br>\n</span><br>\n\n## EventCourseInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `EventCourseInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>name: str</code><br>\n<code>description: str</code><br>\n<code>game_style: int</code><br>\n<code>course_theme: int</code><br>\n<code>unk1: bool</code><br>\n<code>unk2: bool</code><br>\n<code>upload_time: [DateTime](common.md#datetime)</code><br>\n<code>get_info: [DataStoreReqGetInfo](#datastorereqgetinfo) = [DataStoreReqGetInfo](#datastorereqgetinfo)()</code><br>\n<code>unk3: dict[int, int]</code><br>\n<code>unk4: [UnknownStruct6](#unknownstruct6) = [UnknownStruct6](#unknownstruct6)()</code><br>\n<code>unk5: int</code><br>\n<code>one_screen_thumbnail: [EventCourseThumbnail](#eventcoursethumbnail) = [EventCourseThumbnail](#eventcoursethumbnail)()</code><br>\n<code>entire_thumbnail: [EventCourseThumbnail](#eventcoursethumbnail) = [EventCourseThumbnail](#eventcoursethumbnail)()</code><br>\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>end_time: [DateTime](common.md#datetime)</code><br>\n<code>unk6: int</code><br>\n<code>unk7: int</code><br>\n<code>unk8: int</code><br>\n<code>unk9: int</code><br>\n<code>best_time: int</code><br>\n<code>unk10: int</code><br>\n<code>medal_time: int</code><br>\n<code>personal_ghost: [RelationObjectReqGetInfo](#relationobjectreqgetinfo) = [RelationObjectReqGetInfo](#relationobjectreqgetinfo)()</code><br>\n</span><br>\n</span><br>\n\n## EventCourseStatusInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `EventCourseStatusInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: bool</code><br>\n<code>unk3: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## EventCourseThumbnail\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `EventCourseThumbnail` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>filesize: int</code><br>\n<code>root_ca_cert: bytes</code><br>\n<code>filename: str</code><br>\n</span><br>\n\n## GetCoursesEventParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetCoursesEventParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n</span><br>\n\n## GetCoursesParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetCoursesParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_ids: list[int]</code><br>\n<code>option: int = 0</code><br>\n</span><br>\n\n## GetEventCourseGhostParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetEventCourseGhostParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>time: int</code><br>\n<code>count: int</code><br>\n</span><br>\n\n## GetEventCourseHistogramParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetEventCourseHistogramParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n</span><br>\n\n## GetUserOrCourseParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetUserOrCourseParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>code: str</code><br>\n<code>user_option: int = 0</code><br>\n<code>course_option: int = 0</code><br>\n</span><br>\n\n## GetUsersParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetUsersParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pids: list[int]</code><br>\n<code>option: int = 0</code><br>\n</span><br>\n\n## GetWorldMapParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GetWorldMapParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>ids: list[str]</code><br>\n<code>option: int = 0</code><br>\n</span><br>\n\n## RegisterUserParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RegisterUserParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n<code>unk1: [UnknownStruct1](#unknownstruct1) = [UnknownStruct1](#unknownstruct1)()</code><br>\n<code>unk2: bytes</code><br>\n<code>language: int</code><br>\n<code>country: str</code><br>\n<code>device_id: str</code><br>\n</span><br>\n\n## RelationObjectReqGetInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RelationObjectReqGetInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>url: str</code><br>\n<code>data_type: int</code><br>\n<code>size: int</code><br>\n<code>unk: bytes</code><br>\n<code>filename: str</code><br>\n</span><br>\n\n## ReqGetInfoHeadersInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ReqGetInfoHeadersInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>headers: list[[DataStoreKeyValue](#datastorekeyvalue)]</code><br>\n<code>expiration: int</code><br>\n</span><br>\n\n## SearchCommentsInOrderParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCommentsInOrderParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## SearchCoursesBestTimeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesBestTimeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>option: int = 0</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## SearchCoursesEndlessModeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesEndlessModeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>count: int</code><br>\n<code>difficulty: int</code><br>\n</span><br>\n\n## SearchCoursesEventParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesEventParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n</span><br>\n\n## SearchCoursesFirstClearParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesFirstClearParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>option: int = 0</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## SearchCoursesLatestParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesLatestParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## SearchCoursesPlayedByParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesPlayedByParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>count: int</code><br>\n<code>pid: int</code><br>\n</span><br>\n\n## SearchCoursesPointRankingParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesPointRankingParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>difficulty: int</code><br>\n<code>reject_regions: list[int] = []</code><br>\n</span><br>\n\n## SearchCoursesPositiveRatedByParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesPositiveRatedByParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>count: int</code><br>\n<code>pid: int</code><br>\n</span><br>\n\n## SearchCoursesPostedByParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchCoursesPostedByParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>pids: list[int]</code><br>\n</span><br>\n\n## SearchUsersClearedCourseParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchUsersClearedCourseParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>option: int = 0</code><br>\n<code>count: int</code><br>\n</span><br>\n\n## SearchUsersPlayedCourseParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchUsersPlayedCourseParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>option: int = 0</code><br>\n<code>count: int</code><br>\n</span><br>\n\n## SearchUsersPositiveRatedCourseParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchUsersPositiveRatedCourseParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data_id: int</code><br>\n<code>option: int = 0</code><br>\n<code>count: int</code><br>\n</span><br>\n\n## SearchUsersUserPointParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchUsersUserPointParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n<code>buffer: bytes</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## SearchWorldMapPickUpParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchWorldMapPickUpParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>count: int</code><br>\n</span><br>\n\n## SearchWorldMapPlayedByParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SearchWorldMapPlayedByParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n</span><br>\n\n## SyncUserProfileParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SyncUserProfileParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>username: str</code><br>\n<code>unk1: [UnknownStruct1](#unknownstruct1) = [UnknownStruct1](#unknownstruct1)()</code><br>\n<code>unk2: bytes</code><br>\n<code>unk3: int</code><br>\n<code>country: str</code><br>\n<code>unk4: bool</code><br>\n<code>unk5: bool</code><br>\n<code>unk_guid: str</code><br>\n<code>unk6: int</code><br>\n</span><br>\n\n## SyncUserProfileResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SyncUserProfileResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>username: str</code><br>\n<code>unk1: [UnknownStruct1](#unknownstruct1) = [UnknownStruct1](#unknownstruct1)()</code><br>\n<code>unk2: bytes</code><br>\n<code>unk3: int</code><br>\n<code>country: str</code><br>\n<code>unk4: int</code><br>\n<code>unk5: bool</code><br>\n<code>unk6: bool</code><br>\n</span><br>\n\n## UnknownStruct1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UnknownStruct1` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: int</code><br>\n<code>unk4: int</code><br>\n</span><br>\n\n## UnknownStruct3\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UnknownStruct3` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: bool</code><br>\n<code>unk2: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## UnknownStruct6\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UnknownStruct6` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n</span><br>\n\n## UserInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UserInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>code: str</code><br>\n<code>name: str</code><br>\n<code>unk1: [UnknownStruct1](#unknownstruct1) = [UnknownStruct1](#unknownstruct1)()</code><br>\n<code>unk2: bytes</code><br>\n<code>country: str</code><br>\n<code>region: int</code><br>\n<code>last_active: [DateTime](common.md#datetime)</code><br>\n<code>unk3: bool</code><br>\n<code>unk4: bool</code><br>\n<code>unk5: bool</code><br>\n<code>play_stats: dict[int, int]</code><br>\n<code>maker_stats: dict[int, int]</code><br>\n<code>endless_challenge_high_scores: dict[int, int]</code><br>\n<code>multiplayer_stats: dict[int, int]</code><br>\n<code>unk7: dict[int, int]</code><br>\n<code>badges: list[[BadgeInfo](#badgeinfo)]</code><br>\n<code>unk8: dict[int, int]</code><br>\n<code>unk9: dict[int, int]</code><br>\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>unk10: bool</code><br>\n<code>unk11: [DateTime](common.md#datetime)</code><br>\n<code>unk12: bool</code><br>\n</span><br>\nIf `revision` >= 2:<br>\n<span class=\"docs\">\n<code>unk13: [UnknownStruct3](#unknownstruct3) = [UnknownStruct3](#unknownstruct3)()</code><br>\n</span><br>\nIf `revision` >= 3:<br>\n<span class=\"docs\">\n<code>unk14: str</code><br>\n<code>unk15: dict[int, int]</code><br>\n<code>unk16: bool</code><br>\n</span><br>\n</span><br>\n\n## WorldMapInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `WorldMapInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: str</code><br>\n<code>owner_id: int</code><br>\n<code>unk1: bytes</code><br>\n<code>thumbnail: [RelationObjectReqGetInfo](#relationobjectreqgetinfo) = [RelationObjectReqGetInfo](#relationobjectreqgetinfo)()</code><br>\n<code>worlds: int</code><br>\n<code>levels: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: [DateTime](common.md#datetime)</code><br>\n<code>data_ids: list[int]</code><br>\n<code>unk4: dict[int, int]</code><br>\n<code>unk5: int</code><br>\n<code>unk6: int</code><br>\n<code>unk7: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/debug.md",
    "content": "\n# Module: <code>nintendo.nex.debug</code>\n\nProvides a client and server for the `DebugProtocol`. This page was generated automatically from `debug.proto`.\n\n<code>**class** [DebugClient](#debugclient)</code><br>\n<span class=\"docs\">The client for the `DebugProtocol`.</span>\n\n<code>**class** [DebugServer](#debugserver)</code><br>\n<span class=\"docs\">The server for the `DebugProtocol`.</span>\n\n<code>**class** [ApiCall](#apicall)([Structure](common.md))</code><br>\n<code>**class** [ApiCallSummary](#apicallsummary)([Structure](common.md))</code><br>\n\n## DebugClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`DebugClient`](#debugclient).</span>\n\n<code>**async def enable_api_recorder**() -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def disable_api_recorder**() -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def is_api_recorder_enabled**() -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_api_calls**(pids: list[int], start: [DateTime](common.md#datetime), end: [DateTime](common.md#datetime)) -> list[[ApiCall](#apicall)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_api_call_summary**(pid: int, start: [DateTime](common.md#datetime), end: [DateTime](common.md#datetime), only_limit_exceeded: bool) -> list[[ApiCallSummary](#apicallsummary)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n## DebugServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`DebugServer`](#debugserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def enable_api_recorder**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def disable_api_recorder**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_api_recorder_enabled**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_api_calls**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], start: [DateTime](common.md#datetime), end: [DateTime](common.md#datetime)) -> list[[ApiCall](#apicall)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_api_call_summary**(client: [RMCClient](rmc.md#rmcclient), pid: int, start: [DateTime](common.md#datetime), end: [DateTime](common.md#datetime), only_limit_exceeded: bool) -> list[[ApiCallSummary](#apicallsummary)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n## ApiCall\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ApiCall` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n<code>time: [DateTime](common.md#datetime)</code><br>\n<code>pid: int</code><br>\n</span><br>\n\n## ApiCallSummary\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ApiCallSummary` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n<code>limit_exceeded: int</code><br>\n<code>duration: int</code><br>\n<code>limit: int</code><br>\n<code>start: [DateTime](common.md#datetime)</code><br>\n<code>limit_exceeded_count: int</code><br>\n<code>total_count: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/errors.md",
    "content": "\r\n# Module: <code>nintendo.nex.errors</code>\r\n\r\nProvides descriptions for error codes. The error codes in these tables do **not** have the most significant bit set.\r\n\r\n`error_names: dict[int, str]`<br>\r\n<span class=\"docs\">Provides descriptions for error codes.</span>\r\n\r\n`error_codes: dict[str, int]`<br>\r\n<span class=\"docs\">The reverse of `error_names`.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/friends.md",
    "content": "\n# Module: <code>nintendo.nex.friends</code>\n\nProvides a client and server for the `FriendsProtocolV1` and `FriendsProtocolV2`. This page was generated automatically from `friends.proto`.\n\n<code>**class** [FriendsClientV1](#friendsclientv1)</code><br>\n<span class=\"docs\">The client for the `FriendsProtocolV1`.</span>\n\n<code>**class** [FriendsClientV2](#friendsclientv2)</code><br>\n<span class=\"docs\">The client for the `FriendsProtocolV2`.</span>\n\n<code>**class** [FriendsServerV1](#friendsserverv1)</code><br>\n<span class=\"docs\">The server for the `FriendsProtocolV1`.</span>\n\n<code>**class** [FriendsServerV2](#friendsserverv2)</code><br>\n<span class=\"docs\">The server for the `FriendsProtocolV2`.</span>\n\n<code>**class** [AccountExtraInfo](#accountextrainfo)([Structure](common.md))</code><br>\n<code>**class** [BlacklistedPrincipal](#blacklistedprincipal)([Data](common.md))</code><br>\n<code>**class** [Comment](#comment)([Data](common.md))</code><br>\n<code>**class** [FriendComment](#friendcomment)([Data](common.md))</code><br>\n<code>**class** [FriendInfo](#friendinfo)([Data](common.md))</code><br>\n<code>**class** [FriendKey](#friendkey)([Structure](common.md))</code><br>\n<code>**class** [FriendMii](#friendmii)([Data](common.md))</code><br>\n<code>**class** [FriendMiiList](#friendmiilist)([Data](common.md))</code><br>\n<code>**class** [FriendPersistentInfo](#friendpersistentinfo)([Data](common.md))</code><br>\n<code>**class** [FriendPicture](#friendpicture)([Data](common.md))</code><br>\n<code>**class** [FriendPresence](#friendpresence)([Data](common.md))</code><br>\n<code>**class** [FriendRelationship](#friendrelationship)([Data](common.md))</code><br>\n<code>**class** [FriendRequest](#friendrequest)([Data](common.md))</code><br>\n<code>**class** [FriendRequestMessage](#friendrequestmessage)([Data](common.md))</code><br>\n<code>**class** [GameKey](#gamekey)([Data](common.md))</code><br>\n<code>**class** [Mii](#mii)([Data](common.md))</code><br>\n<code>**class** [MiiList](#miilist)([Data](common.md))</code><br>\n<code>**class** [MiiV2](#miiv2)([Data](common.md))</code><br>\n<code>**class** [MyProfile](#myprofile)([Data](common.md))</code><br>\n<code>**class** [NNAInfo](#nnainfo)([Data](common.md))</code><br>\n<code>**class** [NintendoCreateAccountData](#nintendocreateaccountdata)([Data](common.md))</code><br>\n<code>**class** [NintendoPresence](#nintendopresence)([Data](common.md))</code><br>\n<code>**class** [NintendoPresenceV2](#nintendopresencev2)([Data](common.md))</code><br>\n<code>**class** [PersistentNotification](#persistentnotification)([Data](common.md))</code><br>\n<code>**class** [PlayedGame](#playedgame)([Data](common.md))</code><br>\n<code>**class** [PrincipalBasicInfo](#principalbasicinfo)([Data](common.md))</code><br>\n<code>**class** [PrincipalPreference](#principalpreference)([Data](common.md))</code><br>\n<code>**class** [PrincipalRequestBlockSetting](#principalrequestblocksetting)([Data](common.md))</code><br>\n\n## FriendsClientV1\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`FriendsClientV1`](#friendsclientv1).</span>\n\n<code>**async def update_profile**(profile_data: [MyProfile](#myprofile)) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def update_mii**(mii: [Mii](#mii)) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def update_mii_list**(mii_list: [MiiList](#miilist)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_played_games**(played_games: list[[PlayedGame](#playedgame)]) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def update_preference**(show_online_status: bool, show_current_title: bool, block_friend_requests: bool) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_friend_mii**(friends: list[[FriendKey](#friendkey)]) -> list[[FriendMii](#friendmii)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_friend_mii_list**(friends: list[[FriendKey](#friendkey)]) -> list[[FriendMiiList](#friendmiilist)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def is_active_game**(unk1: list[int], game_key: [GameKey](#gamekey)) -> list[int]</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_principal_id_by_local_friend_code**(unk1: int, unk2: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_friend_relationships**(principal_ids: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def add_friend_by_principal_id**(friend_seed: int, pid: int) -> [FriendRelationship](#friendrelationship)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def add_friend_by_principal_ids**(unk: int, pids: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def remove_friend_by_local_friend_code**(friend_code: int) -> None</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def remove_friend_by_principal_id**(pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_all_friends**() -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def update_black_list**(unk: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def sync_friend**(friend_seed: int, principal_ids: list[int], unk: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_presence**(presence_info: [NintendoPresence](#nintendopresence), unk: bool) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def update_favorite_game_key**(game_key: [GameKey](#gamekey)) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def update_comment**(comment: str) -> None</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def update_picture**(unk: int, picture: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def get_friend_presence**(principal_ids: list[int]) -> list[[FriendPresence](#friendpresence)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def get_friend_comment**(friends: list[[FriendKey](#friendkey)]) -> list[[FriendComment](#friendcomment)]</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def get_friend_picture**(principal_ids: list[int]) -> list[[FriendPicture](#friendpicture)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def get_friend_persistent_info**(principal_ids: list[int]) -> list[[FriendPersistentInfo](#friendpersistentinfo)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def send_invitation**(unk: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n## FriendsClientV2\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`FriendsClientV2`](#friendsclientv2).</span>\n\n<code>**async def update_and_get_all_information**(nna_info: [NNAInfo](#nnainfo), presence: [NintendoPresenceV2](#nintendopresencev2), birthday: [DateTime](common.md#datetime)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `1` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>principal_preference: [PrincipalPreference](#principalpreference)</code><br>\n<code>comment: [Comment](#comment)</code><br>\n<code>friends: list[[FriendInfo](#friendinfo)]</code><br>\n<code>sent_requests: list[[FriendRequest](#friendrequest)]</code><br>\n<code>received_requests: list[[FriendRequest](#friendrequest)]</code><br>\n<code>blacklist: list[[BlacklistedPrincipal](#blacklistedprincipal)]</code><br>\n<code>unk1: bool</code><br>\n<code>notifications: list[[PersistentNotification](#persistentnotification)]</code><br>\n<code>unk2: bool</code><br>\n</span>\n</span>\n\n<code>**async def add_friend**(pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `2` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>request: [FriendRequest](#friendrequest)</code><br>\n<code>info: [FriendInfo](#friendinfo)</code><br>\n</span>\n</span>\n\n<code>**async def add_friend_by_name**(name: str) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `3` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>request: [FriendRequest](#friendrequest)</code><br>\n<code>info: [FriendInfo](#friendinfo)</code><br>\n</span>\n</span>\n\n<code>**async def remove_friend**(pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def add_friend_request**(unk1: int, unk2: int, unk3: str, unk4: int, unk5: str, game_key: [GameKey](#gamekey), unk6: [DateTime](common.md#datetime)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `5` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>request: [FriendRequest](#friendrequest)</code><br>\n<code>info: [FriendInfo](#friendinfo)</code><br>\n</span>\n</span>\n\n<code>**async def cancel_friend_request**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def accept_friend_request**(id: int) -> [FriendInfo](#friendinfo)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def delete_friend_request**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def deny_friend_request**(id: int) -> [BlacklistedPrincipal](#blacklistedprincipal)</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def mark_friend_requests_as_received**(ids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def add_black_list**(principal: [BlacklistedPrincipal](#blacklistedprincipal)) -> [BlacklistedPrincipal](#blacklistedprincipal)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def remove_black_list**(pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def update_presence**(presence: [NintendoPresenceV2](#nintendopresencev2)) -> None</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def update_mii**(mii: [MiiV2](#miiv2)) -> [DateTime](common.md#datetime)</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def update_comment**(comment: [Comment](#comment)) -> [DateTime](common.md#datetime)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def update_preference**(preference: [PrincipalPreference](#principalpreference)) -> None</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def get_basic_info**(pids: list[int]) -> list[[PrincipalBasicInfo](#principalbasicinfo)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def delete_persistent_notification**(notifications: list[[PersistentNotification](#persistentnotification)]) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def check_setting_status**() -> int</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def get_request_block_settings**(unk: list[int]) -> list[[PrincipalRequestBlockSetting](#principalrequestblocksetting)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n## FriendsServerV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`FriendsServerV1`](#friendsserverv1).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def update_profile**(client: [RMCClient](rmc.md#rmcclient), profile_data: [MyProfile](#myprofile)) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_mii**(client: [RMCClient](rmc.md#rmcclient), mii: [Mii](#mii)) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_mii_list**(client: [RMCClient](rmc.md#rmcclient), mii_list: [MiiList](#miilist)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_played_games**(client: [RMCClient](rmc.md#rmcclient), played_games: list[[PlayedGame](#playedgame)]) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_preference**(client: [RMCClient](rmc.md#rmcclient), show_online_status: bool, show_current_title: bool, block_friend_requests: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_mii**(client: [RMCClient](rmc.md#rmcclient), friends: list[[FriendKey](#friendkey)]) -> list[[FriendMii](#friendmii)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_mii_list**(client: [RMCClient](rmc.md#rmcclient), friends: list[[FriendKey](#friendkey)]) -> list[[FriendMiiList](#friendmiilist)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_active_game**(client: [RMCClient](rmc.md#rmcclient), unk1: list[int], game_key: [GameKey](#gamekey)) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_principal_id_by_local_friend_code**(client: [RMCClient](rmc.md#rmcclient), unk1: int, unk2: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_relationships**(client: [RMCClient](rmc.md#rmcclient), principal_ids: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_friend_by_principal_id**(client: [RMCClient](rmc.md#rmcclient), friend_seed: int, pid: int) -> [FriendRelationship](#friendrelationship)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_friend_by_principal_ids**(client: [RMCClient](rmc.md#rmcclient), unk: int, pids: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_friend_by_local_friend_code**(client: [RMCClient](rmc.md#rmcclient), friend_code: int) -> None</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_friend_by_principal_id**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_all_friends**(client: [RMCClient](rmc.md#rmcclient)) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_black_list**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def sync_friend**(client: [RMCClient](rmc.md#rmcclient), friend_seed: int, principal_ids: list[int], unk: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_presence**(client: [RMCClient](rmc.md#rmcclient), presence_info: [NintendoPresence](#nintendopresence), unk: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_favorite_game_key**(client: [RMCClient](rmc.md#rmcclient), game_key: [GameKey](#gamekey)) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_comment**(client: [RMCClient](rmc.md#rmcclient), comment: str) -> None</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_picture**(client: [RMCClient](rmc.md#rmcclient), unk: int, picture: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_presence**(client: [RMCClient](rmc.md#rmcclient), principal_ids: list[int]) -> list[[FriendPresence](#friendpresence)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_comment**(client: [RMCClient](rmc.md#rmcclient), friends: list[[FriendKey](#friendkey)]) -> list[[FriendComment](#friendcomment)]</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_picture**(client: [RMCClient](rmc.md#rmcclient), principal_ids: list[int]) -> list[[FriendPicture](#friendpicture)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_persistent_info**(client: [RMCClient](rmc.md#rmcclient), principal_ids: list[int]) -> list[[FriendPersistentInfo](#friendpersistentinfo)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def send_invitation**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n## FriendsServerV2\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`FriendsServerV2`](#friendsserverv2).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def update_and_get_all_information**(client: [RMCClient](rmc.md#rmcclient), nna_info: [NNAInfo](#nnainfo), presence: [NintendoPresenceV2](#nintendopresencev2), birthday: [DateTime](common.md#datetime)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>principal_preference: [PrincipalPreference](#principalpreference)</code><br>\n<code>comment: [Comment](#comment)</code><br>\n<code>friends: list[[FriendInfo](#friendinfo)]</code><br>\n<code>sent_requests: list[[FriendRequest](#friendrequest)]</code><br>\n<code>received_requests: list[[FriendRequest](#friendrequest)]</code><br>\n<code>blacklist: list[[BlacklistedPrincipal](#blacklistedprincipal)]</code><br>\n<code>unk1: bool</code><br>\n<code>notifications: list[[PersistentNotification](#persistentnotification)]</code><br>\n<code>unk2: bool</code><br>\n</span>\n</span>\n\n<code>**async def add_friend**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>request: [FriendRequest](#friendrequest)</code><br>\n<code>info: [FriendInfo](#friendinfo)</code><br>\n</span>\n</span>\n\n<code>**async def add_friend_by_name**(client: [RMCClient](rmc.md#rmcclient), name: str) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>request: [FriendRequest](#friendrequest)</code><br>\n<code>info: [FriendInfo](#friendinfo)</code><br>\n</span>\n</span>\n\n<code>**async def remove_friend**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_friend_request**(client: [RMCClient](rmc.md#rmcclient), unk1: int, unk2: int, unk3: str, unk4: int, unk5: str, game_key: [GameKey](#gamekey), unk6: [DateTime](common.md#datetime)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>request: [FriendRequest](#friendrequest)</code><br>\n<code>info: [FriendInfo](#friendinfo)</code><br>\n</span>\n</span>\n\n<code>**async def cancel_friend_request**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def accept_friend_request**(client: [RMCClient](rmc.md#rmcclient), id: int) -> [FriendInfo](#friendinfo)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_friend_request**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def deny_friend_request**(client: [RMCClient](rmc.md#rmcclient), id: int) -> [BlacklistedPrincipal](#blacklistedprincipal)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def mark_friend_requests_as_received**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_black_list**(client: [RMCClient](rmc.md#rmcclient), principal: [BlacklistedPrincipal](#blacklistedprincipal)) -> [BlacklistedPrincipal](#blacklistedprincipal)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_black_list**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_presence**(client: [RMCClient](rmc.md#rmcclient), presence: [NintendoPresenceV2](#nintendopresencev2)) -> None</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_mii**(client: [RMCClient](rmc.md#rmcclient), mii: [MiiV2](#miiv2)) -> [DateTime](common.md#datetime)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_comment**(client: [RMCClient](rmc.md#rmcclient), comment: [Comment](#comment)) -> [DateTime](common.md#datetime)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_preference**(client: [RMCClient](rmc.md#rmcclient), preference: [PrincipalPreference](#principalpreference)) -> None</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_basic_info**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[PrincipalBasicInfo](#principalbasicinfo)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_persistent_notification**(client: [RMCClient](rmc.md#rmcclient), notifications: list[[PersistentNotification](#persistentnotification)]) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def check_setting_status**(client: [RMCClient](rmc.md#rmcclient)) -> int</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_request_block_settings**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> list[[PrincipalRequestBlockSetting](#principalrequestblocksetting)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n## AccountExtraInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AccountExtraInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>local_friend_code: int</code><br>\n<code>move_count: int</code><br>\n<code>token: str</code><br>\n</span><br>\n\n## BlacklistedPrincipal\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `BlacklistedPrincipal` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>principal_info: [PrincipalBasicInfo](#principalbasicinfo) = [PrincipalBasicInfo](#principalbasicinfo)()</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>since: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## Comment\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Comment` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk: int</code><br>\n<code>text: str</code><br>\n<code>changed: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendComment\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendComment` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>comment: str</code><br>\n<code>modified_at: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>nna_info: [NNAInfo](#nnainfo) = [NNAInfo](#nnainfo)()</code><br>\n<code>presence: [NintendoPresenceV2](#nintendopresencev2) = [NintendoPresenceV2](#nintendopresencev2)()</code><br>\n<code>comment: [Comment](#comment) = [Comment](#comment)()</code><br>\n<code>befriended: [DateTime](common.md#datetime)</code><br>\n<code>last_online: [DateTime](common.md#datetime)</code><br>\n<code>unk: int</code><br>\n</span><br>\n\n## FriendKey\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendKey` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendMii\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendMii` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>mii: [Mii](#mii) = [Mii](#mii)()</code><br>\n<code>modified_at: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendMiiList\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendMiiList` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>mii: [MiiList](#miilist) = [MiiList](#miilist)()</code><br>\n<code>unk2: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendPersistentInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendPersistentInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>region: int</code><br>\n<code>country: int</code><br>\n<code>area: int</code><br>\n<code>language: int</code><br>\n<code>platform: int</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>message: str</code><br>\n<code>message_updated: [DateTime](common.md#datetime)</code><br>\n<code>friended: [DateTime](common.md#datetime)</code><br>\n<code>last_online: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendPicture\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendPicture` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk: int</code><br>\n<code>data: bytes</code><br>\n<code>datetime: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendPresence\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendPresence` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>presence: [NintendoPresence](#nintendopresence) = [NintendoPresence](#nintendopresence)()</code><br>\n</span><br>\n\n## FriendRelationship\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendRelationship` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>friend_code: int</code><br>\n<code>is_complete: int</code><br>\n</span><br>\n\n## FriendRequest\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendRequest` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>principal_info: [PrincipalBasicInfo](#principalbasicinfo) = [PrincipalBasicInfo](#principalbasicinfo)()</code><br>\n<code>message: [FriendRequestMessage](#friendrequestmessage) = [FriendRequestMessage](#friendrequestmessage)()</code><br>\n<code>sent: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendRequestMessage\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendRequestMessage` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>friend_request_id: int</code><br>\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>message: str</code><br>\n<code>unk3: int</code><br>\n<code>string: str</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>datetime: [DateTime](common.md#datetime)</code><br>\n<code>expires: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## GameKey\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GameKey` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>title_id: int = 0</code><br>\n<code>title_version: int = 0</code><br>\n</span><br>\n\n## Mii\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Mii` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n<code>unk1: bool</code><br>\n<code>unk2: int</code><br>\n<code>mii_data: bytes</code><br>\n</span><br>\n\n## MiiList\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MiiList` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: str</code><br>\n<code>unk2: bool</code><br>\n<code>unk3: int</code><br>\n<code>mii_datas: list[bytes]</code><br>\n</span><br>\n\n## MiiV2\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MiiV2` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n<code>unk1: int = 0</code><br>\n<code>unk2: int = 0</code><br>\n<code>data: bytes</code><br>\n<code>datetime: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n\n## MyProfile\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MyProfile` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>region: int</code><br>\n<code>country: int</code><br>\n<code>area: int</code><br>\n<code>language: int</code><br>\n<code>platform: int</code><br>\n<code>local_friend_code_seed: int</code><br>\n<code>mac_address: str</code><br>\n<code>serial_number: str</code><br>\n</span><br>\n\n## NNAInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NNAInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>principal_info: [PrincipalBasicInfo](#principalbasicinfo) = [PrincipalBasicInfo](#principalbasicinfo)()</code><br>\n<code>unk1: int = 94</code><br>\n<code>unk2: int = 11</code><br>\n</span><br>\n\n## NintendoCreateAccountData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoCreateAccountData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>info: [NNAInfo](#nnainfo) = [NNAInfo](#nnainfo)()</code><br>\n<code>token: str</code><br>\n<code>birthday: [DateTime](common.md#datetime)</code><br>\n<code>unk: int</code><br>\n</span><br>\n\n## NintendoPresence\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoPresence` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>changed_bit_flag: int</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>game_mode_description: str</code><br>\n<code>join_availability_flag: int</code><br>\n<code>matchmake_system_type: int</code><br>\n<code>join_game_id: int</code><br>\n<code>join_game_mode: int</code><br>\n<code>owner_pid: int</code><br>\n<code>join_group_id: int</code><br>\n<code>application_data: bytes</code><br>\n</span><br>\n\n## NintendoPresenceV2\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoPresenceV2` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flags: int = 0</code><br>\n<code>is_online: bool = False</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>unk1: int = 0</code><br>\n<code>message: str = \"\"</code><br>\n<code>unk2: int = 0</code><br>\n<code>unk3: int = 0</code><br>\n<code>game_server_id: int = 0</code><br>\n<code>unk4: int = 0</code><br>\n<code>pid: int = 0</code><br>\n<code>gathering_id: int = 0</code><br>\n<code>application_data: bytes = b\"\"</code><br>\n<code>unk5: int = 3</code><br>\n<code>unk6: int = 3</code><br>\n<code>unk7: int = 3</code><br>\n</span><br>\n\n## PersistentNotification\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PersistentNotification` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: int</code><br>\n<code>unk4: int</code><br>\n<code>string: str</code><br>\n</span><br>\n\n## PlayedGame\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayedGame` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>datetime: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## PrincipalBasicInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PrincipalBasicInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>nnid: str</code><br>\n<code>mii: [MiiV2](#miiv2) = [MiiV2](#miiv2)()</code><br>\n<code>unk: int = 2</code><br>\n</span><br>\n\n## PrincipalPreference\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PrincipalPreference` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>show_online_status: bool</code><br>\n<code>show_current_title: bool</code><br>\n<code>block_friend_requests: bool</code><br>\n</span><br>\n\n## PrincipalRequestBlockSetting\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PrincipalRequestBlockSetting` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>blocked: bool</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/friends_3ds.md",
    "content": "\n# Module: <code>nintendo.nex.friends_3ds</code>\n\nProvides a client and server for the `FriendsProtocolV1`. This page was generated automatically from `friends_3ds.proto`.\n\n<code>**class** [FriendsClientV1](#friendsclientv1)</code><br>\n<span class=\"docs\">The client for the `FriendsProtocolV1`.</span>\n\n<code>**class** [FriendsServerV1](#friendsserverv1)</code><br>\n<span class=\"docs\">The server for the `FriendsProtocolV1`.</span>\n\n<code>**class** [FriendMii](#friendmii)([Structure](common.md))</code><br>\n<code>**class** [FriendMiiList](#friendmiilist)([Structure](common.md))</code><br>\n<code>**class** [FriendMiiRequest](#friendmiirequest)([Structure](common.md))</code><br>\n<code>**class** [FriendPersistentInfo](#friendpersistentinfo)([Structure](common.md))</code><br>\n<code>**class** [FriendPicture](#friendpicture)([Structure](common.md))</code><br>\n<code>**class** [FriendPresence](#friendpresence)([Structure](common.md))</code><br>\n<code>**class** [FriendRelationship](#friendrelationship)([Structure](common.md))</code><br>\n<code>**class** [GameKey](#gamekey)([Data](common.md))</code><br>\n<code>**class** [Mii](#mii)([Structure](common.md))</code><br>\n<code>**class** [MiiList](#miilist)([Structure](common.md))</code><br>\n<code>**class** [MyProfile](#myprofile)([Structure](common.md))</code><br>\n<code>**class** [NintendoPresence](#nintendopresence)([Structure](common.md))</code><br>\n<code>**class** [PlayedGame](#playedgame)([Structure](common.md))</code><br>\n\n## FriendsClientV1\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`FriendsClientV1`](#friendsclientv1).</span>\n\n<code>**async def update_profile**(profile_data: [MyProfile](#myprofile)) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def update_mii**(mii: [Mii](#mii)) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def update_mii_list**(mii_list: [MiiList](#miilist)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_played_games**(played_games: list[[PlayedGame](#playedgame)]) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def update_preference**(unk1: bool, unk2: bool, unk3: bool) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_friend_mii**(friends: list[[FriendMiiRequest](#friendmiirequest)]) -> list[[FriendMii](#friendmii)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_friend_mii_list**(friends: list[[FriendMiiRequest](#friendmiirequest)]) -> list[[FriendMiiList](#friendmiilist)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_friend_relationships**(unk: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def add_friend_by_principal_id**(unk: int, pid: int) -> [FriendRelationship](#friendrelationship)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_all_friends**() -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def sync_friend**(unk1: int, unk2: list[int], unk3: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_presence**(presence_info: [NintendoPresence](#nintendopresence), unk: bool) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def update_favorite_game_key**(game_key: [GameKey](#gamekey)) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def update_comment**(comment: str) -> None</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def get_friend_presence**(unk: list[int]) -> list[[FriendPresence](#friendpresence)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def get_friend_picture**(unk: list[int]) -> list[[FriendPicture](#friendpicture)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def get_friend_persistent_info**(unk: list[int]) -> list[[FriendPersistentInfo](#friendpersistentinfo)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def send_invitation**(unk: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n## FriendsServerV1\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`FriendsServerV1`](#friendsserverv1).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def update_profile**(client: [RMCClient](rmc.md#rmcclient), profile_data: [MyProfile](#myprofile)) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_mii**(client: [RMCClient](rmc.md#rmcclient), mii: [Mii](#mii)) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_mii_list**(client: [RMCClient](rmc.md#rmcclient), mii_list: [MiiList](#miilist)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_played_games**(client: [RMCClient](rmc.md#rmcclient), played_games: list[[PlayedGame](#playedgame)]) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_preference**(client: [RMCClient](rmc.md#rmcclient), unk1: bool, unk2: bool, unk3: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_mii**(client: [RMCClient](rmc.md#rmcclient), friends: list[[FriendMiiRequest](#friendmiirequest)]) -> list[[FriendMii](#friendmii)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_mii_list**(client: [RMCClient](rmc.md#rmcclient), friends: list[[FriendMiiRequest](#friendmiirequest)]) -> list[[FriendMiiList](#friendmiilist)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_relationships**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_friend_by_principal_id**(client: [RMCClient](rmc.md#rmcclient), unk: int, pid: int) -> [FriendRelationship](#friendrelationship)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_all_friends**(client: [RMCClient](rmc.md#rmcclient)) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def sync_friend**(client: [RMCClient](rmc.md#rmcclient), unk1: int, unk2: list[int], unk3: list[int]) -> list[[FriendRelationship](#friendrelationship)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_presence**(client: [RMCClient](rmc.md#rmcclient), presence_info: [NintendoPresence](#nintendopresence), unk: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_favorite_game_key**(client: [RMCClient](rmc.md#rmcclient), game_key: [GameKey](#gamekey)) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_comment**(client: [RMCClient](rmc.md#rmcclient), comment: str) -> None</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_presence**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> list[[FriendPresence](#friendpresence)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_picture**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> list[[FriendPicture](#friendpicture)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_persistent_info**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> list[[FriendPersistentInfo](#friendpersistentinfo)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def send_invitation**(client: [RMCClient](rmc.md#rmcclient), unk: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n## FriendMii\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendMii` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>mii: [Mii](#mii) = [Mii](#mii)()</code><br>\n<code>unk2: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendMiiList\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendMiiList` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>mii: [MiiList](#miilist) = [MiiList](#miilist)()</code><br>\n<code>unk2: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendMiiRequest\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendMiiRequest` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendPersistentInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendPersistentInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>region: int</code><br>\n<code>country: int</code><br>\n<code>area: int</code><br>\n<code>language: int</code><br>\n<code>platform: int</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>message: str</code><br>\n<code>message_updated: [DateTime](common.md#datetime)</code><br>\n<code>friended: [DateTime](common.md#datetime)</code><br>\n<code>unk: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendPicture\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendPicture` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk: int</code><br>\n<code>data: bytes</code><br>\n<code>datetime: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## FriendPresence\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendPresence` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk: int</code><br>\n<code>presence: [NintendoPresence](#nintendopresence) = [NintendoPresence](#nintendopresence)()</code><br>\n</span><br>\n\n## FriendRelationship\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendRelationship` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: int</code><br>\n</span><br>\n\n## GameKey\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GameKey` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>title_id: int = 0</code><br>\n<code>title_version: int = 0</code><br>\n</span><br>\n\n## Mii\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Mii` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: str</code><br>\n<code>unk2: bool</code><br>\n<code>unk3: int</code><br>\n<code>mii_data: bytes</code><br>\n</span><br>\n\n## MiiList\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MiiList` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: str</code><br>\n<code>unk2: bool</code><br>\n<code>unk3: int</code><br>\n<code>mii_datas: list[bytes]</code><br>\n</span><br>\n\n## MyProfile\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MyProfile` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>region: int</code><br>\n<code>country: int</code><br>\n<code>area: int</code><br>\n<code>language: int</code><br>\n<code>platform: int</code><br>\n<code>unk1: int</code><br>\n<code>unk2: str</code><br>\n<code>unk3: str</code><br>\n</span><br>\n\n## NintendoPresence\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoPresence` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>changed_bit_flag: int</code><br>\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>game_mode_description: str</code><br>\n<code>join_availability_flag: int</code><br>\n<code>matchmake_system_type: int</code><br>\n<code>join_game_id: int</code><br>\n<code>join_game_mode: int</code><br>\n<code>owner_pid: int</code><br>\n<code>join_group_id: int</code><br>\n<code>application_data: bytes</code><br>\n</span><br>\n\n## PlayedGame\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayedGame` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_key: [GameKey](#gamekey) = [GameKey](#gamekey)()</code><br>\n<code>datetime: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/health.md",
    "content": "\n# Module: <code>nintendo.nex.health</code>\n\nProvides a client and server for the `HealthProtocol`. This page was generated automatically from `health.proto`.\n\n<code>**class** [HealthClient](#healthclient)</code><br>\n<span class=\"docs\">The client for the `HealthProtocol`.</span>\n\n<code>**class** [HealthServer](#healthserver)</code><br>\n<span class=\"docs\">The server for the `HealthProtocol`.</span>\n\n## HealthClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`HealthClient`](#healthclient).</span>\n\n<code>**async def ping_daemon**() -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def ping_database**() -> bool</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def run_sanity_check**() -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def fix_sanity_errors**() -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n## HealthServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`HealthServer`](#healthserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def ping_daemon**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def ping_database**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def run_sanity_check**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def fix_sanity_errors**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n"
  },
  {
    "path": "docs/reference/nex/hpp.md",
    "content": "\r\n# Module: <code>nintendo.nex.hpp</code>\r\n\r\nProvides a client that performs remote method calls through HTTP.\r\n\r\n<code>**class** [HppClient](#hppclient)</code><br>\r\n<span class=\"docs\">The HTTP RMC client.</span>\r\n\r\n## HppClient\r\n<code>**def _\\_init__**(settings: [Settings](settings.md#settings), game_server_id: int, nex_version: str, pid: int, password: str)</code><br>\r\n<span class=\"docs\">Creates a new `hpp` client.</span>\r\n\r\n<code>**def set_environment**(env: str) -> None</code><br>\r\n<span class=\"docs\">Changes the environment. The default is `\"L1\"` (production).</span><br>\r\n\r\n<code>**async def request**(protocol: int, method: int, body: bytes) -> bytes</code><br>\r\n<span class=\"docs\">Performs a remote method call. Blocks until the RMC is complete. Returns the body of the RMC response on success. Raises [`RMCError`](common.md#rmcerror) if the server returns an error code.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/kerberos.md",
    "content": "\r\n# Module: <code>nintendo.nex.kerberos</code>\r\n\r\nProvides classes for Kerberos authentication. For details, click [here](https://github.com/kinnay/nintendo/wiki/Kerberos-Authentication).\r\n\r\n<code>**class** [KeyDerivationOld](#keyderivationold)</code><br>\r\n<span class=\"docs\">Implements the old key derivation method (used by 3DS and Wii U servers).</span>\r\n\r\n<code>**class** [KeyDerivationNew](#keyderivationnew)</code><br>\r\n<span class=\"docs\">Implements the new key derivation method (used by Switch servers).</span>\r\n\r\n<code>**class** [KerberosEncryption](#kerberosencryption)</code><br>\r\n<span class=\"docs\">Implements Kerberos encryption (RC4 + HMAC).</span>\r\n\r\n<code>**class** [ClientTicket](#clientticket)</code><br>\r\n<span class=\"docs\">The Kerberos ticket that's visible to the client.</span>\r\n\r\n<code>**class** [ServerTicket](#serverticket)</code><br>\r\n<span class=\"docs\">The internal part of the Kerberos ticket that's only visible to the server.</span>\r\n\r\n<code>**class** [Credentials](#credentials)</code><br>\r\n<span class=\"docs\">Holds information that's required to log in on a secure server.</span>\r\n\r\n## KeyDerivationOld\r\n<code>**def _\\_init__**(base_count: int = 65000, pid_count: int = 1024)</code><br>\r\n<span class=\"docs\">Creates a new key derivation instance.</span>\r\n\r\n<code>**def derive_key**(password: bytes, pid: int) -> bytes</code><br>\r\n<span class=\"docs\">Derives the Kerberos key from the given password and user id.</span>\r\n\r\n## KeyDerivationNew\r\n<code>**def _\\_init__**(base_count: int = 1, pid_count: int = 1)</code><br>\r\n<span class=\"docs\">Creates a new key derivation instance.</span>\r\n\r\n<code>**def derive_key**(password: bytes, pid: int) -> bytes</code><br>\r\n<span class=\"docs\">Derives the Kerberos key from the given password and user id.</span>\r\n\r\n## KerberosEncryption\r\n<code>**def _\\_init__**(key: bytes)</code><br>\r\n<span class=\"docs\">Creates a `KerberosEncryption` instance.</span>\r\n\r\n<code>**def check**(data: bytes) -> bool</code><br>\r\n<span class=\"docs\">Checks the HMAC. Returns `True` if it is correct.</span>\r\n\r\n<code>**def decrypt**(data: bytes) -> bytes</code><br>\r\n<span class=\"docs\">Checks the HMAC and decrypts the given data. Raises `ValueError` if the HMAC is incorrect.</span>\r\n\r\n<code>**def encrypt**(data: bytes) -> bytes</code><br>\r\n<span class=\"docs\">Encrypts the given data and adds a HMAC.</span>\r\n\r\n## ClientTicket\r\n`session_key: bytes = None`<br>\r\n<span class=\"docs\">The session key of the ticket.</span><br>\r\n`target: int = None`<br>\r\n<span class=\"docs\">The target user id of the ticket.</span><br>\r\n`internal: bytes = None`<br>\r\n<span class=\"docs\">The internal ticket data that can only be decrypted by the target user.</span><br>\r\n\r\n<code>**def _\\_init__**()</code><br>\r\n<span class=\"docs\">Creates a new [`ClientTicket`](#clientticket) instance. The attributes must be filled in manually.</span>\r\n\r\n<code>**def encrypt**(key: bytes, settings: [Settings](settings.md#settings)) -> bytes</code><br>\r\n<span class=\"docs\">Encodes the ticket and encrypts it with the given Kerberos key.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def decrypt**(data: bytes, key: bytes, settings: [Settings](settings.md#settings)) -> [`ClientTicket`](#clientticket)</code><br>\r\n<span class=\"docs\">Decrypts `data` with the given Kerberos key and parses the ticket.</span>\r\n\r\n## ServerTicket\r\n<code>timestamp: [DateTime](common.md#datetime) = None</code><br>\r\n<span class=\"docs\">Time at which the ticket was issued.</span><br>\r\n`source: int = None`<br>\r\n<span class=\"docs\">The source user id of the ticket.</span><br>\r\n`session_key: bytes = None`<br>\r\n<span class=\"docs\">The session key of the ticket.</span><br>\r\n\r\n<code>**def _\\_init__**()</code><br>\r\n<span class=\"docs\">Creates a new [`ServerTicket`](#serverticket) instance. The attributes must be filled in manually.</span>\r\n\r\n<code>**def encrypt**(key: bytes, settings: [Settings](settings.md#settings)) -> bytes</code><br>\r\n<span class=\"docs\">Encodes the ticket and encrypts it with the given Kerberos key.</span>\r\n\r\n<code style=\"color: blue\">@classmethod</code><br>\r\n<code>**def decrypt**(data: bytes, key: bytes, settings: [Settings](settings.md#settings)) -> [`ServerTicket`](#serverticket)</code><br>\r\n<span class=\"docs\">Decrypts `data` with the given Kerberos key and parses the ticket.</span>\r\n\r\n## Credentials\r\n<code>ticket: [ClientTicket](#clientticket)</code><br>\r\n<span class=\"docs\">The ticket received from the authentication server.</span><br>\r\n`pid: int`<br>\r\n<span class=\"docs\">The source user id of the ticket.</span><br>\r\n`cid: int`<br>\r\n<span class=\"docs\">The connection id.</span><br>\r\n\r\n<code>**def _\\_init__**(ticket: [ClientTicket](#clientticket), pid: int, cid: int)</code><br>\r\n<span class=\"docs\">Creates a new [`Credentials`](#credentials) object from the given ticket, user id and connection id.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/matchmaking.md",
    "content": "\n# Module: <code>nintendo.nex.matchmaking</code>\n\nProvides a client and server for the `MatchMakingProtocol`, `MatchMakingProtocolExt`, `MatchmakeExtensionProtocol` and `MatchmakeRefereeProtocol`. This page was generated automatically from `matchmaking.proto`.\n\n<code>**class** [MatchMakingClient](#matchmakingclient)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingClientExt](#matchmakingclientext)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeExtensionClient](#matchmakeextensionclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeExtensionProtocol`.</span>\n\n<code>**class** [MatchmakeRefereeClient](#matchmakerefereeclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchMakingServer](#matchmakingserver)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingServerExt](#matchmakingserverext)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeExtensionServer](#matchmakeextensionserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeExtensionProtocol`.</span>\n\n<code>**class** [MatchmakeRefereeServer](#matchmakerefereeserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeSystem](#matchmakesystem)</code><br>\n\n<code>**class** [AutoMatchmakeParam](#automatchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [CreateMatchmakeSessionParam](#creatematchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [DeletionEntry](#deletionentry)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)([Structure](common.md))</code><br>\n<code>**class** [Gathering](#gathering)([Structure](common.md))</code><br>\n<code>**class** [GatheringStats](#gatheringstats)([Structure](common.md))</code><br>\n<code>**class** [GatheringURLs](#gatheringurls)([Structure](common.md))</code><br>\n<code>**class** [Invitation](#invitation)([Structure](common.md))</code><br>\n<code>**class** [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeBlockListParam](#matchmakeblocklistparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeParam](#matchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeRound](#matchmakerefereeround)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStats](#matchmakerefereestats)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeSession](#matchmakesession)([Gathering](#gathering))</code><br>\n<code>**class** [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)([Structure](common.md))</code><br>\n<code>**class** [ParticipantDetails](#participantdetails)([Structure](common.md))</code><br>\n<code>**class** [PersistentGathering](#persistentgathering)([Gathering](#gathering))</code><br>\n<code>**class** [PlayingSession](#playingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleCommunity](#simplecommunity)([Structure](common.md))</code><br>\n<code>**class** [SimplePlayingSession](#simpleplayingsession)([Structure](common.md))</code><br>\n<code>**class** [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)([Structure](common.md))</code><br>\n\n## MatchMakingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClient`](#matchmakingclient).</span>\n\n<code>**async def register_gathering**(gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def unregister_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def unregister_gatherings**(gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_gathering**(gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def invite**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def accept_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def decline_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def cancel_invitation**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_invitations_sent**(gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_invitations_received**() -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def participate**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def cancel_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_participants**(gid: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def add_participants**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_participants_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def find_by_type**(type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def find_by_description**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def find_by_description_regex**(regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_by_id**(ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_by_single_id**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `21` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def find_by_participants**(pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def find_invitations**(range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def find_by_sql_query**(query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def launch_session**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def update_session_url**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def get_session_url**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `28` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def report_stats**(gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_stats**(gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `32` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def get_pending_deletions**(reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `34` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def find_by_description_like**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def register_local_url**(gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def register_local_urls**(gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def update_session_host_v1**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def get_session_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def update_session_host**(gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def update_gathering_ownership**(gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def migrate_gathering_ownership**(gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n## MatchMakingClientExt\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClientExt`](#matchmakingclientext).</span>\n\n<code>**async def end_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_participants**(gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_participants_urls**(gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_gathering_relations**(id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n## MatchmakeExtensionClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionClient`](#matchmakeextensionclient).</span>\n\n<code>**async def close_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def open_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def auto_matchmake_postpone**(gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def browse_matchmake_session**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `5` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def modify_current_game_attribute**(gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def update_notification_data**(type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_friend_notification_data**(type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def update_application_buffer**(gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def update_matchmake_session_attribute**(gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_friend_notification_data_list**(types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def update_matchmake_session**(gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_playing_session**(pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def create_community**(community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_community**(community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def join_community**(gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_community_by_gathering_id**(gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_official_community**(available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def find_community_by_participant**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def update_privacy_setting**(online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def get_my_block_list**() -> list[int]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def add_to_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def remove_from_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def clear_my_block_list**() -> None</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def report_violation**(pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def is_violation_user**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def get_simple_playing_session**(pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_simple_community**(gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def update_progress_score**(gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def debug_notify_event**(pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def generate_matchmake_session_system_password**(gid: int) -> str</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def clear_matchmake_session_system_password**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def create_matchmake_session_with_param**(param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def join_matchmake_session_with_param**(param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `43` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n<code>**async def request_matchmaking**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Calls method `45` on the server.</span>\n\n<code>**async def withdraw_matchmaking**(request_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def withdraw_matchmaking_all**() -> None</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `48` on the server.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `49` on the server.</span>\n\n<code>**async def find_matchmake_session_by_owner**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `50` on the server.</span>\n\n<code>**async def find_matchmake_session_by_participant**(param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Calls method `51` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `52` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `53` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n## MatchmakeRefereeClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeClient`](#matchmakerefereeclient).</span>\n\n<code>**async def start_round**(param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_start_round_param**(round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def end_round**(param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def end_round_without_report**(round_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_round_participants**(round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_not_summarized_round**() -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_round**(round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_stats_primary**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_stats_primaries**(targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_or_create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def reset_stats**() -> None</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n## MatchMakingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServer`](#matchmakingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gatherings**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def invite**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def accept_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def decline_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_sent**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_received**(client: [RMCClient](rmc.md#rmcclient)) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def participate**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_type**(client: [RMCClient](rmc.md#rmcclient), type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_regex**(client: [RMCClient](rmc.md#rmcclient), regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_id**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_single_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(client: [RMCClient](rmc.md#rmcclient), owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_participants**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_invitations**(client: [RMCClient](rmc.md#rmcclient), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_sql_query**(client: [RMCClient](rmc.md#rmcclient), query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def launch_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(client: [RMCClient](rmc.md#rmcclient), gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_pending_deletions**(client: [RMCClient](rmc.md#rmcclient), reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_like**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host**(client: [RMCClient](rmc.md#rmcclient), gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n## MatchMakingServerExt\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServerExt`](#matchmakingserverext).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def end_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_gathering_relations**(client: [RMCClient](rmc.md#rmcclient), id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n## MatchmakeExtensionServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionServer`](#matchmakeextensionserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def close_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def open_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_postpone**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def modify_current_game_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_application_buffer**(client: [RMCClient](rmc.md#rmcclient), gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data_list**(client: [RMCClient](rmc.md#rmcclient), types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(client: [RMCClient](rmc.md#rmcclient), search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_community**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_official_community**(client: [RMCClient](rmc.md#rmcclient), available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_participant**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_privacy_setting**(client: [RMCClient](rmc.md#rmcclient), online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_to_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_from_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_violation**(client: [RMCClient](rmc.md#rmcclient), pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_violation_user**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(client: [RMCClient](rmc.md#rmcclient), gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_community**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(client: [RMCClient](rmc.md#rmcclient), gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_progress_score**(client: [RMCClient](rmc.md#rmcclient), gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def debug_notify_event**(client: [RMCClient](rmc.md#rmcclient), pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def generate_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(client: [RMCClient](rmc.md#rmcclient), param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n<code>**async def request_matchmaking**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking**(client: [RMCClient](rmc.md#rmcclient), request_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking_all**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `48`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `49`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_owner**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `50`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_participant**(client: [RMCClient](rmc.md#rmcclient), param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Handler for method `51`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `52`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `53`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n## MatchmakeRefereeServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeServer`](#matchmakerefereeserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def start_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_start_round_param**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round_without_report**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round_participants**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_not_summarized_round**(client: [RMCClient](rmc.md#rmcclient)) -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round**(client: [RMCClient](rmc.md#rmcclient), round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primary**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primaries**(client: [RMCClient](rmc.md#rmcclient), targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_or_create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_stats**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n## MatchmakeSystem\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 1`<br>\n`FRIENDS = 2`<br>\n</span>\n\n## AutoMatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AutoMatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)]</code><br>\n<code>target_gids: list[int]</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## CreateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CreateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>additional_participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## DeletionEntry\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DeletionEntry` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>pid: int</code><br>\n<code>reason: int</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pids: list[int]</code><br>\n<code>options: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n</span><br>\n\n## Gathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Gathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int = 0</code><br>\n<code>owner: int = 0</code><br>\n<code>host: int = 0</code><br>\n<code>min_participants: int = 0</code><br>\n<code>max_participants: int = 0</code><br>\n<code>participation_policy: int = 1</code><br>\n<code>policy_argument: int = 0</code><br>\n<code>flags: int = 512</code><br>\n<code>state: int = 0</code><br>\n<code>description: str = \"\"</code><br>\n</span><br>\n\n## GatheringStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>flags: int</code><br>\n<code>values: list[float]</code><br>\n</span><br>\n\n## GatheringURLs\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringURLs` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span><br>\n\n## Invitation\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Invitation` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>guest: int</code><br>\n<code>message: str</code><br>\n</span><br>\n\n## JoinMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `JoinMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>behavior: int</code><br>\n<code>user_password: str</code><br>\n<code>system_password: str</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>extra_participants: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## MatchmakeBlockListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeBlockListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>options: int = 0</code><br>\n</span><br>\n\n## MatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>param: dict[str, object] = {}</code><br>\n</span><br>\n\n## MatchmakeRefereeEndRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeEndRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>round_id: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereePersonalRoundResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereePersonalRoundResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>personal_round_result_flag: int</code><br>\n<code>round_win_loss: int</code><br>\n<code>rating_change: int</code><br>\n<code>buffer: bytes</code><br>\n</span><br>\n\n## MatchmakeRefereeRound\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeRound` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>gid: int</code><br>\n<code>state: int</code><br>\n<code>personal_data_category: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereeStartRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStartRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>personal_data_category: int</code><br>\n<code>gid: int</code><br>\n<code>pids: list[int]</code><br>\n</span><br>\n\n## MatchmakeRefereeStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int</code><br>\n<code>category: int</code><br>\n<code>pid: int</code><br>\n<code>recent_disconnection: int</code><br>\n<code>recent_violation: int</code><br>\n<code>recent_mismatch: int</code><br>\n<code>recent_win: int</code><br>\n<code>recent_loss: int</code><br>\n<code>recent_draw: int</code><br>\n<code>total_disconnect: int</code><br>\n<code>total_violation: int</code><br>\n<code>total_mismatch: int</code><br>\n<code>total_win: int</code><br>\n<code>total_loss: int</code><br>\n<code>total_draw: int</code><br>\n<code>rating_value: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>initial_rating: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>category: int</code><br>\n</span><br>\n\n## MatchmakeSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_mode: int = 0</code><br>\n<code>attribs: list[int] = [0, 0, 0, 0, 0, 0]</code><br>\n<code>open_participation: bool = True</code><br>\n<code>matchmake_system: int = 0</code><br>\n<code>application_data: bytes = b\"\"</code><br>\n<code>num_participants: int = 0</code><br>\nIf 30000 <= `nex.version` < 40000:<br>\n<span class=\"docs\">\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n</span><br>\nIf `nex.version` >= 30000:<br>\n<span class=\"docs\">\n<code>session_key: bytes = b\"\"</code><br>\n</span><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n</span><br>\nIf `nex.version` >= 30600:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30700:<br>\n<span class=\"docs\">\nIf `revision` >= 2:<br>\n<span class=\"docs\">\n<code>user_password: str = \"\"</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30800:<br>\n<span class=\"docs\">\nIf `revision` >= 3:<br>\n<span class=\"docs\">\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n</span><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n<code>session_key: bytes = b\"\"</code><br>\n<code>option: int = 0</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n<code>user_password: str = \"\"</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n<code>codeword: str = \"\"</code><br>\n</span><br>\n</span><br>\n\n## MatchmakeSessionSearchCriteria\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSessionSearchCriteria` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>attribs: list[str] = [\"\", \"\", \"\", \"\", \"\", \"\"]</code><br>\n<code>game_mode: str = \"\"</code><br>\n<code>min_participants: str = \"\"</code><br>\n<code>max_participants: str = \"\"</code><br>\n<code>matchmake_system: str = \"\"</code><br>\n<code>vacant_only: bool = True</code><br>\n<code>exclude_locked: bool = True</code><br>\n<code>exclude_non_host_pid: bool = False</code><br>\n<code>selection_method: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>vacant_participants: int = 1</code><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>exclude_user_password: bool = False</code><br>\n<code>exclude_system_password: bool = False</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>codeword: str = \"\"</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n</span><br>\n\n## ParticipantDetails\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ParticipantDetails` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>message: str</code><br>\n<code>participants: int</code><br>\n</span><br>\n\n## PersistentGathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PersistentGathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>password: str</code><br>\n<code>attribs: list[int]</code><br>\n<code>application_buffer: bytes</code><br>\n<code>participation_start: [DateTime](common.md#datetime)</code><br>\n<code>participation_end: [DateTime](common.md#datetime)</code><br>\n<code>matchmake_session_count: int</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## PlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span><br>\n\n## SimpleCommunity\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleCommunity` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>matchmake_session_count: int</code><br>\n</span><br>\n\n## SimplePlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimplePlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gid: int</code><br>\n<code>game_mode: int</code><br>\n<code>attribute: int</code><br>\n</span><br>\n\n## UpdateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UpdateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>modification_flags: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>open_participation: bool</code><br>\n<code>application_buffer: bytes</code><br>\n<code>progress_score: int</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime)</code><br>\n<code>user_password: str</code><br>\n<code>game_mode: int</code><br>\n<code>description: str</code><br>\n<code>min_participants: int</code><br>\n<code>max_participants: int</code><br>\n<code>matchmake_system: int</code><br>\n<code>participation_policy: int</code><br>\n<code>policy_argument: int</code><br>\n<code>codeword: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/matchmaking_eagle.md",
    "content": "\n# Module: <code>nintendo.nex.matchmaking_eagle</code>\n\nProvides a client and server for the `MatchMakingProtocol`, `MatchMakingProtocolExt`, `MatchmakeExtensionProtocol` and `MatchmakeRefereeProtocol`. This page was generated automatically from `matchmaking_eagle.proto`.\n\n<code>**class** [MatchMakingClient](#matchmakingclient)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingClientExt](#matchmakingclientext)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeExtensionClient](#matchmakeextensionclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeExtensionProtocol`.</span>\n\n<code>**class** [MatchmakeRefereeClient](#matchmakerefereeclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchMakingServer](#matchmakingserver)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingServerExt](#matchmakingserverext)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeExtensionServer](#matchmakeextensionserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeExtensionProtocol`.</span>\n\n<code>**class** [MatchmakeRefereeServer](#matchmakerefereeserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeSystem](#matchmakesystem)</code><br>\n\n<code>**class** [AutoMatchmakeParam](#automatchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [CreateMatchmakeSessionParam](#creatematchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [DeletionEntry](#deletionentry)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)([Structure](common.md))</code><br>\n<code>**class** [Gathering](#gathering)([Structure](common.md))</code><br>\n<code>**class** [GatheringStats](#gatheringstats)([Structure](common.md))</code><br>\n<code>**class** [GatheringURLs](#gatheringurls)([Structure](common.md))</code><br>\n<code>**class** [Invitation](#invitation)([Structure](common.md))</code><br>\n<code>**class** [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeBlockListParam](#matchmakeblocklistparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeParam](#matchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeRound](#matchmakerefereeround)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStats](#matchmakerefereestats)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeSession](#matchmakesession)([Gathering](#gathering))</code><br>\n<code>**class** [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)([Structure](common.md))</code><br>\n<code>**class** [ParticipantDetails](#participantdetails)([Structure](common.md))</code><br>\n<code>**class** [PersistentGathering](#persistentgathering)([Gathering](#gathering))</code><br>\n<code>**class** [PlayingSession](#playingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleCommunity](#simplecommunity)([Structure](common.md))</code><br>\n<code>**class** [SimplePlayingSession](#simpleplayingsession)([Structure](common.md))</code><br>\n<code>**class** [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)([Structure](common.md))</code><br>\n\n## MatchMakingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClient`](#matchmakingclient).</span>\n\n<code>**async def register_gathering**(gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def unregister_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def unregister_gatherings**(gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_gathering**(gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def invite**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def accept_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def decline_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def cancel_invitation**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_invitations_sent**(gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_invitations_received**() -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def participate**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def cancel_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_participants**(gid: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def add_participants**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_participants_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def find_by_type**(type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def find_by_description**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def find_by_description_regex**(regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_by_id**(ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_by_single_id**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `21` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def find_by_participants**(pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def find_invitations**(range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def find_by_sql_query**(query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def launch_session**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def update_session_url**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def get_session_url**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `28` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def report_stats**(gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_stats**(gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `32` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def get_pending_deletions**(reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `34` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def find_by_description_like**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def register_local_url**(gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def register_local_urls**(gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def update_session_host_v1**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def get_session_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def update_session_host**(gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def update_gathering_ownership**(gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def migrate_gathering_ownership**(gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n## MatchMakingClientExt\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClientExt`](#matchmakingclientext).</span>\n\n<code>**async def end_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_participants**(gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_participants_urls**(gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_gathering_relations**(id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n## MatchmakeExtensionClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionClient`](#matchmakeextensionclient).</span>\n\n<code>**async def close_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def open_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def auto_matchmake_postpone**(gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def browse_matchmake_session**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `5` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def modify_current_game_attribute**(gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def update_notification_data**(type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_friend_notification_data**(type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def update_application_buffer**(gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def update_matchmake_session_attribute**(gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_friend_notification_data_list**(types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def update_matchmake_session**(gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_playing_session**(pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def create_community**(community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_community**(community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def join_community**(gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_community_by_gathering_id**(gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_official_community**(available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def find_community_by_participant**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def update_privacy_setting**(online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def get_my_block_list**() -> list[int]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def add_to_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def remove_from_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def clear_my_block_list**() -> None</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def report_violation**(pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def is_violation_user**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def get_simple_playing_session**(pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_simple_community**(gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def update_progress_score**(gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def debug_notify_event**(pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def generate_matchmake_session_system_password**(gid: int) -> str</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def clear_matchmake_session_system_password**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def create_matchmake_session_with_param**(param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def join_matchmake_session_with_param**(param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `43` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n<code>**async def request_matchmaking**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Calls method `45` on the server.</span>\n\n<code>**async def withdraw_matchmaking**(request_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def withdraw_matchmaking_all**() -> None</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `48` on the server.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `49` on the server.</span>\n\n<code>**async def find_matchmake_session_by_owner**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `50` on the server.</span>\n\n<code>**async def find_matchmake_session_by_participant**(param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Calls method `51` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `52` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `53` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n## MatchmakeRefereeClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeClient`](#matchmakerefereeclient).</span>\n\n<code>**async def start_round**(param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_start_round_param**(round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def end_round**(param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def end_round_with_partial_report**(param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def end_round_without_report**(round_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_round_participants**(round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_not_summarized_round**() -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_round**(round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_stats_primary**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_stats_primaries**(targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `10` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_or_create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def reset_stats**() -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n## MatchMakingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServer`](#matchmakingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gatherings**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def invite**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def accept_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def decline_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_sent**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_received**(client: [RMCClient](rmc.md#rmcclient)) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def participate**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_type**(client: [RMCClient](rmc.md#rmcclient), type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_regex**(client: [RMCClient](rmc.md#rmcclient), regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_id**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_single_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(client: [RMCClient](rmc.md#rmcclient), owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_participants**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_invitations**(client: [RMCClient](rmc.md#rmcclient), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_sql_query**(client: [RMCClient](rmc.md#rmcclient), query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def launch_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(client: [RMCClient](rmc.md#rmcclient), gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_pending_deletions**(client: [RMCClient](rmc.md#rmcclient), reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_like**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host**(client: [RMCClient](rmc.md#rmcclient), gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n## MatchMakingServerExt\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServerExt`](#matchmakingserverext).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def end_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_gathering_relations**(client: [RMCClient](rmc.md#rmcclient), id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n## MatchmakeExtensionServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionServer`](#matchmakeextensionserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def close_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def open_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_postpone**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def modify_current_game_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_application_buffer**(client: [RMCClient](rmc.md#rmcclient), gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data_list**(client: [RMCClient](rmc.md#rmcclient), types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(client: [RMCClient](rmc.md#rmcclient), search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_community**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_official_community**(client: [RMCClient](rmc.md#rmcclient), available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_participant**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_privacy_setting**(client: [RMCClient](rmc.md#rmcclient), online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_to_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_from_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_violation**(client: [RMCClient](rmc.md#rmcclient), pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_violation_user**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(client: [RMCClient](rmc.md#rmcclient), gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_community**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(client: [RMCClient](rmc.md#rmcclient), gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_progress_score**(client: [RMCClient](rmc.md#rmcclient), gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def debug_notify_event**(client: [RMCClient](rmc.md#rmcclient), pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def generate_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(client: [RMCClient](rmc.md#rmcclient), param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n<code>**async def request_matchmaking**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking**(client: [RMCClient](rmc.md#rmcclient), request_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking_all**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `48`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `49`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_owner**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `50`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_participant**(client: [RMCClient](rmc.md#rmcclient), param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Handler for method `51`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `52`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `53`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n## MatchmakeRefereeServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeServer`](#matchmakerefereeserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def start_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_start_round_param**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round_with_partial_report**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round_without_report**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round_participants**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_not_summarized_round**(client: [RMCClient](rmc.md#rmcclient)) -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round**(client: [RMCClient](rmc.md#rmcclient), round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primary**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primaries**(client: [RMCClient](rmc.md#rmcclient), targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_or_create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_stats**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n## MatchmakeSystem\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 1`<br>\n`FRIENDS = 2`<br>\n</span>\n\n## AutoMatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AutoMatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)]</code><br>\n<code>target_gids: list[int]</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## CreateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CreateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>additional_participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## DeletionEntry\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DeletionEntry` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>pid: int</code><br>\n<code>reason: int</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pids: list[int]</code><br>\n<code>options: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n</span><br>\n\n## Gathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Gathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int = 0</code><br>\n<code>owner: int = 0</code><br>\n<code>host: int = 0</code><br>\n<code>min_participants: int = 0</code><br>\n<code>max_participants: int = 0</code><br>\n<code>participation_policy: int = 1</code><br>\n<code>policy_argument: int = 0</code><br>\n<code>flags: int = 512</code><br>\n<code>state: int = 0</code><br>\n<code>description: str = \"\"</code><br>\n</span><br>\n\n## GatheringStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>flags: int</code><br>\n<code>values: list[float]</code><br>\n</span><br>\n\n## GatheringURLs\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringURLs` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span><br>\n\n## Invitation\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Invitation` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>guest: int</code><br>\n<code>message: str</code><br>\n</span><br>\n\n## JoinMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `JoinMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>behavior: int</code><br>\n<code>user_password: str</code><br>\n<code>system_password: str</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>extra_participants: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## MatchmakeBlockListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeBlockListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>options: int = 0</code><br>\n</span><br>\n\n## MatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>param: dict[str, object] = {}</code><br>\n</span><br>\n\n## MatchmakeRefereeEndRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeEndRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>round_id: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereePersonalRoundResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereePersonalRoundResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>personal_round_result_flag: int</code><br>\n<code>round_win_loss: int</code><br>\n<code>rating_value_change: int</code><br>\n<code>buffer: bytes</code><br>\n<code>report_summary_mode: int</code><br>\n<code>event_id: int</code><br>\n</span><br>\n\n## MatchmakeRefereeRound\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeRound` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>gid: int</code><br>\n<code>state: int</code><br>\n<code>personal_data_category: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereeStartRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStartRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>personal_data_category: int</code><br>\n<code>gid: int</code><br>\n<code>pids: list[int]</code><br>\n<code>report_summary_mode: int</code><br>\n<code>event_id: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int</code><br>\n<code>category: int</code><br>\n<code>pid: int</code><br>\n<code>recent_disconnection: int</code><br>\n<code>recent_violation: int</code><br>\n<code>recent_mismatch: int</code><br>\n<code>recent_win: int</code><br>\n<code>recent_loss: int</code><br>\n<code>recent_draw: int</code><br>\n<code>total_disconnect: int</code><br>\n<code>total_violation: int</code><br>\n<code>total_mismatch: int</code><br>\n<code>total_win: int</code><br>\n<code>total_loss: int</code><br>\n<code>total_draw: int</code><br>\n<code>rating_value: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>initial_rating: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>category: int</code><br>\n</span><br>\n\n## MatchmakeSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_mode: int = 0</code><br>\n<code>attribs: list[int] = [0, 0, 0, 0, 0, 0]</code><br>\n<code>open_participation: bool = True</code><br>\n<code>matchmake_system: int = 0</code><br>\n<code>application_data: bytes = b\"\"</code><br>\n<code>num_participants: int = 0</code><br>\nIf 30000 <= `nex.version` < 40000:<br>\n<span class=\"docs\">\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n</span><br>\nIf `nex.version` >= 30000:<br>\n<span class=\"docs\">\n<code>session_key: bytes = b\"\"</code><br>\n</span><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n</span><br>\nIf `nex.version` >= 30600:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30700:<br>\n<span class=\"docs\">\nIf `revision` >= 2:<br>\n<span class=\"docs\">\n<code>user_password: str = \"\"</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30800:<br>\n<span class=\"docs\">\nIf `revision` >= 3:<br>\n<span class=\"docs\">\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n</span><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n<code>session_key: bytes = b\"\"</code><br>\n<code>option: int = 0</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n<code>user_password: str = \"\"</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n<code>codeword: str = \"\"</code><br>\n</span><br>\n</span><br>\n\n## MatchmakeSessionSearchCriteria\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSessionSearchCriteria` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>attribs: list[str] = [\"\", \"\", \"\", \"\", \"\", \"\"]</code><br>\n<code>game_mode: str = \"\"</code><br>\n<code>min_participants: str = \"\"</code><br>\n<code>max_participants: str = \"\"</code><br>\n<code>matchmake_system: str = \"\"</code><br>\n<code>vacant_only: bool = True</code><br>\n<code>exclude_locked: bool = True</code><br>\n<code>exclude_non_host_pid: bool = False</code><br>\n<code>selection_method: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>vacant_participants: int = 1</code><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>exclude_user_password: bool = False</code><br>\n<code>exclude_system_password: bool = False</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>codeword: str = \"\"</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n</span><br>\n\n## ParticipantDetails\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ParticipantDetails` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>message: str</code><br>\n<code>participants: int</code><br>\n</span><br>\n\n## PersistentGathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PersistentGathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>password: str</code><br>\n<code>attribs: list[int]</code><br>\n<code>application_buffer: bytes</code><br>\n<code>participation_start: [DateTime](common.md#datetime)</code><br>\n<code>participation_end: [DateTime](common.md#datetime)</code><br>\n<code>matchmake_session_count: int</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## PlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span><br>\n\n## SimpleCommunity\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleCommunity` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>matchmake_session_count: int</code><br>\n</span><br>\n\n## SimplePlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimplePlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gid: int</code><br>\n<code>game_mode: int</code><br>\n<code>attribute: int</code><br>\n</span><br>\n\n## UpdateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UpdateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>modification_flags: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>open_participation: bool</code><br>\n<code>application_buffer: bytes</code><br>\n<code>progress_score: int</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime)</code><br>\n<code>user_password: str</code><br>\n<code>game_mode: int</code><br>\n<code>description: str</code><br>\n<code>min_participants: int</code><br>\n<code>max_participants: int</code><br>\n<code>matchmake_system: int</code><br>\n<code>participation_policy: int</code><br>\n<code>policy_argument: int</code><br>\n<code>codeword: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/matchmaking_mhxx.md",
    "content": "\n# Module: <code>nintendo.nex.matchmaking_mhxx</code>\n\nProvides a client and server for the `MatchMakingProtocol`, `MatchMakingProtocolExt`, `MatchmakeRefereeProtocol` and `MatchmakeExtensionProtocolMHXX`. This page was generated automatically from `matchmaking_mhxx.proto`.\n\n<code>**class** [MatchMakingClient](#matchmakingclient)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingClientExt](#matchmakingclientext)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeRefereeClient](#matchmakerefereeclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeExtensionClientMHXX](#matchmakeextensionclientmhxx)</code><br>\n<span class=\"docs\">The client for the `MatchmakeExtensionProtocolMHXX`.</span>\n\n<code>**class** [MatchMakingServer](#matchmakingserver)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingServerExt](#matchmakingserverext)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeRefereeServer](#matchmakerefereeserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeExtensionServerMHXX](#matchmakeextensionservermhxx)</code><br>\n<span class=\"docs\">The server for the `MatchmakeExtensionProtocolMHXX`.</span>\n\n<code>**class** [MatchmakeSystem](#matchmakesystem)</code><br>\n\n<code>**class** [AutoMatchmakeParam](#automatchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [CreateMatchmakeSessionParam](#creatematchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [DeletionEntry](#deletionentry)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)([Structure](common.md))</code><br>\n<code>**class** [FriendUserInfo](#frienduserinfo)([Structure](common.md))</code><br>\n<code>**class** [FriendUserParam](#frienduserparam)([Structure](common.md))</code><br>\n<code>**class** [Gathering](#gathering)([Structure](common.md))</code><br>\n<code>**class** [GatheringStats](#gatheringstats)([Structure](common.md))</code><br>\n<code>**class** [GatheringURLs](#gatheringurls)([Structure](common.md))</code><br>\n<code>**class** [Invitation](#invitation)([Structure](common.md))</code><br>\n<code>**class** [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeBlockListParam](#matchmakeblocklistparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeParam](#matchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeRound](#matchmakerefereeround)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStats](#matchmakerefereestats)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeSession](#matchmakesession)([Gathering](#gathering))</code><br>\n<code>**class** [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)([Structure](common.md))</code><br>\n<code>**class** [ParticipantDetails](#participantdetails)([Structure](common.md))</code><br>\n<code>**class** [PersistentGathering](#persistentgathering)([Gathering](#gathering))</code><br>\n<code>**class** [PlayingSession](#playingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleCommunity](#simplecommunity)([Structure](common.md))</code><br>\n<code>**class** [SimplePlayingSession](#simpleplayingsession)([Structure](common.md))</code><br>\n<code>**class** [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)([Structure](common.md))</code><br>\n\n## MatchMakingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClient`](#matchmakingclient).</span>\n\n<code>**async def register_gathering**(gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def unregister_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def unregister_gatherings**(gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_gathering**(gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def invite**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def accept_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def decline_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def cancel_invitation**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_invitations_sent**(gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_invitations_received**() -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def participate**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def cancel_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_participants**(gid: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def add_participants**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_participants_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def find_by_type**(type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def find_by_description**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def find_by_description_regex**(regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_by_id**(ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_by_single_id**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `21` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def find_by_participants**(pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def find_invitations**(range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def find_by_sql_query**(query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def launch_session**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def update_session_url**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def get_session_url**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `28` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def report_stats**(gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_stats**(gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `32` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def get_pending_deletions**(reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `34` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def find_by_description_like**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def register_local_url**(gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def register_local_urls**(gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def update_session_host_v1**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def get_session_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def update_session_host**(gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def update_gathering_ownership**(gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def migrate_gathering_ownership**(gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n## MatchMakingClientExt\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClientExt`](#matchmakingclientext).</span>\n\n<code>**async def end_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_participants**(gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_participants_urls**(gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_gathering_relations**(id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n## MatchmakeRefereeClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeClient`](#matchmakerefereeclient).</span>\n\n<code>**async def start_round**(param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_start_round_param**(round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def end_round**(param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def end_round_without_report**(round_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_round_participants**(round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_not_summarized_round**() -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_round**(round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_stats_primary**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_stats_primaries**(targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_or_create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def reset_stats**() -> None</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n## MatchmakeExtensionClientMHXX\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionClientMHXX`](#matchmakeextensionclientmhxx).</span>\n\n<code>**async def close_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def open_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def auto_matchmake_postpone**(gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def browse_matchmake_session**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `5` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def modify_current_game_attribute**(gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def update_notification_data**(type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_friend_notification_data**(type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def update_application_buffer**(gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def update_matchmake_session_attribute**(gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_friend_notification_data_list**(types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def update_matchmake_session**(gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_playing_session**(pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def create_community**(community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_community**(community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def join_community**(gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_community_by_gathering_id**(gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_official_community**(available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def find_community_by_participant**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def update_privacy_setting**(online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def get_my_block_list**() -> list[int]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def add_to_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def remove_from_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def clear_my_block_list**() -> None</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def report_violation**(pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def is_violation_user**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def get_simple_playing_session**(pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_simple_community**(gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def update_progress_score**(gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def debug_notify_event**(pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def generate_matchmake_session_system_password**(gid: int) -> str</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def clear_matchmake_session_system_password**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def create_matchmake_session_with_param**(param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def join_matchmake_session_with_param**(param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `43` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n<code>**async def request_matchmaking**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Calls method `45` on the server.</span>\n\n<code>**async def withdraw_matchmaking**(request_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def withdraw_matchmaking_all**() -> None</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `48` on the server.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `49` on the server.</span>\n\n<code>**async def find_matchmake_session_by_owner**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `50` on the server.</span>\n\n<code>**async def find_matchmake_session_by_participant**(param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Calls method `51` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `52` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `53` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_friend_user_profile**(param: [FriendUserParam](#frienduserparam)) -> None</code><br>\n<span class=\"docs\">Calls method `54` on the server.</span>\n\n<code>**async def get_friend_user_profiles**(pids: list[int]) -> list[[FriendUserInfo](#frienduserinfo)]</code><br>\n<span class=\"docs\">Calls method `55` on the server.</span>\n\n<code>**async def get_friends**() -> list[[FriendUserInfo](#frienduserinfo)]</code><br>\n<span class=\"docs\">Calls method `56` on the server.</span>\n\n<code>**async def add_friends**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `57` on the server.</span>\n\n<code>**async def remove_friend**(pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `58` on the server.</span>\n\n<code>**async def find_community_by_owner**(id: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `59` on the server.</span>\n\n## MatchMakingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServer`](#matchmakingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gatherings**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def invite**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def accept_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def decline_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_sent**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_received**(client: [RMCClient](rmc.md#rmcclient)) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def participate**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_type**(client: [RMCClient](rmc.md#rmcclient), type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_regex**(client: [RMCClient](rmc.md#rmcclient), regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_id**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_single_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(client: [RMCClient](rmc.md#rmcclient), owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_participants**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_invitations**(client: [RMCClient](rmc.md#rmcclient), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_sql_query**(client: [RMCClient](rmc.md#rmcclient), query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def launch_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(client: [RMCClient](rmc.md#rmcclient), gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_pending_deletions**(client: [RMCClient](rmc.md#rmcclient), reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_like**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host**(client: [RMCClient](rmc.md#rmcclient), gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n## MatchMakingServerExt\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServerExt`](#matchmakingserverext).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def end_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_gathering_relations**(client: [RMCClient](rmc.md#rmcclient), id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n## MatchmakeRefereeServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeServer`](#matchmakerefereeserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def start_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_start_round_param**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round_without_report**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round_participants**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_not_summarized_round**(client: [RMCClient](rmc.md#rmcclient)) -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round**(client: [RMCClient](rmc.md#rmcclient), round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primary**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primaries**(client: [RMCClient](rmc.md#rmcclient), targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_or_create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_stats**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n## MatchmakeExtensionServerMHXX\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionServerMHXX`](#matchmakeextensionservermhxx).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def close_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def open_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_postpone**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def modify_current_game_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_application_buffer**(client: [RMCClient](rmc.md#rmcclient), gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data_list**(client: [RMCClient](rmc.md#rmcclient), types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(client: [RMCClient](rmc.md#rmcclient), search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_community**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_official_community**(client: [RMCClient](rmc.md#rmcclient), available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_participant**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_privacy_setting**(client: [RMCClient](rmc.md#rmcclient), online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_to_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_from_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_violation**(client: [RMCClient](rmc.md#rmcclient), pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_violation_user**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(client: [RMCClient](rmc.md#rmcclient), gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_community**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(client: [RMCClient](rmc.md#rmcclient), gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_progress_score**(client: [RMCClient](rmc.md#rmcclient), gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def debug_notify_event**(client: [RMCClient](rmc.md#rmcclient), pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def generate_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(client: [RMCClient](rmc.md#rmcclient), param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n<code>**async def request_matchmaking**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking**(client: [RMCClient](rmc.md#rmcclient), request_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking_all**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `48`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `49`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_owner**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `50`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_participant**(client: [RMCClient](rmc.md#rmcclient), param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Handler for method `51`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `52`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `53`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_friend_user_profile**(client: [RMCClient](rmc.md#rmcclient), param: [FriendUserParam](#frienduserparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `54`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_user_profiles**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[FriendUserInfo](#frienduserinfo)]</code><br>\n<span class=\"docs\">Handler for method `55`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friends**(client: [RMCClient](rmc.md#rmcclient)) -> list[[FriendUserInfo](#frienduserinfo)]</code><br>\n<span class=\"docs\">Handler for method `56`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_friends**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `57`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_friend**(client: [RMCClient](rmc.md#rmcclient), pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `58`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_owner**(client: [RMCClient](rmc.md#rmcclient), id: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `59`. This method should be overridden by a subclass.</span>\n\n## MatchmakeSystem\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 1`<br>\n`FRIENDS = 2`<br>\n</span>\n\n## AutoMatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AutoMatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)]</code><br>\n<code>target_gids: list[int]</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## CreateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CreateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>additional_participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## DeletionEntry\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DeletionEntry` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>pid: int</code><br>\n<code>reason: int</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pids: list[int]</code><br>\n<code>options: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n</span><br>\n\n## FriendUserInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendUserInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>presence: int</code><br>\n</span><br>\n\n## FriendUserParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FriendUserParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>name: str</code><br>\n</span><br>\n\n## Gathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Gathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int = 0</code><br>\n<code>owner: int = 0</code><br>\n<code>host: int = 0</code><br>\n<code>min_participants: int = 0</code><br>\n<code>max_participants: int = 0</code><br>\n<code>participation_policy: int = 1</code><br>\n<code>policy_argument: int = 0</code><br>\n<code>flags: int = 512</code><br>\n<code>state: int = 0</code><br>\n<code>description: str = \"\"</code><br>\n</span><br>\n\n## GatheringStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>flags: int</code><br>\n<code>values: list[float]</code><br>\n</span><br>\n\n## GatheringURLs\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringURLs` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span><br>\n\n## Invitation\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Invitation` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>guest: int</code><br>\n<code>message: str</code><br>\n</span><br>\n\n## JoinMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `JoinMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>behavior: int</code><br>\n<code>user_password: str</code><br>\n<code>system_password: str</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>extra_participants: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## MatchmakeBlockListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeBlockListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>options: int = 0</code><br>\n</span><br>\n\n## MatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>param: dict[str, object] = {}</code><br>\n</span><br>\n\n## MatchmakeRefereeEndRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeEndRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>round_id: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereePersonalRoundResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereePersonalRoundResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>personal_round_result_flag: int</code><br>\n<code>round_win_loss: int</code><br>\n<code>rating_change: int</code><br>\n<code>buffer: bytes</code><br>\n</span><br>\n\n## MatchmakeRefereeRound\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeRound` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>gid: int</code><br>\n<code>state: int</code><br>\n<code>personal_data_category: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereeStartRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStartRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>personal_data_category: int</code><br>\n<code>gid: int</code><br>\n<code>pids: list[int]</code><br>\n</span><br>\n\n## MatchmakeRefereeStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int</code><br>\n<code>category: int</code><br>\n<code>pid: int</code><br>\n<code>recent_disconnection: int</code><br>\n<code>recent_violation: int</code><br>\n<code>recent_mismatch: int</code><br>\n<code>recent_win: int</code><br>\n<code>recent_loss: int</code><br>\n<code>recent_draw: int</code><br>\n<code>total_disconnect: int</code><br>\n<code>total_violation: int</code><br>\n<code>total_mismatch: int</code><br>\n<code>total_win: int</code><br>\n<code>total_loss: int</code><br>\n<code>total_draw: int</code><br>\n<code>rating_value: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>initial_rating: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>category: int</code><br>\n</span><br>\n\n## MatchmakeSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_mode: int = 0</code><br>\n<code>attribs: list[int] = [0, 0, 0, 0, 0, 0]</code><br>\n<code>open_participation: bool = True</code><br>\n<code>matchmake_system: int = 0</code><br>\n<code>application_data: bytes = b\"\"</code><br>\n<code>num_participants: int = 0</code><br>\nIf 30000 <= `nex.version` < 40000:<br>\n<span class=\"docs\">\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n</span><br>\nIf `nex.version` >= 30000:<br>\n<span class=\"docs\">\n<code>session_key: bytes = b\"\"</code><br>\n</span><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n</span><br>\nIf `nex.version` >= 30600:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30700:<br>\n<span class=\"docs\">\nIf `revision` >= 2:<br>\n<span class=\"docs\">\n<code>user_password: str = \"\"</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30800:<br>\n<span class=\"docs\">\nIf `revision` >= 3:<br>\n<span class=\"docs\">\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n</span><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n<code>session_key: bytes = b\"\"</code><br>\n<code>option: int = 0</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n<code>user_password: str = \"\"</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n<code>codeword: str = \"\"</code><br>\n</span><br>\n</span><br>\n\n## MatchmakeSessionSearchCriteria\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSessionSearchCriteria` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>attribs: list[str] = [\"\", \"\", \"\", \"\", \"\", \"\"]</code><br>\n<code>game_mode: str = \"\"</code><br>\n<code>min_participants: str = \"\"</code><br>\n<code>max_participants: str = \"\"</code><br>\n<code>matchmake_system: str = \"\"</code><br>\n<code>vacant_only: bool = True</code><br>\n<code>exclude_locked: bool = True</code><br>\n<code>exclude_non_host_pid: bool = False</code><br>\n<code>selection_method: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>vacant_participants: int = 1</code><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>exclude_user_password: bool = False</code><br>\n<code>exclude_system_password: bool = False</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>codeword: str = \"\"</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n</span><br>\n\n## ParticipantDetails\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ParticipantDetails` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>message: str</code><br>\n<code>participants: int</code><br>\n</span><br>\n\n## PersistentGathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PersistentGathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>password: str</code><br>\n<code>attribs: list[int]</code><br>\n<code>application_buffer: bytes</code><br>\n<code>participation_start: [DateTime](common.md#datetime)</code><br>\n<code>participation_end: [DateTime](common.md#datetime)</code><br>\n<code>matchmake_session_count: int</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## PlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span><br>\n\n## SimpleCommunity\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleCommunity` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>matchmake_session_count: int</code><br>\n</span><br>\n\n## SimplePlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimplePlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gid: int</code><br>\n<code>game_mode: int</code><br>\n<code>attribute: int</code><br>\n</span><br>\n\n## UpdateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UpdateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>modification_flags: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>open_participation: bool</code><br>\n<code>application_buffer: bytes</code><br>\n<code>progress_score: int</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime)</code><br>\n<code>user_password: str</code><br>\n<code>game_mode: int</code><br>\n<code>description: str</code><br>\n<code>min_participants: int</code><br>\n<code>max_participants: int</code><br>\n<code>matchmake_system: int</code><br>\n<code>participation_policy: int</code><br>\n<code>policy_argument: int</code><br>\n<code>codeword: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/matchmaking_mk8.md",
    "content": "\n# Module: <code>nintendo.nex.matchmaking_mk8</code>\n\nProvides a client and server for the `MatchMakingProtocol`, `MatchMakingProtocolExt`, `MatchmakeRefereeProtocol` and `MatchmakeExtensionProtocolMK8`. This page was generated automatically from `matchmaking_mk8.proto`.\n\n<code>**class** [MatchMakingClient](#matchmakingclient)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingClientExt](#matchmakingclientext)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeRefereeClient](#matchmakerefereeclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeExtensionClientMK8](#matchmakeextensionclientmk8)</code><br>\n<span class=\"docs\">The client for the `MatchmakeExtensionProtocolMK8`.</span>\n\n<code>**class** [MatchMakingServer](#matchmakingserver)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingServerExt](#matchmakingserverext)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeRefereeServer](#matchmakerefereeserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeExtensionServerMK8](#matchmakeextensionservermk8)</code><br>\n<span class=\"docs\">The server for the `MatchmakeExtensionProtocolMK8`.</span>\n\n<code>**class** [MatchmakeSystem](#matchmakesystem)</code><br>\n\n<code>**class** [AutoMatchmakeParam](#automatchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [CreateMatchmakeSessionParam](#creatematchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [DeletionEntry](#deletionentry)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)([Structure](common.md))</code><br>\n<code>**class** [Gathering](#gathering)([Structure](common.md))</code><br>\n<code>**class** [GatheringStats](#gatheringstats)([Structure](common.md))</code><br>\n<code>**class** [GatheringURLs](#gatheringurls)([Structure](common.md))</code><br>\n<code>**class** [Invitation](#invitation)([Structure](common.md))</code><br>\n<code>**class** [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeBlockListParam](#matchmakeblocklistparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeParam](#matchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeRound](#matchmakerefereeround)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStats](#matchmakerefereestats)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeSession](#matchmakesession)([Gathering](#gathering))</code><br>\n<code>**class** [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)([Structure](common.md))</code><br>\n<code>**class** [ParticipantDetails](#participantdetails)([Structure](common.md))</code><br>\n<code>**class** [PersistentGathering](#persistentgathering)([Gathering](#gathering))</code><br>\n<code>**class** [PlayingSession](#playingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleCommunity](#simplecommunity)([Structure](common.md))</code><br>\n<code>**class** [SimplePlayingSession](#simpleplayingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchCondition](#simplesearchcondition)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchDateTimeAttribute](#simplesearchdatetimeattribute)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchObject](#simplesearchobject)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchParam](#simplesearchparam)([Structure](common.md))</code><br>\n<code>**class** [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)([Structure](common.md))</code><br>\n\n## MatchMakingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClient`](#matchmakingclient).</span>\n\n<code>**async def register_gathering**(gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def unregister_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def unregister_gatherings**(gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_gathering**(gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def invite**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def accept_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def decline_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def cancel_invitation**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_invitations_sent**(gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_invitations_received**() -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def participate**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def cancel_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_participants**(gid: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def add_participants**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_participants_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def find_by_type**(type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def find_by_description**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def find_by_description_regex**(regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_by_id**(ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_by_single_id**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `21` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def find_by_participants**(pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def find_invitations**(range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def find_by_sql_query**(query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def launch_session**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def update_session_url**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def get_session_url**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `28` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def report_stats**(gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_stats**(gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `32` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def get_pending_deletions**(reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `34` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def find_by_description_like**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def register_local_url**(gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def register_local_urls**(gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def update_session_host_v1**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def get_session_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def update_session_host**(gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def update_gathering_ownership**(gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def migrate_gathering_ownership**(gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n## MatchMakingClientExt\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClientExt`](#matchmakingclientext).</span>\n\n<code>**async def end_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_participants**(gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_participants_urls**(gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_gathering_relations**(id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n## MatchmakeRefereeClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeClient`](#matchmakerefereeclient).</span>\n\n<code>**async def start_round**(param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_start_round_param**(round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def end_round**(param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def end_round_without_report**(round_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_round_participants**(round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_not_summarized_round**() -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_round**(round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_stats_primary**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_stats_primaries**(targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_or_create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def reset_stats**() -> None</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n## MatchmakeExtensionClientMK8\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionClientMK8`](#matchmakeextensionclientmk8).</span>\n\n<code>**async def close_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def open_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def auto_matchmake_postpone**(gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def browse_matchmake_session**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `5` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def modify_current_game_attribute**(gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def update_notification_data**(type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_friend_notification_data**(type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def update_application_buffer**(gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def update_matchmake_session_attribute**(gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_friend_notification_data_list**(types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def update_matchmake_session**(gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_playing_session**(pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def create_community**(community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_community**(community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def join_community**(gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_community_by_gathering_id**(gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_official_community**(available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def find_community_by_participant**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def update_privacy_setting**(online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def get_my_block_list**() -> list[int]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def add_to_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def remove_from_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def clear_my_block_list**() -> None</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def report_violation**(pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def is_violation_user**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def get_simple_playing_session**(pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_simple_community**(gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def update_progress_score**(gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def debug_notify_event**(pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def create_simple_search_object**(object: [SimpleSearchObject](#simplesearchobject)) -> int</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def update_simple_search_object**(id: int, object: [SimpleSearchObject](#simplesearchobject)) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def delete_simple_search_object**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def search_simple_search_object**(param: [SimpleSearchParam](#simplesearchparam)) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def join_matchmake_session_with_extra_participants**(gid: int, join_message: str, ignore_blacklist: bool, participation_count: int, extra_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def search_simple_search_object_by_object_ids**(ids: list[int]) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `43` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n<code>**async def request_matchmaking**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Calls method `45` on the server.</span>\n\n<code>**async def withdraw_matchmaking**(request_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def withdraw_matchmaking_all**() -> None</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `48` on the server.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `49` on the server.</span>\n\n<code>**async def find_matchmake_session_by_owner**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `50` on the server.</span>\n\n<code>**async def find_matchmake_session_by_participant**(param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Calls method `51` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `52` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `53` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n## MatchMakingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServer`](#matchmakingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gatherings**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def invite**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def accept_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def decline_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_sent**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_received**(client: [RMCClient](rmc.md#rmcclient)) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def participate**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_type**(client: [RMCClient](rmc.md#rmcclient), type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_regex**(client: [RMCClient](rmc.md#rmcclient), regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_id**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_single_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(client: [RMCClient](rmc.md#rmcclient), owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_participants**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_invitations**(client: [RMCClient](rmc.md#rmcclient), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_sql_query**(client: [RMCClient](rmc.md#rmcclient), query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def launch_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(client: [RMCClient](rmc.md#rmcclient), gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_pending_deletions**(client: [RMCClient](rmc.md#rmcclient), reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_like**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host**(client: [RMCClient](rmc.md#rmcclient), gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n## MatchMakingServerExt\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServerExt`](#matchmakingserverext).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def end_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_gathering_relations**(client: [RMCClient](rmc.md#rmcclient), id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n## MatchmakeRefereeServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeServer`](#matchmakerefereeserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def start_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_start_round_param**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round_without_report**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round_participants**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_not_summarized_round**(client: [RMCClient](rmc.md#rmcclient)) -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round**(client: [RMCClient](rmc.md#rmcclient), round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primary**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primaries**(client: [RMCClient](rmc.md#rmcclient), targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_or_create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_stats**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n## MatchmakeExtensionServerMK8\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionServerMK8`](#matchmakeextensionservermk8).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def close_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def open_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_postpone**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def modify_current_game_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_application_buffer**(client: [RMCClient](rmc.md#rmcclient), gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data_list**(client: [RMCClient](rmc.md#rmcclient), types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(client: [RMCClient](rmc.md#rmcclient), search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_community**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_official_community**(client: [RMCClient](rmc.md#rmcclient), available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_participant**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_privacy_setting**(client: [RMCClient](rmc.md#rmcclient), online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_to_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_from_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_violation**(client: [RMCClient](rmc.md#rmcclient), pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_violation_user**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(client: [RMCClient](rmc.md#rmcclient), gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_community**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(client: [RMCClient](rmc.md#rmcclient), gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_progress_score**(client: [RMCClient](rmc.md#rmcclient), gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def debug_notify_event**(client: [RMCClient](rmc.md#rmcclient), pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), object: [SimpleSearchObject](#simplesearchobject)) -> int</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), id: int, object: [SimpleSearchObject](#simplesearchobject)) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), param: [SimpleSearchParam](#simplesearchparam)) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_matchmake_session_with_extra_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, join_message: str, ignore_blacklist: bool, participation_count: int, extra_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_simple_search_object_by_object_ids**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(client: [RMCClient](rmc.md#rmcclient), param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n<code>**async def request_matchmaking**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking**(client: [RMCClient](rmc.md#rmcclient), request_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking_all**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `48`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `49`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_owner**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `50`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_participant**(client: [RMCClient](rmc.md#rmcclient), param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Handler for method `51`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `52`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `53`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n## MatchmakeSystem\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 1`<br>\n`FRIENDS = 2`<br>\n</span>\n\n## AutoMatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AutoMatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)]</code><br>\n<code>target_gids: list[int]</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## CreateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CreateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>additional_participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## DeletionEntry\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DeletionEntry` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>pid: int</code><br>\n<code>reason: int</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pids: list[int]</code><br>\n<code>options: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n</span><br>\n\n## Gathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Gathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int = 0</code><br>\n<code>owner: int = 0</code><br>\n<code>host: int = 0</code><br>\n<code>min_participants: int = 0</code><br>\n<code>max_participants: int = 0</code><br>\n<code>participation_policy: int = 1</code><br>\n<code>policy_argument: int = 0</code><br>\n<code>flags: int = 512</code><br>\n<code>state: int = 0</code><br>\n<code>description: str = \"\"</code><br>\n</span><br>\n\n## GatheringStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>flags: int</code><br>\n<code>values: list[float]</code><br>\n</span><br>\n\n## GatheringURLs\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringURLs` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span><br>\n\n## Invitation\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Invitation` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>guest: int</code><br>\n<code>message: str</code><br>\n</span><br>\n\n## JoinMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `JoinMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>behavior: int</code><br>\n<code>user_password: str</code><br>\n<code>system_password: str</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>extra_participants: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## MatchmakeBlockListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeBlockListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>options: int = 0</code><br>\n</span><br>\n\n## MatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>param: dict[str, object] = {}</code><br>\n</span><br>\n\n## MatchmakeRefereeEndRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeEndRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>round_id: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereePersonalRoundResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereePersonalRoundResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>personal_round_result_flag: int</code><br>\n<code>round_win_loss: int</code><br>\n<code>rating_change: int</code><br>\n<code>buffer: bytes</code><br>\n</span><br>\n\n## MatchmakeRefereeRound\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeRound` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>gid: int</code><br>\n<code>state: int</code><br>\n<code>personal_data_category: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereeStartRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStartRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>personal_data_category: int</code><br>\n<code>gid: int</code><br>\n<code>pids: list[int]</code><br>\n</span><br>\n\n## MatchmakeRefereeStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int</code><br>\n<code>category: int</code><br>\n<code>pid: int</code><br>\n<code>recent_disconnection: int</code><br>\n<code>recent_violation: int</code><br>\n<code>recent_mismatch: int</code><br>\n<code>recent_win: int</code><br>\n<code>recent_loss: int</code><br>\n<code>recent_draw: int</code><br>\n<code>total_disconnect: int</code><br>\n<code>total_violation: int</code><br>\n<code>total_mismatch: int</code><br>\n<code>total_win: int</code><br>\n<code>total_loss: int</code><br>\n<code>total_draw: int</code><br>\n<code>rating_value: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>initial_rating: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>category: int</code><br>\n</span><br>\n\n## MatchmakeSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_mode: int = 0</code><br>\n<code>attribs: list[int] = [0, 0, 0, 0, 0, 0]</code><br>\n<code>open_participation: bool = True</code><br>\n<code>matchmake_system: int = 0</code><br>\n<code>application_data: bytes = b\"\"</code><br>\n<code>num_participants: int = 0</code><br>\nIf 30000 <= `nex.version` < 40000:<br>\n<span class=\"docs\">\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n</span><br>\nIf `nex.version` >= 30000:<br>\n<span class=\"docs\">\n<code>session_key: bytes = b\"\"</code><br>\n</span><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n</span><br>\nIf `nex.version` >= 30600:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30700:<br>\n<span class=\"docs\">\nIf `revision` >= 2:<br>\n<span class=\"docs\">\n<code>user_password: str = \"\"</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30800:<br>\n<span class=\"docs\">\nIf `revision` >= 3:<br>\n<span class=\"docs\">\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n</span><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n<code>session_key: bytes = b\"\"</code><br>\n<code>option: int = 0</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n<code>user_password: str = \"\"</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n<code>codeword: str = \"\"</code><br>\n</span><br>\n</span><br>\n\n## MatchmakeSessionSearchCriteria\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSessionSearchCriteria` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>attribs: list[str] = [\"\", \"\", \"\", \"\", \"\", \"\"]</code><br>\n<code>game_mode: str = \"\"</code><br>\n<code>min_participants: str = \"\"</code><br>\n<code>max_participants: str = \"\"</code><br>\n<code>matchmake_system: str = \"\"</code><br>\n<code>vacant_only: bool = True</code><br>\n<code>exclude_locked: bool = True</code><br>\n<code>exclude_non_host_pid: bool = False</code><br>\n<code>selection_method: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>vacant_participants: int = 1</code><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>exclude_user_password: bool = False</code><br>\n<code>exclude_system_password: bool = False</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>codeword: str = \"\"</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n</span><br>\n\n## ParticipantDetails\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ParticipantDetails` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>message: str</code><br>\n<code>participants: int</code><br>\n</span><br>\n\n## PersistentGathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PersistentGathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>password: str</code><br>\n<code>attribs: list[int]</code><br>\n<code>application_buffer: bytes</code><br>\n<code>participation_start: [DateTime](common.md#datetime)</code><br>\n<code>participation_end: [DateTime](common.md#datetime)</code><br>\n<code>matchmake_session_count: int</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## PlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span><br>\n\n## SimpleCommunity\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleCommunity` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>matchmake_session_count: int</code><br>\n</span><br>\n\n## SimplePlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimplePlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gid: int</code><br>\n<code>game_mode: int</code><br>\n<code>attribute: int</code><br>\n</span><br>\n\n## SimpleSearchCondition\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchCondition` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>value: int</code><br>\n<code>operator: int</code><br>\n</span><br>\n\n## SimpleSearchDateTimeAttribute\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchDateTimeAttribute` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>unk3: int</code><br>\n<code>unk4: int</code><br>\n<code>start_time: [DateTime](common.md#datetime)</code><br>\n<code>end_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## SimpleSearchObject\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchObject` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>owner: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>metadata: bytes</code><br>\n<code>community_id: int</code><br>\n<code>community_code: str</code><br>\n<code>datetime: [SimpleSearchDateTimeAttribute](#simplesearchdatetimeattribute) = [SimpleSearchDateTimeAttribute](#simplesearchdatetimeattribute)()</code><br>\n</span><br>\n\n## SimpleSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unk1: int</code><br>\n<code>unk2: int</code><br>\n<code>conditions: list[[SimpleSearchCondition](#simplesearchcondition)]</code><br>\n<code>unk3: str</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>unk4: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## UpdateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UpdateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>modification_flags: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>open_participation: bool</code><br>\n<code>application_buffer: bytes</code><br>\n<code>progress_score: int</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime)</code><br>\n<code>user_password: str</code><br>\n<code>game_mode: int</code><br>\n<code>description: str</code><br>\n<code>min_participants: int</code><br>\n<code>max_participants: int</code><br>\n<code>matchmake_system: int</code><br>\n<code>participation_policy: int</code><br>\n<code>policy_argument: int</code><br>\n<code>codeword: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/matchmaking_mk8d.md",
    "content": "\n# Module: <code>nintendo.nex.matchmaking_mk8d</code>\n\nProvides a client and server for the `MatchMakingProtocol`, `MatchMakingProtocolExt`, `MatchmakeRefereeProtocol` and `MatchmakeExtensionProtocolMK8D`. This page was generated automatically from `matchmaking_mk8d.proto`.\n\n<code>**class** [MatchMakingClient](#matchmakingclient)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingClientExt](#matchmakingclientext)</code><br>\n<span class=\"docs\">The client for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeRefereeClient](#matchmakerefereeclient)</code><br>\n<span class=\"docs\">The client for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeExtensionClientMK8D](#matchmakeextensionclientmk8d)</code><br>\n<span class=\"docs\">The client for the `MatchmakeExtensionProtocolMK8D`.</span>\n\n<code>**class** [MatchMakingServer](#matchmakingserver)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocol`.</span>\n\n<code>**class** [MatchMakingServerExt](#matchmakingserverext)</code><br>\n<span class=\"docs\">The server for the `MatchMakingProtocolExt`.</span>\n\n<code>**class** [MatchmakeRefereeServer](#matchmakerefereeserver)</code><br>\n<span class=\"docs\">The server for the `MatchmakeRefereeProtocol`.</span>\n\n<code>**class** [MatchmakeExtensionServerMK8D](#matchmakeextensionservermk8d)</code><br>\n<span class=\"docs\">The server for the `MatchmakeExtensionProtocolMK8D`.</span>\n\n<code>**class** [MatchmakeSystem](#matchmakesystem)</code><br>\n<code>**class** [SimpleSearchConditionOperator](#simplesearchconditionoperator)</code><br>\n\n<code>**class** [AutoMatchmakeParam](#automatchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [CreateMatchmakeSessionParam](#creatematchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [DeletionEntry](#deletionentry)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)([Structure](common.md))</code><br>\n<code>**class** [FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)([Structure](common.md))</code><br>\n<code>**class** [Gathering](#gathering)([Structure](common.md))</code><br>\n<code>**class** [GatheringStats](#gatheringstats)([Structure](common.md))</code><br>\n<code>**class** [GatheringURLs](#gatheringurls)([Structure](common.md))</code><br>\n<code>**class** [Invitation](#invitation)([Structure](common.md))</code><br>\n<code>**class** [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeBlockListParam](#matchmakeblocklistparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeParam](#matchmakeparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeRound](#matchmakerefereeround)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStats](#matchmakerefereestats)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)([Structure](common.md))</code><br>\n<code>**class** [MatchmakeSession](#matchmakesession)([Gathering](#gathering))</code><br>\n<code>**class** [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)([Structure](common.md))</code><br>\n<code>**class** [ParticipantDetails](#participantdetails)([Structure](common.md))</code><br>\n<code>**class** [PersistentGathering](#persistentgathering)([Gathering](#gathering))</code><br>\n<code>**class** [PlayingSession](#playingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleCommunity](#simplecommunity)([Structure](common.md))</code><br>\n<code>**class** [SimplePlayingSession](#simpleplayingsession)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchCondition](#simplesearchcondition)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchDateTimeAttribute](#simplesearchdatetimeattribute)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchObject](#simplesearchobject)([Structure](common.md))</code><br>\n<code>**class** [SimpleSearchParam](#simplesearchparam)([Structure](common.md))</code><br>\n<code>**class** [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)([Structure](common.md))</code><br>\n\n## MatchMakingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClient`](#matchmakingclient).</span>\n\n<code>**async def register_gathering**(gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def unregister_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def unregister_gatherings**(gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def update_gathering**(gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def invite**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def accept_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def decline_invitation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def cancel_invitation**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_invitations_sent**(gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_invitations_received**() -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def participate**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def cancel_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_participants**(gid: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def add_participants**(gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_participants_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def find_by_type**(type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def find_by_description**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def find_by_description_regex**(regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_by_id**(ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_by_single_id**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `21` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def find_by_participants**(pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def find_invitations**(range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def find_by_sql_query**(query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def launch_session**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def update_session_url**(gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def get_session_url**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `28` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def report_stats**(gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_stats**(gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `32` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(gid: int) -> bool</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def get_pending_deletions**(reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `34` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def find_by_description_like**(description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def register_local_url**(gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def register_local_urls**(gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def update_session_host_v1**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def get_session_urls**(gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def update_session_host**(gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def update_gathering_ownership**(gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Calls method `43` on the server.</span>\n\n<code>**async def migrate_gathering_ownership**(gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n## MatchMakingClientExt\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingClientExt`](#matchmakingclientext).</span>\n\n<code>**async def end_participation**(gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_participants**(gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def get_detailed_participants**(gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def get_participants_urls**(gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_gathering_relations**(id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def delete_from_deletions**(deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n## MatchmakeRefereeClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeClient`](#matchmakerefereeclient).</span>\n\n<code>**async def start_round**(param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_start_round_param**(round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def end_round**(param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def end_round_without_report**(round_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_round_participants**(round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_not_summarized_round**() -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_round**(round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_stats_primary**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_stats_primaries**(targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `9` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_or_create_stats**(param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def reset_stats**() -> None</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n## MatchmakeExtensionClientMK8D\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionClientMK8D`](#matchmakeextensionclientmk8d).</span>\n\n<code>**async def close_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def open_participation**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def auto_matchmake_postpone**(gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def browse_matchmake_session**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `5` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def modify_current_game_attribute**(gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def update_notification_data**(type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_friend_notification_data**(type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def update_application_buffer**(gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def update_matchmake_session_attribute**(gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_friend_notification_data_list**(types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def update_matchmake_session**(gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_playing_session**(pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def create_community**(community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def update_community**(community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def join_community**(gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def find_community_by_gathering_id**(gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def find_official_community**(available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `21` on the server.</span>\n\n<code>**async def find_community_by_participant**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n<code>**async def update_privacy_setting**(online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Calls method `23` on the server.</span>\n\n<code>**async def get_my_block_list**() -> list[int]</code><br>\n<span class=\"docs\">Calls method `24` on the server.</span>\n\n<code>**async def add_to_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `25` on the server.</span>\n\n<code>**async def remove_from_block_list**(pids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `26` on the server.</span>\n\n<code>**async def clear_my_block_list**() -> None</code><br>\n<span class=\"docs\">Calls method `27` on the server.</span>\n\n<code>**async def report_violation**(pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Calls method `28` on the server.</span>\n\n<code>**async def is_violation_user**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `29` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `30` on the server.</span>\n\n<code>**async def get_simple_playing_session**(pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Calls method `31` on the server.</span>\n\n<code>**async def get_simple_community**(gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Calls method `32` on the server.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Calls method `33` on the server.</span>\n\n<code>**async def update_progress_score**(gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Calls method `34` on the server.</span>\n\n<code>**async def debug_notify_event**(pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Calls method `35` on the server.</span>\n\n<code>**async def generate_matchmake_session_system_password**(gid: int) -> str</code><br>\n<span class=\"docs\">Calls method `36` on the server.</span>\n\n<code>**async def clear_matchmake_session_system_password**(gid: int) -> None</code><br>\n<span class=\"docs\">Calls method `37` on the server.</span>\n\n<code>**async def create_matchmake_session_with_param**(param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `38` on the server.</span>\n\n<code>**async def join_matchmake_session_with_param**(param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `39` on the server.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `40` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `41` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `42` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `43` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Calls method `44` on the server.</span>\n\n<code>**async def request_matchmaking**(param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Calls method `45` on the server.</span>\n\n<code>**async def withdraw_matchmaking**(request_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `46` on the server.</span>\n\n<code>**async def withdraw_matchmaking_all**() -> None</code><br>\n<span class=\"docs\">Calls method `47` on the server.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `48` on the server.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Calls method `49` on the server.</span>\n\n<code>**async def find_matchmake_session_by_owner**(pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `50` on the server.</span>\n\n<code>**async def find_matchmake_session_by_participant**(param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Calls method `51` on the server.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Calls method `52` on the server.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `53` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_simple_search_object**(object: [SimpleSearchObject](#simplesearchobject)) -> int</code><br>\n<span class=\"docs\">Calls method `54` on the server.</span>\n\n<code>**async def update_simple_search_object**(id: int, object: [SimpleSearchObject](#simplesearchobject)) -> None</code><br>\n<span class=\"docs\">Calls method `55` on the server.</span>\n\n<code>**async def delete_simple_search_object**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `56` on the server.</span>\n\n<code>**async def search_simple_search_object**(param: [SimpleSearchParam](#simplesearchparam)) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Calls method `57` on the server.</span>\n\n<code>**async def search_simple_search_object_by_object_ids**(ids: list[int]) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Calls method `58` on the server.</span>\n\n<code>**async def join_matchmake_session_with_extra_participants**(gid: int, join_message: str, ignore_blacklist: bool, participation_count: int, extra_participants: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `59` on the server.</span>\n\n<code>**async def create_competition**(competition: [SimpleSearchObject](#simplesearchobject)) -> [SimpleSearchObject](#simplesearchobject)</code><br>\n<span class=\"docs\">Calls method `61` on the server.</span>\n\n<code>**async def delete_competition**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `62` on the server.</span>\n\n<code>**async def register_favorite_competition**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `63` on the server.</span>\n\n<code>**async def unregister_favorite_competition**(id: int) -> None</code><br>\n<span class=\"docs\">Calls method `64` on the server.</span>\n\n<code>**async def get_favorite_competition**() -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Calls method `65` on the server.</span>\n\n## MatchMakingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServer`](#matchmakingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_gatherings**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> bool</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def invite**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def accept_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def decline_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_invitation**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_sent**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_invitations_received**(client: [RMCClient](rmc.md#rmcclient)) -> list[[Invitation](#invitation)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def participate**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def cancel_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_type**(client: [RMCClient](rmc.md#rmcclient), type: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_regex**(client: [RMCClient](rmc.md#rmcclient), regex: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_id**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_single_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span>\n</span>\n\n<code>**async def find_by_owner**(client: [RMCClient](rmc.md#rmcclient), owner: int, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_participants**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_invitations**(client: [RMCClient](rmc.md#rmcclient), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_sql_query**(client: [RMCClient](rmc.md#rmcclient), query: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def launch_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_url**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>url: str</code><br>\n</span>\n</span>\n\n<code>**async def get_state**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>state: int</code><br>\n</span>\n</span>\n\n<code>**async def set_state**(client: [RMCClient](rmc.md#rmcclient), gid: int, state: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, stats: list[[GatheringStats](#gatheringstats)]) -> bool</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), gid: int, pids: list[int], columns: list[int]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>stats: list[[GatheringStats](#gatheringstats)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_gathering**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> bool</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_pending_deletions**(client: [RMCClient](rmc.md#rmcclient), reason: int, range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>deletions: list[[DeletionEntry](#deletionentry)]</code><br>\n</span>\n</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int]) -> bool</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_by_description_like**(client: [RMCClient](rmc.md#rmcclient), description: str, range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_url**(client: [RMCClient](rmc.md#rmcclient), gid: int, url: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_local_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int, urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host_v1**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_session_urls**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> list[[StationURL](common.md#stationurl)]</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_session_host**(client: [RMCClient](rmc.md#rmcclient), gid: int, is_migrate_owner: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, participants_only: bool) -> bool</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass.</span>\n\n<code>**async def migrate_gathering_ownership**(client: [RMCClient](rmc.md#rmcclient), gid: int, potential_owners: list[int], participants_only: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n## MatchMakingServerExt\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchMakingServerExt`](#matchmakingserverext).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def end_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_detailed_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, only_active: bool) -> list[[ParticipantDetails](#participantdetails)]</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_participants_urls**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[GatheringURLs](#gatheringurls)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_gathering_relations**(client: [RMCClient](rmc.md#rmcclient), id: int, descr: str) -> str</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_from_deletions**(client: [RMCClient](rmc.md#rmcclient), deletions: list[int], pid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n## MatchmakeRefereeServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeRefereeServer`](#matchmakerefereeserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def start_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_start_round_param**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> [MatchmakeRefereeStartRoundParam](#matchmakerefereestartroundparam)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeEndRoundParam](#matchmakerefereeendroundparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def end_round_without_report**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round_participants**(client: [RMCClient](rmc.md#rmcclient), round_id: int) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_not_summarized_round**(client: [RMCClient](rmc.md#rmcclient)) -> list[[MatchmakeRefereeRound](#matchmakerefereeround)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_round**(client: [RMCClient](rmc.md#rmcclient), round: int) -> [MatchmakeRefereeRound](#matchmakerefereeround)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primary**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats_primaries**(client: [RMCClient](rmc.md#rmcclient), targets: list[[MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>stats: list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<code>results: list[[Result](common.md#result)]</code><br>\n</span>\n</span>\n\n<code>**async def get_stats_all**(client: [RMCClient](rmc.md#rmcclient), target: [MatchmakeRefereeStatsTarget](#matchmakerefereestatstarget)) -> list[[MatchmakeRefereeStats](#matchmakerefereestats)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_or_create_stats**(client: [RMCClient](rmc.md#rmcclient), param: [MatchmakeRefereeStatsInitParam](#matchmakerefereestatsinitparam)) -> [MatchmakeRefereeStats](#matchmakerefereestats)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def reset_stats**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n## MatchmakeExtensionServerMK8D\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MatchmakeExtensionServerMK8D`](#matchmakeextensionservermk8d).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def close_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def open_participation**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_postpone**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[Gathering](#gathering)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gatherings: list[[Gathering](#gathering)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering), description: str, num_participants: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>session_key: bytes</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str) -> bytes</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def modify_current_game_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attrib: int, value: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data**(client: [RMCClient](rmc.md#rmcclient), type: int) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_application_buffer**(client: [RMCClient](rmc.md#rmcclient), gid: int, buffer: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session_attribute**(client: [RMCClient](rmc.md#rmcclient), gid: int, attribs: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_friend_notification_data_list**(client: [RMCClient](rmc.md#rmcclient), types: list[int]) -> list[[NotificationEvent](notification.md#notificationevent)]</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_matchmake_session**(client: [RMCClient](rmc.md#rmcclient), gathering: [Gathering](#gathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_search_criteria_postpone**(client: [RMCClient](rmc.md#rmcclient), search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> list[[PlayingSession](#playingsession)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering), message: str) -> int</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_community**(client: [RMCClient](rmc.md#rmcclient), community: [PersistentGathering](#persistentgathering)) -> None</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_community**(client: [RMCClient](rmc.md#rmcclient), gid: int, message: str, password: str) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_official_community**(client: [RMCClient](rmc.md#rmcclient), available_only: bool, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `21`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_community_by_participant**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[PersistentGathering](#persistentgathering)]</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_privacy_setting**(client: [RMCClient](rmc.md#rmcclient), online_status: bool, community_participation: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `23`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> list[int]</code><br>\n<span class=\"docs\">Handler for method `24`. This method should be overridden by a subclass.</span>\n\n<code>**async def add_to_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `25`. This method should be overridden by a subclass.</span>\n\n<code>**async def remove_from_block_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `26`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_my_block_list**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `27`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_violation**(client: [RMCClient](rmc.md#rmcclient), pid: int, username: str, violation_code: int) -> None</code><br>\n<span class=\"docs\">Handler for method `28`. This method should be overridden by a subclass.</span>\n\n<code>**async def is_violation_user**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `29`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>flag: bool</code><br>\n<code>score: int</code><br>\n</span>\n</span>\n\n<code>**async def join_matchmake_session_ex**(client: [RMCClient](rmc.md#rmcclient), gid: int, gmessage: str, ignore_block_list: bool, num_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `30`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_playing_session**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], include_login_user: bool) -> list[[SimplePlayingSession](#simpleplayingsession)]</code><br>\n<span class=\"docs\">Handler for method `31`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_simple_community**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[SimpleCommunity](#simplecommunity)]</code><br>\n<span class=\"docs\">Handler for method `32`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_gathering_id_postpone**(client: [RMCClient](rmc.md#rmcclient), gids: list[int], gathering: [Gathering](#gathering), message: str) -> [Gathering](#gathering)</code><br>\n<span class=\"docs\">Handler for method `33`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_progress_score**(client: [RMCClient](rmc.md#rmcclient), gid: int, score: int) -> None</code><br>\n<span class=\"docs\">Handler for method `34`. This method should be overridden by a subclass.</span>\n\n<code>**async def debug_notify_event**(client: [RMCClient](rmc.md#rmcclient), pid: int, main_type: int, sub_type: int, param1: int, param2: int, param3: str) -> None</code><br>\n<span class=\"docs\">Handler for method `35`. This method should be overridden by a subclass.</span>\n\n<code>**async def generate_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> str</code><br>\n<span class=\"docs\">Handler for method `36`. This method should be overridden by a subclass.</span>\n\n<code>**async def clear_matchmake_session_system_password**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> None</code><br>\n<span class=\"docs\">Handler for method `37`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [CreateMatchmakeSessionParam](#creatematchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `38`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_matchmake_session_with_param**(client: [RMCClient](rmc.md#rmcclient), param: [JoinMatchmakeSessionParam](#joinmatchmakesessionparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `39`. This method should be overridden by a subclass.</span>\n\n<code>**async def auto_matchmake_with_param_postpone**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `40`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id_detail**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `41`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `42`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria), range: [ResultRange](common.md#resultrange)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `43`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def update_matchmake_session_part**(client: [RMCClient](rmc.md#rmcclient), param: [UpdateMatchmakeSessionParam](#updatematchmakesessionparam)) -> None</code><br>\n<span class=\"docs\">Handler for method `44`. This method should be overridden by a subclass.</span>\n\n<code>**async def request_matchmaking**(client: [RMCClient](rmc.md#rmcclient), param: [AutoMatchmakeParam](#automatchmakeparam)) -> int</code><br>\n<span class=\"docs\">Handler for method `45`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking**(client: [RMCClient](rmc.md#rmcclient), request_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `46`. This method should be overridden by a subclass.</span>\n\n<code>**async def withdraw_matchmaking_all**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `47`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gids: list[int]) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `48`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_single_gathering_id**(client: [RMCClient](rmc.md#rmcclient), gid: int) -> [MatchmakeSession](#matchmakesession)</code><br>\n<span class=\"docs\">Handler for method `49`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_owner**(client: [RMCClient](rmc.md#rmcclient), pid: int, range: [ResultRange](common.md#resultrange)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `50`. This method should be overridden by a subclass.</span>\n\n<code>**async def find_matchmake_session_by_participant**(client: [RMCClient](rmc.md#rmcclient), param: [FindMatchmakeSessionByParticipantParam](#findmatchmakesessionbyparticipantparam)) -> list[[FindMatchmakeSessionByParticipantResult](#findmatchmakesessionbyparticipantresult)]</code><br>\n<span class=\"docs\">Handler for method `51`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> list[[MatchmakeSession](#matchmakesession)]</code><br>\n<span class=\"docs\">Handler for method `52`. This method should be overridden by a subclass.</span>\n\n<code>**async def browse_matchmake_session_with_host_urls_no_holder_no_result_range**(client: [RMCClient](rmc.md#rmcclient), search_criteria: [MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `53`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>sessions: list[[MatchmakeSession](#matchmakesession)]</code><br>\n<code>urls: list[[GatheringURLs](#gatheringurls)]</code><br>\n</span>\n</span>\n\n<code>**async def create_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), object: [SimpleSearchObject](#simplesearchobject)) -> int</code><br>\n<span class=\"docs\">Handler for method `54`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), id: int, object: [SimpleSearchObject](#simplesearchobject)) -> None</code><br>\n<span class=\"docs\">Handler for method `55`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `56`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_simple_search_object**(client: [RMCClient](rmc.md#rmcclient), param: [SimpleSearchParam](#simplesearchparam)) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Handler for method `57`. This method should be overridden by a subclass.</span>\n\n<code>**async def search_simple_search_object_by_object_ids**(client: [RMCClient](rmc.md#rmcclient), ids: list[int]) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Handler for method `58`. This method should be overridden by a subclass.</span>\n\n<code>**async def join_matchmake_session_with_extra_participants**(client: [RMCClient](rmc.md#rmcclient), gid: int, join_message: str, ignore_blacklist: bool, participation_count: int, extra_participants: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `59`. This method should be overridden by a subclass.</span>\n\n<code>**async def create_competition**(client: [RMCClient](rmc.md#rmcclient), competition: [SimpleSearchObject](#simplesearchobject)) -> [SimpleSearchObject](#simplesearchobject)</code><br>\n<span class=\"docs\">Handler for method `61`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_competition**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `62`. This method should be overridden by a subclass.</span>\n\n<code>**async def register_favorite_competition**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `63`. This method should be overridden by a subclass.</span>\n\n<code>**async def unregister_favorite_competition**(client: [RMCClient](rmc.md#rmcclient), id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `64`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_favorite_competition**(client: [RMCClient](rmc.md#rmcclient)) -> list[[SimpleSearchObject](#simplesearchobject)]</code><br>\n<span class=\"docs\">Handler for method `65`. This method should be overridden by a subclass.</span>\n\n## MatchmakeSystem\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 1`<br>\n`FRIENDS = 2`<br>\n</span>\n\n## SimpleSearchConditionOperator\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`ANY = 0`<br>\n`EQUAL = 1`<br>\n`GREATER_THAN = 2`<br>\n`LESS_THAN = 3`<br>\n`GREATER_THAN_OR_EQUAL = 4`<br>\n`LESS_THAN_OR_EQUAL = 5`<br>\n</span>\n\n## AutoMatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `AutoMatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>search_criteria: list[[MatchmakeSessionSearchCriteria](#matchmakesessionsearchcriteria)]</code><br>\n<code>target_gids: list[int]</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## CreateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CreateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n<code>additional_participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## DeletionEntry\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `DeletionEntry` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>pid: int</code><br>\n<code>reason: int</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pids: list[int]</code><br>\n<code>options: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## FindMatchmakeSessionByParticipantResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `FindMatchmakeSessionByParticipantResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>session: [MatchmakeSession](#matchmakesession) = [MatchmakeSession](#matchmakesession)()</code><br>\n</span><br>\n\n## Gathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Gathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int = 0</code><br>\n<code>owner: int = 0</code><br>\n<code>host: int = 0</code><br>\n<code>min_participants: int = 0</code><br>\n<code>max_participants: int = 0</code><br>\n<code>participation_policy: int = 1</code><br>\n<code>policy_argument: int = 0</code><br>\n<code>flags: int = 512</code><br>\n<code>state: int = 0</code><br>\n<code>description: str = \"\"</code><br>\n</span><br>\n\n## GatheringStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>flags: int</code><br>\n<code>values: list[float]</code><br>\n</span><br>\n\n## GatheringURLs\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `GatheringURLs` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span><br>\n\n## Invitation\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Invitation` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>guest: int</code><br>\n<code>message: str</code><br>\n</span><br>\n\n## JoinMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `JoinMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>participants: list[int]</code><br>\n<code>gid_for_participation_check: int</code><br>\n<code>options: int</code><br>\n<code>behavior: int</code><br>\n<code>user_password: str</code><br>\n<code>system_password: str</code><br>\n<code>join_message: str</code><br>\n<code>num_participants: int</code><br>\n<code>extra_participants: int</code><br>\n<code>block_list: [MatchmakeBlockListParam](#matchmakeblocklistparam) = [MatchmakeBlockListParam](#matchmakeblocklistparam)()</code><br>\n</span><br>\n\n## MatchmakeBlockListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeBlockListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>options: int = 0</code><br>\n</span><br>\n\n## MatchmakeParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>param: dict[str, object] = {}</code><br>\n</span><br>\n\n## MatchmakeRefereeEndRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeEndRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>round_id: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereePersonalRoundResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereePersonalRoundResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>personal_round_result_flag: int</code><br>\n<code>round_win_loss: int</code><br>\n<code>rating_change: int</code><br>\n<code>buffer: bytes</code><br>\n</span><br>\n\n## MatchmakeRefereeRound\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeRound` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>gid: int</code><br>\n<code>state: int</code><br>\n<code>personal_data_category: int</code><br>\n<code>results: list[[MatchmakeRefereePersonalRoundResult](#matchmakerefereepersonalroundresult)]</code><br>\n</span><br>\n\n## MatchmakeRefereeStartRoundParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStartRoundParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>personal_data_category: int</code><br>\n<code>gid: int</code><br>\n<code>pids: list[int]</code><br>\n</span><br>\n\n## MatchmakeRefereeStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int</code><br>\n<code>category: int</code><br>\n<code>pid: int</code><br>\n<code>recent_disconnection: int</code><br>\n<code>recent_violation: int</code><br>\n<code>recent_mismatch: int</code><br>\n<code>recent_win: int</code><br>\n<code>recent_loss: int</code><br>\n<code>recent_draw: int</code><br>\n<code>total_disconnect: int</code><br>\n<code>total_violation: int</code><br>\n<code>total_mismatch: int</code><br>\n<code>total_win: int</code><br>\n<code>total_loss: int</code><br>\n<code>total_draw: int</code><br>\n<code>rating_value: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsInitParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsInitParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>initial_rating: int</code><br>\n</span><br>\n\n## MatchmakeRefereeStatsTarget\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeRefereeStatsTarget` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>category: int</code><br>\n</span><br>\n\n## MatchmakeSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>game_mode: int = 0</code><br>\n<code>attribs: list[int] = [0, 0, 0, 0, 0, 0]</code><br>\n<code>open_participation: bool = True</code><br>\n<code>matchmake_system: int = 0</code><br>\n<code>application_data: bytes = b\"\"</code><br>\n<code>num_participants: int = 0</code><br>\nIf 30000 <= `nex.version` < 40000:<br>\n<span class=\"docs\">\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n</span><br>\nIf `nex.version` >= 30000:<br>\n<span class=\"docs\">\n<code>session_key: bytes = b\"\"</code><br>\n</span><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>option: int = 0</code><br>\n</span><br>\nIf `nex.version` >= 30600:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30700:<br>\n<span class=\"docs\">\nIf `revision` >= 2:<br>\n<span class=\"docs\">\n<code>user_password: str = \"\"</code><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 30800:<br>\n<span class=\"docs\">\nIf `revision` >= 3:<br>\n<span class=\"docs\">\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n</span><br>\n</span><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>progress_score: int = 100</code><br>\n<code>session_key: bytes = b\"\"</code><br>\n<code>option: int = 0</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n<code>user_password: str = \"\"</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>user_password_enabled: bool = False</code><br>\n<code>system_password_enabled: bool = False</code><br>\n<code>codeword: str = \"\"</code><br>\n</span><br>\n</span><br>\n\n## MatchmakeSessionSearchCriteria\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MatchmakeSessionSearchCriteria` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>attribs: list[str] = [\"\", \"\", \"\", \"\", \"\", \"\"]</code><br>\n<code>game_mode: str = \"\"</code><br>\n<code>min_participants: str = \"\"</code><br>\n<code>max_participants: str = \"\"</code><br>\n<code>matchmake_system: str = \"\"</code><br>\n<code>vacant_only: bool = True</code><br>\n<code>exclude_locked: bool = True</code><br>\n<code>exclude_non_host_pid: bool = False</code><br>\n<code>selection_method: int = 0</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>vacant_participants: int = 1</code><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>exclude_user_password: bool = False</code><br>\n<code>exclude_system_password: bool = False</code><br>\n<code>refer_gid: int = 0</code><br>\n<code>codeword: str = \"\"</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n</span><br>\n\n## ParticipantDetails\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ParticipantDetails` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>name: str</code><br>\n<code>message: str</code><br>\n<code>participants: int</code><br>\n</span><br>\n\n## PersistentGathering\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PersistentGathering` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>password: str</code><br>\n<code>attribs: list[int]</code><br>\n<code>application_buffer: bytes</code><br>\n<code>participation_start: [DateTime](common.md#datetime)</code><br>\n<code>participation_end: [DateTime](common.md#datetime)</code><br>\n<code>matchmake_session_count: int</code><br>\n<code>num_participants: int</code><br>\n</span><br>\n\n## PlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `PlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gathering: [Gathering](#gathering)</code><br>\n</span><br>\n\n## SimpleCommunity\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleCommunity` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>matchmake_session_count: int</code><br>\n</span><br>\n\n## SimplePlayingSession\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimplePlayingSession` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>gid: int</code><br>\n<code>game_mode: int</code><br>\n<code>attribute: int</code><br>\n</span><br>\n\n## SimpleSearchCondition\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchCondition` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>value: int</code><br>\n<code>operator: int</code><br>\n</span><br>\n\n## SimpleSearchDateTimeAttribute\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchDateTimeAttribute` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>start_daytime: int</code><br>\n<code>end_daytime: int</code><br>\n<code>start_time: int</code><br>\n<code>end_time: int</code><br>\n<code>start_datetime: [DateTime](common.md#datetime)</code><br>\n<code>end_datetime: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## SimpleSearchObject\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchObject` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>owner: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>metadata: bytes</code><br>\n<code>community_id: int</code><br>\n<code>community_code: str</code><br>\n<code>datetime: [SimpleSearchDateTimeAttribute](#simplesearchdatetimeattribute) = [SimpleSearchDateTimeAttribute](#simplesearchdatetimeattribute)()</code><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>liveliness_rate: int</code><br>\n<code>liveliness_update_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n</span><br>\n</span><br>\n\n## SimpleSearchParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `SimpleSearchParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int = 0</code><br>\n<code>owner: int = 0</code><br>\n<code>conditions: list[[SimpleSearchCondition](#simplesearchcondition)] = []</code><br>\n<code>community_code: str = \"\"</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n<code>datetime: [DateTime](common.md#datetime) = [DateTime](common.md#datetime).never()</code><br>\n</span><br>\n\n## UpdateMatchmakeSessionParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UpdateMatchmakeSessionParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>gid: int</code><br>\n<code>modification_flags: int</code><br>\n<code>attributes: list[int]</code><br>\n<code>open_participation: bool</code><br>\n<code>application_buffer: bytes</code><br>\n<code>progress_score: int</code><br>\n<code>param: [MatchmakeParam](#matchmakeparam) = [MatchmakeParam](#matchmakeparam)()</code><br>\n<code>started_time: [DateTime](common.md#datetime)</code><br>\n<code>user_password: str</code><br>\n<code>game_mode: int</code><br>\n<code>description: str</code><br>\n<code>min_participants: int</code><br>\n<code>max_participants: int</code><br>\n<code>matchmake_system: int</code><br>\n<code>participation_policy: int</code><br>\n<code>policy_argument: int</code><br>\n<code>codeword: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/messaging.md",
    "content": "\n# Module: <code>nintendo.nex.messaging</code>\n\nProvides a client and server for the `MessagingProtocol` and `MessageDeliveryProtocol`. This page was generated automatically from `messaging.proto`.\n\n<code>**class** [MessagingClient](#messagingclient)</code><br>\n<span class=\"docs\">The client for the `MessagingProtocol`.</span>\n\n<code>**class** [MessageDeliveryClient](#messagedeliveryclient)</code><br>\n<span class=\"docs\">The client for the `MessageDeliveryProtocol`.</span>\n\n<code>**class** [MessagingServer](#messagingserver)</code><br>\n<span class=\"docs\">The server for the `MessagingProtocol`.</span>\n\n<code>**class** [MessageDeliveryServer](#messagedeliveryserver)</code><br>\n<span class=\"docs\">The server for the `MessageDeliveryProtocol`.</span>\n\n<code>**class** [RecipientType](#recipienttype)</code><br>\n\n<code>**class** [BinaryMessage](#binarymessage)([UserMessage](#usermessage))</code><br>\n<code>**class** [MessageRecipient](#messagerecipient)([Structure](common.md))</code><br>\n<code>**class** [TextMessage](#textmessage)([UserMessage](#usermessage))</code><br>\n<code>**class** [UserMessage](#usermessage)([Data](common.md))</code><br>\n\n## MessagingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MessagingClient`](#messagingclient).</span>\n\n<code>**async def deliver_message**(message: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `1` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>modified_message: [Data](common.md)</code><br>\n<code>sandbox_node_ids: list[int]</code><br>\n<code>participants: list[int]</code><br>\n</span>\n</span>\n\n<code>**async def get_number_of_messages**(recipient: [MessageRecipient](#messagerecipient)) -> int</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def get_message_headers**(recipient: [MessageRecipient](#messagerecipient), range: [ResultRange](common.md#resultrange)) -> list[[UserMessage](#usermessage)]</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def retrieve_all_messages_within_range**(recipient: [MessageRecipient](#messagerecipient), range: [ResultRange](common.md#resultrange)) -> list[[Data](common.md)]</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def retrieve_messages**(recipient: [MessageRecipient](#messagerecipient), message_ids: list[int], leave_on_server: bool) -> list[[Data](common.md)]</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def delete_messages**(recipient: [MessageRecipient](#messagerecipient), message_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def delete_all_messages**(recipient: [MessageRecipient](#messagerecipient)) -> int</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n## MessageDeliveryClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MessageDeliveryClient`](#messagedeliveryclient).</span>\n\n<code>**async def deliver_message**(message: [Data](common.md)) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n## MessagingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MessagingServer`](#messagingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def deliver_message**(client: [RMCClient](rmc.md#rmcclient), message: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>modified_message: [Data](common.md)</code><br>\n<code>sandbox_node_ids: list[int]</code><br>\n<code>participants: list[int]</code><br>\n</span>\n</span>\n\n<code>**async def get_number_of_messages**(client: [RMCClient](rmc.md#rmcclient), recipient: [MessageRecipient](#messagerecipient)) -> int</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_message_headers**(client: [RMCClient](rmc.md#rmcclient), recipient: [MessageRecipient](#messagerecipient), range: [ResultRange](common.md#resultrange)) -> list[[UserMessage](#usermessage)]</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def retrieve_all_messages_within_range**(client: [RMCClient](rmc.md#rmcclient), recipient: [MessageRecipient](#messagerecipient), range: [ResultRange](common.md#resultrange)) -> list[[Data](common.md)]</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def retrieve_messages**(client: [RMCClient](rmc.md#rmcclient), recipient: [MessageRecipient](#messagerecipient), message_ids: list[int], leave_on_server: bool) -> list[[Data](common.md)]</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_messages**(client: [RMCClient](rmc.md#rmcclient), recipient: [MessageRecipient](#messagerecipient), message_ids: list[int]) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_all_messages**(client: [RMCClient](rmc.md#rmcclient), recipient: [MessageRecipient](#messagerecipient)) -> int</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n## MessageDeliveryServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MessageDeliveryServer`](#messagedeliveryserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def deliver_message**(client: [RMCClient](rmc.md#rmcclient), message: [Data](common.md)) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n## RecipientType\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`PRINCIPAL = 1`<br>\n`GATHERING = 2`<br>\n</span>\n\n## BinaryMessage\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `BinaryMessage` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>body: bytes</code><br>\n</span><br>\n\n## MessageRecipient\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `MessageRecipient` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>pid: int</code><br>\n<code>gid: int</code><br>\n</span><br>\n\n## TextMessage\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `TextMessage` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>body: str</code><br>\n</span><br>\n\n## UserMessage\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UserMessage` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>parent_id: int</code><br>\n<code>sender: int</code><br>\n<code>reception_time: [DateTime](common.md#datetime)</code><br>\n<code>life_time: int</code><br>\n<code>flags: int</code><br>\n<code>subject: str</code><br>\n<code>sender_name: str</code><br>\n<code>recipient: [MessageRecipient](#messagerecipient) = [MessageRecipient](#messagerecipient)()</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/monitoring.md",
    "content": "\n# Module: <code>nintendo.nex.monitoring</code>\n\nProvides a client and server for the `MonitoringProtocol`. This page was generated automatically from `monitoring.proto`.\n\n<code>**class** [MonitoringClient](#monitoringclient)</code><br>\n<span class=\"docs\">The client for the `MonitoringProtocol`.</span>\n\n<code>**class** [MonitoringServer](#monitoringserver)</code><br>\n<span class=\"docs\">The server for the `MonitoringProtocol`.</span>\n\n## MonitoringClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`MonitoringClient`](#monitoringclient).</span>\n\n<code>**async def ping_daemon**() -> bool</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_cluster_members**() -> list[str]</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n## MonitoringServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`MonitoringServer`](#monitoringserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def ping_daemon**(client: [RMCClient](rmc.md#rmcclient)) -> bool</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_cluster_members**(client: [RMCClient](rmc.md#rmcclient)) -> list[str]</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n"
  },
  {
    "path": "docs/reference/nex/natcheck.md",
    "content": "\r\n# Module: <code>nintendo.nex.natcheck</code>\r\n\r\nImplements a NAT check client.\r\n\r\n<code>**async def detect_external_address**(socket: [UDPSocket](https://anynet.readthedocs.io/en/latest/reference/udp/#udpsocket)) -> (str, int)</code><br>\r\n<span class=\"docs\">Attempts to figure out the external IP address and port of the given socket.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/nattraversal.md",
    "content": "\n# Module: <code>nintendo.nex.nattraversal</code>\n\nProvides a client and server for the `NATTraversalProtocol`. This page was generated automatically from `nattraversal.proto`.\n\n<code>**class** [NATTraversalClient](#nattraversalclient)</code><br>\n<span class=\"docs\">The client for the `NATTraversalProtocol`.</span>\n\n<code>**class** [NATTraversalServer](#nattraversalserver)</code><br>\n<span class=\"docs\">The server for the `NATTraversalProtocol`.</span>\n\n## NATTraversalClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`NATTraversalClient`](#nattraversalclient).</span>\n\n<code>**async def request_probe_initiation**(target_urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def initiate_probe**(station_to_probe: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def request_probe_initiation_ext**(target_urls: list[[StationURL](common.md#stationurl)], station_to_probe: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def report_nat_traversal_result**(cid: int, result: bool) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def report_nat_properties**(natm: int, natf: int, rtt: int) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_relay_signature_key**() -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `6` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>mode: int</code><br>\n<code>time: [DateTime](common.md#datetime)</code><br>\n<code>address: str</code><br>\n<code>port: int</code><br>\n<code>address_type: int</code><br>\n<code>game_server_id: int</code><br>\n</span>\n</span>\n\n<code>**async def report_nat_traversal_result_detail**(cid: int, result: bool, detail: int, rtt: int) -> None</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n## NATTraversalServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`NATTraversalServer`](#nattraversalserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def request_probe_initiation**(client: [RMCClient](rmc.md#rmcclient), target_urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def initiate_probe**(client: [RMCClient](rmc.md#rmcclient), station_to_probe: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def request_probe_initiation_ext**(client: [RMCClient](rmc.md#rmcclient), target_urls: list[[StationURL](common.md#stationurl)], station_to_probe: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_nat_traversal_result**(client: [RMCClient](rmc.md#rmcclient), cid: int, result: bool) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def report_nat_properties**(client: [RMCClient](rmc.md#rmcclient), natm: int, natf: int, rtt: int) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_relay_signature_key**(client: [RMCClient](rmc.md#rmcclient)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>mode: int</code><br>\n<code>time: [DateTime](common.md#datetime)</code><br>\n<code>address: str</code><br>\n<code>port: int</code><br>\n<code>address_type: int</code><br>\n<code>game_server_id: int</code><br>\n</span>\n</span>\n\n<code>**async def report_nat_traversal_result_detail**(client: [RMCClient](rmc.md#rmcclient), cid: int, result: bool, detail: int, rtt: int) -> None</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n"
  },
  {
    "path": "docs/reference/nex/nintendonotification.md",
    "content": "\n# Module: <code>nintendo.nex.nintendonotification</code>\n\nProvides a client and server for the `NintendoNotificationProtocol`. This page was generated automatically from `nintendonotification.proto`.\n\n<code>**class** [NintendoNotificationClient](#nintendonotificationclient)</code><br>\n<span class=\"docs\">The client for the `NintendoNotificationProtocol`.</span>\n\n<code>**class** [NintendoNotificationServer](#nintendonotificationserver)</code><br>\n<span class=\"docs\">The server for the `NintendoNotificationProtocol`.</span>\n\n<code>**class** [NintendoNotificationType](#nintendonotificationtype)</code><br>\n\n<code>**class** [NintendoNotificationEvent](#nintendonotificationevent)([Structure](common.md))</code><br>\n<code>**class** [NintendoNotificationEventGeneral](#nintendonotificationeventgeneral)([Data](common.md))</code><br>\n<code>**class** [NintendoNotificationEventKeyValue](#nintendonotificationeventkeyvalue)([Data](common.md))</code><br>\n<code>**class** [NintendoNotificationEventProfile](#nintendonotificationeventprofile)([Data](common.md))</code><br>\n<code>**class** [StringKeyValue](#stringkeyvalue)([Data](common.md))</code><br>\n<code>**class** [u32KeyValue](#u32keyvalue)([Data](common.md))</code><br>\n<code>**class** [u64KeyValue](#u64keyvalue)([Data](common.md))</code><br>\n<code>**class** [u8KeyValue](#u8keyvalue)([Data](common.md))</code><br>\n\n## NintendoNotificationClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`NintendoNotificationClient`](#nintendonotificationclient).</span>\n\n<code>**async def process_nintendo_notification_event**(event: [NintendoNotificationEvent](#nintendonotificationevent)) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def process_nintendo_notification_event_alt**(event: [NintendoNotificationEvent](#nintendonotificationevent)) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n## NintendoNotificationServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`NintendoNotificationServer`](#nintendonotificationserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def process_nintendo_notification_event**(client: [RMCClient](rmc.md#rmcclient), event: [NintendoNotificationEvent](#nintendonotificationevent)) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def process_nintendo_notification_event_alt**(client: [RMCClient](rmc.md#rmcclient), event: [NintendoNotificationEvent](#nintendonotificationevent)) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n## NintendoNotificationType\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`LOGOUT = 10`<br>\n`PRESENCE_CHANGE = 24`<br>\n`UNFRIENDED = 26`<br>\n`FRIENDED = 30`<br>\n`STATUS_CHANGE = 33`<br>\n</span>\n\n## NintendoNotificationEvent\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoNotificationEvent` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>type: int</code><br>\n<code>pid: int</code><br>\n<code>data: [Data](common.md)</code><br>\n</span><br>\n\n## NintendoNotificationEventGeneral\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoNotificationEventGeneral` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>param1: int</code><br>\n<code>param2: int</code><br>\n<code>param3: int</code><br>\n<code>text: str</code><br>\n</span><br>\n\n## NintendoNotificationEventKeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoNotificationEventKeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>u8: list[[u8KeyValue](#u8keyvalue)]</code><br>\n<code>u32: list[[u32KeyValue](#u32keyvalue)]</code><br>\n<code>u64: list[[u64KeyValue](#u64keyvalue)]</code><br>\n<code>string: list[[StringKeyValue](#stringkeyvalue)]</code><br>\n</span><br>\n\n## NintendoNotificationEventProfile\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoNotificationEventProfile` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>region: int</code><br>\n<code>country: int</code><br>\n<code>area: int</code><br>\n<code>language: int</code><br>\n<code>platform: int</code><br>\n</span><br>\n\n## StringKeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `StringKeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: int</code><br>\n<code>value: str</code><br>\n</span><br>\n\n## u32KeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `u32KeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: int</code><br>\n<code>value: int</code><br>\n</span><br>\n\n## u64KeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `u64KeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: int</code><br>\n<code>value: int</code><br>\n</span><br>\n\n## u8KeyValue\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `u8KeyValue` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>key: int</code><br>\n<code>value: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/notification.md",
    "content": "\n# Module: <code>nintendo.nex.notification</code>\n\nProvides a client and server for the `NotificationProtocol`. This page was generated automatically from `notification.proto`.\n\n<code>**class** [NotificationClient](#notificationclient)</code><br>\n<span class=\"docs\">The client for the `NotificationProtocol`.</span>\n\n<code>**class** [NotificationServer](#notificationserver)</code><br>\n<span class=\"docs\">The server for the `NotificationProtocol`.</span>\n\n<code>**class** [NotificationEvent](#notificationevent)([Structure](common.md))</code><br>\n\n## NotificationClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`NotificationClient`](#notificationclient).</span>\n\n<code>**async def process_notification_event**(event: [NotificationEvent](notification.md#notificationevent)) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n## NotificationServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`NotificationServer`](#notificationserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def process_notification_event**(client: [RMCClient](rmc.md#rmcclient), event: [NotificationEvent](notification.md#notificationevent)) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n## NotificationEvent\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NotificationEvent` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>type: int</code><br>\n<code>param1: int = 0</code><br>\n<code>param2: int = 0</code><br>\n<code>text: str = \"\"</code><br>\nIf `nex.version` >= 30500:<br>\n<span class=\"docs\">\n<code>param3: int = 0</code><br>\n</span><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\nIf `revision` >= 1:<br>\n<span class=\"docs\">\n<code>map: dict[str, object] = {}</code><br>\n</span><br>\n</span><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/prudp.md",
    "content": "\r\n# Module: <code>nintendo.nex.prudp</code>\r\n\r\nProvides a client and server for PRUDP. Originally, PRUDP implemented reliable and secure transmission on top of UDP, but the Nintendo Switch introduced a 'Lite' mode in which PRUDP is implemented on top of TCP or WebSockets instead.\r\n\r\n<code>**class** [PRUDPClient](#prudpclient)</code><br>\r\n<span class=\"docs\">A PRUDP client.</span>\r\n\r\n<code>**async with connect**(settings: [Settings](settings.md#settings), host: str, port: int, vport: int = 1, type: int = 10, context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext) = None, credentials: [Credentials](kerberos.md#credentials) = None) -> [PRUDPClient](#prudpclient)</code><br>\r\n<span class=\"docs\">Creates a PRUDP client and connects it to the given address. If `context` is provided, and the underlying transport supports this, the connections is secured with TLS. If credentials are provided they are sent to the server in the connection request. Blocks until the connection is ready and handshake has been performed.</code>\r\n\r\n<code>**async with serve**(handler: Callable, settings: [Settings](settings.md#settings), host: str = \"\", port: int = 0, vport: int = 1, type: int = 10, context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext) = None, key: bytes = None) -> None</code><br>\r\n<span class=\"docs\">Creates a PRUDP server and binds it to the given address. If `host` is empty, the local address of the default interface is used. If `port` is 0, it is chosen by the operating system. `handler` must be an `async` function that accepts a [`PRUDPClient`](#prudpclient). The client is closed automatically when `handler` returns. If `context` is provided, and the underlying transport supports this, the server is secured with TLS. If `key` is provided it is used to decrypt the Kerberos tickets in connection requests. If `key` is `None`, the payload of connection requests is ignored an all client connections are accepted.</span>\r\n\r\n<code>**async with connect_transport**(settings: [Settings](settings.md#settings), host: str, port: int, context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext) = None) -> [PRUDPClientTransport](#prudpclienttransport)</code><br>\r\n<span class=\"docs\">Creates a transport connection for the PRUDP protocol. This can be used to establish multiple PRUDP connections with a single socket.</span>\r\n\r\n<code>**async with serve_transport**(settings: [Settings](settings.md#settings), host: str = \"\", port: int = 0, [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext) = None) -> [PRUDPServerTransport](#prudpservertransport)</code><br>\r\n<span class=\"docs\">Creates a transport server for the PRUDP protocol. This can be used to host multiple PRUDP servers at a single port.</span>\r\n\r\n## PRUDPClient\r\n<code>**async def send**(data: bytes, substream: int = 0) -> None</code><br>\r\n<span class=\"docs\">Sends a reliable data packet to the server through the given substream. Blocks if the send buffer is full. Packets are retransmitted automatically if no acknowledgement is received.</span>\r\n\r\n<code>**async def send_unreliable**(data: bytes) -> None</code><br>\r\n<span class=\"docs\">Sends an unreliable data packet to the server. Blocks if the send buffer is full.</span><br>\r\n\r\n<code>**async def recv**(substream: int = 0) -> bytes</code><br>\r\n<span class=\"docs\">Receives a single reliable data packet from the server from the given substream. Blocks if no reliable data is available.</span>\r\n\r\n<code>**async def recv_unreliable**() -> bytes</code><br>\r\n<span class=\"docs\">Receives an unreliable data packet from the server. Blocks if no unreliable data is available.</span>\r\n\r\n<code>**async def close**() -> None</code><br>\r\n<span class=\"docs\">Closes the connection forcefully by sending an unreliable disconnect packet three times.</span>\r\n\r\n<code>**async def disconnect**() -> None</code><br>\r\n<span class=\"docs\">Closes the connection gracefully by sending a reliable disconnect packet.</span>\r\n\r\n<code>**def pid**() -> int</code><br>\r\n<span class=\"docs\">Returns the user id of the connected client. Returns `None` if the client is connected without credentials.</span>\r\n\r\n<code>**def minor_version**() -> int</code><br>\r\n<span class=\"docs\">Returns the PRUDP minor version that was negotiated during the handshake.</span>\r\n\r\n<code>**def local_address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the local address of the client.</span>\r\n\r\n<code>**def remote_address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the address that the client is connected to.</span>\r\n\r\n<code>**def local_sid**() -> int</code><br>\r\n<span class=\"docs\">Returns the local stream id (PRUDP port).</span>\r\n\r\n<code>**def remote_sid**() -> int</code><br>\r\n<span class=\"docs\">Returns the remote stream id (PRUDP port).</span>\r\n\r\n## PRUDPClientTransport\r\n<code>**async with connect**(port: int, type: int = 10, credentials: credentials: [Credentials](kerberos.md#credentials) = None) -> [PRUDPClient](#prudpclient)</code><br>\r\n<span class=\"docs\">Establishes a new PRUDP connection with the given PRUDP port.</span>\r\n\r\n<code>**def local_address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the local address of the client.</span>\r\n\r\n<code>**def remote_address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the address that the client is connected to.</span>\r\n\r\n## PRUDPServerTransport\r\n<code>**async with serve**(handler: Callable, port: int, type: int = 10, key: bytes = None) -> None</code><br>\r\n<span class=\"docs\">Creates a new PRUDP server at the given PRUDP port.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/ranking.md",
    "content": "\n# Module: <code>nintendo.nex.ranking</code>\n\nProvides a client and server for the `RankingProtocol`. This page was generated automatically from `ranking.proto`.\n\n<code>**class** [RankingClient](#rankingclient)</code><br>\n<span class=\"docs\">The client for the `RankingProtocol`.</span>\n\n<code>**class** [RankingServer](#rankingserver)</code><br>\n<span class=\"docs\">The server for the `RankingProtocol`.</span>\n\n<code>**class** [RankingMode](#rankingmode)</code><br>\n<code>**class** [RankingOrderCalc](#rankingordercalc)</code><br>\n<code>**class** [RankingStatFlags](#rankingstatflags)</code><br>\n\n<code>**class** [RankingCachedResult](#rankingcachedresult)([RankingResult](#rankingresult))</code><br>\n<code>**class** [RankingChangeAttributesParam](#rankingchangeattributesparam)([Structure](common.md))</code><br>\n<code>**class** [RankingOrderParam](#rankingorderparam)([Structure](common.md))</code><br>\n<code>**class** [RankingRankData](#rankingrankdata)([Structure](common.md))</code><br>\n<code>**class** [RankingResult](#rankingresult)([Structure](common.md))</code><br>\n<code>**class** [RankingScoreData](#rankingscoredata)([Structure](common.md))</code><br>\n<code>**class** [RankingStats](#rankingstats)([Structure](common.md))</code><br>\n\n## RankingClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`RankingClient`](#rankingclient).</span>\n\n<code>**async def upload_score**(score_data: [RankingScoreData](#rankingscoredata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def delete_score**(category: int, unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def delete_all_scores**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def upload_common_data**(common_data: bytes, unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_common_data**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_common_data**(unique_id: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_attributes**(category: int, param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def change_all_attributes**(param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_ranking**(mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int, pid: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_approx_order**(category: int, order: [RankingOrderParam](#rankingorderparam), score: int, unique_id: int, pid: int) -> int</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def get_stats**(category: int, order: [RankingOrderParam](#rankingorderparam), flags: int) -> [RankingStats](#rankingstats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_ranking_by_pid_list**(pids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_ranking_by_unique_id_list**(ids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def get_cached_topx_ranking**(category: int, order: [RankingOrderParam](#rankingorderparam)) -> [RankingCachedResult](#rankingcachedresult)</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_cached_topx_rankings**(categories: list[int], order: list[[RankingOrderParam](#rankingorderparam)]) -> list[[RankingCachedResult](#rankingcachedresult)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n## RankingServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`RankingServer`](#rankingserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def upload_score**(client: [RMCClient](rmc.md#rmcclient), score_data: [RankingScoreData](#rankingscoredata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_score**(client: [RMCClient](rmc.md#rmcclient), category: int, unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_all_scores**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def upload_common_data**(client: [RMCClient](rmc.md#rmcclient), common_data: bytes, unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_attributes**(client: [RMCClient](rmc.md#rmcclient), category: int, param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_all_attributes**(client: [RMCClient](rmc.md#rmcclient), param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking**(client: [RMCClient](rmc.md#rmcclient), mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int, pid: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_approx_order**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam), score: int, unique_id: int, pid: int) -> int</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam), flags: int) -> [RankingStats](#rankingstats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_pid_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_unique_id_list**(client: [RMCClient](rmc.md#rmcclient), ids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_cached_topx_ranking**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam)) -> [RankingCachedResult](#rankingcachedresult)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_cached_topx_rankings**(client: [RMCClient](rmc.md#rmcclient), categories: list[int], order: list[[RankingOrderParam](#rankingorderparam)]) -> list[[RankingCachedResult](#rankingcachedresult)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n## RankingMode\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 0`<br>\n`GLOBAL_AROUND_SELF = 1`<br>\n`SELF = 4`<br>\n</span>\n\n## RankingOrderCalc\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`STANDARD = 0`<br>\n`ORDINAL = 1`<br>\n</span>\n\n## RankingStatFlags\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`RANKING_COUNT = 1`<br>\n`TOTAL_SCORE = 2`<br>\n`LOWEST_SCORE = 4`<br>\n`HIGHEST_SCORE = 8`<br>\n`AVERAGE_SCORE = 16`<br>\n`ALL = 31`<br>\n</span>\n\n## RankingCachedResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingCachedResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>created_time: [DateTime](common.md#datetime)</code><br>\n<code>expired_time: [DateTime](common.md#datetime)</code><br>\n<code>max_length: int</code><br>\n</span><br>\n\n## RankingChangeAttributesParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingChangeAttributesParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flags: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n</span><br>\n\n## RankingOrderParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingOrderParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>order_calc: int = 0</code><br>\n<code>group_index: int = 255</code><br>\n<code>group_num: int = 0</code><br>\n<code>time_scope: int = 2</code><br>\n<code>offset: int = 0</code><br>\n<code>count: int = 10</code><br>\n</span><br>\n\n## RankingRankData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingRankData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>unique_id: int</code><br>\n<code>rank: int</code><br>\n<code>category: int</code><br>\n<code>score: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n<code>common_data: bytes</code><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n</span><br>\n\n## RankingResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[[RankingRankData](#rankingrankdata)]</code><br>\n<code>total: int</code><br>\n<code>since_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## RankingScoreData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingScoreData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>score: int</code><br>\n<code>order: int</code><br>\n<code>update_mode: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n</span><br>\n\n## RankingStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>stats: list[float]</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/ranking2.md",
    "content": "\n# Module: <code>nintendo.nex.ranking2</code>\n\nProvides a client and server for the `Ranking2Protocol`. This page was generated automatically from `ranking2.proto`.\n\n<code>**class** [Ranking2Client](#ranking2client)</code><br>\n<span class=\"docs\">The client for the `Ranking2Protocol`.</span>\n\n<code>**class** [Ranking2Server](#ranking2server)</code><br>\n<span class=\"docs\">The server for the `Ranking2Protocol`.</span>\n\n<code>**class** [RankingMode](#rankingmode)</code><br>\n\n<code>**class** [Ranking2CategorySetting](#ranking2categorysetting)([Structure](common.md))</code><br>\n<code>**class** [Ranking2ChartInfo](#ranking2chartinfo)([Structure](common.md))</code><br>\n<code>**class** [Ranking2ChartInfoInput](#ranking2chartinfoinput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2CommonData](#ranking2commondata)([Structure](common.md))</code><br>\n<code>**class** [Ranking2EstimateScoreRankInput](#ranking2estimatescorerankinput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2GetByListParam](#ranking2getbylistparam)([Structure](common.md))</code><br>\n<code>**class** [Ranking2GetParam](#ranking2getparam)([Structure](common.md))</code><br>\n<code>**class** [Ranking2Info](#ranking2info)([Structure](common.md))</code><br>\n<code>**class** [Ranking2RankData](#ranking2rankdata)([Structure](common.md))</code><br>\n<code>**class** [Ranking2ScoreData](#ranking2scoredata)([Structure](common.md))</code><br>\n\n## Ranking2Client\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`Ranking2Client`](#ranking2client).</span>\n\n<code>**async def put_score**(socres: list[[Ranking2ScoreData](#ranking2scoredata)], unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_common_data**(option_flags: int, pid: int, unique_id: int) -> [Ranking2CommonData](#ranking2commondata)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def put_common_data**(data: [Ranking2CommonData](#ranking2commondata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def delete_common_data**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_ranking**(param: [Ranking2GetParam](#ranking2getparam)) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_ranking_by_principal_id**(param: [Ranking2GetByListParam](#ranking2getbylistparam), pids: list[int]) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_category_setting**(category: int) -> [Ranking2CategorySetting](#ranking2categorysetting)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_ranking_chart**(input: [Ranking2ChartInfoInput](#ranking2chartinfoinput)) -> [Ranking2ChartInfo](#ranking2chartinfo)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_ranking_charts**(inputs: list[[Ranking2ChartInfoInput](#ranking2chartinfoinput)]) -> list[[Ranking2ChartInfo](#ranking2chartinfo)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_estimate_score_rank**(input: [Ranking2EstimateScoreRankInput](#ranking2estimatescorerankinput)) -> [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n## Ranking2Server\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`Ranking2Server`](#ranking2server).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def put_score**(client: [RMCClient](rmc.md#rmcclient), socres: list[[Ranking2ScoreData](#ranking2scoredata)], unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_common_data**(client: [RMCClient](rmc.md#rmcclient), option_flags: int, pid: int, unique_id: int) -> [Ranking2CommonData](#ranking2commondata)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def put_common_data**(client: [RMCClient](rmc.md#rmcclient), data: [Ranking2CommonData](#ranking2commondata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking**(client: [RMCClient](rmc.md#rmcclient), param: [Ranking2GetParam](#ranking2getparam)) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_principal_id**(client: [RMCClient](rmc.md#rmcclient), param: [Ranking2GetByListParam](#ranking2getbylistparam), pids: list[int]) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_category_setting**(client: [RMCClient](rmc.md#rmcclient), category: int) -> [Ranking2CategorySetting](#ranking2categorysetting)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_chart**(client: [RMCClient](rmc.md#rmcclient), input: [Ranking2ChartInfoInput](#ranking2chartinfoinput)) -> [Ranking2ChartInfo](#ranking2chartinfo)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_charts**(client: [RMCClient](rmc.md#rmcclient), inputs: list[[Ranking2ChartInfoInput](#ranking2chartinfoinput)]) -> list[[Ranking2ChartInfo](#ranking2chartinfo)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_estimate_score_rank**(client: [RMCClient](rmc.md#rmcclient), input: [Ranking2EstimateScoreRankInput](#ranking2estimatescorerankinput)) -> [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n## RankingMode\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL_AROUND_SELF = 1`<br>\n`GLOBAL = 2`<br>\n`FRIENDS = 3`<br>\n</span>\n\n## Ranking2CategorySetting\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2CategorySetting` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>min_score: int</code><br>\n<code>max_score: int</code><br>\n<code>lowest_rank: int</code><br>\n<code>reset_month: int</code><br>\n<code>reset_day: int</code><br>\n<code>reset_hour: int</code><br>\n<code>reset_mode: int</code><br>\n<code>max_seasons_to_go_back: int</code><br>\n<code>score_order: bool</code><br>\n</span><br>\n\n## Ranking2ChartInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2ChartInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>create_time: [DateTime](common.md#datetime)</code><br>\n<code>index: int</code><br>\n<code>category: int</code><br>\n<code>season: int</code><br>\n<code>bins_size: int</code><br>\n<code>sampling_rate: int</code><br>\n<code>score_order: bool</code><br>\n<code>estimate_length: int</code><br>\n<code>estimate_highest_score: int</code><br>\n<code>estimate_lowest_score: int</code><br>\n<code>estimate_median_score: int</code><br>\n<code>estimate_average_score: float</code><br>\n<code>highest_bins_score: int</code><br>\n<code>lowest_bins_score: int</code><br>\n<code>bins_width: int</code><br>\n<code>attribute1: int</code><br>\n<code>attribute2: int</code><br>\n<code>quantities: list[int]</code><br>\n</span><br>\n\n## Ranking2ChartInfoInput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2ChartInfoInput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>chart_index: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n</span><br>\n\n## Ranking2CommonData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2CommonData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>username: str</code><br>\n<code>mii: bytes</code><br>\n<code>binary_data: bytes</code><br>\n</span><br>\n\n## Ranking2EstimateScoreRankInput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2EstimateScoreRankInput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n<code>score: int</code><br>\n</span><br>\n\n## Ranking2EstimateScoreRankOutput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2EstimateScoreRankOutput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rank: int</code><br>\n<code>length: int</code><br>\n<code>score: int</code><br>\n<code>category: int</code><br>\n<code>season: int</code><br>\n<code>sampling_rate: int</code><br>\n</span><br>\n\n## Ranking2GetByListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2GetByListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>offset: int</code><br>\n<code>length: int</code><br>\n<code>sort_flags: int</code><br>\n<code>option_flags: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n</span><br>\n\n## Ranking2GetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2GetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int = 0</code><br>\n<code>pid: int = 0</code><br>\n<code>category: int</code><br>\n<code>offset: int = 0</code><br>\n<code>count: int = 10</code><br>\n<code>sort_flags: int = 0</code><br>\n<code>option_flags: int = 0</code><br>\n<code>mode: int = 2</code><br>\n<code>seasons_to_go_back: int = 0</code><br>\n</span><br>\n\n## Ranking2Info\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2Info` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[[Ranking2RankData](#ranking2rankdata)]</code><br>\n<code>lowest_rank: int</code><br>\n<code>num_entries: int</code><br>\n<code>season: int</code><br>\n</span><br>\n\n## Ranking2RankData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2RankData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>misc: int</code><br>\n<code>unique_id: int</code><br>\n<code>pid: int</code><br>\n<code>rank: int</code><br>\n<code>score: int</code><br>\n<code>common_data: [Ranking2CommonData](#ranking2commondata) = [Ranking2CommonData](#ranking2commondata)()</code><br>\n</span><br>\n\n## Ranking2ScoreData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2ScoreData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>misc: int</code><br>\n<code>category: int</code><br>\n<code>score: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/ranking2_eagle.md",
    "content": "\n# Module: <code>nintendo.nex.ranking2_eagle</code>\n\nProvides a client and server for the `Ranking2Protocol`. This page was generated automatically from `ranking2_eagle.proto`.\n\n<code>**class** [Ranking2Client](#ranking2client)</code><br>\n<span class=\"docs\">The client for the `Ranking2Protocol`.</span>\n\n<code>**class** [Ranking2Server](#ranking2server)</code><br>\n<span class=\"docs\">The server for the `Ranking2Protocol`.</span>\n\n<code>**class** [RankingMode](#rankingmode)</code><br>\n\n<code>**class** [Ranking2CategorySetting](#ranking2categorysetting)([Structure](common.md))</code><br>\n<code>**class** [Ranking2ChartInfo](#ranking2chartinfo)([Structure](common.md))</code><br>\n<code>**class** [Ranking2ChartInfoInput](#ranking2chartinfoinput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2CommonData](#ranking2commondata)([Structure](common.md))</code><br>\n<code>**class** [Ranking2EstimateMyScoreRankInput](#ranking2estimatemyscorerankinput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2EstimateScoreRankInput](#ranking2estimatescorerankinput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)([Structure](common.md))</code><br>\n<code>**class** [Ranking2GetByListParam](#ranking2getbylistparam)([Structure](common.md))</code><br>\n<code>**class** [Ranking2GetParam](#ranking2getparam)([Structure](common.md))</code><br>\n<code>**class** [Ranking2Info](#ranking2info)([Structure](common.md))</code><br>\n<code>**class** [Ranking2RankData](#ranking2rankdata)([Structure](common.md))</code><br>\n<code>**class** [Ranking2ScoreData](#ranking2scoredata)([Structure](common.md))</code><br>\n\n## Ranking2Client\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`Ranking2Client`](#ranking2client).</span>\n\n<code>**async def put_score**(socres: list[[Ranking2ScoreData](#ranking2scoredata)], unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def get_common_data**(option_flags: int, pid: int, unique_id: int) -> [Ranking2CommonData](#ranking2commondata)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def put_common_data**(data: [Ranking2CommonData](#ranking2commondata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def delete_common_data**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_ranking**(param: [Ranking2GetParam](#ranking2getparam)) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_ranking_by_principal_id**(param: [Ranking2GetByListParam](#ranking2getbylistparam), pids: list[int]) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_category_setting**(category: int) -> [Ranking2CategorySetting](#ranking2categorysetting)</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_ranking_chart**(input: [Ranking2ChartInfoInput](#ranking2chartinfoinput)) -> [Ranking2ChartInfo](#ranking2chartinfo)</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_ranking_charts**(inputs: list[[Ranking2ChartInfoInput](#ranking2chartinfoinput)]) -> list[[Ranking2ChartInfo](#ranking2chartinfo)]</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_estimate_score_rank**(input: [Ranking2EstimateScoreRankInput](#ranking2estimatescorerankinput)) -> [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def get_estimate_my_score_rank**(input: [Ranking2EstimateMyScoreRankInput](#ranking2estimatemyscorerankinput)) -> [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n## Ranking2Server\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`Ranking2Server`](#ranking2server).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def put_score**(client: [RMCClient](rmc.md#rmcclient), socres: list[[Ranking2ScoreData](#ranking2scoredata)], unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_common_data**(client: [RMCClient](rmc.md#rmcclient), option_flags: int, pid: int, unique_id: int) -> [Ranking2CommonData](#ranking2commondata)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def put_common_data**(client: [RMCClient](rmc.md#rmcclient), data: [Ranking2CommonData](#ranking2commondata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking**(client: [RMCClient](rmc.md#rmcclient), param: [Ranking2GetParam](#ranking2getparam)) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_principal_id**(client: [RMCClient](rmc.md#rmcclient), param: [Ranking2GetByListParam](#ranking2getbylistparam), pids: list[int]) -> [Ranking2Info](#ranking2info)</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_category_setting**(client: [RMCClient](rmc.md#rmcclient), category: int) -> [Ranking2CategorySetting](#ranking2categorysetting)</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_chart**(client: [RMCClient](rmc.md#rmcclient), input: [Ranking2ChartInfoInput](#ranking2chartinfoinput)) -> [Ranking2ChartInfo](#ranking2chartinfo)</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_charts**(client: [RMCClient](rmc.md#rmcclient), inputs: list[[Ranking2ChartInfoInput](#ranking2chartinfoinput)]) -> list[[Ranking2ChartInfo](#ranking2chartinfo)]</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_estimate_score_rank**(client: [RMCClient](rmc.md#rmcclient), input: [Ranking2EstimateScoreRankInput](#ranking2estimatescorerankinput)) -> [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_estimate_my_score_rank**(client: [RMCClient](rmc.md#rmcclient), input: [Ranking2EstimateMyScoreRankInput](#ranking2estimatemyscorerankinput)) -> [Ranking2EstimateScoreRankOutput](#ranking2estimatescorerankoutput)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n## RankingMode\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL_AROUND_SELF = 1`<br>\n`GLOBAL = 2`<br>\n`FRIENDS = 3`<br>\n</span>\n\n## Ranking2CategorySetting\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2CategorySetting` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>min_score: int</code><br>\n<code>max_score: int</code><br>\n<code>lowest_rank: int</code><br>\n<code>reset_month: int</code><br>\n<code>reset_day: int</code><br>\n<code>reset_hour: int</code><br>\n<code>reset_mode: int</code><br>\n<code>max_seasons_to_go_back: int</code><br>\n<code>score_order: bool</code><br>\n</span><br>\n\n## Ranking2ChartInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2ChartInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>create_time: [DateTime](common.md#datetime)</code><br>\n<code>index: int</code><br>\n<code>category: int</code><br>\n<code>season: int</code><br>\n<code>bins_size: int</code><br>\n<code>sampling_rate: int</code><br>\n<code>score_order: bool</code><br>\n<code>estimate_length: int</code><br>\n<code>estimate_highest_score: int</code><br>\n<code>estimate_lowest_score: int</code><br>\n<code>estimate_median_score: int</code><br>\n<code>estimate_average_score: float</code><br>\n<code>highest_bins_score: int</code><br>\n<code>lowest_bins_score: int</code><br>\n<code>bins_width: int</code><br>\n<code>attribute1: int</code><br>\n<code>attribute2: int</code><br>\n<code>quantities: list[int]</code><br>\n</span><br>\n\n## Ranking2ChartInfoInput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2ChartInfoInput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>chart_index: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n</span><br>\n\n## Ranking2CommonData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2CommonData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>username: str</code><br>\n<code>mii: bytes</code><br>\n<code>binary_data: bytes</code><br>\n</span><br>\n\n## Ranking2EstimateMyScoreRankInput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2EstimateMyScoreRankInput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n</span><br>\n\n## Ranking2EstimateScoreRankInput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2EstimateScoreRankInput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n<code>score: int</code><br>\n</span><br>\n\n## Ranking2EstimateScoreRankOutput\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2EstimateScoreRankOutput` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rank: int</code><br>\n<code>length: int</code><br>\n<code>score: int</code><br>\n<code>category: int</code><br>\n<code>season: int</code><br>\n<code>sampling_rate: int</code><br>\n</span><br>\n\n## Ranking2GetByListParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2GetByListParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>offset: int</code><br>\n<code>length: int</code><br>\n<code>sort_flags: int</code><br>\n<code>option_flags: int</code><br>\n<code>seasons_to_go_back: int</code><br>\n</span><br>\n\n## Ranking2GetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2GetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int = 0</code><br>\n<code>pid: int = 0</code><br>\n<code>category: int</code><br>\n<code>offset: int = 0</code><br>\n<code>count: int = 10</code><br>\n<code>sort_flags: int = 0</code><br>\n<code>option_flags: int = 0</code><br>\n<code>mode: int = 2</code><br>\n<code>seasons_to_go_back: int = 0</code><br>\n</span><br>\n\n## Ranking2Info\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2Info` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[[Ranking2RankData](#ranking2rankdata)]</code><br>\n<code>lowest_rank: int</code><br>\n<code>num_entries: int</code><br>\n<code>season: int</code><br>\n</span><br>\n\n## Ranking2RankData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2RankData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>misc: int</code><br>\n<code>unique_id: int</code><br>\n<code>pid: int</code><br>\n<code>rank: int</code><br>\n<code>score: int</code><br>\n<code>common_data: [Ranking2CommonData](#ranking2commondata) = [Ranking2CommonData](#ranking2commondata)()</code><br>\n</span><br>\n\n## Ranking2ScoreData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `Ranking2ScoreData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>misc: int</code><br>\n<code>category: int</code><br>\n<code>score: int</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/ranking_mk8.md",
    "content": "\n# Module: <code>nintendo.nex.ranking_mk8</code>\n\nProvides a client and server for the `RankingProtocolMK8`. This page was generated automatically from `ranking_mk8.proto`.\n\n<code>**class** [RankingClientMK8](#rankingclientmk8)</code><br>\n<span class=\"docs\">The client for the `RankingProtocolMK8`.</span>\n\n<code>**class** [RankingServerMK8](#rankingservermk8)</code><br>\n<span class=\"docs\">The server for the `RankingProtocolMK8`.</span>\n\n<code>**class** [RankingMode](#rankingmode)</code><br>\n<code>**class** [RankingOrderCalc](#rankingordercalc)</code><br>\n<code>**class** [RankingStatFlags](#rankingstatflags)</code><br>\n\n<code>**class** [CompetitionRankingInfo](#competitionrankinginfo)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingInfoGetParam](#competitionrankinginfogetparam)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingUploadScoreParam](#competitionrankinguploadscoreparam)([Structure](common.md))</code><br>\n<code>**class** [RankingCachedResult](#rankingcachedresult)([RankingResult](#rankingresult))</code><br>\n<code>**class** [RankingChangeAttributesParam](#rankingchangeattributesparam)([Structure](common.md))</code><br>\n<code>**class** [RankingOrderParam](#rankingorderparam)([Structure](common.md))</code><br>\n<code>**class** [RankingRankData](#rankingrankdata)([Structure](common.md))</code><br>\n<code>**class** [RankingResult](#rankingresult)([Structure](common.md))</code><br>\n<code>**class** [RankingScoreData](#rankingscoredata)([Structure](common.md))</code><br>\n<code>**class** [RankingStats](#rankingstats)([Structure](common.md))</code><br>\n\n## RankingClientMK8\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`RankingClientMK8`](#rankingclientmk8).</span>\n\n<code>**async def upload_score**(score_data: [RankingScoreData](#rankingscoredata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def delete_score**(category: int, unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def delete_all_scores**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def upload_common_data**(common_data: bytes, unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_common_data**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_common_data**(unique_id: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_attributes**(category: int, param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def change_all_attributes**(param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_ranking**(mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int, pid: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_approx_order**(category: int, order: [RankingOrderParam](#rankingorderparam), score: int, unique_id: int, pid: int) -> int</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def get_stats**(category: int, order: [RankingOrderParam](#rankingorderparam), flags: int) -> [RankingStats](#rankingstats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_ranking_by_pid_list**(pids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_ranking_by_unique_id_list**(ids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def upload_competition_ranking_score**(param: [CompetitionRankingUploadScoreParam](#competitionrankinguploadscoreparam)) -> bool</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_competition_info**(param: [CompetitionRankingInfoGetParam](#competitionrankinginfogetparam)) -> list[[CompetitionRankingInfo](#competitionrankinginfo)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n## RankingServerMK8\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`RankingServerMK8`](#rankingservermk8).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def upload_score**(client: [RMCClient](rmc.md#rmcclient), score_data: [RankingScoreData](#rankingscoredata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_score**(client: [RMCClient](rmc.md#rmcclient), category: int, unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_all_scores**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def upload_common_data**(client: [RMCClient](rmc.md#rmcclient), common_data: bytes, unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_attributes**(client: [RMCClient](rmc.md#rmcclient), category: int, param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_all_attributes**(client: [RMCClient](rmc.md#rmcclient), param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking**(client: [RMCClient](rmc.md#rmcclient), mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int, pid: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_approx_order**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam), score: int, unique_id: int, pid: int) -> int</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam), flags: int) -> [RankingStats](#rankingstats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_pid_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_unique_id_list**(client: [RMCClient](rmc.md#rmcclient), ids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def upload_competition_ranking_score**(client: [RMCClient](rmc.md#rmcclient), param: [CompetitionRankingUploadScoreParam](#competitionrankinguploadscoreparam)) -> bool</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_competition_info**(client: [RMCClient](rmc.md#rmcclient), param: [CompetitionRankingInfoGetParam](#competitionrankinginfogetparam)) -> list[[CompetitionRankingInfo](#competitionrankinginfo)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n## RankingMode\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 0`<br>\n`GLOBAL_AROUND_SELF = 1`<br>\n`SELF = 4`<br>\n</span>\n\n## RankingOrderCalc\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`STANDARD = 0`<br>\n`ORDINAL = 1`<br>\n</span>\n\n## RankingStatFlags\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`RANKING_COUNT = 1`<br>\n`TOTAL_SCORE = 2`<br>\n`LOWEST_SCORE = 4`<br>\n`HIGHEST_SCORE = 8`<br>\n`AVERAGE_SCORE = 16`<br>\n`ALL = 31`<br>\n</span>\n\n## CompetitionRankingInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>num_participants: int</code><br>\n<code>team_scores: list[int]</code><br>\n</span><br>\n\n## CompetitionRankingInfoGetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingInfoGetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rank_order: int</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## CompetitionRankingUploadScoreParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingUploadScoreParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>season_id: int</code><br>\n<code>unk3: int</code><br>\n<code>score: int</code><br>\n<code>team_id: int</code><br>\n<code>team_score: int</code><br>\n<code>is_first_upload: bool</code><br>\n<code>metadata: bytes</code><br>\n</span><br>\n\n## RankingCachedResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingCachedResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>created_time: [DateTime](common.md#datetime)</code><br>\n<code>expired_time: [DateTime](common.md#datetime)</code><br>\n<code>max_length: int</code><br>\n</span><br>\n\n## RankingChangeAttributesParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingChangeAttributesParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flags: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n</span><br>\n\n## RankingOrderParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingOrderParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>order_calc: int = 0</code><br>\n<code>group_index: int = 255</code><br>\n<code>group_num: int = 0</code><br>\n<code>time_scope: int = 2</code><br>\n<code>offset: int = 0</code><br>\n<code>count: int = 10</code><br>\n</span><br>\n\n## RankingRankData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingRankData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>unique_id: int</code><br>\n<code>rank: int</code><br>\n<code>category: int</code><br>\n<code>score: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n<code>common_data: bytes</code><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n</span><br>\n\n## RankingResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[[RankingRankData](#rankingrankdata)]</code><br>\n<code>total: int</code><br>\n<code>since_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## RankingScoreData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingScoreData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>score: int</code><br>\n<code>order: int</code><br>\n<code>update_mode: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n</span><br>\n\n## RankingStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>stats: list[float]</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/ranking_mk8d.md",
    "content": "\n# Module: <code>nintendo.nex.ranking_mk8d</code>\n\nProvides a client and server for the `RankingProtocolMK8D`. This page was generated automatically from `ranking_mk8d.proto`.\n\n<code>**class** [RankingClientMK8D](#rankingclientmk8d)</code><br>\n<span class=\"docs\">The client for the `RankingProtocolMK8D`.</span>\n\n<code>**class** [RankingServerMK8D](#rankingservermk8d)</code><br>\n<span class=\"docs\">The server for the `RankingProtocolMK8D`.</span>\n\n<code>**class** [RankingMode](#rankingmode)</code><br>\n<code>**class** [RankingOrderCalc](#rankingordercalc)</code><br>\n<code>**class** [RankingStatFlags](#rankingstatflags)</code><br>\n\n<code>**class** [CommonDataList](#commondatalist)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingGetScoreParam](#competitionrankinggetscoreparam)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingInfo](#competitionrankinginfo)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingInfoGetParam](#competitionrankinginfogetparam)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingScoreData](#competitionrankingscoredata)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingScoreInfo](#competitionrankingscoreinfo)([Structure](common.md))</code><br>\n<code>**class** [CompetitionRankingUploadScoreParam](#competitionrankinguploadscoreparam)([Structure](common.md))</code><br>\n<code>**class** [RankingCachedResult](#rankingcachedresult)([RankingResult](#rankingresult))</code><br>\n<code>**class** [RankingChangeAttributesParam](#rankingchangeattributesparam)([Structure](common.md))</code><br>\n<code>**class** [RankingOrderParam](#rankingorderparam)([Structure](common.md))</code><br>\n<code>**class** [RankingRankData](#rankingrankdata)([Structure](common.md))</code><br>\n<code>**class** [RankingResult](#rankingresult)([Structure](common.md))</code><br>\n<code>**class** [RankingScoreData](#rankingscoredata)([Structure](common.md))</code><br>\n<code>**class** [RankingStats](#rankingstats)([Structure](common.md))</code><br>\n<code>**class** [ScorePack](#scorepack)([Structure](common.md))</code><br>\n\n## RankingClientMK8D\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`RankingClientMK8D`](#rankingclientmk8d).</span>\n\n<code>**async def upload_score**(score_data: [RankingScoreData](#rankingscoredata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def delete_score**(category: int, unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def delete_all_scores**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def upload_common_data**(common_data: bytes, unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def delete_common_data**(unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_common_data**(unique_id: int) -> bytes</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def change_attributes**(category: int, param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def change_all_attributes**(param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n<code>**async def get_ranking**(mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int, pid: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `9` on the server.</span>\n\n<code>**async def get_approx_order**(category: int, order: [RankingOrderParam](#rankingorderparam), score: int, unique_id: int, pid: int) -> int</code><br>\n<span class=\"docs\">Calls method `10` on the server.</span>\n\n<code>**async def get_stats**(category: int, order: [RankingOrderParam](#rankingorderparam), flags: int) -> [RankingStats](#rankingstats)</code><br>\n<span class=\"docs\">Calls method `11` on the server.</span>\n\n<code>**async def get_ranking_by_pid_list**(pids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `12` on the server.</span>\n\n<code>**async def get_ranking_by_unique_id_list**(ids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Calls method `13` on the server.</span>\n\n<code>**async def get_cached_topx_ranking**(category: int, order: [RankingOrderParam](#rankingorderparam)) -> [RankingCachedResult](#rankingcachedresult)</code><br>\n<span class=\"docs\">Calls method `14` on the server.</span>\n\n<code>**async def get_cached_topx_rankings**(categories: list[int], order: list[[RankingOrderParam](#rankingorderparam)]) -> list[[RankingCachedResult](#rankingcachedresult)]</code><br>\n<span class=\"docs\">Calls method `15` on the server.</span>\n\n<code>**async def get_competition_ranking_score**(param: [CompetitionRankingGetScoreParam](#competitionrankinggetscoreparam)) -> list[[CompetitionRankingScoreInfo](#competitionrankingscoreinfo)]</code><br>\n<span class=\"docs\">Calls method `16` on the server.</span>\n\n<code>**async def upload_competition_ranking_score**(param: [CompetitionRankingUploadScoreParam](#competitionrankinguploadscoreparam)) -> bool</code><br>\n<span class=\"docs\">Calls method `17` on the server.</span>\n\n<code>**async def get_competition_info**(param: [CompetitionRankingInfoGetParam](#competitionrankinginfogetparam)) -> list[[CompetitionRankingInfo](#competitionrankinginfo)]</code><br>\n<span class=\"docs\">Calls method `18` on the server.</span>\n\n<code>**async def upload_score_pack**(score_data: [RankingScoreData](#rankingscoredata), metadata: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `19` on the server.</span>\n\n<code>**async def get_score_pack**(pids: list[int], category: int) -> [ScorePack](#scorepack)</code><br>\n<span class=\"docs\">Calls method `20` on the server.</span>\n\n<code>**async def get_commmon_data_by_pid_list**(pids: list[int]) -> [CommonDataList](#commondatalist)</code><br>\n<span class=\"docs\">Calls method `22` on the server.</span>\n\n## RankingServerMK8D\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`RankingServerMK8D`](#rankingservermk8d).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def upload_score**(client: [RMCClient](rmc.md#rmcclient), score_data: [RankingScoreData](#rankingscoredata), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_score**(client: [RMCClient](rmc.md#rmcclient), category: int, unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_all_scores**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def upload_common_data**(client: [RMCClient](rmc.md#rmcclient), common_data: bytes, unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def delete_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_common_data**(client: [RMCClient](rmc.md#rmcclient), unique_id: int) -> bytes</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_attributes**(client: [RMCClient](rmc.md#rmcclient), category: int, param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def change_all_attributes**(client: [RMCClient](rmc.md#rmcclient), param: [RankingChangeAttributesParam](#rankingchangeattributesparam), unique_id: int) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking**(client: [RMCClient](rmc.md#rmcclient), mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int, pid: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `9`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_approx_order**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam), score: int, unique_id: int, pid: int) -> int</code><br>\n<span class=\"docs\">Handler for method `10`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_stats**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam), flags: int) -> [RankingStats](#rankingstats)</code><br>\n<span class=\"docs\">Handler for method `11`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_pid_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `12`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_ranking_by_unique_id_list**(client: [RMCClient](rmc.md#rmcclient), ids: list[int], mode: int, category: int, order: [RankingOrderParam](#rankingorderparam), unique_id: int) -> [RankingResult](#rankingresult)</code><br>\n<span class=\"docs\">Handler for method `13`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_cached_topx_ranking**(client: [RMCClient](rmc.md#rmcclient), category: int, order: [RankingOrderParam](#rankingorderparam)) -> [RankingCachedResult](#rankingcachedresult)</code><br>\n<span class=\"docs\">Handler for method `14`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_cached_topx_rankings**(client: [RMCClient](rmc.md#rmcclient), categories: list[int], order: list[[RankingOrderParam](#rankingorderparam)]) -> list[[RankingCachedResult](#rankingcachedresult)]</code><br>\n<span class=\"docs\">Handler for method `15`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_competition_ranking_score**(client: [RMCClient](rmc.md#rmcclient), param: [CompetitionRankingGetScoreParam](#competitionrankinggetscoreparam)) -> list[[CompetitionRankingScoreInfo](#competitionrankingscoreinfo)]</code><br>\n<span class=\"docs\">Handler for method `16`. This method should be overridden by a subclass.</span>\n\n<code>**async def upload_competition_ranking_score**(client: [RMCClient](rmc.md#rmcclient), param: [CompetitionRankingUploadScoreParam](#competitionrankinguploadscoreparam)) -> bool</code><br>\n<span class=\"docs\">Handler for method `17`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_competition_info**(client: [RMCClient](rmc.md#rmcclient), param: [CompetitionRankingInfoGetParam](#competitionrankinginfogetparam)) -> list[[CompetitionRankingInfo](#competitionrankinginfo)]</code><br>\n<span class=\"docs\">Handler for method `18`. This method should be overridden by a subclass.</span>\n\n<code>**async def upload_score_pack**(client: [RMCClient](rmc.md#rmcclient), score_data: [RankingScoreData](#rankingscoredata), metadata: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `19`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_score_pack**(client: [RMCClient](rmc.md#rmcclient), pids: list[int], category: int) -> [ScorePack](#scorepack)</code><br>\n<span class=\"docs\">Handler for method `20`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_commmon_data_by_pid_list**(client: [RMCClient](rmc.md#rmcclient), pids: list[int]) -> [CommonDataList](#commondatalist)</code><br>\n<span class=\"docs\">Handler for method `22`. This method should be overridden by a subclass.</span>\n\n## RankingMode\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`GLOBAL = 0`<br>\n`GLOBAL_AROUND_SELF = 1`<br>\n`SELF = 4`<br>\n</span>\n\n## RankingOrderCalc\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`STANDARD = 0`<br>\n`ORDINAL = 1`<br>\n</span>\n\n## RankingStatFlags\nThis class defines the following constants:<br>\n<span class=\"docs\">\n`RANKING_COUNT = 1`<br>\n`TOTAL_SCORE = 2`<br>\n`LOWEST_SCORE = 4`<br>\n`HIGHEST_SCORE = 8`<br>\n`AVERAGE_SCORE = 16`<br>\n`ALL = 31`<br>\n</span>\n\n## CommonDataList\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CommonDataList` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[bytes]</code><br>\n</span><br>\n\n## CompetitionRankingGetScoreParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingGetScoreParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## CompetitionRankingInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>num_participants: int</code><br>\n<code>team_scores: list[int]</code><br>\n</span><br>\n\n## CompetitionRankingInfoGetParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingInfoGetParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rank_order: int</code><br>\n<code>range: [ResultRange](common.md#resultrange) = [ResultRange](common.md#resultrange)()</code><br>\n</span><br>\n\n## CompetitionRankingScoreData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingScoreData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>rank: int</code><br>\n<code>pid: int</code><br>\n<code>score: int</code><br>\n<code>last_update: [DateTime](common.md#datetime)</code><br>\n<code>team_id: int = 255</code><br>\n<code>metadata: bytes</code><br>\n</span><br>\n\n## CompetitionRankingScoreInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingScoreInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>season_id: int</code><br>\n<code>scores: list[[CompetitionRankingScoreData](#competitionrankingscoredata)]</code><br>\n<code>num_participants: int</code><br>\n<code>team_scores: list[int]</code><br>\n</span><br>\n\n## CompetitionRankingUploadScoreParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `CompetitionRankingUploadScoreParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>id: int</code><br>\n<code>season_id: int</code><br>\n<code>unk3: int</code><br>\n<code>score: int</code><br>\n<code>team_id: int</code><br>\n<code>team_score: int</code><br>\n<code>is_first_upload: bool</code><br>\n<code>metadata: bytes</code><br>\n</span><br>\n\n## RankingCachedResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingCachedResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>created_time: [DateTime](common.md#datetime)</code><br>\n<code>expired_time: [DateTime](common.md#datetime)</code><br>\n<code>max_length: int</code><br>\n</span><br>\n\n## RankingChangeAttributesParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingChangeAttributesParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>flags: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n</span><br>\n\n## RankingOrderParam\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingOrderParam` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>order_calc: int = 0</code><br>\n<code>group_index: int = 255</code><br>\n<code>group_num: int = 0</code><br>\n<code>time_scope: int = 2</code><br>\n<code>offset: int = 0</code><br>\n<code>count: int = 10</code><br>\n</span><br>\n\n## RankingRankData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingRankData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>pid: int</code><br>\n<code>unique_id: int</code><br>\n<code>rank: int</code><br>\n<code>category: int</code><br>\n<code>score: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n<code>common_data: bytes</code><br>\nIf `nex.version` >= 40000:<br>\n<span class=\"docs\">\n<code>update_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n</span><br>\n\n## RankingResult\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingResult` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[[RankingRankData](#rankingrankdata)]</code><br>\n<code>total: int</code><br>\n<code>since_time: [DateTime](common.md#datetime)</code><br>\n</span><br>\n\n## RankingScoreData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingScoreData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>category: int</code><br>\n<code>score: int</code><br>\n<code>order: int</code><br>\n<code>update_mode: int</code><br>\n<code>groups: list[int]</code><br>\n<code>param: int</code><br>\n</span><br>\n\n## RankingStats\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `RankingStats` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>stats: list[float]</code><br>\n</span><br>\n\n## ScorePack\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ScorePack` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>data: list[bytes]</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/remotelog.md",
    "content": "\n# Module: <code>nintendo.nex.remotelog</code>\n\nProvides a client and server for the `RemoteLogDeviceProtocol`. This page was generated automatically from `remotelog.proto`.\n\n<code>**class** [RemoteLogDeviceClient](#remotelogdeviceclient)</code><br>\n<span class=\"docs\">The client for the `RemoteLogDeviceProtocol`.</span>\n\n<code>**class** [RemoteLogDeviceServer](#remotelogdeviceserver)</code><br>\n<span class=\"docs\">The server for the `RemoteLogDeviceProtocol`.</span>\n\n## RemoteLogDeviceClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`RemoteLogDeviceClient`](#remotelogdeviceclient).</span>\n\n<code>**async def log**(message: str) -> None</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n## RemoteLogDeviceServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`RemoteLogDeviceServer`](#remotelogdeviceserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def log**(client: [RMCClient](rmc.md#rmcclient), message: str) -> None</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n"
  },
  {
    "path": "docs/reference/nex/rmc.md",
    "content": "\r\n# Module: <code>nintendo.nex.rmc</code>\r\n\r\nProvides a client and server for the RMC protocol. An alternative client that calls remote methods through HTTP can be found in the [`nintendo.nex.hpp`](hpp.md) module.\r\n\r\n<code>**class** RMCResponse</code><br>\r\n<span class=\"docs\">Generic response object that is returned when a remote method returns multiple values. The attributes depend on the method.</span>\r\n\r\n<code>**class** [RMCClient](#rmcclient)</code><br>\r\n<span class=\"docs\">RMC client that uses a PRUDP connection.</span>\r\n\r\n<code>**async with connect**(settings: [Settings](settings.md#settings), host: str, port: int, vport: int = 1, context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext) = None, credentials: [Credentials](kerberos.md#credentials) = None, servers: list[object] = []) -> [RMCClient](#rmcclient)</code><br>\r\n<span class=\"docs\">Creates an RMC client based on PRUDP and connects it to the given address. If `context` is provided, and the underlying transport supports this, the connections is secured with TLS. If credentials are provided they are sent to the server in the connection request. Blocks until the connection is ready and handshake has been performed. `servers` must be a list of service implementations.</span>\r\n\r\n<code>**async with serve**(settings: [Settings](settings.md#settings), servers: list[object], host: str = \"\", port: int = 0, vport: int = 1, context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext) = None, key: bytes = None) -> None</code><br>\r\n<span class=\"docs\">Creates an RMC server based on PRUDP and binds it to the given address. If `host` is empty, the local address of the default interface is used. If `port` is 0, it is chosen by the operating system. If `context` is provided, and the underlying transport supports this, the server is secured with TLS. If `key` is provided it is used to decrypt the Kerberos tickets in connection requests. If `key` is `None`, the payload of connection requests is ignored and all client connections are accepted. `servers` must be a list of service implementations.</span>\r\n\r\n<code>**async with serve_on_transport**(settings: [Settings](settings.md#settings), servers: list[object], transport: [PRUDPServerTransport](prudp.md#prudpservertransport), port: int, key: bytes = None) -> None</code><br>\r\n<span class=\"docs\">Creates an RMC server on top of the given transport server. If `key` is provided it is used to decrypt the Kerberos tickets in connection requests. If `key` is `None`, the payload of connection requests is ignored and all client connections are accepted. `servers` must be a list of service implementations.</span>\r\n\r\n## RMCClient\r\n<code>**async def request**(protocol: int, method: int, body: bytes, noresponse: bool = False) -> bytes</code><br>\r\n<span class=\"docs\">Performs a remote method call. Blocks until the RMC is complete. Returns the body of the RMC response on success. Raises [`RMCError`](common.md#rmcerror) if the server returns an error code.<br><br>If `noresponse` is `True`, this method does not wait for a response and returns `None` immediately.</span>\r\n\r\n<code>**async def close**() -> None</code><br>\r\n<span class=\"docs\">Closes the connection forcefully by sending an unreliable disconnect packet three times.</span>\r\n\r\n<code>**async def disconnect**() -> None</code><br>\r\n<span class=\"docs\">Closes the connection gracefully by sending a reliable disconnect packet.</span>\r\n\r\n<code>**def pid**() -> int</code><br>\r\n<span class=\"docs\">Returns the user id of the connected client. Returns `None` if the client is connected without credentials.</span>\r\n\r\n<code>**def local_address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the local address of the client.</span>\r\n\r\n<code>**def remote_address**() -> tuple[str, int]</code><br>\r\n<span class=\"docs\">Returns the address that the client is connected to.</span>\r\n\r\n<code>**def local_sid**() -> int</code><br>\r\n<span class=\"docs\">Returns the local stream id (PRUDP port).</span>\r\n\r\n<code>**def remote_sid**() -> int</code><br>\r\n<span class=\"docs\">Returns the remote stream id (PRUDP port).</span>\r\n"
  },
  {
    "path": "docs/reference/nex/screening.md",
    "content": "\n# Module: <code>nintendo.nex.screening</code>\n\nProvides a client and server for the `ScreeningProtocol`. This page was generated automatically from `screening.proto`.\n\n<code>**class** [ScreeningClient](#screeningclient)</code><br>\n<span class=\"docs\">The client for the `ScreeningProtocol`.</span>\n\n<code>**class** [ScreeningServer](#screeningserver)</code><br>\n<span class=\"docs\">The server for the `ScreeningProtocol`.</span>\n\n## ScreeningClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`ScreeningClient`](#screeningclient).</span>\n\n## ScreeningServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`ScreeningServer`](#screeningserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n"
  },
  {
    "path": "docs/reference/nex/secure.md",
    "content": "\n# Module: <code>nintendo.nex.secure</code>\n\nProvides a client and server for the `SecureConnectionProtocol`. This page was generated automatically from `secure.proto`.\n\n<code>**class** [SecureConnectionClient](#secureconnectionclient)</code><br>\n<span class=\"docs\">The client for the `SecureConnectionProtocol`.</span>\n\n<code>**class** [SecureConnectionServer](#secureconnectionserver)</code><br>\n<span class=\"docs\">The server for the `SecureConnectionProtocol`.</span>\n\n<code>**class** [ConnectionData](#connectiondata)([Structure](common.md))</code><br>\n<code>**class** [NintendoLoginData](#nintendologindata)([Structure](common.md))</code><br>\n\n## SecureConnectionClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`SecureConnectionClient`](#secureconnectionclient).</span>\n\n<code>**async def register**(urls: list[[StationURL](common.md#stationurl)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `1` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>connection_id: int</code><br>\n<code>public_station: [StationURL](common.md#stationurl)</code><br>\n</span>\n</span>\n\n<code>**async def request_connection_data**(cid: int, pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `2` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>connection_data: list[[ConnectionData](#connectiondata)]</code><br>\n</span>\n</span>\n\n<code>**async def request_urls**(cid: int, pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `3` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span>\n</span>\n\n<code>**async def register_ex**(urls: list[[StationURL](common.md#stationurl)], login_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Calls method `4` on the server. The RMC response has the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>connection_id: int</code><br>\n<code>public_station: [StationURL](common.md#stationurl)</code><br>\n</span>\n</span>\n\n<code>**async def test_connectivity**() -> None</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def update_urls**(urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def replace_url**(url: [StationURL](common.md#stationurl), new: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def send_report**(report_id: int, data: bytes) -> None</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n## SecureConnectionServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`SecureConnectionServer`](#secureconnectionserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def register**(client: [RMCClient](rmc.md#rmcclient), urls: list[[StationURL](common.md#stationurl)]) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>connection_id: int</code><br>\n<code>public_station: [StationURL](common.md#stationurl)</code><br>\n</span>\n</span>\n\n<code>**async def request_connection_data**(client: [RMCClient](rmc.md#rmcclient), cid: int, pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>connection_data: list[[ConnectionData](#connectiondata)]</code><br>\n</span>\n</span>\n\n<code>**async def request_urls**(client: [RMCClient](rmc.md#rmcclient), cid: int, pid: int) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: bool</code><br>\n<code>urls: list[[StationURL](common.md#stationurl)]</code><br>\n</span>\n</span>\n\n<code>**async def register_ex**(client: [RMCClient](rmc.md#rmcclient), urls: list[[StationURL](common.md#stationurl)], login_data: [Data](common.md)) -> [RMCResponse](common.md)</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass. The RMC response must have the following attributes:<br>\n<span class=\"docs\">\n<code>result: [Result](common.md#result)</code><br>\n<code>connection_id: int</code><br>\n<code>public_station: [StationURL](common.md#stationurl)</code><br>\n</span>\n</span>\n\n<code>**async def test_connectivity**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def update_urls**(client: [RMCClient](rmc.md#rmcclient), urls: list[[StationURL](common.md#stationurl)]) -> None</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def replace_url**(client: [RMCClient](rmc.md#rmcclient), url: [StationURL](common.md#stationurl), new: [StationURL](common.md#stationurl)) -> None</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def send_report**(client: [RMCClient](rmc.md#rmcclient), report_id: int, data: bytes) -> None</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n## ConnectionData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `ConnectionData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>station: [StationURL](common.md#stationurl)</code><br>\n<code>connection_id: int</code><br>\n</span><br>\n\n## NintendoLoginData\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `NintendoLoginData` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>token: str</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nex/settings.md",
    "content": "\r\n# Module: <code>nintendo.nex.settings</code>\r\n\r\nDefines settings for `nex` classes.\r\n\r\n<code>**class** [Settings](#settings)</code><br>\r\n<span class=\"docs\">Holds the settings.</span>\r\n\r\n<code>**def default**() -> [Settings](#settings)</code><br>\r\n<span class=\"docs\">Creates a settings object with default settings.</span>\r\n\r\n<code>**def load**(name: str) -> [Settings](#settings)</code><br>\r\n<span class=\"docs\">Loads the settings from the given configuration file. The following files are provided:<br>\r\n<span class=\"docs\">\r\n`- 3ds`: provides reasonable defaults for 3DS applications.<br>\r\n`- default`: provides reasonable defaults for Wii U applications.<br>\r\n`- friends`: provides reasonable defaults for the 3DS / Wii U friend server.<br>\r\n`- switch`: provides reasonable defaults for Switch applications.\r\n</span></span>\r\n\r\n## Settings\r\n<code>TRANSPORT_UDP (0)</code><br>\r\n<code>TRANSPORT_TCP (1)</code><br>\r\n<code>TRANSPORT_WEBSOCKET (2)</code>\r\n\r\n<code>COMPRESSION_NONE (0)</code><br>\r\n<code>COMPRESSION_ZLIB (1)</code><br>\r\n\r\n<code>ENCRYPTION_NONE (0)</code><br>\r\n<code>ENCRYPTION_RC4 (1)</code><br>\r\n\r\n<code>**def _\\_getitem__**(name: str) -> object</code><br>\r\n<span class=\"docs\">Returns the value of a specific setting.</span>\r\n\r\n<code>**def _\\_setitem__**(name: str, value: object) -> None</code><br>\r\n<span class=\"docs\">Changes the value of a specific setting. The value is automatically converted to the appropriate type.</span>\r\n\r\n<code>**def configure**(access_key: str, nex_version: int, client_version: int = None) -> None</code><br>\r\n<span class=\"docs\">Configures the `prudp.access_key`, `nex.version` and `nex.client_version` settings.</span>\r\n\r\n<code>**def reset**() -> None</code><br>\r\n<span class=\"docs\">Resets all fields back to their defaults.</span>\r\n\r\n<code>**def copy**() -> [Settings](#settings)</code><br>\r\n<span class=\"docs\">Returns a copy of the settings object.</span>\r\n\r\n<code>**def load**(name: str) -> None</code><br>\r\n<span class=\"docs\">Loads the settings from the given configuration file and applies them on top of the current settings. Only the settings that are defined in the file are replaced.</span>\r\n\r\n## Fields\r\nThe following fields are currently defined:\r\n\r\n<code>nex.version: int = 0</code><br>\r\n<span class=\"docs\">The version of the `nex` library.</span><br>\r\n<code>nex.client_version: int = 0</code><br>\r\n<span class=\"docs\">The client version sent to the server in `ValidateAndRequestTicketWithParam`.</span><br>\r\n<code>nex.struct_header: int = 0</code><br>\r\n<span class=\"docs\">Enables structure headers.</span><br>\r\n<code>nex.pid_size: int = 4</code><br>\r\n<span class=\"docs\">The size of a user id in bytes (`4` or `8`).</span><br>\r\n\r\n<code>prudp.access_key: str = \"\"</code><br>\r\n<span class=\"docs\">The access key of the game server.</span>\r\n\r\n<code>prudp.version: int = 2</code><br>\r\n<span class=\"docs\">The major version of the `prudp` protocol with UDP transport:<br>\r\n<span class=\"docs\">\r\n`- 0`: both client and server use only `prudp v0`<br>\r\n`- 1`: both client and server use only `prudp v1`<br>\r\n`- 2`: client uses only `prudp v1`, server supports both `v0` and `v1`.\r\n</span><br>\r\nIf the transport is different from UDP, the `lite` encoding is always used.\r\n</span><br>\r\n<code>prudp.minor_version: int = 4</code><br>\r\n<span class=\"docs\">The minor version of the `prudp` protocol. \r\nThis is only relevant for `prudp v1` and `lite`.</span>\r\n\r\n<code>prudp.transport: int = TRANSPORT_UDP</code><br>\r\n<span class=\"docs\">The underlying transport protocol for `prudp`.</span><br>\r\n<code>prudp.compression: int = COMPRESSION_NONE</code><br>\r\n<span class=\"docs\">The compression algorithm used for data packets.</span><br>\r\n<code>prudp.encryption: int = ENCRYPTION_RC4</code><br>\r\n<span class=\"docs\">The encryption algorithm used for data packets.</span>\r\n\r\n<code>prudp.resend_timeout: float = 1</code><br>\r\n<span class=\"docs\">Time after which a packet is resent if no acknowledgement is received (in seconds).</span><br>\r\n<code>prudp.resend_limit: int = 2</code><br>\r\n<span class=\"docs\">Number of retransmissions after which the connection is considered dead.</span><br>\r\n<code>prudp.ping_timeout: float = 5</code><br>\r\n<span class=\"docs\">Time after which a ping packet is sent to keep the connection alive (in seconds).</span>\r\n\r\n<code>prudp.fragment_size: int = 1300</code><br>\r\n<span class=\"docs\">The maximum size of a packet payload before it is split up into fragments.</span><br>\r\n<code>prudp.max_substream_id: int = 0</code><br>\r\n<span class=\"docs\">The maximum substream id in `prudp v1`.</span><br>\r\n\r\n<code>prudp_v0.signature_version: int = 0</code><br>\r\n<span class=\"docs\">The version of the packet signature in the `prudp v0` protocol.</span><br>\r\n<code>prudp_v0.flags_version: int = 1</code><br>\r\n<span class=\"docs\"></span>The version of the `flags` field in the `prudp v0` protocol.<br>\r\n<code>prudp_v0.checksum_version: int = 1</code><br>\r\n<span class=\"docs\">The version of the checksum algorithm in the `prudp v0` protocol.</span><br>\r\n\r\n<code>kerberos.key_size: int = 32</code><br>\r\n<span class=\"docs\">The size of the session key in bytes.</span><br>\r\n<code>kerberos.key_derivation: int = 0</code><br>\r\n<span class=\"docs\">The version of the key derivation algorithm for kerberos tickets.</span><br>\r\n<code>kerberos.ticket_version: int = 1</code><br>\r\n<span class=\"docs\">The version of the internal data in kerberos tickets.\r\n"
  },
  {
    "path": "docs/reference/nex/streams.md",
    "content": "\r\n# Module: <code>nintendo.nex.streams</code>\r\n\r\nExtends [generic memory streams](https://anynet.readthedocs.io/en/latest/reference/streams) with useful `nex` related methods.\r\n\r\n<code>**class** StreamOut([anynet.StreamOut](https://anynet.readthedocs.io/en/latest/reference/streams/#streamout))</code><br>\r\n<span class=\"docs\">An output stream that supports various `nex` structures.</span>\r\n\r\n<code>**class** StreamIn([anynet.StreamIn](https://anynet.readthedocs.io/en/latest/reference/streams/#streamin))</code><br>\r\n<span class=\"docs\">An input stream that supports various `nex` structures.</span>\r\n\r\n## StreamOut\r\n<code>**def _\\_init__**(settings: [Settings](settings.md#settings))</code><br>\r\n<span class=\"docs\">Creates a new output stream.</span>\r\n\r\n<code>**def pid**(value: int) -> None</code><br>\r\n<span class=\"docs\">Writes a user id into the stream.</span>\r\n\r\n<code>**def result**(value: [Result](common.md#result)) -> None</code><br>\r\n<span class=\"docs\">Writes a result into the stream.</span>\r\n\r\n<code>**def list**(value: list, func: Callable) -> None</code><br>\r\n<span class=\"docs\">Writes a list into the stream. For example: `stream.list([1, 2, 3], stream.u8)`.</span>\r\n\r\n<code>**def map**(value: dict, keyfunc: Callable, valuefunc: Callable) -> None</code><br>\r\n<span class=\"docs\">Writes a map into the stream. For example: `stream.map({\"a\": 1, \"b\": 2}, stream.string, stream.u8)`.</span>\r\n\r\n<code>**def string**(value: str) -> None</code><br>\r\n<span class=\"docs\">Writes an UTF-8 string into the stream. Automatically adds a null terminator.</span>\r\n\r\n<code>**def stationurl**(value: [StationURL](common.md#stationurl)) -> None</code><br>\r\n<span class=\"docs\">Writes a [StationURL](common.md#stationurl) into the stream.</span>\r\n\r\n<code>**def datetime**(value: [DateTime](common.md#datetime)) -> None</code><br>\r\n<span class=\"docs\">Writes a [DateTime](common.md#datetime) object into the stream.</span>\r\n\r\n<code>**def buffer**(value: bytes) -> None</code><br>\r\n<span class=\"docs\">Writes a buffer into the stream with a 32-bit length field.</span>\r\n\r\n<code>**def qbuffer**(value: bytes) -> None</code><br>\r\n<span class=\"docs\">Writes a buffer into the stream with a 16-bit length field.</span>\r\n\r\n<code>**def add**(value: [Structure](common.md)) -> None</code><br>\r\n<span class=\"docs\">Writes a `nex` structure into the stream.</span>\r\n\r\n<code>**def anydata**(value: object) -> None</code><br>\r\n<span class=\"docs\">Wraps a structure in a data holder and writes it into the stream.</span>\r\n\r\n<code>**def variant**(value: object) -> None</code><br>\r\n<span class=\"docs\">Writes a variant into the stream. `value` must be either `None` or an instance of `int`, `float`, `bool`, `str` or [`DateTime`](common.md#datetime).</span>\r\n\r\n## StreamIn\r\n<code>**def _\\_init__**(data: bytes, settings: [Settings](settings.md#settings))</code><br>\r\n<span class=\"docs\">Creates a new input stream.</span>\r\n\r\n<code>**def pid**() -> int</code><br>\r\n<span class=\"docs\">Reads a user id from the stream.</span>\r\n\r\n<code>**def result**() -> [Result](common.md#result)</code><br>\r\n<span class=\"docs\">Reads a result from the stream.</span>\r\n\r\n<code>**def repeat**(func: Callable, num: int) -> list</code><br>\r\n<span class=\"docs\">Extracts a fixed number of copies of a given type from the stream. For convenience, `func` may also be a subclass of [`Structure`](common.md) instead of a function. For example: `stream.repeat(stream.u8, 5)` or `stream.repeat(ResultRange, 2)`.</span>\r\n\r\n<code>**def list**(func: Callable) -> list</code><br>\r\n<span class=\"docs\">Reads a list from the stream. For convenience, `func` may also be a subclass of [`Structure`](common.md) instead of a function. For example: `stream.list(stream.u8)` or `stream.list(ResultRange)`.</span>\r\n\r\n<code>**def map**(keyfunc: Callable, valuefunc: Callable) -> dict</code><br>\r\n<span class=\"docs\">Reads a map from the stream. For convenience, `keyfunc` and `valuefunc` may also be a subclass of [`Structure`](common.md) instead of a function. For example: `stream.map(stream.string, ResultRange)`.</span>\r\n\r\n<code>**def string**() -> str</code><br>\r\n<span class=\"docs\">Reads a UTF-8 string from the stream. Automatically removes the null terminator.</span>\r\n\r\n<code>**def stationurl**() -> [StationURL](common.md#stationurl)</code><br>\r\n<span class=\"docs\">Reads a station url from the stream.</span>\r\n\r\n<code>**def datetime**() -> [DateTime](common.md#datetime)</code><br>\r\n<span class=\"docs\">Reads a [DateTime](common.md#datetime) object from the stream.</span>\r\n\r\n<code>**def buffer**() -> bytes</code><br>\r\n<span class=\"docs\">Reads a buffer from the stream with a 32-bit length field.</span>\r\n\r\n<code>**def qbuffer**() -> bytes</code><br>\r\n<span class=\"docs\">Reads a buffer from the stream with a 16-bit length field.</span>\r\n\r\n<code>**def substream**() -> [StreamIn](#streamin)</code><br>\r\n<span class=\"docs\">Reads a buffer from the stream with a 32-bit length field and returns an input stream.</span>\r\n\r\n<code>**def extract**(cls: Type[[Structure](common.md)]) -> [Structure](common.md)</code><br>\r\n<span class=\"docs\">Reads a `nex` structure from the stream.</span>\r\n\r\n<code>**def anydata**() -> object</code><br>\r\n<span class=\"docs\">Reads a data holder from the stream and returns its content, which is usually a subclass of [`Data`](common.md).</span>\r\n\r\n<code>**def variant**() -> object</code><br>\r\n<span class=\"docs\">Reads a variant from the stream.</span>\r\n"
  },
  {
    "path": "docs/reference/nex/subscriber.md",
    "content": "\n# Module: <code>nintendo.nex.subscriber</code>\n\nProvides a client and server for the `SubscriberProtocol`. This page was generated automatically from `subscriber.proto`.\n\n<code>**class** [SubscriberClient](#subscriberclient)</code><br>\n<span class=\"docs\">The client for the `SubscriberProtocol`.</span>\n\n<code>**class** [SubscriberServer](#subscriberserver)</code><br>\n<span class=\"docs\">The server for the `SubscriberProtocol`.</span>\n\n## SubscriberClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`SubscriberClient`](#subscriberclient).</span>\n\n## SubscriberServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`SubscriberServer`](#subscriberserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n"
  },
  {
    "path": "docs/reference/nex/utility.md",
    "content": "\n# Module: <code>nintendo.nex.utility</code>\n\nProvides a client and server for the `UtilityProtocol`. This page was generated automatically from `utility.proto`.\n\n<code>**class** [UtilityClient](#utilityclient)</code><br>\n<span class=\"docs\">The client for the `UtilityProtocol`.</span>\n\n<code>**class** [UtilityServer](#utilityserver)</code><br>\n<span class=\"docs\">The server for the `UtilityProtocol`.</span>\n\n<code>**class** [UniqueIdInfo](#uniqueidinfo)([Structure](common.md))</code><br>\n\n## UtilityClient\n<code>**def _\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\n<span class=\"docs\">Creates a new [`UtilityClient`](#utilityclient).</span>\n\n<code>**async def acquire_nex_unique_id**() -> int</code><br>\n<span class=\"docs\">Calls method `1` on the server.</span>\n\n<code>**async def acquire_nex_unique_id_with_password**() -> [UniqueIdInfo](#uniqueidinfo)</code><br>\n<span class=\"docs\">Calls method `2` on the server.</span>\n\n<code>**async def associate_nex_unique_id_with_my_principal_id**(info: [UniqueIdInfo](#uniqueidinfo)) -> None</code><br>\n<span class=\"docs\">Calls method `3` on the server.</span>\n\n<code>**async def associate_nex_unique_ids_with_my_principal_id**(infos: list[[UniqueIdInfo](#uniqueidinfo)]) -> None</code><br>\n<span class=\"docs\">Calls method `4` on the server.</span>\n\n<code>**async def get_associated_nex_unique_id_with_my_principal_id**() -> [UniqueIdInfo](#uniqueidinfo)</code><br>\n<span class=\"docs\">Calls method `5` on the server.</span>\n\n<code>**async def get_associated_nex_unique_ids_with_my_principal_id**() -> list[[UniqueIdInfo](#uniqueidinfo)]</code><br>\n<span class=\"docs\">Calls method `6` on the server.</span>\n\n<code>**async def get_integer_settings**(index: int) -> dict[int, int]</code><br>\n<span class=\"docs\">Calls method `7` on the server.</span>\n\n<code>**async def get_string_settings**(index: int) -> dict[int, str]</code><br>\n<span class=\"docs\">Calls method `8` on the server.</span>\n\n## UtilityServer\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new [`UtilityServer`](#utilityserver).</span>\n\n<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\n<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\n\n<code>**async def acquire_nex_unique_id**(client: [RMCClient](rmc.md#rmcclient)) -> int</code><br>\n<span class=\"docs\">Handler for method `1`. This method should be overridden by a subclass.</span>\n\n<code>**async def acquire_nex_unique_id_with_password**(client: [RMCClient](rmc.md#rmcclient)) -> [UniqueIdInfo](#uniqueidinfo)</code><br>\n<span class=\"docs\">Handler for method `2`. This method should be overridden by a subclass.</span>\n\n<code>**async def associate_nex_unique_id_with_my_principal_id**(client: [RMCClient](rmc.md#rmcclient), info: [UniqueIdInfo](#uniqueidinfo)) -> None</code><br>\n<span class=\"docs\">Handler for method `3`. This method should be overridden by a subclass.</span>\n\n<code>**async def associate_nex_unique_ids_with_my_principal_id**(client: [RMCClient](rmc.md#rmcclient), infos: list[[UniqueIdInfo](#uniqueidinfo)]) -> None</code><br>\n<span class=\"docs\">Handler for method `4`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_associated_nex_unique_id_with_my_principal_id**(client: [RMCClient](rmc.md#rmcclient)) -> [UniqueIdInfo](#uniqueidinfo)</code><br>\n<span class=\"docs\">Handler for method `5`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_associated_nex_unique_ids_with_my_principal_id**(client: [RMCClient](rmc.md#rmcclient)) -> list[[UniqueIdInfo](#uniqueidinfo)]</code><br>\n<span class=\"docs\">Handler for method `6`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_integer_settings**(client: [RMCClient](rmc.md#rmcclient), index: int) -> dict[int, int]</code><br>\n<span class=\"docs\">Handler for method `7`. This method should be overridden by a subclass.</span>\n\n<code>**async def get_string_settings**(client: [RMCClient](rmc.md#rmcclient), index: int) -> dict[int, str]</code><br>\n<span class=\"docs\">Handler for method `8`. This method should be overridden by a subclass.</span>\n\n## UniqueIdInfo\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new `UniqueIdInfo` instance. Required fields must be filled in manually.</span>\n\nThe following fields are defined in this class:<br>\n<span class=\"docs\">\n<code>unique_id: int = 0</code><br>\n<code>password: int = 0</code><br>\n</span><br>\n\n"
  },
  {
    "path": "docs/reference/nnas.md",
    "content": "\r\n# Module: <code>nintendo.nnas</code>\r\n\r\nProvides a client for the 3DS/Wii U [account server](https://github.com/kinnay/nintendo/wiki/Account-Server).\r\n\r\n<code>**class** NNASError(Exception)</code><br>\r\n<span class=\"docs\">Raised when the server returns an error code.</span>\r\n\r\n<code>**class** [NNASClient](#nnasclient)</code><br>\r\n<span class=\"docs\">The account server client.</span>\r\n\r\n<code>**def calc_password_hash**(pid: int, password: str) -> str</code>\r\n<span class=\"docs\">Calculates the password hash for hash-based authentication and returns the hexdigest.</span>\r\n\r\n## NNASClient\r\n<code>**def _\\_init__**()</code><br>\r\n<span class=\"docs\">Creates a new account server client.</span>\r\n\r\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\r\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo CA - G3`, and `Wii U Common Prod 1` is used as the client certificate.</span>\r\n\r\n<code>**def set_url**(url: str) -> None</code><br>\r\n<span class=\"docs\">Changes the server to which requests are sent. The default is `account.nintendo.net`.</span>\r\n\r\n<code>**def set_client_id**(client_id: str) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-Client-ID` header. The default is `\"a2efa818a34fa16b8afbc8a74eba3eda\"`.</span>\r\n\r\n<code>**def set_client_secret**(client_secret: str) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-Client-Secret` header. The default is `\"c91cdb5658bd4954ade78533a339cf9a\"`.</span>\r\n\r\n<code>**def set_platform_id**(platform_id: int) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-Platform-ID` header. The default is `1` (Wii U).</span>\r\n\r\n<code>**def set_device_type**(device_type: int) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-Device-Type` header. The default is `2` (retail).</span>\r\n\r\n<code>**def set_fpd_version**(version: int) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-FPD-Version` header. The default is `0`.</span>\r\n\r\n<code>**def set_environment**(environment: str) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-Environment` header. The default is `\"L1\"` (production).</span>\r\n\r\n<code>**def set_device**(device_id: int, serial_number: str, system_version: int, cert: str = None) -> None</code><br>\r\n<span class=\"docs\">Changes the `X-Nintendo-Device-ID`, `X-Nintendo-Serial-Number`, `X-Nintendo-System-Version` and `X-Nintendo-Device-Cert` headers. By default, the system version is set to `0x260` and the other headers are omitted.</span>\r\n\r\n<code>**def set_locale**(region: int, country: str, language: str) -> None</code><br>\r\n<span class=\"docs\">Changes the `X-Nintendo-Region`, `X-Nintendo-Country` and `Accept-Language` headers. By default, the region is `4` (Europe), the country is `\"NL\"` (Netherlands) and the language is `\"en\"` (English).</span>\r\n\r\n<code>**def set_title**(title_id: int, title_version: int) -> None</code><br>\r\n<span class=\"docs\">Changes the `X-Nintendo-Title-ID` and `X-Nintendo-Application-Version` headers. The `X-Nintendo-Unique-ID` header is also derived from the title id. By default, these headers are omitted.</span>\r\n\r\n<code>**async def login**(username: str, password: str, password_type: str = None) -> [OAuth20](#oauth20)</code><br>\r\n<span class=\"docs\">Logs in on the account server. This method must be called prior to any method that accesses your account data.</span>\r\n\r\n<code>**async def get_nex_token**(access_token: str, game_server_id: int) -> [NexToken](#nextoken)</code><br>\r\n<span class=\"docs\">Requests a `nex` token for the given game server.</span>\r\n\r\n<code>**async def get_service_token**(access_token: str, client_id: str) -> str</code><br>\r\n<span class=\"docs\">Requests an independent service token for the given client id.</span>\r\n\r\n<code>**async def get_profile**(access_token: str) -> [Profile](#profile)</code><br>\r\n<span class=\"docs\">Requests your profile.</span>\r\n\r\n<code>**async def get_miis**(pids: list[int]) -> list[[Mii](#mii)]</code><br>\r\n<span class=\"docs\">Requests the miis for the given user ids.</span>\r\n\r\n<code>**async def get_pids**(nnids: list[str]) -> dict[str, int]</code><br>\r\n<span class=\"docs\">Requests the user ids for the given Nintendo Network IDs.</span>\r\n\r\n<code>**async def get_nnids**(pids: list[int]) -> dict[int, str]</code><br>\r\n<span class=\"docs\">Requests the Nintendo Network IDs for the given user ids.</span>\r\n\r\n<code>**async def get_pid**(nnid: str) -> int</code><br>\r\n<span class=\"docs\">Requests the user id for the given Nintendo Network ID.</span>\r\n\r\n<code>**async def get_nnid**(pid: int) -> str</code><br>\r\n<span class=\"docs\">Requests the Nintendo Network ID for the given user id.</span>\r\n\r\n## Account\r\n`domain: str`<br>\r\n`type: str`<br>\r\n`username: str`\r\n\r\n## DeviceAttribute\r\n`created_date: datetime.datetime`<br>\r\n`name: str`<br>\r\n`value: str`<br>\r\n\r\n## Email\r\n`id: int`<br>\r\n`address: str`<br>\r\n`primary: bool`<br>\r\n`parent: bool`<br>\r\n`reachable: bool`<br>\r\n`type: str`<br>\r\n`validated: bool`<br>\r\n`validated_date: datetime.datetime`<br>\r\n\r\n## Mii\r\n`data: bytes`<br>\r\n`id: int`<br>\r\n`name: str`<br>\r\n`images: list[MiiImage]`<br>\r\n`primary: bool`<br>\r\n`pid: int`<br>\r\n`nnid: str`\r\n\r\n## MiiImage\r\n`id: int`<br>\r\n`type: str`<br>\r\n`url: str`<br>\r\n`cached_url: str`<br>\r\n\r\n## NexToken\r\n`host: str`<br>\r\n`port: int`<br>\r\n`pid: int`<br>\r\n`password: str`<br>\r\n`token: str`\r\n\r\n## OAuth20\r\n`token: str`<br>\r\n`refresh_token: str`<br>\r\n`expires_in: int`\r\n\r\n## Profile\r\n<code>accounts: list[[Account](#account)]</code><br>\r\n`active_flag: bool`<br>\r\n`birth_date: datetime.datetime`<br>\r\n`country: str`<br>\r\n`create_date: datetime.datetime`<br>\r\n<code>device_attributes: list[[DeviceAttribute](#deviceattribute)]</code><br>\r\n`forgot_pw_email_sent: datetime.datetime`<br>\r\n`gender: str`<br>\r\n`language: str`<br>\r\n`updated: datetime.datetime`<br>\r\n`marketing_flag: bool`<br>\r\n`off_device_flag: bool`<br>\r\n`pid: int`<br>\r\n<code>email: [Email](#email)</code><br>\r\n<code>mii: [ProfileMii](#profilemii)</code><br>\r\n`region: int`<br>\r\n`temporary_password_expiration: datetime.datetime`<br>\r\n`tz_name: str`<br>\r\n`nnid: str`<br>\r\n`utc_offset: int`<br>\r\n\r\n## ProfileMii\r\n`id: int`<br>\r\n`name: str`<br>\r\n`data: bytes`<br>\r\n`primary: bool`<br>\r\n`status: str`<br>\r\n`hash: str`<br>\r\n<code>images: list[[MiiImage](#miiimage)]</code><br>\r\n"
  },
  {
    "path": "docs/reference/switch/aauth.md",
    "content": "\r\n# Module: <code>nintendo.switch.aauth</code>\r\nProvides a client for the [application authentication server](https://github.com/kinnay/nintendo/wiki/AAuth-Server).\r\n\r\n<code>**class** [AAuthError](#aautherror)(Exception)</code><br>\r\n<span class=\"docs\">Raised when the `aauth` server returns an error code.</span>\r\n\r\n<code>**class** [AAuthClient](#aauthclient)</code><br>\r\n<span class=\"docs\">The `aauth` client.</span>\r\n\r\n## AAuthError\r\nThis exception is raised when the `aauth` server returns an error code. The following constants are defined in this class:\r\n\r\n`DEVICE_TOKEN_EXPIRED: int = 103`<br>\r\n`ROMID_BANNED: int = 105`<br>\r\n`UNAUTHORIZED_APPLICATION: int = 106`<br>\r\n`SERVICE_CLOSED: int = 109`<br>\r\n`APPLICATION_UPDATE_REQUIRED: int = 111`<br>\r\n`INTERNAL_SERVER_ERROR: int = 112`<br>\r\n`GENERIC: int = 118`<br>\r\n`REGION_MISMATCH: int = 121`\r\n\r\nThe error can be inspected using the following attributes:\r\n\r\n<code>response: [HTTPResponse](https://anynet.readthedocs.io/en/latest/reference/http/#httpresponse)</code><br>\r\n`code: int`<br>\r\n`message: str`\r\n\r\n## AAuthClient\r\n<code>**def _\\_init__**()</code><br>\r\n<span class=\"docs\">Creates a new `aauth` client.</span>\r\n\r\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\r\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\r\n\r\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\r\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo CA - G3` or `Nintendo Root CA - G4`, depending on the specified system version.</span>\r\n\r\n<code>**def set_certificate**(cert: [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscertificate), key: [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls/#tlsprivatekey)) -> None</code>\r\n<span class=\"docs\">Changes the client certificate of the current TLS context. When `aauth.hac.lp1.ndas.srv.nintendo.net` is used, which is the case on system version 20.0.0 and later, the server rejects all requests without a valid client certificate.</span>\r\n\r\n<code>**def set_host**(url: str) -> None</code><br>\r\n<span class=\"docs\">Changes the server to which the HTTP requests are sent. The default is `aauth-lp1.ndas.srv.nintendo.net` or `aauth.hac.lp1.ndas.srv.nintendo.net`, depending on the specified system version.</span>\r\n\r\n<code>**def set_power_state**(state: str) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-PowerState` header. The default is `\"FA\"`.\r\n\r\n<code>**def set_system_version**(version: int) -> None</code></br>\r\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` indicates system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\r\n\r\n<code>**async def get_time**() -> tuple[int, str]</code><br>\r\n<span class=\"docs\">Requests the current server time with `/v1/time`. Returns a tuple that contains the current server time and your public IP address.</span>\r\n\r\n<code>**async def challenge**(device_token: str) -> dict</code><br>\r\n<span class=\"docs\">Requests a challenge from the `aauth` server. The device token can be obtained from the [`dauth server`](dauth.md). The challenge is used for gamecard authentication.</span>\r\n\r\n<code>**async def auth_system**(title_id: int, title_version: int, device_token: str) -> dict</code><br>\r\n<span class=\"docs\">Requests an application token from the `aauth` server for a system title. The device token can be obtained from the [`dauth server`](dauth.md).</span>\r\n\r\n<code>**async def auth_digital**(title_id: int, title_version: int, device_token: str, cert: bytes | str) -> dict</code><br>\r\n<span class=\"docs\">Requests an application token from the `aauth` server for a digital title. The device token can be obtained from the [`dauth server`](dauth.md). Prior to system version `15.0.0`, the `cert` parameter must contain the raw ticket (which can be dumped with nxdumptool). In system version `15.0.0` and later, it must contain a contents authorization token instead (which can be obtained from the [`dragons server`](dragons.md)).</span>\r\n\r\n<code>**async def auth_gamecard**(title_id: int, title_version: int, device_token: str, cert: bytes, gvt: bytes, challenge: str = None, challenge_src: str = None) -> dict</code><br>\r\n<span class=\"docs\">Requests an application token from the `aauth` server for a gamecard. The device token can be obtained from the [`dauth server`](dauth.md). The certificate can be obtained with nxdumptool. The `gvt` parameter must contain the challenge response. Unless you have the [Lotus](https://switchbrew.org/wiki/Lotus3) encryption keys, the challenge cannot be solved offline, but EpicUsername12 made [a tool](https://github.com/EpicUsername12/nx-netauth-link) that solves the challenge on a real Switch.<br><br>\r\nThe `challenge` and `challenge_src` parameters are required on system version 19.0.1 and later.</span>\r\n\r\n<code>**async def auth_nocert**(title_id: int, title_version: int, device_token): str -> dict</code><br>\r\n<span class=\"docs\">Requests an application token from the `aauth` server for a title for which no ticket was found on the Switch.<br><br><b><span style=\"color: red\">WARNING:</span></b> Do not use `auth_nocert` on a production server, because it will immediately ban your Switch.</span>\r\n"
  },
  {
    "path": "docs/reference/switch/atumn.md",
    "content": "\n# Module: <code>nintendo.switch.atumn</code>\nProvides a client for the [system update content server](https://github.com/kinnay/nintendo/wiki/Atumn-Server).\n\n<code>**class** [AtumnClient](#atumnclient)</code><br>\n<span class=\"docs\">The `atumn` client.</span>\n\n## AtumnClient\n<code>**def _\\_init__**(device_id: int)</code><br>\n<span class=\"docs\">Creates a new atumn client. The device id can be obtained from [PRODINFO](../switch.md).</span>\n\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\n\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo Class 2 CA - G3` and no client certificate is used.</span>\n\n<code>**def set_certificate**(cert: [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscertificate), key: [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls/#tlsprivatekey)) -> None</code>\n<span class=\"docs\">Changes the client certificate of the current TLS context. The server rejects all requests without a valid client certificate.</span>\n\n<code>**def set_host**(host: str) -> None</code><br>\n<span class=\"docs\">Changes the server to which the HTTP requests are sent. The default is: `atumn.hac.lp1.d4c.nintendo.net`.\n</span>\n\n<code>**def set_system_version**(version: int) -> None</code></br>\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` indicates system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\n\n<code>**async def download_content_metadata**(title_id: int, title_version: int, *, system_update: bool = False) -> bytes</code><br>\n<span class=\"docs\">Downloads the metadata NCA for the given title id and version. The `system_update` parameter should only be set to `True` for the system update title (`0100000000000816`).</span>\n\n<code>**async def download_content**(content_id: str) -> bytes</code><br>\n<span class=\"docs\">Downloads the NCA for the given content id.</span>\n"
  },
  {
    "path": "docs/reference/switch/baas.md",
    "content": "\r\n# Module: <code>nintendo.switch.baas</code>\r\nProvides a client for the [BaaS server](https://github.com/kinnay/nintendo/wiki/BAAS-Server).\r\n\r\n<code>**class** [PresenceState](#presencestate)</code><br>\r\n<span class=\"docs\">Provides predefined constants for the presence state.</span>\r\n\r\n<code>**class** [BAASError](#baaserror)(Exception)</code><br>\r\n<span class=\"docs\">Raised when the `BaaS` server returns an error code.</span>\r\n\r\n<code>**class** [BAASClient](#baasclient)</code><br>\r\n<span class=\"docs\">The `BaaS` client.</span>\r\n\r\n## PresenceState\r\n`INACTIVE: str = \"INACTIVE\"`<br>\r\n`ONLINE: str = \"ONLINE\"`<br>\r\n`PLAYING: str = \"PLAYING\"`\r\n\r\n## BAASError\r\n<code>response: [HTTPResponse](https://anynet.readthedocs.io/en/latest/reference/http/#httpresponse)</code><br>\r\n`type: str`<br>\r\n`name: str`<br>\r\n`title: str`<br>\r\n`detail: str`<br>\r\n`status: int`<br>\r\n`instance: str`\r\n\r\n## BAASClient\r\n<code>**def _\\_init__**()</code><br>\r\n<span class=\"docs\">Creates a new `BaaS` client.</span>\r\n\r\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\r\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\r\n\r\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\r\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with default authorities.</span>\r\n\r\n<code>**def set_certificate**(cert: [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscertificate), key: [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls/#tlsprivatekey)) -> None</code>\r\n<span class=\"docs\">Changes the client certificate of the current TLS context. This is required on system version 21.0.0 and later, when `m-lp1.baas.nintendo.com` is contacted.</span>\r\n\r\n<code>**def set_host**(host: str) -> None</code><br>\r\n<span class=\"docs\">Changes the server to which the HTTP requests are sent. By default, requests are sent to `e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com` or `m-lp1.baas.nintendo.com`, depending on the system version.\r\n\r\n<code>**def set_power_state**(state: str) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-PowerState` header. The default is `\"FA\"`.\r\n\r\n<code>**def set_system_version**(version: int) -> None</code></br>\r\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` indicates system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\r\n\r\n<code>**async def authenticate**(device_token: str, penne_id: str = None) -> dict</code><br>\r\n<span class=\"docs\">Requests an authorization token with `/1.0.0/application/token`. This method must be called before any other requests can be made. The device token can be obtained from the [`dauth server`](dauth.md).<br><br>\r\nThe `penneId` parameter was added in system version 19.0.0.\r\n</span>\r\n\r\n<code>**async def login**(id: int, password: str, access_token: str, app_token: str = None, na_country: str = None, skip_verification: bool = False, is_persistent: bool = True) -> dict</code><br>\r\n<span class=\"docs\">Logs in with the given user id and password, using `/1.0.0/login`. If an app token is provided, the server returns an id token that can be used to log in on a game server. App tokens can be obtained from the [`aauth server`](aauth.md). If `skip_verification` is `True` the client asks the server to skip NSO verification.<br><br>\r\nThe `na_country` parameter is required in system version 18.0.0 and later. The `is_persistent` parameter was added in system version 20.0.0.</span>\r\n\r\n<code>**async def register**(access_token: str) -> dict</code><br>\r\n<span class=\"docs\">Registers a new device account on the `BaaS` server.</span>\r\n\r\n<code>**async def update_presence**(user_id: int, device_account_id: int, access_token: str, state: str, title_id: int, presence_group_id: int, app_fields: dict[str, str] = {}, acd_index: int = 0) -> dict</code><br>\r\n<span class=\"docs\">Updates your presence state by patching `/1.0.0/users/<id>/device_accounts/<id>`.</span>\r\n\r\n<code>**async def get_friends**(user_id: int, access_token: str, count: int = 300)</code><br>\r\n<span class=\"docs\">Requests your friend list with `/2.0.0/users/<id>/friends`.</span>\r\n"
  },
  {
    "path": "docs/reference/switch/dauth.md",
    "content": "\r\n# Module: <code>nintendo.switch.dauth</code>\r\nProvides a client for the [device authentication server](https://github.com/kinnay/nintendo/wiki/DAuth-Server).\r\n\r\n<code>**class** [DAuthError](#dautherror)(Exception)</code><br>\r\n<span class=\"docs\">Raised when the `dauth` server returns an error code.</span>\r\n\r\n<code>**class** [DAuthClient](#dauthclient)</code><br>\r\n<span class=\"docs\">The `dauth` client.</span>\r\n\r\n<code>**class** [DAuthCache](#dauthcache)</code><br>\r\n<span class=\"docs\">A cache for the dauth client that remembers preloaded tokens.</span>\r\n\r\n## Global Constants\r\n`CLIENT_ID_SCSI: int = 0x146C8AC7B8A0DB52`<br>\r\n`CLIENT_ID_ER: int = 0x16E96F76850156D1`<br>\r\n`CLIENT_ID_ATUM: int = 0x3117B250CAB38F45`<br>\r\n`CLIENT_ID_ESHOP: int = 0x41F4A6491028E3C4`<br>\r\n`CLIENT_ID_BCAT: int = 0x67BF9945B45248C6`<br>\r\n`CLIENT_ID_SATA: int = 0x6AC5A6873FE5F68C`<br>\r\n`CLIENT_ID_ACCOUNT_APPLET: int = 0x75FE236362FF5F8B`<br>\r\n`CLIENT_ID_ACCOUNT: int = 0x81333C548B2E876D`<br>\r\n`CLIENT_ID_NPNS: int = 0x83B72B05DC3278D7`<br>\r\n`CLIENT_ID_BAAS: int = 0x8F849B5D34778D8E`<br>\r\n`CLIENT_ID_BEACH: int = 0x93AF0ACB26258DE9`<br>\r\n`CLIENT_ID_SPROFILE: int = 0xBAD8156F44AC935A`<br>\r\n`CLIENT_ID_DRAGONS: int = 0xD5B6CAC2C1514C56`<br>\r\n`CLIENT_ID_SCSI_POLICY: int = 0xD98185ACB55994B4`<br>\r\n`CLIENT_ID_PCTL: int = 0xDC656EA03B63CF68`<br>\r\n`CLIENT_ID_PREPO: int = 0xDF51C436BC01C437`<br>\r\n`CLIENT_ID_PENNE: int = 0xE58171FE439390CE`\r\n\r\n## DAuthError\r\nThis exception is raised when the `dauth` server returns an error code. The following constants are defined in this class:\r\n\r\n`UNAUTHORIZED_DEVICE: int = 4`<br>\r\n`SYSTEM_UPDATE_REQUIRED: int = 7`<br>\r\n`BANNED_DEVICE: int = 8`<br>\r\n`INTERNAL_SERVER_ERROR: int = 9`<br>\r\n`GENERIC: int = 14`<br>\r\n`CHALLENGE_EXPIRED: int = 15`<br>\r\n`WRONG_MAC: int = 16`<br>\r\n`BROKEN_DEVICE: int = 17`\r\n\r\nThe error can be inspected using the following attributes:\r\n\r\n<code>response: [HTTPResponse](https://anynet.readthedocs.io/en/latest/reference/http/#httpresponse)</code><br>\r\n`code: int`<br>\r\n`message: str`\r\n\r\n## DAuthClient\r\n<b><span style=\"color: red\">NOTE:</span></b> On system version 20.0.0 and later, it is recommended to request tokens through a [`DAuthCache`](#dauthcache) instead of using the `DAuthClient` directly. This is because the Switch requests multiple tokens at once on those system versions, and the `DAuthCache` makes it easier to mimic that behavior.</span>\r\n\r\n<code>**def _\\_init__**(keys: dict[str, bytes])</code><br>\r\n<span class=\"docs\">Creates a new `dauth` client with the given keys. The `dauth` client requires the `aes_kek_generation_source` and `master_key_XX` keys.</span>\r\n\r\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\r\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\r\n\r\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\r\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo CA - G3` and no client certificate is used.</span>\r\n\r\n<code>**def set_certificate**(cert: [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscertificate), key: [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls/#tlsprivatekey)) -> None</code>\r\n<span class=\"docs\">Changes the client certificate of the current TLS context. The server rejects all requests without a valid client certificate.</span>\r\n\r\n<code>**def set_power_state**(state: str) -> None</code><br>\r\n<span class=\"docs\">Changes the content of the `X-Nintendo-PowerState` header. The default is `\"FA\"`.</span>\r\n\r\n<code>**def set_platform_region**(region: int) -> None</code><br>\r\n<span class=\"docs\">Changes the platform region. This affects the `ist` parameter in the device authentication request. The default is `1`.</span>\r\n\r\n<code>**def set_host**(host: str) -> None</code><br>\r\n<span class=\"docs\">Changes the server to which the HTTP requests are sent. The default is `dauth-lp1.ndas.srv.nintendo.net`.\r\n\r\n<code>**def set_system_version**(version: int) -> None</code></br>\r\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` is system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\r\n\r\n<code>**async def challenge**() -> dict</code><br>\r\n<span class=\"docs\">Requests a challenge from the `dauth` server.</span>\r\n\r\n<code>**async def device_token**(client_id: int) -> dict</code><br>\r\n<span class=\"docs\">Requests a device token from the `dauth` server. The challenge is done automatically. This method is available up to system version 19.0.1.<br><br>\r\n\r\n<code>**async def edge_token**(client_id: int, vendor_id: str = \"akamai\") -> dict</code><br>\r\n<span class=\"docs\">Requests an edge token from the `dauth` server. The challenge is done automatically. This method is available up to system version 19.0.1.<br><br>\r\n\r\n<code>**async def device_tokens**(client_ids: list[int]) -> dict</code><br>\r\n<span class=\"docs\">Requests a multiple device tokens from the `dauth` server. This method is available on system version 20.0.0 and later.</span>\r\n\r\n<code>**async def edge_tokens**(token_requests: list[tuple[int, str]]) -> dict</code><br>\r\n<span class=\"docs\">Requests a multiple edge tokens from the `dauth` server. The `token_requests` parameter should contain a list of `(client_id, vendor_id)` tuples. This method is available on system version 20.0.0 and later.</span>\r\n\r\n<code>**async def preload_device_tokens**() -> dict</code><br>\r\n<span class=\"docs\">Requests all device tokens that are preloaded by the Switch at once. This method is available on system version 20.0.0 and later.</span>\r\n\r\n<code>**async def preload_edge_tokens**() -> dict</code><br>\r\n<span class=\"docs\">Requests all edge tokens that are preloaded by the Switch at once. This method is available on system version 20.0.0 and later.</span>\r\n\r\n## DAuthCache\r\n<code>**def _\\_init__**(client: [DAuthClient](#dauthclient), expiration=None)</code><br>\r\n<span class=\"docs\">Creates a new dauth cache for the given client. If `expiration` is provided, tokens are discarded after the given number of seconds. Otherwise, the `expires_in` field that is returned by the server is used.</span>\r\n\r\n<code>**async def device_token**(client_id: int) -> dict</code><br>\r\n<span class=\"docs\">Returns a device token from the cache or requests it from the dauth server if it is not present in the cache.</span>\r\n\r\n<code>**async def edge_token**(client_id: int, vendor_id: str = \"akamai\") -> dict</code><br>\r\n<span class=\"docs\">Returns an edge token from the cache or requests it from the dauth server if it is not present in the cache.</span>\r\n"
  },
  {
    "path": "docs/reference/switch/dragons.md",
    "content": "\n# Module: <code>nintendo.switch.dragons</code>\nProvides a client for the [dragons servers](https://github.com/kinnay/nintendo/wiki/Dragons-Servers).\n\n<code>**class** [DragonsError](#dragonserror)(Exception)</code><br>\n<span class=\"docs\">Raised when the dragons server returns an error code.</span>\n\n<code>**class** [DragonsClient](#dragonsclient)</code><br>\n<span class=\"docs\">The dragons client.</span>\n\n## DragonsError\n<code>response: [HTTPResponse](https://anynet.readthedocs.io/en/latest/reference/http/#httpresponse)</code><br>\n`type: str`<br>\n`name: str`<br>\n`title: str`<br>\n`detail: str`<br>\n`status: int`<br>\n`invalid_params: list | None`\n\nIf present, the `invalid_params` field contains a list of dictionaries, each of which provides two keys: `name` and `reason`.\n\n## DragonsClient\n<code>**def _\\_init__**(device_id: int = None)</code><br>\n<span class=\"docs\">Creates a new dragons client. The device id is required for all methods except for `contents_authorization_token_for_aauth`.</span>\n\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\n\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo Class 2 CA - G3` and no client certificate is used.</span>\n\n<code>**def set_certificate**(cert: [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscertificate), key: [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls/#tlsprivatekey)) -> None</code>\n<span class=\"docs\">Changes the client certificate of the current TLS context. The server rejects all requests without a valid client certificate.</span>\n\n<code>**def set_hosts**(dragons: str, dragonst: str, tigers: str) -> None</code><br>\n<span class=\"docs\">Changes the servers to which the HTTP requests are sent. The defaults are:<br>\n* `dragons.hac.lp1.dragons.nintendo.net`<br>\n* `dragonst.hac.lp1.dragons.nintendo.net`<br>\n* `tigers.hac.lp1.dragons.nintendo.net`\n</span>\n\n<code>**def set_system_version**(version: int) -> None</code></br>\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` indicates system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\n\n<code>**async def publish_device_linked_elicenses**(device_token: str) -> dict</code><br>\n<span class=\"docs\">Requests all elicenses that are linked to the given device. The device token can be obtained from the [`dauth server`](dauth.md).</span>\n\n<code>**async def exercise_elicense**(device_token: str, elicense_ids: list[str], account_ids: list[int], current_account_id: int) -> None</code><br>\n<span class=\"docs\">Calls `/v1/elicenses/exercise` with the given parameters.</span>\n\n<code>**async def contents_authorization_token_for_aauth**(device_token: str, elicense_id: str, na_id: int, title_id: int) -> dict</code><br>\n<span class=\"docs\">Requests a contents authorization token for [aauth](aauth.md). The device token can be obtained from the [`dauth server`](dauth.md).</span>\n"
  },
  {
    "path": "docs/reference/switch/five.md",
    "content": "\n# Module: <code>nintendo.switch.five</code>\nProvides a client for the [online play invitation server](https://github.com/kinnay/nintendo/wiki/Online-Play-Invitation-Server).\n\n<code>**class** [FiveError](#fiveerror)(Exception)</code><br>\n<span class=\"docs\">Raised when the server returns an error code.</span>\n\n<code>**class** [FiveClient](#fiveclient)</code><br>\n<span class=\"docs\">The client.</span>\n\n## FiveError\nThis exception is raised when the server returns an error code. The following constants are defined in this class:\n\n`INVALID_PARAMETER: int = 2`<br>\n`INVALID_REQUEST_URI: int = 3`<br>\n`UNAUTHORIZED: int = 6`<br>\n`RESOURCE_NOT_FOUND: int = 10`<br>\n`APPLICATION_DATA_TOO_LARGE: int = 11`\n\nThe error can be inspected using the following attributes:\n\n<code>response: [HTTPResponse](https://anynet.readthedocs.io/en/latest/reference/http/#httpresponse)</code><br>\n`code: int`<br>\n`message: str`\n\n## FiveClient\n<code>**def _\\_init__**()</code><br>\n<span class=\"docs\">Creates a new online play invitation client.</span>\n\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\n\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo CA - G3`.</span>\n\n<code>**def set_host**(url: str) -> None</code><br>\n<span class=\"docs\">Changes the server to which the HTTP requests are sent. The default is `app.lp1.five.nintendo.net`.\n\n<code>**def set_system_version**(version: int) -> None</code></br>\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` indicates system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\n\n<code>**async def get_unread_invitation_count**(access_token: str, user_id: int) -> int</code><br>\n<span class=\"docs\">Requests the number of unread invitations with `/v1/users/<id>/invitations/inbox?fields=count&read=false`.</span>\n\n<code>**async def get_inbox**(access_token: str, user_id: int) -> dict</code><br>\n<span class=\"docs\">Requests the list of received online play invitations.</span>\n\n<code>**async def get_invitation_group**(access_token: str, invitation_group_id: int) -> dict</code><br>\n<span class=\"docs\">Requests details about a specific invitation group.</span>\n\n<code>**async def mark_as_read**(access_token: str, ids: list[int]) -> None</code><br>\n<span class=\"docs\">Marks the given list of invitations as read.</span>\n\n<code>**async def mark_all_as_read**(access_token: str, user_id: int) -> None</code><br>\n<span class=\"docs\">Marks all received invitations as read.</span>\n\n<code>**async def send_invitation**(access_token: str, receivers: list[int], application_id: int, application_group_id: int, application_data: bytes, messages: dict[str, str], application_id_match: bool = False, acd_index: int = 0) -> dict</code><br>\n<span class=\"docs\">Sends an online play invitation to at most 16 users. The application group id is usually the same as the application id (title id). The application data is game-specific and may contain at most 1024 bytes.</span>\n"
  },
  {
    "path": "docs/reference/switch/sun.md",
    "content": "\n# Module: <code>nintendo.switch.sun</code>\nProvides a client for the [system update meta server](https://github.com/kinnay/nintendo/wiki/Sun-Server).\n\n<code>**class** [SunError](#sunerror)(Exception)</code><br>\n<span class=\"docs\">Raised when the `sun` server returns an error code.</span>\n\n<code>**class** [SunClient](#sunclient)</code><br>\n<span class=\"docs\">The `sun` client.</span>\n\n## SunError\n<code>response: [HTTPResponse](https://anynet.readthedocs.io/en/latest/reference/http/#httpresponse)</code><br>\n`code: str`<br>\n`message: str`\n\n## SunClient\n<code>**def _\\_init__**(device_id: int)</code><br>\n<span class=\"docs\">Creates a new sun client. The device id can be obtained from [PRODINFO](../switch.md).</span>\n\n<code>**def set_request_callback**(callback: Callable) -> None</code><br>\n<span class=\"docs\">By default, requests are performed with [`http.request`](https://anynet.readthedocs.io/en/latest/reference/http). This method lets you provide a custom callback instead.</span>\n\n<code>**def set_context**(context: [TLSContext](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscontext)) -> None</code><br>\n<span class=\"docs\">Changes the TLS context. By default, the server certificate is verified with `Nintendo Class 2 CA - G3` and no client certificate is used.</span>\n\n<code>**def set_certificate**(cert: [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls/#tlscertificate), key: [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls/#tlsprivatekey)) -> None</code>\n<span class=\"docs\">Changes the client certificate of the current TLS context. The server rejects all requests without a valid client certificate.</span>\n\n<code>**def set_host**(host: str) -> None</code><br>\n<span class=\"docs\">Changes the server to which the HTTP requests are sent. The default is: `sun.hac.lp1.d4c.nintendo.net`.\n</span>\n\n<code>**def set_system_version**(version: int) -> None</code></br>\n<span class=\"docs\">Changes the system version that is emulated by the client. The system version should be given as a decimal integer. For example, `1002` indicates system version `10.0.2`. All system versions from `9.0.0` up to `22.1.0` are supported.</span>\n\n<code>**async def system_update_meta**() -> dict</code><br>\n<span class=\"docs\">Requests the latest system update metadata.</span>\n"
  },
  {
    "path": "docs/reference/switch.md",
    "content": "\r\n# Module: <code>nintendo.switch</code>\r\n\r\nProvides useful functions and classes related to Nintendo Switch.\r\n\r\n<code>**def load_keys**(filename: str) -> dict[str, bytes]</code><br>\r\n<span class=\"docs\">Loads encryption keys from a file such as `prod.keys`.</span>\r\n\r\n<code>**class** [ProdInfo](#prodinfo)</code><br>\r\n<span class=\"docs\">Reads a decrypted `PRODINFO` file.</span>\r\n\r\n## ProdInfo\r\n<code>**def _\\_init__**(keys: dict[str, bytes], filename: str)</code><br>\r\n<span class=\"docs\">Creates a new [ProdInfo](#prodinfo) object from the given file. The key set should contain at least `ssl_rsa_kek`.</span>\r\n\r\n<code>**def get_device_id**() -> int</code><br>\r\n<span class=\"docs\">Extracts the device id.</span>\r\n\r\n<code>**def get_tls_cert**() -> [TLSCertificate](https://anynet.readthedocs.io/en/latest/reference/tls#tlscertificate)</code><br>\r\n<span class=\"docs\">Extracts the device certificate.</span>\r\n\r\n<code>**def get_tls_key**() -> [TLSPrivateKey](https://anynet.readthedocs.io/en/latest/reference/tls#tlsprivatekey)</code><br>\r\n<span class=\"docs\">Extract the private key that belongs to the device certificate.</span>\r\n"
  },
  {
    "path": "docs/style.css",
    "content": "\r\n.docs {\r\n\tmargin-left: 25px;\r\n\tdisplay: inline-block;\r\n}\r\n\r\ncode, .rst-content code {\r\n\tbackground: transparent;\r\n\tfont-size: 100%;\r\n\tborder: none;\r\n\tpadding: 0px;\r\n}\r\n\r\n.docs code {\r\n\tcolor: #c60;\r\n}\r\n\r\ntd, th {\r\n\tpadding: 5px;\r\n}\r\n\r\ntable {\r\n\tmargin-bottom: 20px;\r\n}\r\n"
  },
  {
    "path": "examples/3ds/friends.py",
    "content": "\nfrom nintendo import nasc\nfrom nintendo.nex import backend, friends, settings\nimport anyio\n\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\n\nSERIAL_NUMBER = \"...\" # Serial number on console minus the last digit\nMAC_ADDRESS = \"aabbccddeeff\" # Console MAC address (see WiFi settings), all lowercase with no colons\nDEVICE_CERT = bytes.fromhex(\"...\") # Unique console certificate. Get from sniffing traffic\nDEVICE_NAME = \"...\" # Doesn't matter\n\n# 3DS does NOT send NEX credentials over NASC\n# They are generated once when the account is created and stored on the device\n# Homebrew like https://github.com/Stary2001/nex-dissector/tree/master/get_3ds_pid_password\n# can be used to dump the PID and password\nPID = 0\nPID_HMAC = \"...\" # Sniff console traffic or dump from friends title save (bytes 66-84)\n\nNEX_PASSWORD = \"...\"\n\nREGION = 3 # EUR\nLANGUAGE = 2\n\n\n\nasync def main():\n\tclient = nasc.NASCClient()\n\tclient.set_title(0x0004013000003202, 20000)\n\tclient.set_device(SERIAL_NUMBER, MAC_ADDRESS, DEVICE_CERT, DEVICE_NAME)\n\tclient.set_locale(REGION, LANGUAGE)\n\tclient.set_user(PID, PID_HMAC)\n\t\n\tresponse = await client.login(0x3200)\n\n\ts = settings.load(\"friends\")\n\ts.configure(\"ridfebb9\", 20000)\n\tasync with backend.connect(s, response.host, response.port) as be:\n\t\tasync with be.login(str(PID), NEX_PASSWORD) as client:\n\t\t\tfriends_client = friends.FriendsClientV1(client)\n\t\t\tawait friends_client.update_comment(\"Hello World\")\n\nanyio.run(main)\n"
  },
  {
    "path": "examples/custom/server.py",
    "content": "\nfrom nintendo.nex import rmc, kerberos, friends, \\\n\tauthentication, common, settings\nimport collections\nimport secrets\n\nimport aioconsole\nimport asyncio\n\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\n\nUser = collections.namedtuple(\"User\", \"pid name password\")\n\nusers = [\n\tUser(2, \"Quazal Rendez-Vous\", \"password\"),\n\tUser(100, \"guest\", \"MMQea3n!fsik\")\n\t#More accounts here\n]\n\ndef get_user_by_name(name):\n\tfor user in users:\n\t\tif user.name == name:\n\t\t\treturn user\n\t\t\t\ndef get_user_by_pid(pid):\n\tfor user in users:\n\t\tif user.pid == pid:\n\t\t\treturn user\n\t\t\t\ndef derive_key(user):\n\tderiv = kerberos.KeyDerivationOld(65000, 1024)\n\treturn deriv.derive_key(user.password.encode(\"ascii\"), user.pid)\n\n\t\nSECURE_SERVER = \"Quazal Rendez-Vous\"\n\nclass AuthenticationServer(authentication.AuthenticationServer):\n\tdef __init__(self, settings):\n\t\tsuper().__init__()\n\t\tself.settings = settings\n\t\n\tasync def login(self, client, username):\n\t\tprint(\"User trying to log in:\", username)\n\t\t\n\t\tuser = get_user_by_name(username)\n\t\tif not user:\n\t\t\traise common.RMCError(\"RendezVous::InvalidUsername\")\n\t\t\t\n\t\tserver = get_user_by_name(SECURE_SERVER)\n\t\t\n\t\turl = common.StationURL(\n\t\t\tscheme=\"prudps\", address=\"127.0.0.1\", port=1224,\n\t\t\tPID = server.pid, CID = 1, type = 2,\n\t\t\tsid = 1, stream = 10\n\t\t)\n\t\t\n\t\tconn_data = authentication.RVConnectionData()\n\t\tconn_data.main_station = url\n\t\tconn_data.special_protocols = []\n\t\tconn_data.special_station = common.StationURL()\n\t\t\n\t\tresponse = rmc.RMCResponse()\n\t\tresponse.result = common.Result.success()\n\t\tresponse.pid = user.pid\n\t\tresponse.ticket = self.generate_ticket(user, server)\n\t\tresponse.connection_data = conn_data\n\t\tresponse.server_name = \"Example server\"\n\t\treturn response\n\t\t\n\tdef generate_ticket(self, source, target):\n\t\tsettings = self.settings\n\t\t\n\t\tuser_key = derive_key(source)\n\t\tserver_key = derive_key(target)\n\t\tsession_key = secrets.token_bytes(settings[\"kerberos.key_size\"])\n\t\t\n\t\tinternal = kerberos.ServerTicket()\n\t\tinternal.timestamp = common.DateTime.now()\n\t\tinternal.source = source.pid\n\t\tinternal.session_key = session_key\n\t\t\n\t\tticket = kerberos.ClientTicket()\n\t\tticket.session_key = session_key\n\t\tticket.target = target.pid\n\t\tticket.internal = internal.encrypt(server_key, settings)\n\t\t\n\t\treturn ticket.encrypt(user_key, settings)\n\t\t\n\nclass FriendsServer(friends.FriendsServerV1):\n\tpass #Implement friend server methods here\n\n\nasync def main():\n\ts = settings.load(\"friends\")\n\ts.configure(\"ridfebb9\", 20000)\n\t\n\tauth_servers = [\n\t\tAuthenticationServer(s)\n\t]\n\tsecure_servers = [\n\t\tFriendsServer()\n\t]\n\t\n\tserver_key = derive_key(get_user_by_name(SECURE_SERVER))\n\tasync with rmc.serve(s, auth_servers, \"127.0.0.1\", 1223):\n\t\tasync with rmc.serve(s, secure_servers, \"127.0.0.1\", 1224, key=server_key):\n\t\t\tawait aioconsole.ainput(\"Press enter to exit...\\n\")\n\nasyncio.run(main())\n"
  },
  {
    "path": "examples/custom/server_login.py",
    "content": "\nfrom nintendo.nex import backend, settings\nimport anyio\n\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\n\nasync def main():\n\ts = settings.load(\"friends\")\n\ts.configure(\"ridfebb9\", 20000)\n\t\n\tasync with backend.connect(s, \"127.0.0.1\", 1223) as be:\n\t\tasync with be.login_guest() as client:\n\t\t\tpass\n\nanyio.run(main)\n"
  },
  {
    "path": "examples/switch/animalcrossing.py",
    "content": "\r\nfrom nintendo.switch import dauth, aauth, baas, dragons\r\nfrom nintendo.nex import backend, authentication, matchmaking, settings\r\nfrom nintendo import switch\r\nimport anyio\r\n\r\nimport logging\r\nlogging.basicConfig(level=logging.INFO)\r\n\r\n\r\nSYSTEM_VERSION = 2210 # 22.1.0\r\n\r\n# You can get your user id and password from\r\n# su/baas/<guid>.dat in save folder 8000000000000010.\r\n\r\n# Bytes 0x20 - 0x28 contain the user id in reversed\r\n# byte order, and bytes 0x28 - 0x50 contain the\r\n# password in plain text.\r\n\r\n# Alternatively, you can set up a mitm on your Switch\r\n# and extract them from the request to /1.0.0/login\r\n\r\nBAAS_USER_ID = 0x0123456789abcdef # 16 hex digits\r\nBAAS_PASSWORD = \"...\" # Should be 40 characters\r\nNA_COUNTRY = \"JP\" # Country of your Nintendo account\r\n\r\n# You can dump prod.keys with Lockpick_RCM and\r\n# PRODINFO from hekate (decrypt it if necessary)\r\nPATH_KEYS = \"/path/to/prod.keys\"\r\nPATH_PRODINFO = \"/path/to/PRODINFO\"\r\n\r\n# License information is stored encrypted in saved/<license owner id>\r\n# in save folder 80000000000000E4.\r\n\r\n# Alternatively, they can be obtained from the dragons server\r\n# by calling publish_device_linked_elicenses (see docs), or with\r\n# a mitm on your Switch.\r\nELICENSE_ID = \"...\" # 32 hex digits\r\nNA_ID = 0x0123456789abcdef # 16 hex digits\r\n\r\nPENNE_ID = \"...\"\r\n\r\nCODE = \"ABCDE\" # Dodo code\r\n\r\n\r\nTITLE_ID = 0x01006F8002326000\r\nTITLE_VERSION = 0x1C0000\r\n\r\nGAME_SERVER_ID = 0x2EE2E300\r\nACCESS_KEY = \"v43a10em\"\r\nNEX_VERSION = 40604\r\nCLIENT_VERSION = 2\r\n\r\n\r\nHOST = \"g%08x-lp1.s.n.srv.nintendo.net\" %GAME_SERVER_ID\r\nPORT = 443\r\n\r\n\r\nasync def main():\r\n\tkeys = switch.load_keys(PATH_KEYS)\r\n\t\r\n\tinfo = switch.ProdInfo(keys, PATH_PRODINFO)\r\n\tcert = info.get_tls_cert()\r\n\tpkey = info.get_tls_key()\r\n\t\r\n\tdauth_client = dauth.DAuthClient(keys)\r\n\tdauth_client.set_certificate(cert, pkey)\r\n\tdauth_client.set_system_version(SYSTEM_VERSION)\r\n\r\n\tdauth_cache = dauth.DAuthCache(dauth_client)\r\n\t\r\n\tdragons_client = dragons.DragonsClient()\r\n\tdragons_client.set_certificate(cert, pkey)\r\n\tdragons_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\taauth_client = aauth.AAuthClient()\r\n\taauth_client.set_certificate(cert, pkey)\r\n\taauth_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\tbaas_client = baas.BAASClient()\r\n\tbaas_client.set_certificate(cert, pkey)\r\n\tbaas_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\t# Request a device authentication token for dragons\r\n\tresponse = await dauth_cache.device_token(dauth.CLIENT_ID_DRAGONS)\r\n\tdevice_token_dragons = response[\"device_auth_token\"]\r\n\t\r\n\t# Request a device authentication token for aauth and bass\r\n\tresponse = await dauth_cache.device_token(dauth.CLIENT_ID_BAAS)\r\n\tdevice_token_baas = response[\"device_auth_token\"]\r\n\t\r\n\t# Request a contents authorization token from dragons\r\n\tresponse = await dragons_client.contents_authorization_token_for_aauth(device_token_dragons, ELICENSE_ID, NA_ID, TITLE_ID)\r\n\tcontents_token = response[\"contents_authorization_token\"]\r\n\t\r\n\t# Request an application authentication token\r\n\tresponse = await aauth_client.auth_digital(TITLE_ID, TITLE_VERSION, device_token_baas, contents_token)\r\n\tapp_token = response[\"application_auth_token\"]\r\n\t\r\n\t# Request an anonymous access token for baas\r\n\tresponse = await baas_client.authenticate(device_token_baas, PENNE_ID)\r\n\taccess_token = response[\"accessToken\"]\r\n\t\r\n\t# Log in on the baas server\r\n\tresponse = await baas_client.login(\r\n\t\tBAAS_USER_ID, BAAS_PASSWORD, access_token, app_token, NA_COUNTRY\r\n\t)\r\n\tuser_id = int(response[\"user\"][\"id\"], 16)\r\n\tid_token = response[\"idToken\"]\r\n\t\r\n\t# Set up authentication info for nex server\r\n\tauth_info = authentication.AuthenticationInfo()\r\n\tauth_info.token = id_token\r\n\tauth_info.ngs_version = 4 #Switch\r\n\tauth_info.token_type = 2\r\n\t\r\n\t# Establish connection with nex server\r\n\ts = settings.load(\"switch\")\r\n\ts.configure(ACCESS_KEY, NEX_VERSION, CLIENT_VERSION)\r\n\tasync with backend.connect(s, HOST, PORT) as be:\r\n\t\tasync with be.login(str(user_id), auth_info=auth_info) as client:\r\n\t\t\tmm = matchmaking.MatchmakeExtensionClient(client)\r\n\r\n\t\t\tparam = matchmaking.MatchmakeSessionSearchCriteria()\r\n\t\t\tparam.attribs = [\"\", \"\", \"\", \"\", \"\", \"\"]\r\n\t\t\tparam.game_mode = \"2\"\r\n\t\t\tparam.min_participants = \"1\"\r\n\t\t\tparam.max_participants = \"1,8\"\r\n\t\t\tparam.matchmake_system = \"1\"\r\n\t\t\tparam.vacant_only = False\r\n\t\t\tparam.exclude_locked = True\r\n\t\t\tparam.exclude_non_host_pid = True\r\n\t\t\tparam.selection_method = 0\r\n\t\t\tparam.vacant_participants = 1\r\n\t\t\tparam.exclude_user_password = True\r\n\t\t\tparam.exclude_system_password = True\r\n\t\t\tparam.refer_gid = 0\r\n\t\t\tparam.codeword = CODE\r\n\r\n\t\t\tsessions = await mm.browse_matchmake_session_no_holder_no_result_range(param)\r\n\t\t\tif not sessions:\r\n\t\t\t\tprint(\"\\nNo island found for '%s'\\n\" %CODE)\r\n\t\t\telse:\r\n\t\t\t\tsession = sessions[0]\r\n\t\t\t\tdata = session.application_data\r\n\t\t\t\tprint(\"\\nFound island:\")\r\n\t\t\t\tprint(\"\\tId:\", session.id)\r\n\t\t\t\tprint(\"\\tActive players:\", session.num_participants)\r\n\t\t\t\tprint(\"\\tIsland name:\", data[12:32].decode(\"utf16\").rstrip(\"\\0\"))\r\n\t\t\t\tprint(\"\\tHost name:\", data[40:60].decode(\"utf16\").rstrip(\"\\0\"))\r\n\t\t\t\tprint()\r\n\r\nanyio.run(main)\r\n"
  },
  {
    "path": "examples/switch/smm2_level.py",
    "content": "\r\nfrom nintendo.switch import dauth, aauth, baas, dragons\r\nfrom nintendo.nex import backend, authentication, \\\r\n\tsettings, datastore_smm2 as datastore\r\nfrom nintendo import switch\r\nfrom anynet import http\r\nimport anyio\r\n\r\nimport logging\r\nlogging.basicConfig(level=logging.INFO)\r\n\r\n\r\nSYSTEM_VERSION = 2210 # 22.1.0\r\n\r\n# You can get your user id and password from\r\n# su/baas/<guid>.dat in save folder 8000000000000010.\r\n\r\n# Bytes 0x20 - 0x28 contain the user id in reversed\r\n# byte order, and bytes 0x28 - 0x50 contain the\r\n# password in plain text.\r\n\r\n# Alternatively, you can set up a mitm on your Switch\r\n# and extract them from the request to /1.0.0/login\r\n\r\nBAAS_USER_ID = 0x0123456789abcdef # 16 hex digits\r\nBAAS_PASSWORD = \"...\" # Should be 40 characters\r\nNA_COUNTRY = \"JP\" # Country of your Nintendo account\r\n\r\n# You can dump prod.keys with Lockpick_RCM and\r\n# PRODINFO from hekate (decrypt it if necessary)\r\nPATH_KEYS = \"/path/to/prod.keys\"\r\nPATH_PRODINFO = \"/path/to/PRODINFO\"\r\n\r\n# License information is stored encrypted in saved/<license owner id>\r\n# in save folder 80000000000000E4.\r\n\r\n# Alternatively, they can be obtained from the dragons server\r\n# by calling publish_device_linked_elicenses (see docs), or with\r\n# a mitm on your Switch.\r\nELICENSE_ID = \"...\" # 32 hex digits\r\nNA_ID = 0x0123456789abcdef # 16 hex digits\r\n\r\nPENNE_ID = \"...\"\r\n\r\nCOURSE_ID = \"2J53K2Y9G\"\r\n\r\n\r\nTITLE_ID = 0x01009B90006DC000\r\nTITLE_VERSION = 0x70000\r\n\r\nGAME_SERVER_ID = 0x22306D00\r\nACCESS_KEY = \"fdf6617f\"\r\nNEX_VERSION = 40605\r\nCLIENT_VERSION = 60\r\n\r\n\r\nHOST = \"g%08x-lp1.s.n.srv.nintendo.net\" %GAME_SERVER_ID\r\nPORT = 443\r\n\r\n\r\nGameStyles = [\"SMB1\", \"SMB3\", \"SMW\", \"NSMBU\", \"SM3DW\"]\r\n\r\nDifficulties = [\"Easy\", \"Normal\", \"Expert\", \"Super expert\"]\r\n\r\nCourseThemes = [\r\n\t\"Overworld\", \"Underground\", \"Castle\", \"Airship\",\r\n\t\"Underwater\", \"Ghost house\", \"Snow\", \"Desert\",\r\n\t\"Sky\", \"Forest\"\r\n]\r\n\r\nTagNames = [\r\n\t\"None\", \"Standard\", \"Puzzle solving\", \"Speedrun\",\r\n\t\"Autoscroll\", \"Auto mario\", \"Short and sweet\",\r\n\t\"Multiplayer versus\", \"Themed\", \"Music\", \"Art\",\r\n\t\"Technical\", \"Shooter\", \"Boss battle\",\r\n\t\"Single player\", \"Link\"\r\n]\r\n\r\n\r\ndef format_time(milliseconds):\r\n\tseconds = (milliseconds // 1000) % 60\r\n\tminutes = (milliseconds // 1000) // 60\r\n\tmilliseconds = milliseconds % 1000\r\n\treturn \"%02i:%02i.%03i\" %(minutes, seconds, milliseconds)\r\n\t\r\n\r\nasync def download_thumbnail(store, info, filename):\r\n\tresponse = await store.get_req_get_info_headers_info(info.data_type)\r\n\theaders = {h.key: h.value for h in response.headers}\r\n\tresponse = await http.get(info.url, headers=headers)\r\n\tresponse.raise_if_error()\r\n\twith open(filename, \"wb\") as f:\r\n\t\tf.write(response.body)\r\n\r\n\r\nasync def main():\r\n\tkeys = switch.load_keys(PATH_KEYS)\r\n\t\r\n\tinfo = switch.ProdInfo(keys, PATH_PRODINFO)\r\n\tcert = info.get_tls_cert()\r\n\tpkey = info.get_tls_key()\r\n\t\r\n\tdauth_client = dauth.DAuthClient(keys)\r\n\tdauth_client.set_certificate(cert, pkey)\r\n\tdauth_client.set_system_version(SYSTEM_VERSION)\r\n\r\n\tdauth_cache = dauth.DAuthCache(dauth_client)\r\n\t\r\n\tdragons_client = dragons.DragonsClient()\r\n\tdragons_client.set_certificate(cert, pkey)\r\n\tdragons_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\taauth_client = aauth.AAuthClient()\r\n\taauth_client.set_certificate(cert, pkey)\r\n\taauth_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\tbaas_client = baas.BAASClient()\r\n\tbaas_client.set_certificate(cert, pkey)\r\n\tbaas_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\t# Request a device authentication token for dragons\r\n\tresponse = await dauth_cache.device_token(dauth.CLIENT_ID_DRAGONS)\r\n\tdevice_token_dragons = response[\"device_auth_token\"]\r\n\t\r\n\t# Request a device authentication token for aauth and bass\r\n\tresponse = await dauth_cache.device_token(dauth.CLIENT_ID_BAAS)\r\n\tdevice_token_baas = response[\"device_auth_token\"]\r\n\t\r\n\t# Request a contents authorization token from dragons\r\n\tresponse = await dragons_client.contents_authorization_token_for_aauth(device_token_dragons, ELICENSE_ID, NA_ID, TITLE_ID)\r\n\tcontents_token = response[\"contents_authorization_token\"]\r\n\t\r\n\t# Request an application authentication token\r\n\tresponse = await aauth_client.auth_digital(TITLE_ID, TITLE_VERSION, device_token_baas, contents_token)\r\n\tapp_token = response[\"application_auth_token\"]\r\n\t\r\n\t# Request an anonymous access token for baas\r\n\tresponse = await baas_client.authenticate(device_token_baas, PENNE_ID)\r\n\taccess_token = response[\"accessToken\"]\r\n\t\r\n\t# Log in on the baas server\r\n\tresponse = await baas_client.login(\r\n\t\tBAAS_USER_ID, BAAS_PASSWORD, access_token, app_token, NA_COUNTRY\r\n\t)\r\n\tuser_id = int(response[\"user\"][\"id\"], 16)\r\n\tid_token = response[\"idToken\"]\r\n\r\n\t# Set up authentication info for nex server\r\n\tauth_info = authentication.AuthenticationInfo()\r\n\tauth_info.token = id_token\r\n\tauth_info.ngs_version = 4 #Switch\r\n\tauth_info.token_type = 2\r\n\t\r\n\ts = settings.load(\"switch\")\r\n\ts.configure(ACCESS_KEY, NEX_VERSION, CLIENT_VERSION)\r\n\tasync with backend.connect(s, HOST, PORT) as be:\r\n\t\tasync with be.login(str(user_id), auth_info=auth_info) as client:\r\n\t\t\tstore = datastore.DataStoreClientSMM2(client)\r\n\t\t\t\r\n\t\t\tparam = datastore.GetUserOrCourseParam()\r\n\t\t\tparam.code = COURSE_ID\r\n\t\t\tparam.course_option = datastore.CourseOption.ALL\r\n\r\n\t\t\tresponse = await store.get_user_or_course(param)\r\n\t\t\tcourse = response.course\r\n\r\n\t\t\t# Print information about the course\r\n\t\t\tprint(\"Level info:\")\r\n\t\t\tprint(\"\\tName:\", course.name)\r\n\t\t\tprint(\"\\tDescription:\", course.description)\r\n\t\t\tprint(\"\\tUploaded at:\", course.upload_time)\r\n\t\t\tprint(\"\\tGame:\", GameStyles[course.game_style])\r\n\t\t\tprint(\"\\tTheme:\", CourseThemes[course.course_theme])\r\n\t\t\tprint(\"\\tDifficulty:\", Difficulties[course.difficulty])\r\n\t\t\tprint(\"\\tFirst tag:\", TagNames[course.tag1])\r\n\t\t\tprint(\"\\tSecond tag:\", TagNames[course.tag2])\r\n\t\t\tprint(\"\\tWorld record:\", format_time(course.time_stats.world_record))\r\n\t\t\tprint(\"\\tNumber of comments:\", course.comment_stats[0])\r\n\r\n\t\t\t# Request information about its uploader\r\n\t\t\tparam = datastore.GetUsersParam()\r\n\t\t\tparam.pids = [course.owner_id]\r\n\r\n\t\t\tresponse = await store.get_users(param)\r\n\t\t\tuser = response.users[0]\r\n\t\t\tprint(\"Uploader:\")\r\n\t\t\tprint(\"\\tCode:\", user.code)\r\n\t\t\tprint(\"\\tName:\", user.name)\r\n\t\t\tprint(\"\\tCountry:\", user.country)\r\n\t\t\tprint(\"\\tLast active:\", user.last_active)\r\n\r\n\t\t\t# Download thumbnails\r\n\t\t\tawait download_thumbnail(store, course.one_screen_thumbnail, \"thumbnail_onescreen.jpg\")\r\n\t\t\tawait download_thumbnail(store, course.entire_thumbnail, \"thumbnail_entire.jpg\")\r\n\r\n\t\t\t# Download level file\r\n\t\t\tparam = datastore.DataStorePrepareGetParam()\r\n\t\t\tparam.data_id = course.data_id\r\n\r\n\t\t\treq_info = await store.prepare_get_object(param)\r\n\t\t\tresponse = await http.get(req_info.url)\r\n\t\t\tresponse.raise_if_error()\r\n\t\t\twith open(\"level.bin\", \"wb\") as f:\r\n\t\t\t\tf.write(response.body)\r\n\r\nanyio.run(main)\r\n"
  },
  {
    "path": "examples/switch/smm2_ninji.py",
    "content": "\r\nfrom nintendo.switch import dauth, aauth, baas, dragons\r\nfrom nintendo.nex import backend, authentication, \\\r\n\tsettings, datastore_smm2 as datastore\r\nfrom nintendo import switch\r\nfrom anynet import http\r\nimport anyio\r\nimport zlib\r\n\r\nimport logging\r\nlogging.basicConfig(level=logging.INFO)\r\n\r\n\r\nSYSTEM_VERSION = 2210 # 22.1.0\r\n\r\n# You can get your user id and password from\r\n# su/baas/<guid>.dat in save folder 8000000000000010.\r\n\r\n# Bytes 0x20 - 0x28 contain the user id in reversed\r\n# byte order, and bytes 0x28 - 0x50 contain the\r\n# password in plain text.\r\n\r\n# Alternatively, you can set up a mitm on your Switch\r\n# and extract them from the request to /1.0.0/login\r\n\r\nBAAS_USER_ID = 0x0123456789abcdef # 16 hex digits\r\nBAAS_PASSWORD = \"...\" # Should be 40 characters\r\nNA_COUNTRY = \"JP\" # Country of your Nintendo account\r\n\r\n# You can dump prod.keys with Lockpick_RCM and\r\n# PRODINFO from hekate (decrypt it if necessary)\r\nPATH_KEYS = \"/path/to/prod.keys\"\r\nPATH_PRODINFO = \"/path/to/PRODINFO\"\r\n\r\n# License information is stored encrypted in saved/<license owner id>\r\n# in save folder 80000000000000E4.\r\n\r\n# Alternatively, they can be obtained from the dragons server\r\n# by calling publish_device_linked_elicenses (see docs), or with\r\n# a mitm on your Switch.\r\nELICENSE_ID = \"...\" # 32 hex digits\r\nNA_ID = 0x0123456789abcdef # 16 hex digits\r\n\r\nPENNE_ID = \"...\"\r\n\r\n\r\nTITLE_ID = 0x01009B90006DC000\r\nTITLE_VERSION = 0x70000\r\n\r\nGAME_SERVER_ID = 0x22306D00\r\nACCESS_KEY = \"fdf6617f\"\r\nNEX_VERSION = 40605\r\nCLIENT_VERSION = 60\r\n\r\n\r\nHOST = \"g%08x-lp1.s.n.srv.nintendo.net\" %GAME_SERVER_ID\r\nPORT = 443\r\n\r\n\r\nasync def main():\r\n\tkeys = switch.load_keys(PATH_KEYS)\r\n\t\r\n\tinfo = switch.ProdInfo(keys, PATH_PRODINFO)\r\n\tcert = info.get_tls_cert()\r\n\tpkey = info.get_tls_key()\r\n\t\r\n\tdauth_client = dauth.DAuthClient(keys)\r\n\tdauth_client.set_certificate(cert, pkey)\r\n\tdauth_client.set_system_version(SYSTEM_VERSION)\r\n\r\n\tdauth_cache = dauth.DAuthCache(dauth_client)\r\n\t\r\n\tdragons_client = dragons.DragonsClient()\r\n\tdragons_client.set_certificate(cert, pkey)\r\n\tdragons_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\taauth_client = aauth.AAuthClient()\r\n\taauth_client.set_certificate(cert, pkey)\r\n\taauth_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\tbaas_client = baas.BAASClient()\r\n\tbaas_client.set_certificate(cert, pkey)\r\n\tbaas_client.set_system_version(SYSTEM_VERSION)\r\n\t\r\n\t# Request a device authentication token for dragons\r\n\tresponse = await dauth_cache.device_token(dauth.CLIENT_ID_DRAGONS)\r\n\tdevice_token_dragons = response[\"device_auth_token\"]\r\n\t\r\n\t# Request a device authentication token for aauth and bass\r\n\tresponse = await dauth_cache.device_token(dauth.CLIENT_ID_BAAS)\r\n\tdevice_token_baas = response[\"device_auth_token\"]\r\n\t\r\n\t# Request a contents authorization token from dragons\r\n\tresponse = await dragons_client.contents_authorization_token_for_aauth(device_token_dragons, ELICENSE_ID, NA_ID, TITLE_ID)\r\n\tcontents_token = response[\"contents_authorization_token\"]\r\n\t\r\n\t# Request an application authentication token\r\n\tresponse = await aauth_client.auth_digital(TITLE_ID, TITLE_VERSION, device_token_baas, contents_token)\r\n\tapp_token = response[\"application_auth_token\"]\r\n\t\r\n\t# Request an anonymous access token for baas\r\n\tresponse = await baas_client.authenticate(device_token_baas, PENNE_ID)\r\n\taccess_token = response[\"accessToken\"]\r\n\t\r\n\t# Log in on the baas server\r\n\tresponse = await baas_client.login(\r\n\t\tBAAS_USER_ID, BAAS_PASSWORD, access_token, app_token, NA_COUNTRY\r\n\t)\r\n\tuser_id = int(response[\"user\"][\"id\"], 16)\r\n\tid_token = response[\"idToken\"]\r\n\r\n\t# Set up authentication info for nex server\r\n\tauth_info = authentication.AuthenticationInfo()\r\n\tauth_info.token = id_token\r\n\tauth_info.ngs_version = 4 #Switch\r\n\tauth_info.token_type = 2\r\n\t\r\n\ts = settings.load(\"switch\")\r\n\ts.configure(ACCESS_KEY, NEX_VERSION, CLIENT_VERSION)\r\n\tasync with backend.connect(s, HOST, PORT) as be:\r\n\t\tasync with be.login(str(user_id), auth_info=auth_info) as client:\r\n\t\t\t# Search for ninji courses\r\n\t\t\tstore = datastore.DataStoreClientSMM2(client)\r\n\t\t\t\r\n\t\t\tparam = datastore.SearchCoursesEventParam()\r\n\t\t\tcourses = await store.search_courses_event(param)\r\n\t\t\tprint(\"Found %i ninji courses.\\n\" %len(courses))\r\n\t\t\t\r\n\t\t\t# Print information about the oldest ninji course\r\n\t\t\tcourse = courses[-1]\r\n\t\t\tprint(\"Name:\", course.name)\r\n\t\t\tprint(\"Description:\", course.description)\r\n\t\t\tprint(\"Start time:\", course.upload_time)\r\n\t\t\tprint(\"End time:\", course.end_time)\r\n\t\t\tprint()\r\n\t\t\t\r\n\t\t\t# Request ghost info\r\n\t\t\tparam = datastore.GetEventCourseGhostParam()\r\n\t\t\tparam.data_id = course.data_id\r\n\t\t\tparam.time = 30000 # Request ghosts with a time around 30 seconds\r\n\t\t\tparam.count = 1 # Only request a single ghost\r\n\t\t\t\r\n\t\t\tghost = (await store.get_event_course_ghost(param))[0]\r\n\t\t\t\r\n\t\t\t# Request info about the ghost player\r\n\t\t\tparam = datastore.GetUsersParam()\r\n\t\t\tparam.pids = [ghost.pid]\r\n\t\t\t\r\n\t\t\tuser = (await store.get_users(param)).users[0]\r\n\t\t\tprint(\"Player:\", user.name)\r\n\t\t\tprint(\"Time: %i.%03i\" %(ghost.time // 1000, ghost.time % 1000))\r\n\t\t\tprint()\r\n\t\t\t\r\n\t\t\t# Download replay file\r\n\t\t\theader_info = await store.get_req_get_info_headers_info(ghost.replay_file.data_type)\r\n\t\t\theaders = {h.key: h.value for h in header_info.headers}\r\n\t\t\tresponse = await http.get(ghost.replay_file.url, headers=headers)\r\n\t\t\tresponse.raise_if_error()\r\n\t\t\t\r\n\t\t\t# Decompress and save replay file\r\n\t\t\tdata = zlib.decompress(response.body)\r\n\t\t\twith open(\"replay.bin\", \"wb\") as f:\r\n\t\t\t\tf.write(data)\r\n\r\nanyio.run(main)\r\n"
  },
  {
    "path": "examples/switch/system_update.py",
    "content": "\nfrom nintendo.switch import sun, atumn\nfrom nintendo import switch\nimport anyio\nimport os\nimport re\nimport struct\nimport subprocess\n\n\nSYSTEM_VERSION = 2210 # 22.1.0\n\n# You can dump prod.keys with Lockpick_RCM and\n# PRODINFO from hekate (decrypt it if necessary)\nPATH_KEYS = \"/path/to/prod.keys\"\nPATH_PRODINFO = \"/path/to/PRODINFO\"\n\n# This script uses hactool to parse NCA files\nPATH_HACTOOL = \"/path/to/hactool\"\n\n# Name of folder where files will be stored\nOUTPUT_PATH = \"/path/to/folder\"\n\n\nasync def retry(worker, n=3):\n\t# If the download / connection fails, retry just in case\n\tfor i in range(n):\n\t\ttry:\n\t\t\treturn await worker\n\t\texcept anyio.BrokenResourceError:\n\t\t\tprint(\"Retrying...\")\n\traise Exception(\"Download failed!\")\n\nasync def download_content_metadata(atumn_client, title_id, title_version, *, system_update=False):\n\t# Download NCA\n\tprint(\"Downloading metadata NCA for title %016x...\" %title_id)\n\tdata = await retry(atumn_client.download_content_metadata(title_id, title_version, system_update=system_update))\n\t\n\t# Save data to file\n\tnca_path = OUTPUT_PATH + \"/metadata_nca/%016x.nca\" %title_id\n\twith open(nca_path, \"wb\") as f:\n\t\tf.write(data)\n\t\n\t# Extract CNMT from NCA\n\tsection0dir = OUTPUT_PATH + \"/cnmt\"\n\toutput = subprocess.check_output([PATH_HACTOOL, nca_path, \"--section0dir\", section0dir, \"--disablekeywarns\"])\n\treturn re.search(\"\\nSaving .* to (.*)\\\\.\\\\.\\\\.\\n\", output.decode())[1] # Return the filename\n\nasync def download_content(atumn_client, title_id, metadata_path):\n\t# Parse the CNMT\n\twith open(metadata_path, \"rb\") as f:\n\t\tdata = f.read()\n\t\n\tcontent_count = struct.unpack_from(\"<H\", data, 0x10)[0]\n\tif content_count == 0: return # Nothing to do\n\telif content_count > 1:\n\t\traise ValueError(\"We currently assume that each title has no more than one NCA\")\n\t\n\t# Download content NCA\n\tcontent_id = data[0x40:0x50].hex()\n\tcontent_size = struct.unpack_from(\"<I\", data, 0x50)[0]\n\n\tprint(\"Downloading content NCA for title %016x... (%i bytes)\" %(title_id, content_size))\n\tdata = await retry(atumn_client.download_content(content_id))\n\n\t# Save data to file\n\tnca_path = OUTPUT_PATH + \"/content_nca/%016x.nca\" %title_id\n\twith open(nca_path, \"wb\") as f:\n\t\tf.write(data)\n\t\n\t# Unpacking content NCA\n\tcontent_path = OUTPUT_PATH + \"/titles/%016x\" %title_id\n\tos.makedirs(content_path, exist_ok=True)\n\n\texefsdir = content_path + \"/exefs\"\n\tromfsdir = content_path + \"/romfs\"\n\n\targs = [\n\t\tPATH_HACTOOL, nca_path, \"--exefsdir\", exefsdir,\n\t\t\"--romfsdir\", romfsdir, \"--disablekeywarns\"\n\t]\n\tsubprocess.run(args, stdout=subprocess.DEVNULL)\n\n\t# Rename folder if there is a name in the NPDM\n\tnpdm_path = content_path + \"/exefs/main.npdm\"\n\tif os.path.isfile(npdm_path):\n\t\twith open(npdm_path, \"rb\") as f:\n\t\t\tname = f.read()[0x20:0x30].rstrip(b\"\\0\").decode()\n\t\t\tif name != \"Application\":\n\t\t\t\tos.rename(content_path, OUTPUT_PATH + \"/titles/%s\" %name)\n\n\nasync def main():\n\tkeys = switch.load_keys(PATH_KEYS)\n\t\n\tprodinfo = switch.ProdInfo(keys, PATH_PRODINFO)\n\tdevice_cert = prodinfo.get_tls_cert()\n\tdevice_cert_key = prodinfo.get_tls_key()\n\tdevice_id = prodinfo.get_device_id()\n\t\n\tsun_client = sun.SunClient(device_id)\n\tsun_client.set_system_version(SYSTEM_VERSION)\n\tsun_client.set_certificate(device_cert, device_cert_key)\n\n\tatumn_client = atumn.AtumnClient(device_id)\n\tatumn_client.set_system_version(SYSTEM_VERSION)\n\tatumn_client.set_certificate(device_cert, device_cert_key)\n\n\t# Prepare folders\n\tos.makedirs(OUTPUT_PATH + \"/metadata_nca\", exist_ok=True)\n\tos.makedirs(OUTPUT_PATH + \"/content_nca\", exist_ok=True)\n\tos.makedirs(OUTPUT_PATH + \"/cnmt\", exist_ok=True)\n\tos.makedirs(OUTPUT_PATH + \"/titles\", exist_ok=True)\n\n\t# Request latest system update info\n\tresponse = await sun_client.system_update_meta()\n\ttitle_id = int(response[\"system_update_metas\"][0][\"title_id\"], 16)\n\ttitle_version = response[\"system_update_metas\"][0][\"title_version\"]\n\n\tprint(\"Latest system update:\")\n\tprint(\"    Title id: %016x\" %title_id)\n\tprint(\"    Title version: %i\" %title_version)\n\tprint()\n\n\t# Download metadata NCA for the system update title\n\tawait download_content_metadata(atumn_client, title_id, title_version, system_update=True)\n\n\t# Parse CNMT of the system update title\n\twith open(OUTPUT_PATH + \"/cnmt/SystemUpdate_%016x.cnmt\" %title_id, \"rb\") as f:\n\t\tdata = f.read()\n\t\n\ttitles = []\n\tmetadata_count = struct.unpack_from(\"<H\", data, 0x12)[0]\n\tfor i in range(metadata_count):\n\t\ttitle_id, title_version = struct.unpack_from(\"<QI\", data, 0x24 + i * 0x10)\n\t\ttitles.append((title_id, title_version))\n\t\n\t# Download and unpack remaining metadata NCAs\n\tmetadata_paths = {}\n\tfor title_id, title_version in titles:\n\t\tmetadata_path = await download_content_metadata(atumn_client, title_id, title_version)\n\t\tmetadata_paths[title_id] = metadata_path\n\t\n\t# Download and unpack content NCAs\n\tfor title_id, path in metadata_paths.items():\n\t\tawait download_content(atumn_client, title_id, path)\n\t\t\n\nanyio.run(main)\n"
  },
  {
    "path": "examples/wiiu/donkeykong.py",
    "content": "\r\nfrom nintendo.nex import backend, ranking, datastore, settings\r\nfrom nintendo import nnas\r\nfrom anynet import http\r\nimport anyio\r\n\r\nimport logging\r\nlogging.basicConfig(level=logging.INFO)\r\n\r\n\r\nDEVICE_ID = 12345678 #From MCP_GetDeviceId\r\nSERIAL_NUMBER = \"...\"\r\nSYSTEM_VERSION = 0x270\r\nREGION = 4 #EUR\r\nCOUNTRY = \"NL\"\r\nLANGUAGE = \"en\"\r\n\r\nUSERNAME = \"...\" #Nintendo network id\r\nPASSWORD = \"...\" #Nintendo network password\r\n\r\nTITLE_ID = 0x0005000010138300\r\nTITLE_VERSION = 17\r\n\r\nGAME_SERVER_ID = 0x10144800\r\nACCESS_KEY = \"7fcf384a\"\r\nNEX_VERSION = 30400\r\n\r\n\r\nasync def main():\r\n\tnas = nnas.NNASClient()\r\n\tnas.set_device(DEVICE_ID, SERIAL_NUMBER, SYSTEM_VERSION)\r\n\tnas.set_title(TITLE_ID, TITLE_VERSION)\r\n\tnas.set_locale(REGION, COUNTRY, LANGUAGE)\r\n\t\r\n\taccess_token = await nas.login(USERNAME, PASSWORD)\r\n\tnex_token = await nas.get_nex_token(access_token.token, GAME_SERVER_ID)\r\n\r\n\ts = settings.default()\r\n\ts.configure(ACCESS_KEY, NEX_VERSION)\r\n\tasync with backend.connect(s, nex_token.host, nex_token.port) as be:\r\n\t\tasync with be.login(str(nex_token.pid), nex_token.password) as client:\r\n\t\t\torder_param = ranking.RankingOrderParam()\r\n\t\t\torder_param.offset = 0 #Start with the world record\r\n\t\t\torder_param.count = 20 #Download 20 highscores\r\n\r\n\t\t\tranking_client = ranking.RankingClient(client)\r\n\t\t\trankings = await ranking_client.get_ranking(\r\n\t\t\t\tranking.RankingMode.GLOBAL, #Get the global leaderboard\r\n\t\t\t\t0x893EB726, #Category, this is 3-A (Magrove Cove)\r\n\t\t\t\torder_param,\r\n\t\t\t\t0, 0\r\n\t\t\t)\r\n\t\t\r\n\t\t\tprint(\"Total:\", rankings.total)\r\n\t\t\tprint(\"Rankings:\")\r\n\t\t\tfor rankdata in rankings.data:\r\n\t\t\t\tseconds = (rankdata.score >> 1) / 60\r\n\t\t\t\ttime = \"%i:%02i.%02i\" %(seconds / 60, seconds % 60, (seconds * 100) % 100)\r\n\t\t\t\tdamage = \" Damaged \" if rankdata.score & 1 else \"No damage\"\r\n\t\t\t\tkong = [\"No Kong\", \"Diddy\", \"Dixie\", \"Cranky\"][rankdata.groups[1]]\r\n\t\t\t\tname = rankdata.common_data.decode(\"ascii\")[:-1]\r\n\t\t\r\n\t\t\t\tprint(\"\\t%2i   %20s   %s (%s)   %s\" %(rankdata.rank, name, time, damage, kong))\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t#Now download the world record replay file if available\r\n\t\t\tworld_record = rankings.data[0]\r\n\t\t\tif world_record.param: #If world record has a replay file\t\r\n\t\t\t\tstore = datastore.DataStoreClient(client)\r\n\t\t\t\t\r\n\t\t\t\tget_param = datastore.DataStorePrepareGetParam()\r\n\t\t\t\tget_param.data_id = world_record.param\r\n\t\t\t\t\r\n\t\t\t\treq_info = await store.prepare_get_object(get_param)\r\n\t\t\t\theaders = {header.key: header.value for header in req_info.headers}\r\n\t\t\t\tresponse = await http.get(req_info.url, headers=headers)\r\n\t\t\t\tresponse.raise_if_error()\r\n\t\t\t\t\r\n\t\t\t\twith open(\"replay.bin\", \"wb\") as f:\r\n\t\t\t\t\tf.write(response.body)\r\n\r\nanyio.run(main)\r\n"
  },
  {
    "path": "examples/wiiu/friends.py",
    "content": "\nfrom nintendo.nex import backend, friends, common, settings\nfrom nintendo import nnas\nimport anyio\n\nimport logging\nlogging.basicConfig(level=logging.INFO)\n\n\nDEVICE_ID = 12345678 #From MCP_GetDeviceId\nSERIAL_NUMBER = \"...\"\nSYSTEM_VERSION = 0x270\nREGION = 4 #EUR\nCOUNTRY = \"NL\"\nLANGUAGE = \"en\"\n\nUSERNAME = \"...\" #Nintendo network id\nPASSWORD = \"...\" #Nintendo network password\n\nBIRTHDAY = common.DateTime.make(2000, 12, 31)\n\nTITLE_ID = 0x10001C00\nTITLE_VERSION = 0\n\nGAME_SERVER_ID = 0x3200\nACCESS_KEY = \"ridfebb9\"\nNEX_VERSION = 20000\n\n\ndef print_requests(requests):\n\tfor request in requests:\n\t\tprincipal_info = request.principal_info\n\t\tmessage = request.message\n\t\tprint(\"\\tWho: %s (%s)\" %(principal_info.nnid, principal_info.mii.name))\n\t\tprint(\"\\tMessage:\", message.message)\n\t\tif message.game_key.title_id:\n\t\t\tprint(\"\\tGame: %016X (v%i)\" %(message.game_key.title_id, message.game_key.title_version))\n\t\tprint(\"\\tSent:\", request.sent)\n\t\tprint(\"\\tExpires:\", message.expires)\n\t\tprint(\"\\t\" + \"-\" * 40)\n\tprint()\n\n\nasync def main():\n\tnas = nnas.NNASClient()\n\tnas.set_device(DEVICE_ID, SERIAL_NUMBER, SYSTEM_VERSION)\n\tnas.set_title(TITLE_ID, TITLE_VERSION)\n\tnas.set_locale(REGION, COUNTRY, LANGUAGE)\n\t\n\taccess_token = await nas.login(USERNAME, PASSWORD)\n\tnex_token = await nas.get_nex_token(access_token.token, GAME_SERVER_ID)\n\n\tpid = await nas.get_pid(USERNAME)\n\tmii = await nas.get_mii(pid)\n\t\n\ts = settings.load(\"friends\")\n\ts.configure(ACCESS_KEY, NEX_VERSION)\n\tasync with backend.connect(s, nex_token.host, nex_token.port) as be:\n\t\tasync with be.login(str(nex_token.pid), nex_token.password) as client:\n\t\t\tnna_info = friends.NNAInfo()\n\t\t\tnna_info.principal_info.pid = pid\n\t\t\tnna_info.principal_info.nnid = USERNAME\n\t\t\tnna_info.principal_info.mii.name = mii.name\n\t\t\tnna_info.principal_info.mii.data = mii.data\n\t\t\t\n\t\t\t#NintendoPresenceV2 tells the server about your online status, which\n\t\t\t#game you're currently playing, etc. This will be shown to your friends\n\t\t\t#in their friend list (unless you disabled this feature).\t\n\t\t\tpresence = friends.NintendoPresenceV2()\n\t\t\t\n\t\t\tfriends_client = friends.FriendsClientV2(client)\n\t\t\tresponse = await friends_client.update_and_get_all_information(\n\t\t\t\tnna_info, presence, BIRTHDAY\n\t\t\t)\n\t\t\t\n\t\t\tif response.comment.text:\n\t\t\t\tprint(\"Your status message: %s (last changed on %s)\" %(response.comment.text, response.comment.changed))\n\t\t\telse:\n\t\t\t\tprint(\"You don't have a status message\")\n\t\t\t\n\t\t\tif response.friends:\n\t\t\t\tprint(\"Friends:\")\n\t\t\t\tfor friend in response.friends:\n\t\t\t\t\tprincipal_info = friend.nna_info.principal_info\n\t\t\t\t\tprint(\"\\tNNID:\", principal_info.nnid)\n\t\t\t\t\tprint(\"\\tName:\", principal_info.mii.name)\n\t\t\t\t\t\n\t\t\t\t\tpresence = friend.presence\n\t\t\t\t\tprint(\"\\tOnline:\", [\"No\", \"Yes\"][presence.is_online])\n\t\t\t\t\tif presence.game_key.title_id:\n\t\t\t\t\t\tprint(\"\\tPlaying: %016X (v%i)\" %(presence.game_key.title_id, presence.game_key.title_version))\n\t\t\t\t\t\n\t\t\t\t\tif friend.comment.text:\n\t\t\t\t\t\tprint(\"\\tStatus: %s (last changed on %s)\" %(friend.comment.text, friend.comment.changed))\n\t\t\t\t\t\t\n\t\t\t\t\tprint(\"\\tFriend since:\", friend.befriended)\n\t\t\t\t\tprint(\"\\tLast online:\", friend.last_online)\n\t\t\t\t\tprint(\"\\t\" + \"-\" * 40)\n\t\t\t\tprint()\n\t\t\telse:\n\t\t\t\tprint(\"You don't have any friends\")\n\t\t\t\n\t\t\tif response.sent_requests:\n\t\t\t\tprint(\"Friend requests sent:\")\n\t\t\t\tprint_requests(response.sent_requests)\n\t\t\telse:\n\t\t\t\tprint(\"You haven't sent any friend requests\")\n\t\t\t\t\n\t\t\tif response.received_requests:\n\t\t\t\tprint(\"Friend requests received:\")\n\t\t\t\tprint_requests(response.received_requests)\n\t\t\telse:\n\t\t\t\tprint(\"You haven't received any friend requests\")\n\t\t\t\t\n\t\t\tif response.blacklist:\n\t\t\t\tprint(\"Blacklist:\")\n\t\t\t\tfor item in response.blacklist:\n\t\t\t\t\tprincipal_info = item.principal_info\n\t\t\t\t\tprint(\"\\tWho: %s (%s)\" %(principal_info.nnid, principal_info.mii.name))\n\t\t\t\t\tif item.game_key.title_id:\n\t\t\t\t\t\tprint(\"\\tGame: %016X (%i)\" %(item.game_key.title_id, item.game_key.title_version))\n\t\t\t\t\tprint(\"\\tSince:\", item.since)\n\t\t\t\t\tprint(\"\\t\" + \"-\" * 40)\n\t\t\telse:\n\t\t\t\tprint(\"You haven't blacklisted any users\")\n\nanyio.run(main)\n\t\t\t"
  },
  {
    "path": "examples/wiiu/mariokart.py",
    "content": "\r\nfrom nintendo.nex import backend, ranking, datastore, settings\r\nfrom nintendo import nnas\r\nfrom anynet import http\r\nimport anyio\r\n\r\nimport logging\r\nlogging.basicConfig(level=logging.INFO)\r\n\r\n\r\nDEVICE_ID = 12345678 #From MCP_GetDeviceId\r\nSERIAL_NUMBER = \"...\"\r\nSYSTEM_VERSION = 0x270\r\nREGION_ID = 4 #EU\r\nCOUNTRY_ID = 94 #NL\r\nREGION_NAME = \"EUR\"\r\nCOUNTRY_NAME = \"NL\"\r\nLANGUAGE = \"en\"\r\n\r\nUSERNAME = \"...\" #Nintendo network id\r\nPASSWORD = \"...\" #Nintendo network password\r\n\r\nTRACK_ID = 27 #Mario Kart Stadium\r\n\r\nTITLE_ID = 0x000500001010ED00\r\nTITLE_VERSION = 64\r\n\r\nGAME_SERVER_ID = 0x1010EB00\r\nACCESS_KEY = \"25dbf96a\"\r\nNEX_VERSION = 30504\r\n\r\n\r\ndef format_time(score):\r\n\tmillisec = score % 1000\r\n\tseconds = score // 1000 % 60\r\n\tminutes = score // 1000 // 60\r\n\treturn \"%i:%02i.%03i\" %(minutes, seconds, millisec)\r\n\r\n\r\nasync def main():\r\n\tnas = nnas.NNASClient()\r\n\tnas.set_device(DEVICE_ID, SERIAL_NUMBER, SYSTEM_VERSION)\r\n\tnas.set_title(TITLE_ID, TITLE_VERSION)\r\n\tnas.set_locale(REGION_ID, COUNTRY_NAME, LANGUAGE)\r\n\t\r\n\taccess_token = await nas.login(USERNAME, PASSWORD)\r\n\tnex_token = await nas.get_nex_token(access_token.token, GAME_SERVER_ID)\r\n\t\r\n\ts = settings.default()\r\n\ts.configure(ACCESS_KEY, NEX_VERSION)\r\n\tasync with backend.connect(s, nex_token.host, nex_token.port) as be:\r\n\t\tasync with be.login(str(nex_token.pid), nex_token.password) as client:\r\n\t\t\tranking_client = ranking.RankingClient(client)\r\n\t\r\n\t\t\torder_param = ranking.RankingOrderParam()\r\n\t\t\torder_param.order_calc = ranking.RankingOrderCalc.ORDINAL\r\n\t\t\torder_param.offset = 499 #Start at 500th place\r\n\t\t\torder_param.count = 20 #Download 20 highscores\r\n\t\r\n\t\t\trankings = await ranking_client.get_ranking(\r\n\t\t\t\tranking.RankingMode.GLOBAL, TRACK_ID,\r\n\t\t\t\torder_param, 0, 0\r\n\t\t\t)\r\n\t\r\n\t\t\tranking_stats = await ranking_client.get_stats(\r\n\t\t\t\tTRACK_ID, order_param, ranking.RankingStatFlags.ALL\r\n\t\t\t)\r\n\t\t\r\n\t\t\tnames = await nas.get_nnids([data.pid for data in rankings.data])\r\n\t\r\n\t\t\t#Print some interesting stats\r\n\t\t\tstats = ranking_stats.stats\r\n\t\t\tprint(\"Total:\", int(stats[0]))\r\n\t\t\tprint(\"Total time:\", format_time(stats[1]))\r\n\t\t\tprint(\"Lowest time:\", format_time(stats[2]))\r\n\t\t\tprint(\"Highest time:\", format_time(stats[3]))\r\n\t\t\tprint(\"Average time:\", format_time(stats[4]))\r\n\t\r\n\t\t\tprint(\"Rankings:\")\r\n\t\t\tfor rankdata in rankings.data:\r\n\t\t\t\ttime = format_time(rankdata.score)\r\n\t\t\t\tprint(\"\\t%5i   %20s   %s\" %(rankdata.rank, names[rankdata.pid], time))\r\n\t\t\r\n\t\t\t#Let's download the replay file of whoever is in 500th place\r\n\t\t\tstore = datastore.DataStoreClient(client)\r\n\t\t\t\r\n\t\t\trankdata = rankings.data[0]\r\n\t\t\tget_param = datastore.DataStorePrepareGetParam()\r\n\t\t\tget_param.persistence_target.owner_id = rankdata.pid\r\n\t\t\tget_param.persistence_target.persistence_id = TRACK_ID - 16\r\n\t\t\tget_param.extra_data = [\"WUP\", str(REGION_ID), REGION_NAME, str(COUNTRY_ID), COUNTRY_NAME, \"\"]\r\n\t\t\t\r\n\t\t\treq_info = await store.prepare_get_object(get_param)\r\n\t\t\theaders = {header.key: header.value for header in req_info.headers}\r\n\t\t\tresponse = await http.get(req_info.url, headers=headers)\r\n\t\t\tresponse.raise_if_error()\r\n\t\t\t\r\n\t\t\twith open(\"replay.bin\", \"wb\") as f:\r\n\t\t\t\tf.write(response.body)\r\n\r\nanyio.run(main)\r\n"
  },
  {
    "path": "examples/wiiu/miis.py",
    "content": "\r\nfrom nintendo import nnas, miis\r\nimport anyio\r\n\r\nasync def main():\r\n\tnas = nnas.NNASClient()\r\n\tpid = await nas.get_pid(\"Kinnay-WiiU\")\r\n\tmii = await nas.get_mii(pid)\r\n\tprint(\"NNID:\", mii.nnid)\r\n\tprint(\"PID:\", mii.pid)\r\n\tprint(\"Name:\", mii.name)\r\n\r\n\tinfo = miis.MiiData.parse(mii.data)\r\n\tprint(\"Mii:\")\r\n\tprint(\"\\tBirthday: %i-%i\" %(info.birth_day, info.birth_month))\r\n\tprint(\"\\tCreator name:\", info.creator_name)\r\n\tprint(\"\\tMii color:\", info.color)\r\n\tprint(\"\\tMii size: %i%%\" %(info.size / 128 * 100))\r\n\tprint(\"\\tMii weight: %i%%\" %(info.fatness / 128 * 100))\r\n\tprint(\"\\tGender:\", [\"Male\", \"Female\"][info.gender])\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tBlush style:\", info.blush_type)\r\n\tprint(\"\\tFace style:\", info.face_style)\r\n\tprint(\"\\tFace color:\", info.face_color)\r\n\tprint(\"\\tFace shape:\", info.face_type)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tHair style:\", info.hair_type)\r\n\tprint(\"\\tHair color:\", info.hair_color)\r\n\tprint(\"\\tHair mirrored:\", [\"No\", \"Yes\"][info.hair_mirrored])\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tEye style:\", info.eye_type)\r\n\tprint(\"\\tEye color:\", info.eye_color)\r\n\tprint(\"\\tEye size:\", info.eye_scale)\r\n\tprint(\"\\tEye thickness:\", info.eye_thickness)\r\n\tprint(\"\\tEye height:\", info.eye_height)\r\n\tprint(\"\\tEye distance:\", info.eye_distance)\r\n\tprint(\"\\tEye rotation:\", info.eye_rotation)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tEyebrow style:\", info.eyebrow_type)\r\n\tprint(\"\\tEyebrow color:\", info.eyebrow_color)\r\n\tprint(\"\\tEyebrow size:\", info.eyebrow_scale)\r\n\tprint(\"\\tEyebrow thickness:\", info.eyebrow_thickness)\r\n\tprint(\"\\tEyebrow height:\", info.eyebrow_height)\r\n\tprint(\"\\tEyebrow distance:\", info.eyebrow_distance)\r\n\tprint(\"\\tEyebrow rotation:\", info.eyebrow_rotation)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tNose style:\", info.nose_type)\r\n\tprint(\"\\tNose size:\", info.nose_scale)\r\n\tprint(\"\\tNose height:\", info.nose_height)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tMouth style:\", info.mouth_type)\r\n\tprint(\"\\tMouth color:\", info.mouth_color)\r\n\tprint(\"\\tMouth size:\", info.mouth_scale)\r\n\tprint(\"\\tMouth thickness:\", info.mouth_thickness)\r\n\tprint(\"\\tMouth height:\", info.mouth_height)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tMustache style:\", info.mustache_type)\r\n\tif info.mustache_type:\r\n\t\tprint(\"\\tMustache height:\", info.mustache_height)\r\n\t\tprint(\"\\tMustache size:\", info.mustache_scale)\r\n\tprint(\"\\tBeard style:\", info.beard_type)\r\n\tif info.beard_type:\r\n\t\tprint(\"\\tBeard color:\", info.beard_color)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tGlasses style:\", info.glass_type)\r\n\tif info.glass_type:\r\n\t\tprint(\"\\tGlasses color:\", info.glass_color)\r\n\t\tprint(\"\\tGlasses size:\", info.glass_scale)\r\n\t\tprint(\"\\tGlasses height:\", info.glass_height)\r\n\tprint(\"\\t----------\")\r\n\tprint(\"\\tMole:\", [\"No\", \"Yes\"][info.mole_enabled])\r\n\tif info.mole_enabled:\r\n\t\tprint(\"\\tMole size:\", info.mole_scale)\r\n\t\tprint(\"\\tMole X:\", info.mole_xpos)\r\n\t\tprint(\"\\tMole Y:\", info.mole_ypos)\r\n\r\n\tprint(\"Images:\")\r\n\tfor image in mii.images:\r\n\t\tprint(\"\\t%s\" %image.url)\r\n\r\nanyio.run(main)\r\n"
  },
  {
    "path": "generate_protocols.py",
    "content": "\nimport string\nimport os\n\n\nTYPE_NAME = 0\nTYPE_RESERVED = 1\nTYPE_SYMBOL = 2\nTYPE_NUMBER = 3\nTYPE_STRING = 4\nTYPE_EOF = 5\n\nclass Token:\n\tdef __init__(self, type, value, row, col):\n\t\tself.type = type\n\t\tself.value = value\n\t\tself.row = row\n\t\tself.col = col\n\n\nNAME_HEAD_CHARS = string.ascii_letters + \"_\"\nNAME_CHARS = NAME_HEAD_CHARS + string.digits\n\nNUMBER_CHARS = string.digits + string.ascii_lowercase\n\nSPECIAL_CHARS = \"{}()[]<>:;,.-=!#\"\n\nRESERVED_WORDS = [\n\t\"import\", \"protocol\", \"method\", \"struct\", \"enum\",\n\t\"nex\", \"revision\", \"set\"\n]\n\t\t\t\nCHAR_EOF = \"EOF\"\n\nclass Tokenizer:\n\tdef process(self, data):\n\t\tself.tokens = []\n\t\tself.state = self.state_next\n\t\t\n\t\tself.row = 1\n\t\tself.col = 1\n\t\tfor char in data:\n\t\t\tself.state(char)\n\t\t\t\n\t\t\tif char == \"\\n\":\n\t\t\t\tself.row += 1\n\t\t\t\tself.col = 1\n\t\t\telse:\n\t\t\t\tself.col += 1\n\t\t\t\t\n\t\tself.state(CHAR_EOF)\n\t\tself.add(TYPE_EOF, None)\n\t\treturn self.tokens\n\t\t\n\tdef error(self, char):\n\t\traise ValueError(\"Unexpected character at %i:%i in %s: %s\" %(self.row, self.col, self.state.__name__, char))\n\t\n\tdef add(self, type, value):\n\t\ttoken = Token(type, value, self.token_row, self.token_col)\n\t\tself.tokens.append(token)\n\t\t\n\tdef state_next(self, char):\n\t\tself.token_row = self.row\n\t\tself.token_col = self.col\n\t\t\n\t\tif char == '\"':\n\t\t\tself.string = \"\"\n\t\t\tself.state = self.state_string\n\t\telif char == \"/\":\n\t\t\tself.state = self.state_comment_start\n\t\telif char == \"0\":\n\t\t\tself.number = \"\"\n\t\t\tself.state = self.state_number_prefix\n\t\telif char in NUMBER_CHARS[:10]:\n\t\t\tself.base = 10\n\t\t\tself.number = char\n\t\t\tself.state = self.state_number\n\t\telif char in NAME_HEAD_CHARS:\n\t\t\tself.name = char\n\t\t\tself.state = self.state_name\n\t\telif char in SPECIAL_CHARS:\n\t\t\tself.add(TYPE_SYMBOL, char)\n\t\telif char in string.whitespace or char == CHAR_EOF:\n\t\t\tpass\n\t\telse:\n\t\t\tself.error(char)\n\t\t\t\n\tdef state_comment_start(self, char):\n\t\tif char == \"/\":\n\t\t\tself.state = self.state_comment_line\n\t\telif char == \"*\":\n\t\t\tself.state = self.state_comment_block\n\t\telse:\n\t\t\tself.error(char)\n\t\t\t\n\tdef state_comment_line(self, char):\n\t\tif char == \"\\n\" or char == CHAR_EOF:\n\t\t\tself.state = self.state_next\n\t\t\t\n\tdef state_comment_block(self, char):\n\t\tif char == CHAR_EOF:\n\t\t\tself.error(char)\n\t\telif char == \"*\":\n\t\t\tself.state = self.state_comment_end\n\t\n\tdef state_comment_end(self, char):\n\t\tif char == \"/\":\n\t\t\tself.state = self.state_next\n\t\telse:\n\t\t\tself.state = self.state_comment_block\n\t\t\tself.state(char)\n\t\t\t\n\tdef state_name(self, char):\n\t\tif char in NAME_CHARS:\n\t\t\tself.name += char\n\t\telse:\n\t\t\tif self.name in RESERVED_WORDS:\n\t\t\t\tself.add(TYPE_RESERVED, self.name)\n\t\t\telse:\n\t\t\t\tself.add(TYPE_NAME, self.name)\n\t\t\tself.state = self.state_next\n\t\t\tself.state(char)\n\t\t\t\n\tdef state_string(self, char):\n\t\tif char == CHAR_EOF:\n\t\t\tself.error(char)\n\t\telif char == '\"':\n\t\t\tself.add(TYPE_STRING, self.string)\n\t\t\tself.state = self.state_next\n\t\telse:\n\t\t\tself.string += char\n\t\t\t\n\tdef state_number(self, char):\n\t\tif char.lower() in NUMBER_CHARS[:self.base]:\n\t\t\tself.number += char\n\t\telse:\n\t\t\tself.add(TYPE_NUMBER, int(self.number, self.base))\n\t\t\tself.state = self.state_next\n\t\t\tself.state(char)\n\t\t\t\n\tdef state_number_prefix(self, char):\n\t\tif char == \"x\":\n\t\t\tself.base = 16\n\t\t\tself.state = self.state_number\n\t\telse:\n\t\t\tself.base = 10\n\t\t\tself.number = \"0\"\n\t\t\tself.state = self.state_number\n\t\t\tself.state(char)\n\n\t\t\t\nclass TokenStream:\n\tdef __init__(self, tokens):\n\t\tself.tokens = tokens\n\t\tself.index = 0\n\t\t\n\tdef read(self):\n\t\ttoken = self.tokens[self.index]\n\t\tself.index += 1\n\t\treturn token\n\t\n\tdef peek(self):\n\t\treturn self.tokens[self.index]\n\t\t\n\tdef rewind(self):\n\t\tself.index -= 1\n\t\t\n\tdef error(self, token):\n\t\tif token.type == TYPE_EOF:\n\t\t\tmessage = \"Unexpected end of file\"\n\t\telse:\n\t\t\tmessage = \"Unexpected token at %i:%i: %s\" %(token.row, token.col, token.value)\n\t\traise ValueError(message)\n\t\t\n\tdef read_token(self, type):\n\t\ttoken = self.read()\n\t\tif token.type != type:\n\t\t\tself.error(token)\n\t\treturn token\n\t\t\n\tdef parse_token(self, type):\n\t\treturn self.read_token(type).value\n\t\t\n\tdef skip_token(self, type, value):\n\t\ttoken = self.read()\n\t\tif token.type != type or token.value != value:\n\t\t\tself.error(token)\n\t\n\tdef check_token(self, type, value):\n\t\ttoken = self.peek()\n\t\tif token.type == type and token.value == value:\n\t\t\tself.index += 1\n\t\t\treturn True\n\t\treturn False\n\t\n\tdef read_reserved(self): return self.read_token(TYPE_RESERVED)\n\tdef read_name(self): return self.read_token(TYPE_NAME)\n\tdef read_symbol(self): return self.read_token(TYPE_SYMBOL)\n\t\t\n\tdef parse_name(self): return self.parse_token(TYPE_NAME)\n\tdef parse_number(self): return self.parse_token(TYPE_NUMBER)\n\tdef parse_string(self): return self.parse_token(TYPE_STRING)\n\t\n\tdef check_reserved(self, value): return self.check_token(TYPE_RESERVED, value)\n\tdef check_symbol(self, value): return self.check_token(TYPE_SYMBOL, value)\n\tdef check_eof(self): return self.check_token(TYPE_EOF, None)\n\t\n\tdef skip_name(self, value): self.skip_token(TYPE_NAME, value)\n\tdef skip_reserved(self, value): self.skip_token(TYPE_RESERVED, value)\n\tdef skip_symbol(self, value): self.skip_token(TYPE_SYMBOL, value)\n\n\nclass Scope:\n\tdef __init__(self):\n\t\tself.names = []\n\t\t\n\tdef __contains__(self, name):\n\t\treturn name in self.names\n\t\t\n\tdef add(self, name):\n\t\tif name in self.names:\n\t\t\treturn True\n\t\tself.names.append(name)\n\t\treturn False\n\t\t\n\t\t\nclass File:\n\tdef __init__(self):\n\t\tself.protocols = {}\n\t\tself.structs = {}\n\t\tself.enums = []\n\t\t\n\t\tself.scope = Scope()\n\t\n\tdef check_protocols(self):\n\t\tfor proto in self.protocols.values():\n\t\t\tproto.check()\n\t\n\tdef sort_protocols(self):\n\t\tfor proto in self.protocols.values():\n\t\t\tproto.sort()\n\t\n\tdef sort_types(self):\n\t\tself.structs = {k: v for k, v in sorted(self.structs.items())}\n\t\tself.enums = sorted(self.enums, key=lambda e: e.name)\n\t\n\tdef add_file(self, file):\n\t\tfor proto in file.protocols.values():\n\t\t\tself.add_protocol(proto)\n\t\tfor struct in file.structs.values():\n\t\t\tself.add_struct(struct)\n\t\tfor enum in file.enums:\n\t\t\tself.add_enum(enum)\n\t\t\n\tdef add_protocol(self, proto):\n\t\tif self.scope.add(proto.name):\n\t\t\titem = self.protocols.get(proto.name)\n\t\t\tif not item or item.file == self or proto.file != self:\n\t\t\t\traise ValueError(\"%s is already defined\" %proto.name)\n\t\tself.protocols[proto.name] = proto\n\t\n\tdef add_struct(self, struct):\n\t\tif self.scope.add(struct.name):\n\t\t\titem = self.structs.get(struct.name)\n\t\t\tif not item or item.file == self or struct.file != self:\n\t\t\t\traise ValueError(\"%s is already defined\" %struct.name)\n\t\tself.structs[struct.name] = struct\n\t\n\tdef add_enum(self, enum):\n\t\tif self.scope.add(enum.name):\n\t\t\traise ValueError(\"%s is already defined\" %enum.name)\n\t\tself.enums.append(enum)\n\n\t\nclass Protocol:\n\tid = None\n\tname = None\n\toverridden = False\n\tnoresponse = False\n\t\n\tdef __init__(self):\n\t\tself.methods = {}\n\t\t\n\t\tself.scope = Scope()\n\t\t\n\tdef sort(self):\n\t\tself.methods = {k: v for k, v in sorted(self.methods.items())}\n\t\n\tdef check(self):\n\t\tif self.noresponse and any(method.response.vars for method in self.methods.values()):\n\t\t\traise ValueError(\"%s is marked noresponse but at least one method returns a non-empty response\" %self.name)\n\t\n\tdef add_method(self, method):\n\t\tif self.scope.add(method.name):\n\t\t\traise ValueError(\"%s is already defined in %s\" %(method.name, self.name))\n\t\tif method.id in self.methods:\n\t\t\traise ValueError(\"Method id %i is used twice in %s\" %(method.id, self.name))\n\t\tself.methods[method.id] = method\n\t\n\tdef set_parent(self, parent):\n\t\tparent.overridden = True\n\t\t\n\t\tself.id = parent.id\n\t\tfor method in parent.methods.values():\n\t\t\tif method.id not in self.methods:\n\t\t\t\tself.add_method(method)\n\t\t\n\nclass Method:\n\tid = None\n\tname = None\n\trequest = None\n\tresponse = None\n\tsupported = None\n\t\t\n\t\t\nclass VariableList:\n\tdef __init__(self):\n\t\tself.vars = []\n\t\tself.scope = Scope()\n\t\t\n\tdef add(self, var):\n\t\tif self.scope.add(var.name):\n\t\t\traise ValueError(\"Duplicate variable name: %s\" %var.name)\n\t\tself.vars.append(var)\n\t\t\n\t\t\nclass Variable:\n\ttype = None\n\tname = None\n\tdefault = None\n\t\t\n\nclass Type:\n\tname = None\n\ttemplate = None\n\t\t\n\t\t\nclass Struct:\n\tname = None\n\tparent = None\n\tbody = None\n\t\n\t\nclass Condition:\n\tVERSION = 0\n\tREVISION = 1\n\t\n\ttype = None\n\tminimum = None\n\tmaximum = None\n\tbody = None\n\n\nclass StructBody:\n\tdef __init__(self):\n\t\tself.fields = []\n\t\n\tdef has_revision(self):\n\t\tfor field in self.fields:\n\t\t\tif isinstance(field, Condition):\n\t\t\t\tif field.type == Condition.REVISION:\n\t\t\t\t\treturn True\n\t\t\t\tif field.body.has_revision():\n\t\t\t\t\treturn True\n\t\treturn False\n\t\t\n\tdef add(self, field):\n\t\tself.fields.append(field)\n\n\nclass Enum:\n\tname = None\n\t\n\tdef __init__(self):\n\t\tself.values = []\n\t\t\n\t\tself.scope = Scope()\n\t\n\tdef add(self, name, value):\n\t\tif self.scope.add(name):\n\t\t\traise ValueError(\"Name %s used twice in enum %s\" %(name, self.name))\n\t\tself.values.append((name, value))\n\n\nTEMPLATE_TYPES = {\n\t\"list\": 1,\n\t\"map\": 2\n}\n\nNUMERIC_TYPES = [\n\t\"uint8\", \"uint16\", \"uint32\", \"uint64\",\n\t\"sint8\", \"sint16\", \"sint32\", \"sint64\",\n\t\"pid\"\n]\n\nSTRING_TYPES = [\n\t\"string\", \"buffer\", \"qbuffer\", \"stationurl\"\n]\n\n\t\t\nclass Parser:\n\tdef process(self, tokens):\n\t\tstream = TokenStream(tokens)\n\t\treturn self.parse_file(stream)\n\t\n\tdef parse_file(self, stream):\n\t\tself.file = File()\n\t\twhile True:\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_EOF:\n\t\t\t\treturn self.file\n\t\t\telif token.type == TYPE_RESERVED and token.value == \"import\":\n\t\t\t\tself.parse_import(stream)\n\t\t\telif token.type == TYPE_RESERVED and token.value == \"protocol\":\n\t\t\t\tself.file.add_protocol(self.parse_protocol(stream))\n\t\t\telif token.type == TYPE_RESERVED and token.value == \"struct\":\n\t\t\t\tself.file.add_struct(self.parse_struct(stream))\n\t\t\telif token.type == TYPE_RESERVED and token.value == \"enum\":\n\t\t\t\tself.file.add_enum(self.parse_enum(stream))\n\t\t\telse:\n\t\t\t\tstream.error(token)\n\t\t\t\t\n\tdef parse_import(self, stream):\n\t\tstream.skip_reserved(\"import\")\n\t\tname = stream.parse_name()\n\t\tstream.skip_symbol(\";\")\n\t\t\n\t\tprint(\"Importing %s.proto\" %name)\n\t\t\n\t\tpath = \"nintendo/files/proto/%s.proto\" %name\n\t\twith open(path) as f:\n\t\t\ttext = f.read()\n\t\ttokens = Tokenizer().process(text)\n\t\tfile = Parser().process(tokens)\n\t\t\n\t\tself.file.add_file(file)\n\t\t\t\t\n\tdef parse_protocol(self, stream):\n\t\tstream.skip_reserved(\"protocol\")\n\t\t\n\t\tprotocol = Protocol()\n\t\tprotocol.file = self.file\n\t\tprotocol.name = stream.parse_name()\n\t\tstream.skip_symbol(\":\")\n\t\t\n\t\tparent = None\n\t\ttoken = stream.read()\n\t\tif token.type == TYPE_NUMBER:\n\t\t\tprotocol.id = token.value\n\t\telif token.type == TYPE_NAME:\n\t\t\tparent = token.value\n\t\telse:\n\t\t\tstream.error(token)\n\t\tstream.skip_symbol(\"{\")\n\t\t\n\t\tself.prev_method = 0\n\t\t\n\t\twhile True:\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_SYMBOL and token.value == \"}\":\n\t\t\t\tstream.skip_symbol(\"}\")\n\t\t\t\tbreak\n\t\t\telif token.type == TYPE_RESERVED:\n\t\t\t\tif token.value == \"method\": protocol.add_method(self.parse_method(stream))\n\t\t\t\telif token.value == \"set\":\n\t\t\t\t\tstream.skip_reserved(\"set\")\n\t\t\t\t\tstream.skip_name(\"noresponse\")\n\t\t\t\t\tstream.skip_symbol(\";\")\n\t\t\t\t\tprotocol.noresponse = True\n\t\t\t\telse:\n\t\t\t\t\tstream.error(token)\n\t\t\telse:\n\t\t\t\tstream.error(token)\n\t\t\t\t\n\t\tif parent:\n\t\t\tprotocol.set_parent(self.file.protocols[parent])\n\t\t\n\t\treturn protocol\n\t\t\t\t\n\tdef parse_method(self, stream):\n\t\tstream.skip_reserved(\"method\")\n\t\t\n\t\tmethod = Method()\n\t\t\n\t\ttoken = stream.peek()\n\t\tif token.type == TYPE_SYMBOL and token.value == \"(\":\n\t\t\tstream.skip_symbol(\"(\")\n\t\t\tmethod.id = stream.parse_number()\n\t\t\tstream.skip_symbol(\")\")\n\t\telse:\n\t\t\tmethod.id = self.prev_method + 1\n\t\tself.prev_method = method.id\n\t\t\n\t\tmethod.name = stream.parse_name()\n\t\t\n\t\ttoken = stream.read_symbol()\n\t\tif token.value == \"(\":\n\t\t\tmethod.request = self.parse_parameter_list(stream)\n\t\t\t\n\t\t\tstream.skip_symbol(\"{\")\n\t\t\tmethod.response = self.parse_variable_list(stream)\n\t\t\t\n\t\t\tmethod.supported = True\n\t\telif token.value == \";\":\n\t\t\tmethod.supported = False\n\t\telse:\n\t\t\tstream.error(token)\n\t\treturn method\n\t\t\n\tdef parse_parameter_list(self, stream):\n\t\tlist = VariableList()\n\t\t\n\t\ttoken = stream.peek()\n\t\tif token.type == TYPE_SYMBOL and token.value == \")\":\n\t\t\tstream.skip_symbol(\")\")\n\t\t\treturn list\n\t\t\n\t\twhile True:\n\t\t\tlist.add(self.parse_variable(stream))\n\t\t\t\n\t\t\ttoken = stream.read_symbol()\n\t\t\tif token.value == \")\":\n\t\t\t\treturn list\n\t\t\telif token.value != \",\":\n\t\t\t\tstream.error(token)\n\t\t\n\tdef parse_variable_list(self, stream):\n\t\tlist = VariableList()\n\t\t\n\t\twhile True:\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_SYMBOL and token.value == \"}\":\n\t\t\t\tstream.skip_symbol(\"}\")\n\t\t\t\treturn list\n\t\t\t\n\t\t\tlist.add(self.parse_variable(stream))\n\t\t\tstream.skip_symbol(\";\")\n\t\n\tdef parse_variable(self, stream):\n\t\tvar = Variable()\n\t\tvar.type = self.parse_type(stream)\n\t\tvar.name = stream.parse_name()\n\t\t\n\t\ttoken = stream.peek()\n\t\tif token.type == TYPE_SYMBOL and token.value == \"=\":\n\t\t\tstream.skip_symbol(\"=\")\n\t\t\tvar.default = self.parse_constant(stream, var.type)\n\t\t\n\t\treturn var\n\t\n\tdef parse_type(self, stream):\n\t\ttype = Type()\n\t\ttype.name = stream.parse_name()\n\t\t\n\t\tif type.name in TEMPLATE_TYPES:\n\t\t\ttype.template = self.parse_template(stream, TEMPLATE_TYPES[type.name])\n\n\t\telif type.name == \"anydata\":\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_SYMBOL and token.value == \"<\":\n\t\t\t\ttype.template = self.parse_template(stream, 1)\n\t\t\t\n\t\treturn type\n\t\n\tdef parse_template(self, stream, num):\n\t\ttemplate = []\n\t\t\n\t\tstream.skip_symbol(\"<\")\n\t\tfor i in range(num):\n\t\t\ttemplate.append(self.parse_type(stream))\n\t\t\tif i < num - 1:\n\t\t\t\tstream.skip_symbol(\",\")\n\t\tstream.skip_symbol(\">\")\n\t\treturn template\n\t\t\n\tdef parse_constant(self, stream, type):\n\t\tif type.name in NUMERIC_TYPES: return stream.parse_number()\n\t\telif type.name in STRING_TYPES: return stream.parse_string()\n\t\telif type.name == \"bool\":\n\t\t\ttoken = stream.read_name()\n\t\t\tif token.value not in [\"false\", \"true\"]:\n\t\t\t\tstream.error(token)\n\t\t\treturn token.value == \"true\"\n\t\telif type.name == \"datetime\":\n\t\t\ttoken = stream.read()\n\t\t\tif token.type == TYPE_NUMBER: return token.value\n\t\t\telif token.type == TYPE_NAME:\n\t\t\t\tif token.value == \"never\": return 0\n\t\t\t\tif token.value == \"future\": return 671076024059\n\t\t\tstream.error(token)\n\t\telif type.name == \"list\":\n\t\t\tlist = []\n\t\t\t\n\t\t\tstream.skip_symbol(\"[\")\n\t\t\t\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_SYMBOL and token.value == \"]\":\n\t\t\t\tstream.skip_symbol(\"]\")\n\t\t\t\treturn list\n\t\t\t\t\n\t\t\tsubtype = type.template[0]\n\t\t\twhile True:\n\t\t\t\tlist.append(self.parse_constant(stream, subtype))\n\t\t\t\t\n\t\t\t\ttoken = stream.read_symbol()\n\t\t\t\tif token.value == \"]\":\n\t\t\t\t\treturn list\n\t\t\t\telif token.value != \",\":\n\t\t\t\t\tstream.error(token)\n\t\telif type.name == \"map\":\n\t\t\tmap = {}\n\t\t\t\n\t\t\tstream.skip_symbol(\"{\")\n\t\t\t\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_SYMBOL and token.value == \"}\":\n\t\t\t\tstream.skip_symbol(\"}\")\n\t\t\t\treturn map\n\t\t\t\t\n\t\t\tkeytype = type.template[0]\n\t\t\tvaluetype = type.template[1]\n\t\t\twhile True:\n\t\t\t\tkey = self.parse_constant(stream, keytype)\n\t\t\t\tstream.skip_symbol(\":\")\n\t\t\t\tvalue = self.parse_constant(stream, valuetype)\n\t\t\t\tmap[key] = value\n\t\t\t\t\n\t\t\t\ttoken = stream.read_symbol()\n\t\t\t\tif token.value == \"}\":\n\t\t\t\t\treturn map\n\t\t\t\telif token.value != \",\":\n\t\t\t\t\tstream.error(token)\n\t\telse:\n\t\t\traise ValueError(\"Don't know how to parse constant for %s\" %type.name)\n\t\t\t\n\tdef parse_struct(self, stream):\n\t\tstream.skip_reserved(\"struct\")\n\t\t\n\t\tstruct = Struct()\n\t\tstruct.file = self.file\n\t\tstruct.name = stream.parse_name()\n\t\t\n\t\ttoken = stream.peek()\n\t\tif token.type == TYPE_SYMBOL and token.value == \":\":\n\t\t\tstream.skip_symbol(\":\")\n\t\t\tstruct.parent = stream.parse_name()\n\t\t\n\t\tstruct.body = self.parse_struct_body(stream)\n\t\treturn struct\n\t\t\n\tdef parse_struct_body(self, stream):\n\t\tbody = StructBody()\n\t\t\n\t\tstream.skip_symbol(\"{\")\n\t\twhile True:\n\t\t\ttoken = stream.peek()\n\t\t\tif token.type == TYPE_SYMBOL and token.value == \"}\":\n\t\t\t\tstream.skip_symbol(\"}\")\n\t\t\t\treturn body\n\t\t\t\n\t\t\tbody.add(self.parse_struct_item(stream))\n\t\n\tdef parse_struct_item(self, stream):\n\t\ttoken = stream.peek()\n\t\tif token.type == TYPE_RESERVED:\n\t\t\treturn self.parse_condition(stream)\n\t\t\n\t\tvar = self.parse_variable(stream)\n\t\tstream.skip_symbol(\";\")\n\t\treturn var\n\t\t\t\n\tdef parse_condition(self, stream):\n\t\tcond = Condition()\n\t\t\n\t\ttoken = stream.read_reserved()\n\t\tif token.value == \"nex\": cond.type = Condition.VERSION\n\t\telif token.value == \"revision\": cond.type = Condition.REVISION\n\t\telse:\n\t\t\tstream.error(token)\n\t\t\n\t\tcond.minimum = stream.parse_number()\n\t\tif stream.check_symbol(\"-\"):\n\t\t\tcond.maximum = stream.parse_number()\n\t\t\n\t\tcond.body = self.parse_struct_body(stream)\n\t\treturn cond\n\t\t\n\tdef parse_enum(self, stream):\n\t\tstream.skip_reserved(\"enum\")\n\t\t\n\t\tenum = Enum()\n\t\tenum.name = stream.parse_name()\n\t\tstream.skip_symbol(\"{\")\n\t\t\n\t\ttoken = stream.peek()\n\t\tif token.type == TYPE_SYMBOL and token.value == \"}\":\n\t\t\tstream.skip_symbol(\"}\")\n\t\t\treturn enum\n\t\t\n\t\twhile True:\n\t\t\tname = stream.parse_name()\n\t\t\tstream.skip_symbol(\"=\")\n\t\t\tvalue = stream.parse_number()\n\t\t\tenum.add(name, value)\n\t\t\t\n\t\t\ttoken = stream.read_symbol()\n\t\t\tif token.value == \"}\":\n\t\t\t\treturn enum\n\t\t\telif token.value != \",\":\n\t\t\t\tstream.error(token)\n\t\t\t\t\n\t\t\t\t\nclass CodeStream:\n\tdef __init__(self):\n\t\tself.code = \"\"\n\t\tself.tabs = 0\n\t\t\n\tdef get(self): return self.code\n\t\n\tdef indent(self): self.tabs += 1\n\tdef unindent(self): self.tabs -= 1\n\t\n\tdef write(self, text):\n\t\tself.code += text\n\t\t\n\tdef begin_line(self):\n\t\tself.write(\"\\t\" * self.tabs)\n\t\t\n\tdef write_line(self, line=\"\"):\n\t\tself.begin_line()\n\t\tself.write(line + \"\\n\")\n\t\t\t\t\n\t\t\t\t\nBASIC_TYPES = [\n\t\"float\", \"double\", \"bool\",\n\t\"pid\", \"result\", \"datetime\",\n\t\"string\", \"stationurl\", \"buffer\",\n\t\"qbuffer\", \"anydata\", \"variant\"\n]\n\nMAPPED_TYPES = {\n\t\"uint8\": \"u8\",\n\t\"uint16\": \"u16\",\n\t\"uint32\": \"u32\",\n\t\"uint64\": \"u64\",\n\t\n\t\"sint8\": \"s8\",\n\t\"sint16\": \"s16\",\n\t\"sint32\": \"s32\",\n\t\"sint64\": \"s64\",\n}\n\nEXTERNAL_TYPES = [\n\t\"ResultRange\", \"NotificationEvent\"\n]\n\ndef make_class_name(name, type):\n\tif \"_\" in name:\n\t\tname, ext = name.rsplit(\"_\", 1)\n\t\treturn \"%s%s%s\" %(name, type, ext)\n\treturn \"%s%s\" %(name, type)\n\nclass CodeGenerator:\n\tdef process(self, file):\n\t\tself.file = file\n\t\tself.file.check_protocols()\n\t\tself.file.sort_protocols()\n\t\t\n\t\tstream = CodeStream()\n\t\tself.generate_file(stream)\n\t\treturn stream.get()\n\t\t\n\tdef generate_file(self, stream):\n\t\tself.generate_header(stream)\n\t\tfor enum in self.file.enums:\n\t\t\tself.generate_enum(stream, enum)\n\t\tfor struct in self.file.structs.values():\n\t\t\tself.generate_struct(stream, struct)\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tself.generate_protocol(stream, proto)\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tself.generate_client(stream, proto)\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tself.generate_server(stream, proto)\n\t\t\n\tdef generate_header(self, stream):\n\t\tstream.write_line()\n\t\tstream.write_line(\"# This file was generated automatically by generate_protocols.py\")\n\t\tstream.write_line()\n\t\tstream.write_line(\"from nintendo.nex import notification, rmc, common, streams\")\n\t\tstream.write_line()\n\t\tstream.write_line(\"import logging\")\n\t\tstream.write_line(\"logger = logging.getLogger(__name__)\")\n\t\tstream.write_line()\n\t\t\t\n\tdef generate_enum(self, stream, enum):\n\t\tstream.write_line()\n\t\tstream.write_line(\"class %s:\" %enum.name)\n\t\tstream.indent()\n\t\tif enum.values:\n\t\t\tfor name, value in enum.values:\n\t\t\t\tstream.write_line(\"%s = %i\" %(name, value))\n\t\telse:\n\t\t\tstream.write_line(\"pass\")\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_struct(self, stream, struct):\n\t\tstream.write_line()\n\t\t\n\t\tparent = struct.parent\n\t\tif parent is None:\n\t\t\tparent = \"common.Structure\"\n\t\telif parent == \"Data\":\n\t\t\tparent = \"common.Data\"\n\t\tstream.write_line(\"class %s(%s):\" %(struct.name, parent))\n\t\tstream.indent()\n\t\t\n\t\tself.generate_struct_init(stream, struct)\n\t\tself.generate_struct_version(stream, struct)\n\t\tself.generate_struct_check(stream, struct)\n\t\tself.generate_struct_load(stream, struct)\n\t\tself.generate_struct_save(stream, struct)\n\t\t\n\t\tstream.unindent()\n\t\tif struct.parent:\n\t\t\tstream.write_line('common.DataHolder.register(%s, \"%s\")' %(struct.name, struct.name))\n\t\tstream.write_line()\n\t\t\n\tdef generate_struct_init(self, stream, struct):\n\t\tstream.write_line(\"def __init__(self):\")\n\t\tstream.indent()\n\t\tstream.write_line(\"super().__init__()\")\n\t\tself.generate_struct_init_body(stream, struct.body, {})\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_struct_init_body(self, stream, body, defaults):\n\t\tfor field in body.fields:\n\t\t\tif isinstance(field, Variable):\n\t\t\t\tif field.name in defaults:\n\t\t\t\t\tif defaults[field.name] != field.default:\n\t\t\t\t\t\traise ValueError(\"Duplicate variable name in struct with incompatible defaults: %s\" %field.name)\n\t\t\t\telse:\n\t\t\t\t\tdefaults[field.name] = field.default\n\t\t\t\t\tstream.write_line(\"self.%s = %s\" %(field.name, self.make_constant(field.type, field.default)))\n\t\t\t\n\t\t\telif isinstance(field, Condition):\n\t\t\t\tself.generate_struct_init_body(stream, field.body, defaults)\n\t\n\tdef generate_if_statement(self, stream, cond, prefix=\"\"):\n\t\tfield = f'{prefix}settings[\"nex.version\"]' if cond.type == Condition.VERSION else \"version\"\n\t\tif cond.maximum is None:\n\t\t\tstream.write_line(f\"if {field} >= {cond.minimum}:\")\n\t\telse:\n\t\t\tstream.write_line(f\"if {cond.minimum} <= {field} < {cond.maximum}:\")\n\t\n\tdef generate_struct_version(self, stream, struct):\n\t\tif struct.body.has_revision():\n\t\t\tstream.write_line(\"def max_version(self, settings):\")\n\t\t\tstream.indent()\n\t\t\tstream.write_line(\"version = 0\")\n\t\t\tself.generate_struct_version_body(stream, struct.body)\n\t\t\tstream.write_line(\"return version\")\n\t\t\tstream.unindent()\n\t\t\tstream.write_line()\n\t\t\t\n\tdef generate_struct_version_body(self, stream, body):\n\t\tfor field in body.fields:\n\t\t\tif isinstance(field, Condition):\n\t\t\t\tif field.type == Condition.REVISION:\n\t\t\t\t\tstream.write_line(\"version = %i\" %field.minimum)\n\t\t\t\telif field.type == Condition.VERSION:\n\t\t\t\t\tif field.body.has_revision():\n\t\t\t\t\t\tself.generate_if_statement(stream, field)\n\t\t\t\t\t\tstream.indent()\n\t\t\t\t\t\tself.generate_struct_version_body(stream, field.body)\n\t\t\t\t\t\tstream.unindent()\n\t\t\t\t\t\n\tdef generate_struct_check(self, stream, struct):\n\t\tstream.write_line(\"def check_required(self, settings, version):\")\n\t\tstream.indent()\n\t\tself.generate_struct_check_body(stream, struct.body)\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_struct_check_body(self, stream, body):\n\t\trequired = []\n\t\tfor field in body.fields:\n\t\t\tif isinstance(field, Variable):\n\t\t\t\tif field.type.name not in self.file.structs and \\\n\t\t\t\t   field.type.name not in EXTERNAL_TYPES and \\\n\t\t\t\t   field.default is None:\n\t\t\t\t\trequired.append(field.name)\n\t\tif required:\n\t\t\tstream.write_line(\"for field in %s:\" %required)\n\t\t\tstream.write_line(\"\\tif getattr(self, field) is None:\")\n\t\t\tstream.write_line('\\t\\traise ValueError(\"No value assigned to required field: %s\" %field)')\n\t\t\n\t\tconditions = [f for f in body.fields if isinstance(f, Condition)]\n\t\tfor cond in conditions:\n\t\t\tself.generate_if_statement(stream, cond)\n\t\t\tstream.indent()\n\t\t\tself.generate_struct_check_body(stream, cond.body)\n\t\t\tstream.unindent()\n\t\t\t\n\t\tif not required and not conditions:\n\t\t\tstream.write_line(\"pass\")\n\t\t\n\tdef generate_struct_load(self, stream, struct):\n\t\tstream.write_line(\"def load(self, stream, version):\")\n\t\tstream.indent()\n\t\tself.generate_struct_load_body(stream, struct.body)\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_struct_load_body(self, stream, body):\n\t\tif not body.fields:\n\t\t\tstream.write_line(\"pass\")\n\t\t\n\t\tfor field in body.fields:\n\t\t\tif isinstance(field, Variable):\n\t\t\t\tstream.write_line(\"self.%s = %s\" %(field.name, self.make_extract(field.type)))\n\t\t\telif isinstance(field, Condition):\n\t\t\t\tself.generate_if_statement(stream, field, \"stream.\")\n\t\t\t\tstream.indent()\n\t\t\t\tself.generate_struct_load_body(stream, field.body)\n\t\t\t\tstream.unindent()\n\t\t\n\tdef generate_struct_save(self, stream, struct):\n\t\tstream.write_line(\"def save(self, stream, version):\")\n\t\tstream.indent()\n\t\tstream.write_line(\"self.check_required(stream.settings, version)\")\n\t\tself.generate_struct_save_body(stream, struct.body)\n\t\tstream.unindent()\n\t\n\tdef generate_struct_save_body(self, stream, body):\n\t\tfor field in body.fields:\n\t\t\tif isinstance(field, Variable):\n\t\t\t\tstream.write_line(self.make_encode(field.type, \"self.%s\" %field.name))\n\t\t\telif isinstance(field, Condition):\n\t\t\t\tself.generate_if_statement(stream, field, \"stream.\")\n\t\t\t\tstream.indent()\n\t\t\t\tself.generate_struct_save_body(stream, field.body)\n\t\t\t\tstream.unindent()\n\t\t\n\tdef generate_protocol(self, stream, proto):\n\t\tname = make_class_name(proto.name, \"Protocol\")\n\t\t\n\t\tstream.write_line()\n\t\tstream.write_line(\"class %s:\" %name)\n\t\tstream.indent()\n\t\t\n\t\tif proto.noresponse:\n\t\t\tstream.write_line(\"NORESPONSE = True\")\n\t\t\tstream.write_line()\n\t\t\n\t\tfor method in proto.methods.values():\n\t\t\tstream.write_line(\"METHOD_%s = %i\" %(method.name.upper(), method.id))\n\t\tstream.write_line()\n\t\tstream.write_line(\"PROTOCOL_ID = 0x%X\" %proto.id)\n\t\t\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_client(self, stream, proto):\n\t\tproto_name = make_class_name(proto.name, \"Protocol\")\n\t\tclient_name = make_class_name(proto.name, \"Client\")\n\t\t\n\t\tstream.write_line()\n\t\tstream.write_line(\"class %s(%s):\" %(client_name, proto_name))\n\t\tstream.indent()\n\t\t\n\t\tstream.write_line(\"def __init__(self, client):\")\n\t\tstream.write_line(\"\\tself.settings = client.settings\")\n\t\tstream.write_line(\"\\tself.client = client\")\n\t\tstream.write_line()\n\t\t\t\n\t\tfirst = True\n\t\tfor method in proto.methods.values():\n\t\t\tif method.supported:\n\t\t\t\tif not first:\n\t\t\t\t\tstream.write_line()\n\t\t\t\telse:\n\t\t\t\t\tfirst = False\n\t\t\t\tself.generate_client_method(stream, proto, method)\n\t\t\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_client_method(self, stream, proto, method):\n\t\tclass_name = make_class_name(proto.name, \"Client\")\n\t\n\t\tparam = \", \".join([\"self\"] + [param.name for param in method.request.vars])\n\t\tstream.write_line(\"async def %s(%s):\" %(method.name, param))\n\t\t\n\t\tstream.indent()\n\t\tstream.write_line('logger.info(\"%s.%s()\")' %(class_name, method.name))\n\t\tstream.write_line(\"#--- request ---\")\n\t\tstream.write_line(\"stream = streams.StreamOut(self.settings)\")\n\t\tfor param in method.request.vars:\n\t\t\tstream.write_line(self.make_encode(param.type, param.name))\n\t\t\n\t\tif proto.noresponse:\n\t\t\tstream.write_line(\"await self.client.request(self.PROTOCOL_ID, self.METHOD_%s, stream.get(), True)\" %method.name.upper())\n\t\telse:\n\t\t\tstream.write_line(\"data = await self.client.request(self.PROTOCOL_ID, self.METHOD_%s, stream.get())\" %method.name.upper())\n\t\t\t\n\t\t\tstream.write_line()\n\t\t\tstream.write_line(\"#--- response ---\")\n\t\t\tstream.write_line(\"stream = streams.StreamIn(data, self.settings)\")\n\t\t\tif len(method.response.vars) > 1:\n\t\t\t\tstream.write_line(\"obj = rmc.RMCResponse()\")\n\t\t\t\tfor var in method.response.vars:\n\t\t\t\t\tstream.write_line(\"obj.%s = %s\" %(var.name, self.make_extract(var.type)))\n\t\t\telif len(method.response.vars) == 1:\n\t\t\t\tvalue = method.response.vars[0]\n\t\t\t\tstream.write_line(\"%s = %s\" %(value.name, self.make_extract(value.type)))\n\t\t\tstream.write_line(\"if not stream.eof():\")\n\t\t\tstream.write_line('\\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))')\n\t\t\tstream.write_line('logger.info(\"%s.%s -> done\")' %(class_name, method.name))\n\t\t\tif len(method.response.vars) > 1:\n\t\t\t\tstream.write_line(\"return obj\")\n\t\t\telif len(method.response.vars) == 1:\n\t\t\t\tstream.write_line(\"return %s\"  %(method.response.vars[0].name))\n\t\t\t\n\t\tstream.unindent()\n\t\t\n\tdef generate_server(self, stream, proto):\n\t\tserver_name = make_class_name(proto.name, \"Server\")\n\t\tproto_name = make_class_name(proto.name, \"Protocol\")\n\t\t\n\t\tstream.write_line()\n\t\tstream.write_line(\"class %s(%s):\" %(server_name, proto_name))\n\t\tstream.indent()\n\t\t\n\t\tstream.write_line(\"def __init__(self):\")\n\t\tstream.indent()\n\t\tstream.write_line(\"self.methods = {\")\n\t\tfor method in proto.methods.values():\n\t\t\tstream.write_line(\"\\tself.METHOD_%s: self.handle_%s,\" %(method.name.upper(), method.name))\n\t\tstream.write_line(\"}\")\n\t\tstream.unindent()\n\t\t\n\t\tstream.write_line()\n\t\tstream.write_line(\"async def logout(self, client):\")\n\t\tstream.write_line(\"\\tpass\")\n\t\tstream.write_line()\n\t\tstream.write_line(\"async def handle(self, client, method_id, input, output):\")\n\t\tstream.write_line(\"\\tif method_id in self.methods:\")\n\t\tstream.write_line(\"\\t\\tawait self.methods[method_id](client, input, output)\")\n\t\tstream.write_line(\"\\telse:\")\n\t\tstream.write_line('\\t\\tlogger.warning(\"Unknown method called on %s: %%i\", method_id)' %server_name)\n\t\tstream.write_line('\\t\\traise common.RMCError(\"Core::NotImplemented\")')\n\t\t\n\t\tfor method in proto.methods.values():\n\t\t\tstream.write_line()\n\t\t\tself.generate_server_method(stream, proto, method)\n\t\tfor method in proto.methods.values():\n\t\t\tif method.supported:\n\t\t\t\tstream.write_line()\n\t\t\t\tself.generate_server_stub(stream, proto, method)\n\t\t\n\t\tstream.unindent()\n\t\tstream.write_line()\n\t\t\n\tdef generate_server_method(self, stream, proto, method):\n\t\tclass_name = make_class_name(proto.name, \"Server\")\n\t\n\t\tstream.write_line(\"async def handle_%s(self, client, input, output):\" %method.name)\n\t\t\n\t\tif not method.supported:\n\t\t\tstream.write_line('\\tlogger.warning(\"%s.%s is not supported\")' %(class_name, method.name))\n\t\t\tstream.write_line('\\traise common.RMCError(\"Core::NotImplemented\")')\n\t\t\treturn\n\t\t\t\n\t\tstream.indent()\n\t\tstream.write_line('logger.info(\"%s.%s()\")' %(class_name, method.name))\n\t\tstream.write_line(\"#--- request ---\")\n\t\tfor param in method.request.vars:\n\t\t\tstream.write_line(\"%s = %s\" %(param.name, self.make_extract(param.type, \"input\")))\n\t\t\n\t\tparams = \", \".join([\"client\"] + [p.name for p in method.request.vars])\n\t\t\n\t\tif len(method.response.vars) > 1:\n\t\t\tnames = [var.name for var in method.response.vars]\n\t\t\tstream.write_line(\"response = await self.%s(%s)\" %(method.name, params))\n\t\t\tstream.write_line()\n\t\t\tstream.write_line(\"#--- response ---\")\n\t\t\tstream.write_line(\"if not isinstance(response, rmc.RMCResponse):\")\n\t\t\tstream.write_line('\\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)')\n\t\t\tstream.write_line(\"for field in %s:\" %names)\n\t\t\tstream.write_line(\"\\tif not hasattr(response, field):\")\n\t\t\tstream.write_line('\\t\\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)')\n\t\t\tfor var in method.response.vars:\n\t\t\t\tstream.write_line(self.make_encode(var.type, \"response.%s\" %var.name, \"output\"))\n\t\telif len(method.response.vars) == 1:\n\t\t\tvar = method.response.vars[0]\n\t\t\texpected = self.make_python_type(var.type)\n\t\t\tstream.write_line(\"response = await self.%s(%s)\" %(method.name, params))\n\t\t\tstream.write_line()\n\t\t\tstream.write_line(\"#--- response ---\")\n\t\t\tstream.write_line(\"if not isinstance(response, %s):\" %expected)\n\t\t\tstream.write_line('\\traise RuntimeError(\"Expected %s, got %%s\" %%response.__class__.__name__)' %expected)\n\t\t\tstream.write_line(self.make_encode(var.type, \"response\", \"output\"))\n\t\telse:\n\t\t\tstream.write_line(\"await self.%s(%s)\" %(method.name, params))\n\t\tstream.unindent()\n\t\t\n\tdef generate_server_stub(self, stream, proto, method):\n\t\tclass_name = make_class_name(proto.name, \"Server\")\n\t\tstream.write_line(\"async def %s(self, *args):\" %method.name)\n\t\tstream.write_line('\\tlogger.warning(\"%s.%s not implemented\")' %(class_name, method.name))\n\t\tstream.write_line('\\traise common.RMCError(\"Core::NotImplemented\")')\n\t\t\n\tdef make_python_type(self, type):\n\t\tif type.name == \"bool\": return \"bool\"\n\t\tif type.name == \"list\": return \"list\"\n\t\tif type.name == \"map\": return \"dict\"\n\t\tif type.name == \"string\": return \"str\"\n\t\tif type.name == \"variant\": return \"object\"\n\t\tif type.name in [\"buffer\", \"qbuffer\"]: return \"bytes\"\n\t\tif type.name == \"datetime\": return \"common.DateTime\"\n\t\tif type.name == \"stationurl\": return \"common.StationURL\"\n\t\tif type.name == \"result\": return \"common.Result\"\n\t\tif type.name == \"anydata\":\n\t\t\tif type.template:\n\t\t\t\treturn self.make_python_type(type.template[0])\n\t\t\treturn \"common.Data\"\n\t\tif type.name == \"ResultRange\": return \"common.ResultRange\"\n\t\tif type.name == \"NotificationEvent\": return \"notification.NotificationEvent\"\n\t\tif type.name in self.file.structs: return type.name\n\t\tif type.name in NUMERIC_TYPES: return \"int\"\n\t\traise ValueError(\"Unknown type: %s\" %type.name)\n\t\t\t\t\n\tdef make_constant(self, type, value):\n\t\tif type.name in self.file.structs: return \"%s()\" %type.name\n\t\tif type.name == \"ResultRange\": return \"common.ResultRange()\"\n\t\tif type.name == \"NotificationEvent\": return \"notification.NotificationEvent()\"\n\t\t\n\t\tif value is None:\n\t\t\treturn \"None\"\n\t\t\n\t\tif type.name == \"datetime\": return \"common.DateTime(%i)\" %value\n\t\tif type.name == \"string\": return '\"%s\"' %value\n\t\tif type.name == \"stationurl\": return 'common.StationURL.parse(\"%s\")' %value\n\t\tif type.name in [\"buffer\", \"qbuffer\"]: return 'b\"%s\"' %value\n\t\tif type.name in NUMERIC_TYPES + [\"bool\"]: return str(value)\n\t\tif type.name == \"list\":\n\t\t\tentries = []\n\t\t\tfor entry in value:\n\t\t\t\tentries.append(self.make_constant(type.template[0], entry))\n\t\t\treturn \"[%s]\" %\", \".join(entries)\n\t\tif type.name == \"map\":\n\t\t\titems = []\n\t\t\tfor key, value in value.items():\n\t\t\t\tkey = self.make_constant(type.template[0], key)\n\t\t\t\tvalue = self.make_constant(type.template[1], value)\n\t\t\t\titems.append(\"%s: %s\" %(key, value))\n\t\t\treturn \"{%s}\" %\", \".join(items)\n\t\t\n\t\traise ValueError(\"Unknown type: %s\" %type.name)\t\t\n\t\t\n\tdef make_extract(self, type, stream=\"stream\"):\n\t\tif type.name in BASIC_TYPES: return \"%s.%s()\" %(stream, type.name)\n\t\tif type.name in MAPPED_TYPES: return \"%s.%s()\" %(stream, MAPPED_TYPES[type.name])\n\t\tif type.name in self.file.structs: return \"%s.extract(%s)\" %(stream, type.name)\n\t\tif type.name == \"ResultRange\": return \"%s.extract(common.ResultRange)\" %stream\n\t\tif type.name == \"NotificationEvent\": return \"%s.extract(notification.NotificationEvent)\" %stream\n\t\tif type.name == \"list\":\n\t\t\tfunc = self.make_extract_func(type.template[0], stream)\n\t\t\treturn \"%s.list(%s)\" %(stream, func)\n\t\tif type.name == \"map\":\n\t\t\tkeyfunc = self.make_extract_func(type.template[0], stream)\n\t\t\tvaluefunc = self.make_extract_func(type.template[1], stream)\n\t\t\treturn \"%s.map(%s, %s)\" %(stream, keyfunc, valuefunc)\n\t\traise ValueError(\"Unknown type: %s\" %type.name)\n\t\n\tdef make_extract_func(self, type, stream=\"stream\"):\n\t\tif type.name in BASIC_TYPES: return \"%s.%s\" %(stream, type.name)\n\t\tif type.name in MAPPED_TYPES: return \"%s.%s\" %(stream, MAPPED_TYPES[type.name])\n\t\tif type.name in self.file.structs: return type.name\n\t\tif type.name == \"ResultRange\": return \"common.ResultRange\"\n\t\tif type.name == \"NotificationEvent\": return \"notification.NotificationEvent\"\n\t\tif type.name == \"list\":\n\t\t\treturn \"lambda: %s.list(%s)\" %(stream, self.make_extract_func(type.template[0], stream))\n\t\traise ValueError(\"Unknown type in list: %s\" %type.name)\n\t\t\n\tdef make_encode(self, type, name, stream=\"stream\"):\n\t\tif type.name == \"list\":\n\t\t\tfunc = self.make_encode_func(type.template[0], stream)\n\t\t\treturn \"%s.list(%s, %s)\" %(stream, name, func)\n\t\tif type.name == \"map\":\n\t\t\tkeyfunc = self.make_encode_func(type.template[0], stream)\n\t\t\tvaluefunc = self.make_encode_func(type.template[1], stream)\n\t\t\treturn \"%s.map(%s, %s, %s)\" %(stream, name, keyfunc, valuefunc)\n\t\treturn \"%s(%s)\" %(self.make_encode_func(type, stream), name)\n\t\t\n\tdef make_encode_func(self, type, stream=\"stream\"):\n\t\tif type.name in BASIC_TYPES: return \"%s.%s\" %(stream, type.name)\n\t\tif type.name in MAPPED_TYPES: return \"%s.%s\" %(stream, MAPPED_TYPES[type.name])\n\t\tif type.name in self.file.structs: return \"%s.add\" %stream\n\t\tif type.name in EXTERNAL_TYPES: return \"%s.add\" %stream\n\t\tif type.name == \"list\":\n\t\t\treturn \"lambda x: %s.list(x, %s)\" %(stream, self.make_encode_func(type.template[0], stream))\n\t\traise ValueError(\"Unknown type: %s\" %type.name)\n\n\t\t\nclass DocsGenerator:\n\tdef process(self, file, name):\n\t\tself.file = file\n\t\tself.file.sort_types()\n\t\t\n\t\tself.text = \"\"\n\t\tself.generate_file(name)\n\t\treturn self.text\n\t\t\n\tdef generate_file(self, name):\n\t\tself.generate_header(name)\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tself.generate_client(proto)\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tself.generate_server(proto)\n\t\tfor enum in self.file.enums:\n\t\t\tself.generate_enum(enum)\n\t\tfor struct in self.file.structs.values():\n\t\t\tself.generate_struct(struct)\n\t\t\n\tdef generate_header(self, name):\n\t\tself.text += \"\\n# Module: <code>nintendo.nex.%s</code>\\n\\n\" %name\n\t\tself.text += \"Provides a client and server for the \"\n\t\t\n\t\tprotocols = []\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tprotocols.append(proto)\n\t\t\n\t\tfor i, proto in enumerate(protocols):\n\t\t\tself.text += \"`%s`\" %make_class_name(proto.name, \"Protocol\")\n\t\t\tif i < len(protocols) - 2:\n\t\t\t\tself.text += \", \"\n\t\t\telif i == len(protocols) - 2:\n\t\t\t\tself.text += \" and \"\n\t\t\t\t\n\t\tself.text += \". This page was generated automatically from `%s.proto`.\\n\\n\" %name\n\t\t\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tname = make_class_name(proto.name, \"Client\")\n\t\t\t\tproto = make_class_name(proto.name, \"Protocol\")\n\t\t\t\tself.text += \"<code>**class** [%s](#%s)</code><br>\\n\" %(name, name.lower())\n\t\t\t\tself.text += '<span class=\"docs\">The client for the `%s`.</span>\\n\\n' %proto\n\t\t\n\t\tfor proto in self.file.protocols.values():\n\t\t\tif not proto.overridden:\n\t\t\t\tname = make_class_name(proto.name, \"Server\")\n\t\t\t\tproto = make_class_name(proto.name, \"Protocol\")\n\t\t\t\tself.text += \"<code>**class** [%s](#%s)</code><br>\\n\" %(name, name.lower())\n\t\t\t\tself.text += '<span class=\"docs\">The server for the `%s`.</span>\\n\\n' %proto\n\t\t\n\t\tfor enum in self.file.enums:\n\t\t\tself.text += \"<code>**class** [%s](#%s)</code><br>\\n\" %(enum.name, enum.name.lower())\n\t\tif self.file.enums:\n\t\t\tself.text += \"\\n\"\n\t\t\n\t\tfor struct in self.file.structs.values():\n\t\t\tif not struct.parent:\n\t\t\t\tparent = \"[Structure](common.md)\"\n\t\t\telif struct.parent == \"Data\":\n\t\t\t\tparent = \"[Data](common.md)\"\n\t\t\telif struct.parent in self.file.structs:\n\t\t\t\tparent = \"[%s](#%s)\" %(struct.parent, struct.parent.lower())\n\t\t\telse:\n\t\t\t\traise ValueError(\"Unknown struct parent: %s\" %struct.parent)\n\t\t\tself.text += \"<code>**class** [%s](#%s)(%s)</code><br>\\n\" %(struct.name, struct.name.lower(), parent)\n\t\tif self.file.structs:\n\t\t\tself.text += \"\\n\"\n\t\t\t\n\tdef generate_enum(self, enum):\n\t\tself.text += \"## %s\\n\" %enum.name\n\t\tself.text += \"This class defines the following constants:<br>\\n\"\n\t\tself.text += '<span class=\"docs\">\\n'\n\t\tfor name, value in enum.values:\n\t\t\tself.text += \"`%s = %i`<br>\\n\" %(name, value)\n\t\tself.text += \"</span>\\n\\n\"\n\t\t\n\tdef generate_struct(self, struct):\n\t\tself.text += \"## %s\\n\" %struct.name\n\t\tself.text += \"<code>**def _\\\\_init__**()</code><br>\\n\"\n\t\tself.text += '<span class=\"docs\">Creates a new `%s` instance.' %struct.name\n\t\tself.text += \" Required fields must be filled in manually.</span>\\n\\n\"\n\t\tself.text += \"The following fields are defined in this class:<br>\\n\"\n\t\tself.generate_struct_body(struct.body)\n\t\tself.text += \"\\n\"\n\t\n\tdef generate_struct_body(self, body):\n\t\tself.text += '<span class=\"docs\">\\n'\n\t\tfor field in body.fields:\n\t\t\tif isinstance(field, Variable):\n\t\t\t\tvariable = self.format_variable(field, True)\n\t\t\t\tself.text += \"<code>%s</code><br>\\n\" %variable\n\t\t\telif isinstance(field, Condition):\n\t\t\t\ttype = {\n\t\t\t\t\tCondition.VERSION: \"nex.version\",\n\t\t\t\t\tCondition.REVISION: \"revision\"\n\t\t\t\t}[field.type]\n\t\t\t\tif field.maximum is None:\n\t\t\t\t\tself.text += f\"If `{type}` >= {field.minimum}:<br>\\n\"\n\t\t\t\telse:\n\t\t\t\t\tself.text += f\"If {field.minimum} <= `{type}` < {field.maximum}:<br>\\n\"\n\t\t\t\tself.generate_struct_body(field.body)\n\t\tself.text += \"</span><br>\\n\"\n\t\t\n\tdef generate_client(self, proto):\n\t\tname = make_class_name(proto.name, \"Client\")\n\t\tself.text += \"## %s\\n\" %name\n\t\tself.text += \"<code>**def _\\\\_init__**(client: [RMCClient](rmc.md#rmcclient) / [HppClient](hpp.md#hppclient))</code><br>\\n\"\n\t\tself.text += '<span class=\"docs\">Creates a new [`%s`](#%s).</span>\\n\\n' %(name, name.lower())\n\t\t\n\t\tfor method in proto.methods.values():\n\t\t\tif method.supported:\n\t\t\t\tself.generate_client_method(method)\n\t\t\n\tdef generate_client_method(self, method):\n\t\tparam = \", \".join([self.format_variable(param, False) for param in method.request.vars])\n\t\trval = self.format_return_value(method)\n\t\tself.text += \"<code>**async def %s**(%s) -> %s</code><br>\\n\" %(method.name, param, rval)\n\t\tself.text += '<span class=\"docs\">Calls method `%i` on the server.' %method.id\n\t\tif len(method.response.vars) > 1:\n\t\t\tself.text += \" The RMC response has the following attributes:<br>\\n\"\n\t\t\tself.text += '<span class=\"docs\">\\n'\n\t\t\tfor var in method.response.vars:\n\t\t\t\tself.text += \"<code>%s</code><br>\\n\" %self.format_variable(var, False)\n\t\t\tself.text += \"</span>\\n\"\n\t\tself.text += \"</span>\\n\\n\"\n\t\t\n\tdef generate_server(self, proto):\n\t\tname = make_class_name(proto.name, \"Server\")\n\t\tself.text += \"## %s\\n\" %name\n\t\tself.text += \"<code>**def _\\\\_init__**()</code><br>\\n\"\n\t\tself.text += '<span class=\"docs\">Creates a new [`%s`](#%s).</span>\\n\\n' %(name, name.lower())\n\t\tself.text += \"<code>**async def logout**(client: [RMCClient](rmc.md#rmcclient)) -> None</code><br>\\n\"\n\t\tself.text += '<span class=\"docs\">Called whenever a client is disconnected. May be overridden by a subclass.</span>\\n\\n'\n\t\t\n\t\tfor method in proto.methods.values():\n\t\t\tif method.supported:\n\t\t\t\tself.generate_server_method(method)\n\t\t\n\tdef generate_server_method(self, method):\n\t\tparam = [\"client: [RMCClient](rmc.md#rmcclient)\"]\n\t\tparam += [self.format_variable(param, False) for param in method.request.vars]\n\t\tparam = \", \".join(param)\n\t\trval = self.format_return_value(method)\n\t\tself.text += \"<code>**async def %s**(%s) -> %s</code><br>\\n\" %(method.name, param, rval)\n\t\tself.text += '<span class=\"docs\">Handler for method `%i`.' %method.id\n\t\tself.text += \" This method should be overridden by a subclass.\"\n\t\tif len(method.response.vars) > 1:\n\t\t\tself.text += \" The RMC response must have the following attributes:<br>\\n\"\n\t\t\tself.text += '<span class=\"docs\">\\n'\n\t\t\tfor var in method.response.vars:\n\t\t\t\tself.text += \"<code>%s</code><br>\\n\" %self.format_variable(var, False)\n\t\t\tself.text += \"</span>\\n\"\n\t\tself.text += \"</span>\\n\\n\"\n\t\n\tdef format_variable(self, var, defaults):\n\t\ttext = \"%s: %s\" %(var.name, self.format_type(var.type))\n\t\tif defaults:\n\t\t\tif var.default is not None or var.type.name in [\"ResultRange\", \"NotificationEvent\"] or var.type.name in self.file.structs:\n\t\t\t\ttext += \" = %s\" %self.format_constant(var.type, var.default)\n\t\treturn text\n\t\n\tdef format_type(self, type):\n\t\tif type.name == \"bool\": return \"bool\"\n\t\tif type.name == \"string\": return \"str\"\n\t\tif type.name in [\"float\", \"double\"]: return \"float\"\n\t\tif type.name in [\"buffer\", \"qbuffer\"]: return \"bytes\"\n\t\tif type.name == \"variant\": return \"object\"\n\t\tif type.name == \"datetime\": return \"[DateTime](common.md#datetime)\"\n\t\tif type.name == \"stationurl\": return \"[StationURL](common.md#stationurl)\"\n\t\tif type.name == \"result\": return \"[Result](common.md#result)\"\n\t\tif type.name == \"anydata\":\n\t\t\tif type.template:\n\t\t\t\treturn self.format_type(type.template[0])\n\t\t\treturn \"[Data](common.md)\"\n\t\tif type.name == \"ResultRange\": return \"[ResultRange](common.md#resultrange)\"\n\t\tif type.name == \"NotificationEvent\": return \"[NotificationEvent](notification.md#notificationevent)\"\n\t\tif type.name in self.file.structs: return \"[%s](#%s)\" %(type.name, type.name.lower())\n\t\tif type.name in NUMERIC_TYPES: return \"int\"\n\t\tif type.name == \"list\": return \"list[%s]\" %self.format_type(type.template[0])\n\t\tif type.name == \"map\": return \"dict[%s, %s]\" %(\n\t\t\tself.format_type(type.template[0]), self.format_type(type.template[1])\n\t\t)\n\t\traise ValueError(\"Unknown type: %s\" %type.name)\n\t\n\tdef format_return_value(self, method):\n\t\tif len(method.response.vars) > 1:\n\t\t\treturn \"[RMCResponse](common.md)\"\n\t\tif len(method.response.vars) == 1:\n\t\t\treturn self.format_type(method.response.vars[0].type)\n\t\treturn \"None\"\n\t\t\t\t\n\tdef format_constant(self, type, value):\n\t\tif type.name in self.file.structs: return \"[%s](#%s)()\" %(type.name, type.name.lower())\n\t\tif type.name == \"ResultRange\": return \"[ResultRange](common.md#resultrange)()\"\n\t\tif type.name == \"NotificationEvent\": return \"[NotificationEvent](notification.md#notificationevent)()\"\n\t\t\n\t\tif type.name in NUMERIC_TYPES + [\"bool\"]: return str(value)\n\t\tif type.name in [\"buffer\", \"qbuffer\"]: return 'b\"%s\"' %value\n\t\tif type.name in [\"string\", \"stationurl\"]: return '\"%s\"' %value\n\t\tif type.name == \"datetime\":\n\t\t\tif value == 0:\n\t\t\t\treturn \"[DateTime](common.md#datetime).never()\"\n\t\t\telif value == 671076024059:\n\t\t\t\treturn \"[DateTime](common.md#datetime).future()\"\n\t\t\treturn \"[DateTime](common.md#datetime)(%i)\" %value\n\t\t\n\t\tif type.name == \"list\":\n\t\t\tentries = []\n\t\t\tfor entry in value:\n\t\t\t\tentries.append(self.format_constant(type.template[0], entry))\n\t\t\treturn \"[%s]\" %\", \".join(entries)\n\t\tif type.name == \"map\":\n\t\t\titems = []\n\t\t\tfor key, value in value.items():\n\t\t\t\tkey = self.format_constant(type.template[0], key)\n\t\t\t\tvalue = self.format_constant(type.template[1], value)\n\t\t\t\titems.append(\"%s: %s\" %(key, value))\n\t\t\treturn \"{%s}\" %\", \".join(items)\n\t\t\n\t\traise ValueError(\"Unknown type: %s\" %type.name)\n\t\t\n\ndef process(filename):\n\tfilepath = os.path.join(\"nintendo/files/proto\", filename)\n\tname = os.path.splitext(filename)[0]\n\t\t\n\tprint(\"Parsing %s\" %filename)\n\twith open(filepath) as f:\n\t\ttext = f.read()\n\ttokens = Tokenizer().process(text)\n\tfile = Parser().process(tokens)\n\tcode = CodeGenerator().process(file)\n\tdocs = DocsGenerator().process(file, name)\n\t\n\twith open(\"nintendo/nex/%s.py\" %name, \"wb\") as f:\n\t\tf.write(code.encode())\n\twith open(\"docs/reference/nex/%s.md\" %name, \"wb\") as f:\n\t\tf.write(docs.encode())\n\nfor name in os.listdir(\"nintendo/files/proto\"):\n\tprocess(name)\n"
  },
  {
    "path": "mkdocs.yml",
    "content": "site_name: NintendoClients\ntheme: readthedocs\nextra_css: [style.css]"
  },
  {
    "path": "nintendo/__init__.py",
    "content": "\n\n"
  },
  {
    "path": "nintendo/files/config/3ds.cfg",
    "content": "\nprudp.version = 0\nprudp.fragment_size = 962\n"
  },
  {
    "path": "nintendo/files/config/default.cfg",
    "content": "\nnex.version = 0\nnex.client_version = 0\nnex.struct_header = 0\nnex.pid_size = 4\n\nprudp.access_key = \n\nprudp.version = 2\nprudp.minor_version = 4\nprudp.supported_functions = 0\n\nprudp.transport = 0\nprudp.compression = 0\nprudp.encryption = 1\n\nprudp.resend_timeout = 1\nprudp.resend_limit = 2\nprudp.ping_timeout = 5\n\nprudp.fragment_size = 1300\nprudp.max_substream_id = 0\n\nprudp_v0.signature_version = 0\nprudp_v0.flags_version = 1\nprudp_v0.checksum_version = 1\n\nkerberos.key_size = 32\nkerberos.key_derivation = 0\nkerberos.ticket_version = 1\n"
  },
  {
    "path": "nintendo/files/config/friends.cfg",
    "content": "\nprudp.version = 0\nprudp.fragment_size = 962\n\nprudp_v0.signature_version = 1\n\nkerberos.key_size = 16\n"
  },
  {
    "path": "nintendo/files/config/switch.cfg",
    "content": "\nprudp.minor_version = 5\n\nprudp.transport = 2\nprudp.encryption = 0\n\nprudp.resend_timeout = 5\nprudp.resend_limit = 0\n\nkerberos.key_derivation = 1\n\nnex.pid_size = 8\nnex.struct_header = 1\n"
  },
  {
    "path": "nintendo/files/proto/aauser.proto",
    "content": "\r\nstruct ApplicationInfo {\r\n\tuint64 title_id;\r\n\tuint16 title_version;\r\n}\r\n\r\nprotocol AAUser : 123 {\r\n\tmethod register_application(uint64 title_id) {}\r\n\tmethod unregister_application(uint64 title_id) {}\r\n\tmethod set_application_info(list<ApplicationInfo> application_info) {}\r\n\tmethod get_application_info() {\r\n\t\tlist<ApplicationInfo> info;\r\n\t}\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/account.proto",
    "content": "\nstruct AccountData {\n\tpid pid;\n\tstring name;\n\tuint32 groups;\n\tstring email;\n\tdatetime creation_date;\n\tdatetime effective_date;\n\tstring not_effective_message;\n\tdatetime expiry_date;\n\tstring expired_message;\n}\n\nstruct BasicAccountInfo {\n\tpid pid;\n\tstring name;\n}\n\nprotocol Account : 25 {\n\tmethod create_account(string name, string key, uint32 groups, string email) {\n\t\tresult result;\n\t}\n\tmethod delete_account(pid pid) {}\n\tmethod disable_account(pid pid, datetime until, string message) {\n\t\tresult result;\n\t}\n\tmethod change_password(string new_key) { bool result; }\n\tmethod test_capability(uint32 capability) { bool result; }\n\tmethod get_name(pid pid) { string name; }\n\tmethod get_account_data() {\n\t\tresult result;\n\t\tAccountData data;\n\t}\n\tmethod get_private_data() {\n\t\tbool result;\n\t\tanydata data;\n\t}\n\tmethod get_public_data(pid pid) {\n\t\tbool result;\n\t\tanydata data;\n\t}\n\tmethod get_multiple_public_data(list<pid> pids) {\n\t\tbool result;\n\t\tlist<anydata> data;\n\t}\n\tmethod update_account_name(string name) { result result; }\n\tmethod update_account_email(string email) { result result; }\n\tmethod update_custom_data(anydata public_data, anydata private_data) {\n\t\tresult result;\n\t}\n\tmethod find_by_name_regex(uint32 groups, string regex, ResultRange range) {\n\t\tlist<BasicAccountInfo> accounts;\n\t}\n\tmethod update_account_expiry_date(pid pid, datetime expiry, string message) {}\n\tmethod update_account_effective_date(pid pid, datetime effective_from, string message) {}\n\tmethod update_status(string status) {}\n\tmethod get_status(pid pid) {\n\t\tstring status;\n\t}\n\tmethod get_last_connection_stats(pid pid) {\n\t\tdatetime last_session_login;\n\t\tdatetime last_session_logout;\n\t\tdatetime current_session_login;\n\t}\n\tmethod reset_password() { bool result; }\n\tmethod create_account_with_custom_data(\n\t\tstring name, string key, uint32 groups, string email,\n\t\tanydata public_data, anydata private_data\n\t) {}\n\tmethod retrieve_account() {\n\t\tAccountData account_data;\n\t\tanydata public_data;\n\t\tanydata private_data;\n\t}\n\tmethod update_account(\n\t\tstring key, string email, anydata public_data,\n\t\tanydata private_data\n\t) {}\n\tmethod change_password_by_guest(string name, string email, string key) {}\n\tmethod find_by_name_like(uint32 groups, string like, ResultRange range) {\n\t\tlist<BasicAccountInfo> accounts;\n\t}\n\tmethod custom_create_account(string name, string key, uint32 groups, string email, anydata auth_data) {\n\t\tpid pid;\n\t}\n\tmethod nintendo_create_account(string name, string key, uint32 groups, string email, anydata auth_data) {\n\t\tpid pid;\n\t\tstring pid_hmac;\n\t}\n\tmethod lookup_or_create_account(string name, string key, uint32 groups, string email, anydata auth_data) {\n\t\tpid pid;\n\t}\n\tmethod disconnect_principal(pid pid) { bool result; }\n\tmethod disconnect_all_principals() { bool result; }\n}\n"
  },
  {
    "path": "nintendo/files/proto/authentication.proto",
    "content": "\n// Defines protocol 10\n\nstruct AuthenticationInfo : Data {\n\tstring token;\n\tuint32 ngs_version = 3;\n\tuint8 token_type = 1;\n\tuint32 server_version = 0;\n}\n\nstruct RVConnectionData {\n\tstationurl main_station = \"prudp:/\";\n\tlist<uint8> special_protocols = [];\n\tstationurl special_station = \"prudp:/\";\n\n\tnex 30500 {\n\t\trevision 1 {\n\t\t\tdatetime server_time = 0;\n\t\t}\n\t}\n}\n\nstruct ValidateAndRequestTicketParam {\n\tuint32 platform = 3;\n\tstring username;\n\tanydata data;\n\tbool skip_version_check = false;\n\tuint32 nex_version;\n\tuint32 client_version;\n}\n\nstruct ValidateAndRequestTicketResult {\n\tpid pid;\n\tbuffer ticket;\n\tstationurl server_url;\n\tdatetime server_time;\n\tstring server_name;\n\tstring source_key;\n}\n\nprotocol Authentication : 10 {\n\tmethod login(string username) {\n\t\tresult result;\n\t\tpid pid;\n\t\tbuffer ticket;\n\t\tRVConnectionData connection_data;\n\t\tstring server_name;\n\t}\n\t\n\tmethod login_ex(string username, anydata extra_data) {\n\t\tresult result;\n\t\tpid pid;\n\t\tbuffer ticket;\n\t\tRVConnectionData connection_data;\n\t\tstring server_name;\n\t}\n\t\n\tmethod request_ticket(pid source, pid target) {\n\t\tresult result;\n\t\tbuffer ticket;\n\t}\n\t\n\tmethod get_pid(string username) {\n\t\tpid pid;\n\t}\n\t\n\tmethod get_name(pid pid) {\n\t\tstring name;\n\t}\n\t\n\tmethod login_with_context(anydata login_data) {\n\t\tresult result;\n\t\tpid pid;\n\t\tbuffer ticket;\n\t\tRVConnectionData connection_data;\n\t}\n}\n\nprotocol Authentication_NX : 10 {\n\tmethod validate_and_request_ticket(string username) {\n\t\tresult result;\n\t\tpid pid;\n\t\tbuffer ticket;\n\t\tRVConnectionData connection_data;\n\t\tstring server_name;\n\t}\n\t\n\tmethod validate_and_request_ticket_with_custom_data(string username, anydata extra_data) {\n\t\tresult result;\n\t\tpid pid;\n\t\tbuffer ticket;\n\t\tRVConnectionData connection_data;\n\t\tstring server_name;\n\t\tstring source_key;\n\t}\n\t\n\tmethod request_ticket(pid source, pid target) {\n\t\tresult result;\n\t\tbuffer ticket;\n\t\tstring key;\n\t}\n\t\n\tmethod get_pid(string username) {\n\t\tpid pid;\n\t}\n\t\n\tmethod get_name(pid pid) {\n\t\tstring name;\n\t}\n\t\n\tmethod validate_and_request_ticket_with_param(ValidateAndRequestTicketParam param) {\n\t\tValidateAndRequestTicketResult result;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/datastore.proto",
    "content": "\nstruct DataStoreChangeMetaCompareParam {\n\tuint32 comparison_flag;\n\tstring name;\n\tDataStorePermission permission;\n\tDataStorePermission delete_permission;\n\tuint16 period;\n\tqbuffer meta_binary;\n\tlist<string> tags;\n\tuint32 referred_count;\n\tuint16 data_type;\n\tuint8 status;\n}\n\nstruct DataStoreChangeMetaParam {\n\tuint64 data_id;\n\tuint32 modifies_flag;\n\tstring name;\n\tDataStorePermission permission;\n\tDataStorePermission delete_permission;\n\tuint16 period;\n\tqbuffer meta_binary;\n\tlist<string> tags;\n\tuint64 update_password;\n\tuint32 referred_count;\n\tuint16 data_type;\n\tuint8 status;\n\tDataStoreChangeMetaCompareParam compare_param;\n\tDataStorePersistenceTarget persistence_target;\n}\n\nstruct DataStoreChangeMetaParamV1 {\n\tuint64 data_id;\n\tuint32 modifies_flag;\n\tstring name;\n\tDataStorePermission permission;\n\tDataStorePermission delete_permission;\n\tuint16 period;\n\tqbuffer meta_binary;\n\tlist<string> tags;\n\tuint64 update_password;\n}\n\nstruct DataStoreCompletePostParam {\n\tuint64 data_id;\n\tbool success;\n}\n\nstruct DataStoreCompletePostParamV1 {\n\tuint32 data_id;\n\tbool success;\n}\n\nstruct DataStoreCompleteUpdateParam {\n\tuint64 data_id;\n\tuint32 version;\n\tbool success;\n}\n\nstruct DataStoreDeleteParam {\n\tuint64 data_id;\n\tuint64 update_password;\n}\n\nstruct DataStoreGetMetaParam {\n\tuint64 data_id = 0;\n\tDataStorePersistenceTarget persistence_target;\n\tuint8 result_option = 0;\n\tuint64 access_password = 0;\n}\n\nstruct DataStoreGetNewArrivedNotificationsParam {\n\tuint64 last_notification_id;\n\tuint16 limit;\n}\n\nstruct DataStoreGetNotificationUrlParam {\n\tstring previous_url;\n}\n\nstruct DataStoreGetSpecificMetaParam {\n\tlist<uint64> data_ids;\n}\n\nstruct DataStoreGetSpecificMetaParamV1 {\n\tlist<uint32> data_ids;\n}\n\nstruct DataStoreKeyValue {\n\tstring key;\n\tstring value;\n}\n\nstruct DataStoreMetaInfo {\n\tuint64 data_id;\n\tpid owner_id;\n\tuint32 size;\n\tstring name;\n\tuint16 data_type;\n\tqbuffer meta_binary;\n\tDataStorePermission permission;\n\tDataStorePermission delete_permission;\n\tdatetime create_time;\n\tdatetime update_time;\n\tuint16 period;\n\tuint8 status;\n\tuint32 referred_count;\n\tuint32 refer_data_id;\n\tuint32 flag;\n\tdatetime referred_time;\n\tdatetime expire_time;\n\tlist<string> tags;\n\tlist<DataStoreRatingInfoWithSlot> ratings;\n}\n\nstruct DataStoreNotification {\n\tuint64 notification_id;\n\tuint64 data_id;\n}\n\nstruct DataStoreNotificationV1 {\n\tuint64 notification_id;\n\tuint32 data_id;\n}\n\nstruct DataStorePasswordInfo {\n\tuint64 data_id;\n\tuint64 access_password;\n\tuint64 update_password;\n}\n\nstruct DataStorePermission {\n\tuint8 permission = 3;\n\tlist<pid> recipients = [];\n}\n\nstruct DataStorePersistenceInfo {\n\tpid owner_id;\n\tuint16 slot_id;\n\tuint64 data_id;\n}\n\nstruct DataStorePersistenceInitParam {\n\tuint16 persistence_id = 65535;\n\tbool delete_last_object = true;\n}\n\nstruct DataStorePersistenceTarget {\n\tpid owner_id = 0;\n\tuint16 persistence_id = 65535;\n}\n\nstruct DataStorePrepareGetParam {\n\tuint64 data_id = 0;\n\tuint32 lock_id = 0;\n\tDataStorePersistenceTarget persistence_target;\n\tuint64 access_password = 0;\n\t\n\tnex 30500 {\n\t\tlist<string> extra_data = [];\n\t}\n}\n\nstruct DataStorePrepareGetParamV1 {\n\tuint32 data_id;\n\tuint32 lock_id = 0;\n}\n\nstruct DataStorePreparePostParam {\n\tuint32 size;\n\tstring name;\n\tuint16 data_type;\n\tqbuffer meta_binary;\n\tDataStorePermission permission;\n\tDataStorePermission delete_permission;\n\tuint32 flag;\n\tuint16 period;\n\tuint32 refer_data_id = 0;\n\tlist<string> tags = [];\n\tlist<DataStoreRatingInitParamWithSlot> rating_init_param = [];\n\tDataStorePersistenceInitParam persistence_init_param;\n\t\n\tnex 30500 {\n\t\tlist<string> extra_data;\n\t}\n}\n\nstruct DataStorePreparePostParamV1 {\n\tuint32 size;\n\tstring name;\n\tuint16 data_type = 0;\n\tqbuffer meta_binary = \"\";\n\tDataStorePermission permission;\n\tDataStorePermission delete_permission;\n\tuint32 flag;\n\tuint16 period;\n\tuint32 refer_data_id = 0;\n\tlist<string> tags;\n\tlist<DataStoreRatingInitParamWithSlot> rating_init_param;\n}\n\nstruct DataStorePrepareUpdateParam {\n\tuint64 data_id;\n\tuint32 size;\n\tuint64 update_password;\n\tlist<string> extra_data;\n}\n\nstruct DataStoreRateObjectParam {\n\tsint32 rating_value;\n\tuint64 access_password;\n}\n\nstruct DataStoreRatingInfo {\n\tsint64 total_value;\n\tuint32 count;\n\tsint64 initial_value;\n}\n\nstruct DataStoreRatingInfoWithSlot {\n\tuint8 slot;\n\tDataStoreRatingInfo info;\n}\n\nstruct DataStoreRatingInitParam {\n\tuint8 flag;\n\tuint8 internal_flag;\n\tuint8 lock_type;\n\tsint64 initial_value;\n\tsint32 range_min;\n\tsint32 range_max;\n\tsint8 period_hour;\n\tsint16 period_duration;\n}\n\nstruct DataStoreRatingInitParamWithSlot {\n\tsint8 slot;\n\tDataStoreRatingInitParam param;\n}\n\nstruct DataStoreRatingLog {\n\tbool is_rated;\n\tpid pid;\n\tsint32 rating_value;\n\tdatetime lock_expiration_time;\n}\n\nstruct DataStoreRatingTarget {\n\tuint64 data_id;\n\tsint8 slot;\n}\n\nstruct DataStoreReqGetAdditionalMeta {\n\tpid owner_id;\n\tuint16 data_type;\n\tuint16 version;\n\tqbuffer meta_binary;\n}\n\nstruct DataStoreReqGetInfo {\n\tstring url;\n\tlist<DataStoreKeyValue> headers;\n\tuint32 size;\n\tbuffer root_ca_cert;\n\t\n\tnex 30500 {\n\t\tuint64 data_id;\n\t}\n}\n\nstruct DataStoreReqGetInfoV1 {\n\tstring url;\n\tlist<DataStoreKeyValue> headers;\n\tuint32 size;\n\tbuffer root_ca_cert;\n}\n\nstruct DataStoreReqGetNotificationUrlInfo {\n\tstring url;\n\tstring key;\n\tstring query;\n\tbuffer root_ca_cert;\n}\n\nstruct DataStoreReqPostInfo {\n\tuint64 data_id;\n\tstring url;\n\tlist<DataStoreKeyValue> headers;\n\tlist<DataStoreKeyValue> form;\n\tbuffer root_ca_cert;\n}\n\nstruct DataStoreReqPostInfoV1 {\n\tuint32 data_id;\n\tstring url;\n\tlist<DataStoreKeyValue> headers;\n\tlist<DataStoreKeyValue> form;\n\tbuffer root_ca_cert;\n}\n\nstruct DataStoreReqUpdateInfo {\n\tuint32 version;\n\tstring url;\n\tlist<DataStoreKeyValue> headers;\n\tlist<DataStoreKeyValue> form;\n\tbuffer root_ca_cert;\n}\n\nstruct DataStoreSearchParam {\n\tuint8 search_target = 1;\n\tlist<pid> owner_ids = [];\n\tuint8 owner_type = 0;\n\tlist<uint64> destination_ids = [];\n\tuint16 data_type = 65535;\n\tdatetime created_after = future;\n\tdatetime created_before = future;\n\tdatetime updated_after = future;\n\tdatetime updated_before = future;\n\tuint32 refer_data_id = 0;\n\tlist<string> tags = [];\n\tuint8 result_order_column = 0;\n\tuint8 result_order = 0;\n\tResultRange result_range;\n\tuint8 result_option = 0;\n\tuint32 minimal_rating_frequency = 0;\n\tbool use_cache = false;\n\tbool total_count_enabled = true;\n\tlist<uint16> data_types = [];\n}\n\nstruct DataStoreSearchResult {\n\tuint32 total_count;\n\tlist<DataStoreMetaInfo> result;\n\tuint8 total_count_type;\n}\n\nstruct DataStoreSpecificMetaInfo {\n\tuint64 data_id;\n\tpid owner_id;\n\tuint32 size;\n\tuint16 data_type;\n\tuint32 version;\n}\n\nstruct DataStoreSpecificMetaInfoV1 {\n\tuint32 data_id;\n\tpid owner_id;\n\tuint32 size;\n\tuint16 data_type;\n\tuint16 version;\n}\n\nstruct DataStoreTouchObjectParam {\n\tuint64 data_id;\n\tuint32 lock_id;\n\tuint64 access_password;\n}\n\nprotocol DataStore : 115 {\n\tmethod prepare_get_object_v1(DataStorePrepareGetParamV1 param) {\n\t\tDataStoreReqGetInfoV1 info;\n\t}\n\t\n\tmethod prepare_post_object_v1(DataStorePreparePostParamV1 param) {\n\t\tDataStoreReqPostInfoV1 info;\n\t}\n\t\n\tmethod complete_post_object_v1(DataStoreCompletePostParamV1 param) {}\n\t\n\tmethod delete_object(DataStoreDeleteParam param) {}\n\tmethod delete_objects(list<DataStoreDeleteParam> param, bool transactional) {\n\t\tlist<result> results;\n\t}\n\t\n\tmethod change_meta_v1(DataStoreChangeMetaParamV1 param) {}\n\tmethod change_metas_v1(list<uint64> data_ids, list<DataStoreChangeMetaParamV1> param, bool transactional) {\n\t\tlist<result> results;\n\t}\n\t\n\tmethod get_meta(DataStoreGetMetaParam param) {\n\t\tDataStoreMetaInfo info;\n\t}\n\t\n\tmethod get_metas(list<uint64> data_ids, DataStoreGetMetaParam param) {\n\t\tlist<DataStoreMetaInfo> info;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod prepare_update_object(DataStorePrepareUpdateParam param) {\n\t\tDataStoreReqUpdateInfo info;\n\t}\n\t\n\tmethod complete_update_object(DataStoreCompleteUpdateParam param) {}\n\t\n\tmethod search_object(DataStoreSearchParam param) {\n\t\tDataStoreSearchResult result;\n\t}\n\t\n\tmethod get_notification_url(DataStoreGetNotificationUrlParam param) {\n\t\tDataStoreReqGetNotificationUrlInfo info;\n\t}\n\t\n\tmethod get_new_arrived_notifications_v1(DataStoreGetNewArrivedNotificationsParam param) {\n\t\tlist<DataStoreNotificationV1> result;\n\t\tbool has_next;\n\t}\n\t\n\tmethod rate_object(DataStoreRatingTarget target, DataStoreRateObjectParam param, bool fetch_ratings) {\n\t\tDataStoreRatingInfo info;\n\t}\n\t\n\tmethod get_rating(DataStoreRatingTarget target, uint64 access_password) {\n\t\tDataStoreRatingInfo rating;\n\t}\n\t\n\tmethod get_ratings(list<uint64> data_ids, uint64 access_password) {\n\t\tlist<list<DataStoreRatingInfoWithSlot>> ratings;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod reset_rating(DataStoreRatingTarget target, uint64 update_password) {}\n\t\n\tmethod reset_ratings(list<uint64> data_ids, bool transactional) {\n\t\tlist<result> results;\n\t}\n\t\n\tmethod get_specific_meta_v1(DataStoreGetSpecificMetaParamV1 param) {\n\t\tlist<DataStoreSpecificMetaInfoV1> infos;\n\t}\n\t\n\tmethod post_meta_binary(DataStorePreparePostParam param) {\n\t\tuint64 data_id;\n\t}\n\t\n\tmethod touch_object(DataStoreTouchObjectParam param) {}\n\t\n\tmethod get_rating_with_log(DataStoreRatingTarget target, uint64 access_password) {\n\t\tDataStoreRatingInfo rating;\n\t\tDataStoreRatingLog log;\n\t}\n\t\n\tmethod prepare_post_object(DataStorePreparePostParam param) {\n\t\tDataStoreReqPostInfo info;\n\t}\n\t\n\tmethod prepare_get_object(DataStorePrepareGetParam param) {\n\t\tDataStoreReqGetInfo info;\n\t}\n\t\n\tmethod complete_post_object(DataStoreCompletePostParam param) {}\n\t\n\tmethod get_new_arrived_notifications(DataStoreGetNewArrivedNotificationsParam param) {\n\t\tlist<DataStoreNotification> result;\n\t\tbool has_next;\n\t}\n\t\n\tmethod get_specific_meta(DataStoreGetSpecificMetaParam param) {\n\t\tlist<DataStoreSpecificMetaInfo> infos;\n\t}\n\t\n\tmethod get_persistence_info(pid owner_id, uint16 slot_id) {\n\t\tDataStorePersistenceInfo info;\n\t}\n\t\n\tmethod get_persistence_infos(pid owner_id, list<uint16> slot_ids) {\n\t\tlist<DataStorePersistenceInfo> infos;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod perpetuate_object(uint16 persistence_slot_id, uint64 data_id, bool delete_last_object) {}\n\tmethod unperpetuate_object(uint16 persistence_slot_id, bool delete_last_object) {}\n\t\n\tmethod prepare_get_object_or_meta_binary(DataStorePrepareGetParam param) {\n\t\tDataStoreReqGetInfo get_info;\n\t\tDataStoreReqGetAdditionalMeta additional_meta;\n\t}\n\t\n\tmethod get_password_info(uint64 data_id) {\n\t\tDataStorePasswordInfo info;\n\t}\n\t\n\tmethod get_password_infos(list<uint64> data_ids) {\n\t\tlist<DataStorePasswordInfo> infos;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod get_metas_multiple_param(list<DataStoreGetMetaParam> params) {\n\t\tlist<DataStoreMetaInfo> infos;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod complete_post_objects(list<uint64> data_ids) {}\n\t\n\tmethod change_meta(DataStoreChangeMetaParam param) {}\n\tmethod change_metas(list<uint64> data_ids, list<DataStoreChangeMetaParam> param, bool transactional) {\n\t\tlist<result> results;\n\t}\n\t\n\tmethod rate_objects(list<DataStoreRatingTarget> targets, list<DataStoreRateObjectParam> param, bool transactional, bool fetch_ratings) {\n\t\tlist<DataStoreRatingInfo> infos;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod post_meta_binary_with_data_id(uint64 data_id, DataStorePreparePostParam param) {}\n\tmethod post_meta_binaries_with_data_id(list<uint64> data_ids, list<DataStorePreparePostParam> param, bool transactional) {\n\t\tlist<result> results;\n\t}\n\t\n\tmethod rate_object_with_posting(\n\t\tDataStoreRatingTarget target, DataStoreRateObjectParam rate_param,\n\t\tDataStorePreparePostParam post_param, bool fetch_ratings\n\t) {\n\t\tDataStoreRatingInfo info;\n\t}\n\t\n\tmethod rate_objects_with_posting(\n\t\tlist<DataStoreRatingTarget> targets, list<DataStoreRateObjectParam> rate_param,\n\t\tlist<DataStorePreparePostParam> post_param, bool transactional, bool fetch_ratings\n\t) {\n\t\tlist<DataStoreRatingInfo> ratings;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod get_object_infos(list<uint64> data_ids) {\n\t\tlist<DataStoreReqGetInfo> infos;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod search_object_light(DataStoreSearchParam param) {\n\t\tDataStoreSearchResult result;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/datastore_miitopia_3ds.proto",
    "content": "\nimport datastore;\n\n/*** Enums ***/\n\nenum Gender {\n\tMALE = 0,\n\tFEMALE = 1,\n\n\tANY = 2\n}\n\nenum Category {\n\tSINGING = 0,\n\tSPORT = 1,\n\tACTING = 2,\n\tCOMEDY = 3,\n\tMUSIC = 4,\n\tMARTIAL_ARTS = 5,\n\tDANCING = 6,\n\tADVENTURING = 7,\n\tFILM_DIRECTING = 8,\n\tCOOKING = 9,\n\tCHATTING = 10,\n\tPUBLIC_SPEAKING = 11,\n\tCRAFTWORK = 12,\n\tDRAWING = 13,\n\tSTUDYING = 14,\n\tWRITING = 15,\n\tFASHION = 16,\n\tDINING = 17,\n\tNOT_TELLING = 18,\n\n\tANY = 0xFF\n}\n\n/*** Method parameters ***/\n\nstruct MiiTubeSearchParam {\n\tstring name;\n\tuint32 page = 0;\n\tuint8 category = 0xFF;\n\tuint8 gender = 2;\n\tuint8 country;\n\tuint8 search_type = 0;\n\tuint8 result_option = 0;\n}\n\nstruct MiiTubeMiiInfo {\n\tDataStoreMetaInfo meta_info;\n\tuint8 category;\n\tuint8 ranking_type;\n}\n\nstruct MiiTubeSearchResult {\n\tlist<MiiTubeMiiInfo> result;\n\tuint32 count;\n\tuint32 page;\n\tbool has_next;\n}\n\nprotocol DataStore_Miitopia3DS : DataStore {\n\tmethod(47) search_mii(MiiTubeSearchParam param) {\n\t\tMiiTubeSearchResult search_result;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/datastore_smm.proto",
    "content": "\r\nimport datastore;\r\n\r\nprotocol DataStore_SMM : DataStore {\r\n\tmethod(61) get_application_config(uint32 id) {\r\n\t\tlist<uint32> config;\r\n\t}\r\n\t\r\n\tmethod(74) get_application_config_string(uint32 id) {\r\n\t\tlist<string> config;\r\n\t}\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/datastore_smm2.proto",
    "content": "\nimport datastore;\n\n/*** Enums ***/\n\nenum ClearCondition {\n\tNORMAL = 0,\n\tCOLLECT_COINS = 4116396131,\n\tKILL_SKIPSQUEAKS = 4042480826\n}\n\nenum CourseDifficulty {\n\tEASY = 0,\n\tSTANDARD = 1,\n\tEXPERT = 2,\n\tSUPER_EXPERT = 3\n}\n\nenum CourseTag {\n\tNONE = 0,\n\tSTANDARD = 1,\n\tPUZZLE_SOLVING = 2,\n\tSPEEDRUN = 3,\n\tAUTOSCROLL = 4,\n\tAUTO_MARIO = 5,\n\tSHORT_AND_SWEET = 6,\n\tMULTIPLAYER_VS = 7,\n\tTHEMED = 8,\n\tMUSIC = 9\n}\n\nenum CourseTheme {\n\tGROUND = 0,\n\tUNDERGROUND = 1,\n\tCASTLE = 2,\n\tAIRSHIP = 3,\n\tUNDERWATER = 4,\n\tGHOST_HOUSE = 5,\n\tSNOW = 6,\n\tDESERT = 7,\n\tSKY = 8,\n\tFOREST = 9\n}\n\nenum GameStyle {\n\tSMB1 = 0,\n\tSMB3 = 1,\n\tSMW = 2,\n\tNSMBU = 3,\n\tSM3DW = 4\n}\n\nenum MultiplayerStatsKeys {\n\tMULTIPLAYER_SCORE = 0,\n\tVERSUS_PLAYS = 2,\n\tVERSUS_WINS = 3,\n\tCOOP_PLAYS = 10,\n\tCOOP_WINS = 11\n}\n\nenum PlayStatsKeys {\n\tPLAYS = 0,\n\tCLEARS = 1,\n\tATTEMPTS = 2,\n\tDEATHS = 3\n}\n\n/*** Option flags ***/\n\t\nenum CourseOption {\n\tPLAY_STATS = 1,\n\tRATINGS = 2,\n\tTIME_STATS = 4,\n\tCOMMENT_STATS = 8,\n\tUNK9 = 0x10,\n\tUNK10 = 0x20,\n\tUNK8 = 0x40,\n\tONE_SCREEN_THUMBNAIL = 0x80,\n\tENTIRE_THUMBNAIL = 0x100,\n\t\n\tALL = 0x1FF\n}\n\nenum EventCourseOption {\n\tUNK3 = 1,\n\tGET_INFO = 2,\n\t\n\tBEST_TIME = 8,\n\tONE_SCREEN_THUMBNAIL = 0x10,\n\tENTIRE_THUMBNAIL = 0x20,\n\tUNK1 = 0x40,\n\t\n\tMEDAL_TIME = 0x100,\n\tGHOST = 0x200,\n\t\n\tALL = 0x3FF\n}\n\nenum UserOption {\n\tPLAY_STATS = 1,\n\tMAKER_STATS = 2,\n\tUNK2 = 4,\n\tENDLESS_MODE = 8,\n\tMULTIPLAYER_STATS = 0x10,\n\tBADGE_INFO = 0x20,\n\tUNK8 = 0x40,\n\tUNK9 = 0x80,\n\t\n\tUNK1 = 0x200,\n\tUNK7 = 0x400,\n\t\n\tUNK11 = 0x1000,\n\tUNK13 = 0x2000,\n\t\n\tUNK15 = 0x8000,\n\t\n\tALL = 0xFFFF\n}\n\n/*** Method parameters ***/\n\nstruct GetCoursesParam {\n\tlist<uint64> data_ids;\n\tuint32 option = 0;\n}\n\nstruct GetCoursesEventParam {}\n\nstruct SearchCommentsInOrderParam {\n\tuint64 data_id;\n\tResultRange range;\n}\n\nstruct GetEventCourseGhostParam {\n\tuint64 data_id;\n\tuint32 time;\n\tuint8 count;\n}\n\nstruct GetEventCourseHistogramParam {\n\tuint64 data_id;\n}\n\nstruct GetUserOrCourseParam {\n\tstring code;\n\tuint32 user_option = 0;\n\tuint32 course_option = 0;\n}\n\nstruct GetUsersParam {\n\tlist<pid> pids;\n\tuint32 option = 0;\n}\n\nstruct RegisterUserParam {\n\tstring name;\n\tUnknownStruct1 unk1;\n\tqbuffer unk2;\n\tuint8 language;\n\tstring country;\n\tstring device_id;\n}\n\nstruct SearchCoursesPostedByParam {\n\tuint32 option = 0;\n\tResultRange range;\n\tlist<uint64> pids;\n}\n\nstruct SearchCoursesPositiveRatedByParam {\n\tuint32 option = 0;\n\tuint32 count;\n\tuint64 pid;\n}\n\nstruct SearchCoursesPlayedByParam {\n\tuint32 option = 0;\n\tuint32 count;\n\tuint64 pid;\n}\n\nstruct SearchCoursesEndlessModeParam {\n\tuint32 option = 0;\n\tuint32 count;\n\tuint8 difficulty;\n}\n\nstruct SearchCoursesFirstClearParam {\n\tuint64 pid;\n\tuint32 option = 0;\n\tResultRange range;\n}\n\nstruct SearchCoursesBestTimeParam {\n\tuint64 pid;\n\tuint32 option = 0;\n\tResultRange range;\n}\n\nstruct SearchCoursesEventParam {\n\tuint32 option = 0;\n}\n\nstruct SearchCoursesLatestParam {\n\tuint32 option = 0;\n\tResultRange range;\n}\n\nstruct SearchUsersPlayedCourseParam {\n\tuint64 data_id;\n\tuint32 option = 0;\n\tuint32 count;\n}\n\nstruct SearchUsersClearedCourseParam {\n\tuint64 data_id;\n\tuint32 option = 0;\n\tuint32 count;\n}\n\nstruct SearchUsersPositiveRatedCourseParam {\n\tuint64 data_id;\n\tuint32 option = 0;\n\tuint32 count;\n}\n\nstruct SearchCoursesPointRankingParam {\n\tuint32 option = 0;\n\tResultRange range;\n\tuint8 difficulty;\n\tlist<uint8> reject_regions = [];\n}\n\nstruct SearchUsersUserPointParam {\n\tuint32 option = 0;\n\tbuffer buffer;\n\tResultRange range;\n}\n\nstruct SyncUserProfileParam {\n\tstring\tusername;\n\tUnknownStruct1 unk1;\n\tqbuffer\tunk2;\n\tuint8\tunk3;\n\tstring\tcountry;\n\tbool\tunk4;\n\tbool\tunk5;\n\tstring\tunk_guid;\n\tuint32\tunk6;\n}\n\nstruct GetWorldMapParam {\n\tlist<string> ids;\n\tuint32 option = 0;\n}\n\nstruct SearchWorldMapPickUpParam {\n\tuint32 count;\n}\n\nstruct SearchWorldMapPlayedByParam {\n\tuint32 unk1;\n\tuint32 unk2;\n}\n\n/*** Other structures ***/\n\nstruct BadgeInfo {\n\tuint16 unk1;\n\tuint8 unk2;\n}\n\nstruct CommentInfo {\n\tuint64 unk1;\n\tstring unk2;\n\tuint8 unk3;\n\tuint8 unk4;\n\tuint64 unk5;\n\tuint16 unk6;\n\tuint16 unk7;\n\tuint8 unk8;\n\tuint8 unk9;\n\tuint16 unk10;\n\tbool unk11;\n\tbool unk12;\n\tdatetime unk13;\n\tqbuffer unk14;\n\tstring unk15;\n\tCommentPictureReqGetInfoWithoutHeaders picture;\n\tuint16 unk16;\n\tuint8 unk17;\n}\n\nstruct DeathPositionInfo {\n\tuint64 data_id;\n\tuint16 x;\n\tuint16 y;\n\tbool is_subworld;\n}\n\nstruct CommentPictureReqGetInfoWithoutHeaders {\n\tstring url;\n\tuint8 data_type;\n\tuint32 unk1;\n\tbuffer unk2;\n\tstring filename;\n}\n\nstruct CourseInfo {\n\tuint64 data_id;\n\tstring code;\n\tpid owner_id;\n\tstring name;\n\tstring description;\n\tuint8 game_style;\n\tuint8 course_theme;\n\tdatetime upload_time;\n\tuint8 difficulty;\n\tuint8 tag1;\n\tuint8 tag2;\n\tuint8 unk1;\n\tuint32 clear_condition;\n\tuint16 clear_condition_magnitude;\n\tuint16 unk2;\n\tqbuffer unk3;\n\tmap<uint8, uint32> play_stats;\n\tmap<uint8, uint32> ratings;\n\tmap<uint8, uint32> unk4;\n\tCourseTimeStats time_stats;\n\tmap<uint8, uint32> comment_stats;\n\tuint8 unk9;\n\tuint8 unk10;\n\tuint8 unk11;\n\tuint8 unk12;\n\tRelationObjectReqGetInfo one_screen_thumbnail;\n\tRelationObjectReqGetInfo entire_thumbnail;\n}\n\nstruct WorldMapInfo {\n\tstring id;\n\tpid owner_id;\n\tqbuffer unk1;\n\tRelationObjectReqGetInfo thumbnail;\n\tuint8 worlds;\n\tuint8 levels;\n\tuint8 unk2;\n\tdatetime unk3;\n\tlist<uint64> data_ids;\n\tmap<uint8, uint32> unk4;\n\tuint32 unk5;\n\tuint8 unk6;\n\tuint8 unk7;\n}\n\nstruct CourseTimeStats {\n\tpid first_completion;\n\tpid world_record_holder;\n\tuint32 world_record;\n\tuint32 upload_time;\n}\n\nstruct EventCourseGhostInfo {\n\tRelationObjectReqGetInfo replay_file;\n\tuint32 time;\n\tpid pid;\n}\n\nstruct EventCourseHistogram {\n\tuint64 data_id;\n\tuint32 unk1;\n\tuint32 unk2;\n\tuint32 unk3;\n\tlist<uint32> values;\n\tmap<uint8, uint32> medals;\n\tuint32 unk4;\n}\n\nstruct EventCourseInfo {\n\tuint64 data_id;\n\tstring name;\n\tstring description;\n\tuint8 game_style;\n\tuint8 course_theme;\n\tbool unk1;\n\tbool unk2;\n\tdatetime upload_time;\n\tDataStoreReqGetInfo get_info;\n\tmap<uint8, uint32> unk3;\n\tUnknownStruct6 unk4;\n\tuint8 unk5;\n\tEventCourseThumbnail one_screen_thumbnail;\n\tEventCourseThumbnail entire_thumbnail;\n\t\n\trevision 1 {\n\t\tdatetime end_time;\n\t\tuint8 unk6;\n\t\tuint32 unk7;\n\t\tuint16 unk8;\n\t\tuint16 unk9;\n\t\tuint32 best_time;\n\t\tuint32 unk10;\n\t\tuint32 medal_time;\n\t\tRelationObjectReqGetInfo personal_ghost;\n\t}\n}\n\nstruct EventCourseStatusInfo {\n\tuint64 unk1;\n\tbool unk2;\n\tdatetime unk3;\n}\n\nstruct EventCourseThumbnail {\n\tstring url;\n\tlist<DataStoreKeyValue> headers;\n\tuint32 filesize;\n\tbuffer root_ca_cert;\n\tstring filename;\n}\n\nstruct RelationObjectReqGetInfo {\n\tstring url;\n\tuint8 data_type;\n\tuint32 size;\n\tbuffer unk;\n\tstring filename;\n}\n\nstruct ReqGetInfoHeadersInfo {\n\tlist<DataStoreKeyValue> headers;\n\tuint32 expiration;\n}\n\nstruct SyncUserProfileResult {\n\tuint64 pid;\n\tstring username;\n\tUnknownStruct1 unk1;\n\tqbuffer unk2;\n\tuint8 unk3;\n\tstring country;\n\tuint8 unk4;\n\tbool unk5;\n\tbool unk6;\n}\n\nstruct UserInfo {\n\tpid pid;\n\tstring code;\n\tstring name;\n\tUnknownStruct1 unk1;\n\tqbuffer unk2;\n\tstring country;\n\tuint8 region;\n\tdatetime last_active;\n\tbool unk3;\n\tbool unk4;\n\tbool unk5;\n\tmap<uint8, uint32> play_stats;\n\tmap<uint8, uint32> maker_stats;\n\tmap<uint8, uint32> endless_challenge_high_scores;\n\tmap<uint8, uint32> multiplayer_stats;\n\tmap<uint8, uint32> unk7;\n\tlist<BadgeInfo> badges;\n\tmap<uint8, uint32> unk8;\n\tmap<uint8, uint32> unk9;\n\t\n\trevision 1 {\n\t\tbool unk10;\n\t\tdatetime unk11;\n\t\tbool unk12;\n\t}\n\t\n\trevision 2 {\n\t\tUnknownStruct3 unk13;\n\t}\n\t\n\trevision 3 {\n\t\tstring unk14;\n\t\tmap<uint8, uint32> unk15;\n\t\tbool unk16;\n\t}\n}\n\n/*** Unknown structures ***/\n\nstruct UnknownStruct1 {\n\tuint16 unk1;\n\tuint16 unk2;\n\tuint16 unk3;\n\tuint16 unk4;\n}\n\nstruct UnknownStruct3 {\n\tbool unk1;\n\tdatetime unk2;\n}\n\nstruct UnknownStruct6 {\n\tuint64 unk1;\n\tuint32 unk2;\n}\n\nprotocol DataStore_SMM2 : DataStore {\n\tmethod(47) register_user(RegisterUserParam param) {}\n\n\tmethod(48) get_users(GetUsersParam param) {\n\t\tlist<UserInfo> users;\n\t\tlist<result> results;\n\t}\n\n\tmethod(49) sync_user_profile(SyncUserProfileParam param) {\n\t\tSyncUserProfileResult result;\n\t}\n\t\n\tmethod(50) search_users_user_point(SearchUsersUserPointParam param) {\n\t\tlist<UserInfo> users;\n\t\tlist<uint32> ranks;\n\t\tbool result;\n\t}\n\n\tmethod(53) search_users_played_course(SearchUsersPlayedCourseParam param) {\n\t\tlist<UserInfo> users;\n\t}\n\n\tmethod(54) search_users_cleared_course(SearchUsersClearedCourseParam param) {\n\t\tlist<UserInfo> users;\n\t}\n\n\tmethod(55) search_users_positive_rated_course(SearchUsersPositiveRatedCourseParam param) {\n\t\tlist<UserInfo> users;\n\t}\n\n\tmethod(59) update_last_login_time() {}\n\n\tmethod(65) get_username_ng_type() {\n\t\tuint8 unk;\n\t}\n\t\n\tmethod(70) get_courses(GetCoursesParam param) {\n\t\tlist<CourseInfo> courses;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod(71) search_courses_point_ranking(SearchCoursesPointRankingParam param) {\n\t\tlist<CourseInfo> courses;\n\t\tlist<uint32> ranks;\n\t\tbool result;\n\t}\n\t\n\tmethod(73) search_courses_latest(SearchCoursesLatestParam param) {\n\t\tlist<CourseInfo> courses;\n\t\tbool result;\n\t}\n\n\tmethod(74) search_courses_posted_by(SearchCoursesPostedByParam param) {\n\t\tlist<CourseInfo> courses;\n\t\tbool result;\n\t}\n\n\tmethod(75) search_courses_positive_rated_by(SearchCoursesPositiveRatedByParam param) {\n\t\tlist<CourseInfo> courses;\n\t}\n\n\tmethod(76) search_courses_played_by(SearchCoursesPlayedByParam param) {\n\t\tlist<CourseInfo> courses;\n\t}\n\n\tmethod(79) search_courses_endless_mode(SearchCoursesEndlessModeParam param) {\n\t\tlist<CourseInfo> courses;\n\t}\n\n\tmethod(80) search_courses_first_clear(SearchCoursesFirstClearParam param) {\n\t\tlist<CourseInfo> courses;\n\t\tbool result;\n\t}\n\n\tmethod(81) search_courses_best_time(SearchCoursesBestTimeParam param) {\n\t\tlist<CourseInfo> courses;\n\t\tbool result;\n\t}\n\t\n\tmethod(85) get_courses_event(GetCoursesParam param, GetCoursesEventParam dummy) {\n\t\tlist<EventCourseInfo> courses;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod(86) search_courses_event(SearchCoursesEventParam param) {\n\t\tlist<EventCourseInfo> courses;\n\t}\n\n\tmethod(94) search_comments_in_order(SearchCommentsInOrderParam param) {\n\t\tlist<CommentInfo> comments;\n\t\tbool result;\n\t}\n\t\n\tmethod(95) search_comments(uint64 data_id) {\n\t\tlist<CommentInfo> comments;\n\t}\n\n\tmethod(103) get_death_positions(uint64 data_id) {\n\t\tlist<DeathPositionInfo> positions;\n\t}\n\t\n\tmethod(131) get_user_or_course(GetUserOrCourseParam param) {\n\t\tUserInfo user;\n\t\tCourseInfo course;\n\t}\n\t\n\tmethod(134) get_req_get_info_headers_info(uint8 type) {\n\t\tReqGetInfoHeadersInfo result;\n\t}\n\t\n\tmethod(153) get_event_course_stamp() {\n\t\tuint32 stamps;\n\t}\n\t\n\tmethod(154) get_event_course_status() {\n\t\tEventCourseStatusInfo info;\n\t}\n\t\n\tmethod(156) get_event_course_histogram(GetEventCourseHistogramParam param) {\n\t\tEventCourseHistogram histogram;\n\t}\n\t\n\tmethod(157) get_event_course_ghost(GetEventCourseGhostParam param) {\n\t\tlist<EventCourseGhostInfo> ghosts;\n\t}\n\n\tmethod(160) get_world_map(GetWorldMapParam param) {\n\t\tlist<WorldMapInfo> maps;\n\t\tlist<result> results;\n\t}\n\n\tmethod(162) search_world_map_pick_up(SearchWorldMapPickUpParam param) {\n\t\tlist<WorldMapInfo> maps;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/debug.proto",
    "content": "\nstruct ApiCall {\n\tstring name;\n\tdatetime time;\n\tpid pid;\n}\n\nstruct ApiCallSummary {\n\tstring name;\n\tuint32 limit_exceeded;\n\tuint32 duration;\n\tuint32 limit;\n\tdatetime start;\n\tuint32 limit_exceeded_count;\n\tuint32 total_count;\n}\n\nprotocol Debug : 116 {\n\tmethod enable_api_recorder() {}\n\tmethod disable_api_recorder() {}\n\t\n\tmethod is_api_recorder_enabled() {\n\t\tbool enabled;\n\t}\n\t\n\tmethod get_api_calls(list<pid> pids, datetime start, datetime end) {\n\t\tlist<ApiCall> calls;\n\t}\n\t\n\tmethod set_exclude_joined_matchmake_session;\n\tmethod get_exclude_joined_matchmake_session;\n\t\n\tmethod get_api_call_summary(pid pid, datetime start, datetime end, bool only_limit_exceeded) {\n\t\tlist<ApiCallSummary> summaries;\n\t}\n}\n\n"
  },
  {
    "path": "nintendo/files/proto/friends.proto",
    "content": "\n// 3DS structures\n\nstruct AccountExtraInfo {\n\tuint64 local_friend_code;\n\tuint32 move_count;\n\tstring token;\n}\n\nstruct FriendComment : Data {\n\tuint32 pid;\n\tstring comment;\n\tdatetime modified_at;\n}\n\nstruct FriendKey {\n\tuint32 unk1;\n\tdatetime unk2;\n}\n\nstruct FriendMii : Data {\n\tpid pid;\n\tMii mii;\n\tdatetime modified_at;\n}\n\nstruct FriendMiiList : Data {\n\tuint32 unk1;\n\tMiiList mii;\n\tdatetime unk2;\n}\n\nstruct FriendPersistentInfo : Data {\n\tpid pid;\n\tuint8 region;\n\tuint8 country;\n\tuint8 area;\n\tuint8 language;\n\tuint8 platform;\n\tGameKey game_key;\n\tstring message;\n\tdatetime message_updated;\n\tdatetime friended;\n\tdatetime last_online;\n}\n\nstruct FriendPicture : Data {\n\tuint32 unk;\n\tbuffer data;\n\tdatetime datetime;\n}\n\nstruct FriendPresence : Data {\n\tpid pid;\n\tNintendoPresence presence;\n}\n\nstruct FriendRelationship : Data {\n\tpid pid;\n\tuint64 friend_code;\n\tuint8 is_complete;\n}\n\nstruct GameKey : Data {\n\tuint64 title_id = 0;\n\tuint16 title_version = 0;\n}\n\nstruct Mii : Data {\n\tstring name;\n\tbool unk1;\n\tuint8 unk2;\n\tbuffer mii_data;\n}\n\nstruct MiiList : Data {\n\tstring unk1;\n\tbool unk2;\n\tuint8 unk3;\n\tlist<buffer> mii_datas;\n}\n\nstruct MyProfile : Data {\n\tuint8 region;\n\tuint8 country;\n\tuint8 area;\n\tuint8 language;\n\tuint8 platform;\n\tuint64 local_friend_code_seed;\n\tstring mac_address;\n\tstring serial_number;\n}\n\nstruct NintendoPresence : Data {\n\tuint32 changed_bit_flag;\n\tGameKey game_key;\n\tstring game_mode_description;\n\tuint32 join_availability_flag;\n\tuint8 matchmake_system_type;\n\tuint32 join_game_id;\n\tuint32 join_game_mode;\n\tpid owner_pid;\n\tuint32 join_group_id;\n\tbuffer application_data;\n}\n\nstruct PlayedGame : Data {\n\tGameKey game_key;\n\tdatetime datetime;\n}\n\n\n// Wii U structures\n\nstruct BlacklistedPrincipal : Data {\n\tPrincipalBasicInfo principal_info;\n\tGameKey game_key;\n\tdatetime since;\n}\n\nstruct Comment : Data {\n\tuint8 unk;\n\tstring text;\n\tdatetime changed;\n}\n\nstruct FriendInfo : Data {\n\tNNAInfo nna_info;\n\tNintendoPresenceV2 presence;\n\tComment comment;\n\tdatetime befriended;\n\tdatetime last_online;\n\tuint64 unk;\n}\n\nstruct FriendRequest : Data {\n\tPrincipalBasicInfo principal_info;\n\tFriendRequestMessage message;\n\tdatetime sent;\n}\n\nstruct FriendRequestMessage : Data {\n\tuint64 friend_request_id;\n\tuint8 unk1;\n\tuint8 unk2;\n\tstring message;\n\tuint8 unk3;\n\tstring string;\n\tGameKey game_key;\n\tdatetime datetime;\n\tdatetime expires;\n}\n\nstruct MiiV2 : Data {\n\tstring name;\n\tuint8 unk1 = 0;\n\tuint8 unk2 = 0;\n\tbuffer data;\n\tdatetime datetime = 0;\n}\n\nstruct NNAInfo : Data {\n\tPrincipalBasicInfo principal_info;\n\tuint8 unk1 = 94;\n\tuint8 unk2 = 11;\n}\n\nstruct NintendoCreateAccountData : Data {\n\tNNAInfo info;\n\tstring token;\n\tdatetime birthday;\n\tuint64 unk;\n}\n\nstruct NintendoPresenceV2 : Data {\n\tuint32 flags = 0;\n\tbool is_online = false;\n\tGameKey game_key;\n\tuint8 unk1 = 0;\n\tstring message = \"\";\n\tuint32 unk2 = 0;\n\tuint8 unk3 = 0;\n\tuint32 game_server_id = 0;\n\tuint32 unk4 = 0;\n\tuint32 pid = 0;\n\tuint32 gathering_id = 0;\n\tbuffer application_data = \"\";\n\tuint8 unk5 = 3;\n\tuint8 unk6 = 3;\n\tuint8 unk7 = 3;\n}\n\nstruct PersistentNotification : Data {\n\tuint64 unk1;\n\tuint32 unk2;\n\tuint32 unk3;\n\tuint32 unk4;\n\tstring string;\n}\n\nstruct PrincipalBasicInfo : Data {\n\tpid pid;\n\tstring nnid;\n\tMiiV2 mii;\n\tuint8 unk = 2;\n}\n\nstruct PrincipalPreference : Data {\n\tbool show_online_status;\n\tbool show_current_title;\n\tbool block_friend_requests;\n}\n\nstruct PrincipalRequestBlockSetting : Data {\n\tuint32 pid;\n\tbool blocked;\n}\n\nprotocol Friends_V1 : 101 {\n\tmethod update_profile(MyProfile profile_data) {}\n\tmethod update_mii(Mii mii) {}\n\tmethod update_mii_list(MiiList mii_list) {}\n\tmethod update_played_games(list<PlayedGame> played_games) {}\n\tmethod update_preference(bool show_online_status, bool show_current_title, bool block_friend_requests) {}\n\t\n\tmethod get_friend_mii(list<FriendKey> friends) {\n\t\tlist<FriendMii> miis;\n\t}\n\tmethod get_friend_mii_list(list<FriendKey> friends) {\n\t\tlist<FriendMiiList> mii_lists;\n\t}\n\t\n\tmethod is_active_game(list<uint32> unk1, GameKey game_key) {\n\t\tlist<uint32> unk;\n\t}\n\t\n\tmethod get_principal_id_by_local_friend_code(uint64 unk1, list<uint64> unk2) {\n\t\tlist<FriendRelationship> friend_relationships;\n\t}\n\n\tmethod get_friend_relationships(list<pid> principal_ids) {\n\t\tlist<FriendRelationship> friend_relationships;\n\t}\n\n\tmethod add_friend_by_principal_id(uint64 friend_seed, pid pid) {\n\t\tFriendRelationship friend_relationship;\n\t}\n\t\n\tmethod add_friend_by_principal_ids(uint64 unk, list<pid> pids) {\n\t\tlist<FriendRelationship> friend_relationships;\n\t}\n\t\n\tmethod remove_friend_by_local_friend_code(uint64 friend_code) {}\n\tmethod remove_friend_by_principal_id(pid pid) {}\n\n\tmethod get_all_friends() {\n\t\tlist<FriendRelationship> friend_relationships;\n\t}\n\t\n\tmethod update_black_list(list<uint32> unk) {}\n\n\tmethod sync_friend(uint64 friend_seed, list<pid> principal_ids, list<uint64> unk) {\n\t\tlist<FriendRelationship> friend_list;\n\t}\n\n\tmethod update_presence(NintendoPresence presence_info, bool unk) {}\n\tmethod update_favorite_game_key(GameKey game_key) {}\n\tmethod update_comment(string comment) {}\n\tmethod update_picture(uint32 unk, buffer picture) {}\n\n\tmethod get_friend_presence(list<pid> principal_ids) {\n\t\tlist<FriendPresence> friend_presence_list;\n\t}\n\t\n\tmethod get_friend_comment(list<FriendKey> friends) {\n\t\tlist<FriendComment> comments;\n\t}\n\n\tmethod get_friend_picture(list<pid> principal_ids) {\n\t\tlist<FriendPicture> friend_pictures;\n\t}\n\n\tmethod get_friend_persistent_info(list<pid> principal_ids) {\n\t\tlist<FriendPersistentInfo> persistent_infos;\n\t}\n\n\tmethod send_invitation(list<uint32> unk) {}\n}\n\nprotocol Friends_V2 : 102 {\n\tmethod update_and_get_all_information(NNAInfo nna_info, NintendoPresenceV2 presence, datetime birthday) {\n\t\tPrincipalPreference principal_preference;\n\t\tComment comment;\n\t\tlist<FriendInfo> friends;\n\t\tlist<FriendRequest> sent_requests;\n\t\tlist<FriendRequest> received_requests;\n\t\tlist<BlacklistedPrincipal> blacklist;\n\t\tbool unk1;\n\t\tlist<PersistentNotification> notifications;\n\t\tbool unk2;\n\t}\n\t\n\tmethod add_friend(pid pid) {\n\t\tFriendRequest request;\n\t\tFriendInfo info;\n\t}\n\t\n\tmethod add_friend_by_name(string name) {\n\t\tFriendRequest request;\n\t\tFriendInfo info;\n\t}\n\t\n\tmethod remove_friend(pid pid) {}\n\t\n\tmethod add_friend_request(\n\t\tuint32 unk1, uint8 unk2, string unk3, uint8 unk4,\n\t\tstring unk5, GameKey game_key, datetime unk6\n\t) {\n\t\tFriendRequest request;\n\t\tFriendInfo info;\n\t}\n\t\n\tmethod cancel_friend_request(uint64 id) {}\n\t\n\tmethod accept_friend_request(uint64 id) {\n\t\tFriendInfo info;\n\t}\n\t\n\tmethod delete_friend_request(uint64 id) {}\n\t\n\tmethod deny_friend_request(uint64 id) {\n\t\tBlacklistedPrincipal blacklist;\n\t}\n\t\n\tmethod mark_friend_requests_as_received(list<uint64> ids) {}\n\t\n\tmethod add_black_list(BlacklistedPrincipal principal) {\n\t\tBlacklistedPrincipal principal;\n\t}\n\t\n\tmethod remove_black_list(pid pid) {}\n\t\n\tmethod update_presence(NintendoPresenceV2 presence) {}\n\t\n\tmethod update_mii(MiiV2 mii) {\n\t\tdatetime unk;\n\t}\n\t\n\tmethod update_comment(Comment comment) {\n\t\tdatetime unk;\n\t}\n\t\n\tmethod update_preference(PrincipalPreference preference) {}\n\t\n\tmethod get_basic_info(list<pid> pids) {\n\t\tlist<PrincipalBasicInfo> info;\n\t}\n\t\n\tmethod delete_persistent_notification(list<PersistentNotification> notifications) {}\n\t\n\tmethod check_setting_status() {\n\t\tuint8 unk;\n\t}\n\t\n\tmethod get_request_block_settings(list<uint32> unk) {\n\t\tlist<PrincipalRequestBlockSetting> settings;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/health.proto",
    "content": "\r\nprotocol Health : 18 {\r\n\tmethod ping_daemon() { bool result; }\r\n\tmethod ping_database() { bool result; }\r\n\tmethod run_sanity_check() { bool result; }\r\n\tmethod fix_sanity_errors() { bool result; }\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/matchmaking.proto",
    "content": "\nenum MatchmakeSystem {\n\tGLOBAL = 1,\n\tFRIENDS = 2\n}\n\nstruct Gathering {\n\tuint32 id = 0;\n\tpid owner = 0;\n\tpid host = 0;\n\tuint16 min_participants = 0;\n\tuint16 max_participants = 0;\n\tuint32 participation_policy = 1;\n\tuint32 policy_argument = 0;\n\tuint32 flags = 512;\n\tuint32 state = 0;\n\tstring description = \"\";\n}\n\nstruct GatheringURLs {\n\tuint32 gid;\n\tlist<stationurl> urls;\n}\n\nstruct GatheringStats {\n\tpid pid;\n\tuint32 flags;\n\tlist<float> values;\n}\n\nstruct Invitation {\n\tuint32 gid;\n\tuint32 guest;\n\tstring message;\n}\n\nstruct ParticipantDetails {\n\tpid pid;\n\tstring name;\n\tstring message;\n\tuint16 participants;\n}\n\nstruct DeletionEntry {\n\tuint32 gid;\n\tpid pid;\n\tuint32 reason;\n}\n\nstruct MatchmakeParam {\n\tmap<string, variant> param = {};\n}\n\nstruct MatchmakeSessionSearchCriteria {\n\tlist<string> attribs = [\"\", \"\", \"\", \"\", \"\", \"\"];\n\tstring game_mode = \"\";\n\tstring min_participants = \"\";\n\tstring max_participants = \"\";\n\tstring matchmake_system = \"\";\n\tbool vacant_only = true;\n\tbool exclude_locked = true;\n\tbool exclude_non_host_pid = false;\n\tuint32 selection_method = 0;\n\t\n\tnex 30500 {\n\t\tuint16 vacant_participants = 1;\n\t}\n\t\n\tnex 40000 {\n\t\tMatchmakeParam param;\n\t\tbool exclude_user_password = false;\n\t\tbool exclude_system_password = false;\n\t\tuint32 refer_gid = 0;\n\t\tstring codeword = \"\";\n\t\tResultRange range;\n\t}\n}\n\t\nstruct MatchmakeSession : Gathering {\n\tuint32 game_mode = 0;\n\tlist<uint32> attribs = [0, 0, 0, 0, 0, 0];\n\tbool open_participation = true;\n\tuint32 matchmake_system = 0;\n\tbuffer application_data = \"\";\n\tuint32 num_participants = 0;\n\t\n\tnex 30000 - 40000 {\n\t\tnex 30500 {\n\t\t\tuint8 progress_score = 100;\n\t\t}\n\t\t\n\t\tnex 30000 {\n\t\t\tbuffer session_key = \"\";\n\t\t}\n\t\t\n\t\tnex 30500 {\n\t\t\tuint32 option = 0;\n\t\t}\n\t\t\n\t\tnex 30600 {\n\t\t\trevision 1 {\n\t\t\t\tMatchmakeParam param;\n\t\t\t\tdatetime started_time = 0;\n\t\t\t}\n\t\t}\n\n\t\tnex 30700 {\n\t\t\trevision 2 {\n\t\t\t\tstring user_password = \"\";\n\t\t\t}\n\t\t}\n\n\t\tnex 30800 {\n\t\t\trevision 3 {\n\t\t\t\tuint32 refer_gid = 0;\n\t\t\t\tbool user_password_enabled = false;\n\t\t\t\tbool system_password_enabled = false;\n\t\t\t}\n\t\t}\n\t}\n\n\tnex 40000 {\n\t\tuint8 progress_score = 100;\n\t\tbuffer session_key = \"\";\n\t\tuint32 option = 0;\n\t\tMatchmakeParam param;\n\t\tdatetime started_time = 0;\n\t\tstring user_password = \"\";\n\t\tuint32 refer_gid = 0;\n\t\tbool user_password_enabled = false;\n\t\tbool system_password_enabled = false;\n\t\tstring codeword = \"\";\n\t}\n}\n\nstruct MatchmakeBlockListParam {\n\tuint32 options = 0;\n}\n\nstruct CreateMatchmakeSessionParam {\n\tMatchmakeSession session;\n\tlist<pid> additional_participants;\n\tuint32 gid_for_participation_check;\n\tuint32 options;\n\tstring join_message;\n\tuint16 num_participants;\n}\n\nstruct JoinMatchmakeSessionParam {\n\tuint32 gid;\n\tlist<pid> participants;\n\tuint32 gid_for_participation_check;\n\tuint32 options;\n\tuint8 behavior;\n\tstring user_password;\n\tstring system_password;\n\tstring join_message;\n\tuint16 num_participants;\n\tuint16 extra_participants;\n\tMatchmakeBlockListParam block_list;\n}\n\nstruct UpdateMatchmakeSessionParam {\n\tuint32 gid;\n\tuint32 modification_flags;\n\tlist<uint32> attributes;\n\tbool open_participation;\n\tbuffer application_buffer;\n\tuint8 progress_score;\n\tMatchmakeParam param;\n\tdatetime started_time;\n\tstring user_password;\n\tuint32 game_mode;\n\tstring description;\n\tuint16 min_participants;\n\tuint16 max_participants;\n\tuint32 matchmake_system;\n\tuint32 participation_policy;\n\tuint32 policy_argument;\n\tstring codeword;\n}\n\nstruct AutoMatchmakeParam {\n\tMatchmakeSession session;\n\tlist<pid> participants;\n\tuint32 gid_for_participation_check;\n\tuint32 options;\n\tstring join_message;\n\tuint16 num_participants;\n\tlist<MatchmakeSessionSearchCriteria> search_criteria;\n\tlist<uint32> target_gids;\n\tMatchmakeBlockListParam block_list;\n}\n\nstruct FindMatchmakeSessionByParticipantParam {\n\tlist<pid> pids;\n\tuint32 options;\n\tMatchmakeBlockListParam block_list;\n}\n\nstruct FindMatchmakeSessionByParticipantResult {\n\tpid pid;\n\tMatchmakeSession session;\n}\n\nstruct PersistentGathering : Gathering {\n\tuint32 type;\n\tstring password;\n\tlist<uint32> attribs;\n\tbuffer application_buffer;\n\tdatetime participation_start;\n\tdatetime participation_end;\n\tuint32 matchmake_session_count;\n\tuint32 num_participants;\n}\n\nstruct SimpleCommunity {\n\tuint32 gid;\n\tuint32 matchmake_session_count;\n}\n\nstruct PlayingSession {\n\tpid pid;\n\tanydata<Gathering> gathering;\n}\n\t\nstruct SimplePlayingSession {\n\tpid pid;\n\tuint32 gid;\n\tuint32 game_mode;\n\tuint32 attribute;\n}\n\n/*** MatchmakeReferee structures ***/\n\nstruct MatchmakeRefereeRound {\n\tuint64 id;\n\tuint32 gid;\n\tuint32 state;\n\tuint32 personal_data_category;\n\tlist<MatchmakeRefereePersonalRoundResult> results;\n}\n\nstruct MatchmakeRefereeStartRoundParam {\n\tuint32 personal_data_category;\n\tuint32 gid;\n\tlist<pid> pids;\n}\n\nstruct MatchmakeRefereeEndRoundParam {\n\tuint64 round_id;\n\tlist<MatchmakeRefereePersonalRoundResult> results;\n}\n\nstruct MatchmakeRefereePersonalRoundResult {\n\tpid pid;\n\tuint32 personal_round_result_flag;\n\tuint32 round_win_loss;\n\tsint32 rating_change;\n\tqbuffer buffer;\n}\n\nstruct MatchmakeRefereeStats {\n\tuint64 unique_id;\n\tuint32 category;\n\tpid pid;\n\tuint32 recent_disconnection;\n\tuint32 recent_violation;\n\tuint32 recent_mismatch;\n\tuint32 recent_win;\n\tuint32 recent_loss;\n\tuint32 recent_draw;\n\tuint32 total_disconnect;\n\tuint32 total_violation;\n\tuint32 total_mismatch;\n\tuint32 total_win;\n\tuint32 total_loss;\n\tuint32 total_draw;\n\tuint32 rating_value;\n}\n\nstruct MatchmakeRefereeStatsTarget {\n\tpid pid;\n\tuint32 category;\n}\n\nstruct MatchmakeRefereeStatsInitParam {\n\tuint32 category;\n\tuint32 initial_rating;\n}\n\nprotocol MatchMaking : 21 {\n\tmethod register_gathering(anydata<Gathering> gathering) {\n\t\tuint32 gid;\n\t}\n\t\n\tmethod unregister_gathering(uint32 gid) {\n\t\tbool result;\n\t}\n\t\n\tmethod unregister_gatherings(list<uint32> gids) {\n\t\tbool result;\n\t}\n\t\n\tmethod update_gathering(anydata<Gathering> gathering) {\n\t\tbool result;\n\t}\n\t\n\tmethod invite(uint32 gid, list<pid> pids, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod accept_invitation(uint32 gid, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod decline_invitation(uint32 gid, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod cancel_invitation(uint32 gid, list<pid> pids, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_invitations_sent(uint32 gid) {\n\t\tlist<Invitation> invitations;\n\t}\n\t\n\tmethod get_invitations_received() {\n\t\tlist<Invitation> invitations;\n\t}\n\t\n\tmethod participate(uint32 gid, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod cancel_participation(uint32 gid, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_participants(uint32 gid) {\n\t\tlist<pid> participants;\n\t}\n\t\n\tmethod add_participants(uint32 gid, list<pid> pids, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_detailed_participants(uint32 gid) {\n\t\tlist<ParticipantDetails> details;\n\t}\n\t\n\tmethod get_participants_urls(uint32 gid) {\n\t\tlist<stationurl> urls;\n\t}\n\t\n\tmethod find_by_type(string type, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_by_description(string description, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_by_description_regex(string regex, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_by_id(list<uint32> ids) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_by_single_id(uint32 gid) {\n\t\tbool result;\n\t\tanydata<Gathering> gathering;\n\t}\n\t\n\tmethod find_by_owner(pid owner, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_by_participants(list<pid> pids) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_invitations(ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod find_by_sql_query(string query, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod launch_session(uint32 gid, string url) {\n\t\tbool result;\n\t}\n\t\n\tmethod update_session_url(uint32 gid, string url) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_session_url(uint32 gid) {\n\t\tbool result;\n\t\tstring url;\n\t}\n\t\n\tmethod get_state(uint32 gid) {\n\t\tbool result;\n\t\tuint32 state;\n\t}\n\t\n\tmethod set_state(uint32 gid, uint32 state) {\n\t\tbool result;\n\t}\n\t\n\tmethod report_stats(uint32 gid, list<GatheringStats> stats) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_stats(uint32 gid, list<pid> pids, list<uint8> columns) {\n\t\tbool result;\n\t\tlist<GatheringStats> stats;\n\t}\n\t\n\tmethod delete_gathering(uint32 gid) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_pending_deletions(uint32 reason, ResultRange range) {\n\t\tbool result;\n\t\tlist<DeletionEntry> deletions;\n\t}\n\t\n\tmethod delete_from_deletions(list<uint32> deletions) {\n\t\tbool result;\n\t}\n\t\n\tmethod migrate_gathering_ownership_v1(uint32 gid, list<pid> potential_owners) {\n\t\tbool result;\n\t}\n\t\n\tmethod find_by_description_like(string description, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod register_local_url(uint32 gid, stationurl url) {}\n\tmethod register_local_urls(uint32 gid, list<stationurl> urls) {}\n\tmethod update_session_host_v1(uint32 gid) {}\n\t\n\tmethod get_session_urls(uint32 gid) {\n\t\tlist<stationurl> urls;\n\t}\n\t\n\tmethod update_session_host(uint32 gid, bool is_migrate_owner) {}\n\t\n\tmethod update_gathering_ownership(uint32 gid, bool participants_only) {\n\t\tbool result;\n\t}\n\t\n\tmethod migrate_gathering_ownership(uint32 gid, list<pid> potential_owners, bool participants_only) {}\n}\n\nprotocol MatchMaking_Ext : 50 {\n\tmethod end_participation(uint32 gid, string message) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_participants(uint32 gid, bool only_active) {\n\t\tlist<pid> participants;\n\t}\n\t\n\tmethod get_detailed_participants(uint32 gid, bool only_active) {\n\t\tlist<ParticipantDetails> details;\n\t}\n\t\n\tmethod get_participants_urls(list<uint32> gids) {\n\t\tlist<GatheringURLs> urls;\n\t}\n\t\n\tmethod get_gathering_relations(uint32 id, string descr) {\n\t\tstring result;\n\t}\n\t\n\tmethod delete_from_deletions(list<uint32> deletions, pid pid) {}\n}\n\nprotocol MatchmakeExtension : 109 {\n\tmethod close_participation(uint32 gid) {}\n\tmethod open_participation(uint32 gid) {}\n\t\n\tmethod auto_matchmake_postpone(anydata<Gathering> gathering, string message) {\n\t\tanydata<Gathering> gathering;\n\t}\n\t\n\tmethod browse_matchmake_session(MatchmakeSessionSearchCriteria search_criteria, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t}\n\t\n\tmethod browse_matchmake_session_with_host_urls(MatchmakeSessionSearchCriteria search_criteria, ResultRange range) {\n\t\tlist<anydata<Gathering>> gatherings;\n\t\tlist<GatheringURLs> urls;\n\t}\n\t\n\tmethod create_matchmake_session(anydata<Gathering> gathering, string description, uint16 num_participants) {\n\t\tuint32 gid;\n\t\tbuffer session_key;\n\t}\n\t\n\tmethod join_matchmake_session(uint32 gid, string message) {\n\t\tbuffer session_key;\n\t}\n\t\n\tmethod modify_current_game_attribute(uint32 gid, uint32 attrib, uint32 value) {}\n\tmethod update_notification_data(uint32 type, pid param1, pid param2, string param3) {}\n\t\n\tmethod get_friend_notification_data(sint32 type) {\n\t\tlist<NotificationEvent> notifications;\n\t}\n\t\n\tmethod update_application_buffer(uint32 gid, buffer buffer) {}\n\tmethod update_matchmake_session_attribute(uint32 gid, list<uint32> attribs) {}\n\t\n\tmethod get_friend_notification_data_list(list<uint32> types) {\n\t\tlist<NotificationEvent> notifications;\n\t}\n\t\n\tmethod update_matchmake_session(anydata<Gathering> gathering) {}\n\t\n\tmethod auto_matchmake_with_search_criteria_postpone(\n\t\tlist<MatchmakeSessionSearchCriteria> search_criteria,\n\t\tanydata<Gathering> gathering, string message\n\t) {\n\t\tanydata<Gathering> gathering;\n\t}\n\t\n\tmethod get_playing_session(list<pid> pids) {\n\t\tlist<PlayingSession> sessions;\n\t}\n\t\n\tmethod create_community(PersistentGathering community, string message) {\n\t\tuint32 gid;\n\t}\n\tmethod update_community(PersistentGathering community) {}\n\tmethod join_community(uint32 gid, string message, string password) {}\n\t\n\tmethod find_community_by_gathering_id(list<uint32> gids) {\n\t\tlist<PersistentGathering> communities;\n\t}\n\t\n\tmethod find_official_community(bool available_only, ResultRange range) {\n\t\tlist<PersistentGathering> communities;\n\t}\n\t\n\tmethod find_community_by_participant(pid pid, ResultRange range) {\n\t\tlist<PersistentGathering> communities;\n\t}\n\t\n\tmethod update_privacy_setting(bool online_status, bool community_participation) {}\n\t\n\tmethod get_my_block_list() { list<pid> pids; }\n\tmethod add_to_block_list(list<pid> pids) {}\n\tmethod remove_from_block_list(list<pid> pids) {}\n\tmethod clear_my_block_list() {}\n\t\n\tmethod report_violation(pid pid, string username, uint32 violation_code) {}\n\t\n\tmethod is_violation_user() {\n\t\tbool flag;\n\t\tuint32 score;\n\t}\n\t\n\tmethod join_matchmake_session_ex(uint32 gid, string gmessage, bool ignore_block_list, uint16 num_participants) {\n\t\tbuffer session_key;\n\t}\n\t\n\tmethod get_simple_playing_session(list<pid> pids, bool include_login_user) {\n\t\tlist<SimplePlayingSession> session;\n\t}\n\t\n\tmethod get_simple_community(list<uint32> gids) {\n\t\tlist<SimpleCommunity> communities;\n\t}\n\t\n\tmethod auto_matchmake_with_gathering_id_postpone(list<uint32> gids, anydata<Gathering> gathering, string message) {\n\t\tanydata<Gathering> joined_gathering;\n\t}\n\t\n\tmethod update_progress_score(uint32 gid, uint8 score) {}\n\t\n\tmethod debug_notify_event(pid pid, uint32 main_type, uint32 sub_type, uint64 param1, uint64 param2, string param3) {}\n\t\n\tmethod generate_matchmake_session_system_password(uint32 gid) {\n\t\tstring password;\n\t}\n\tmethod clear_matchmake_session_system_password(uint32 gid) {}\n\t\n\tmethod create_matchmake_session_with_param(CreateMatchmakeSessionParam param) {\n\t\tMatchmakeSession session;\n\t}\n\t\n\tmethod join_matchmake_session_with_param(JoinMatchmakeSessionParam param) {\n\t\tMatchmakeSession session;\n\t}\n\t\n\tmethod auto_matchmake_with_param_postpone(AutoMatchmakeParam param) {\n\t\tMatchmakeSession session;\n\t}\n\t\n\tmethod find_matchmake_session_by_gathering_id_detail(uint32 gid) {\n\t\tMatchmakeSession session;\n\t}\n\t\n\tmethod browse_matchmake_session_no_holder(MatchmakeSessionSearchCriteria search_criteria, ResultRange range) {\n\t\tlist<MatchmakeSession> sessions;\n\t}\n\t\n\tmethod browse_matchmake_session_with_host_urls_no_holder(MatchmakeSessionSearchCriteria search_criteria, ResultRange range) {\n\t\tlist<MatchmakeSession> sessions;\n\t\tlist<GatheringURLs> urls;\n\t}\n\t\n\tmethod update_matchmake_session_part(UpdateMatchmakeSessionParam param) {}\n\t\n\tmethod request_matchmaking(AutoMatchmakeParam param) {\n\t\tuint64 request_id;\n\t}\n\t\n\tmethod withdraw_matchmaking(uint64 request_id) {}\n\tmethod withdraw_matchmaking_all() {}\n\t\n\tmethod find_matchmake_session_by_gathering_id(list<uint32> gids) {\n\t\tlist<MatchmakeSession> sessions;\n\t}\n\t\n\tmethod find_matchmake_session_by_single_gathering_id(uint32 gid) {\n\t\tMatchmakeSession session;\n\t}\n\t\n\tmethod find_matchmake_session_by_owner(pid pid, ResultRange range) {\n\t\tlist<MatchmakeSession> sessions;\n\t}\n\t\n\tmethod find_matchmake_session_by_participant(FindMatchmakeSessionByParticipantParam param) {\n\t\tlist<FindMatchmakeSessionByParticipantResult> result;\n\t}\n\t\n\tmethod browse_matchmake_session_no_holder_no_result_range(\n\t\tMatchmakeSessionSearchCriteria search_criteria\n\t) {\n\t\tlist<MatchmakeSession> sessions;\n\t}\n\t\n\tmethod browse_matchmake_session_with_host_urls_no_holder_no_result_range(\n\t\tMatchmakeSessionSearchCriteria search_criteria\n\t) {\n\t\tlist<MatchmakeSession> sessions;\n\t\tlist<GatheringURLs> urls;\n\t}\n}\n\nprotocol MatchmakeReferee : 120 {\n\tmethod start_round(MatchmakeRefereeStartRoundParam param) {\n\t\tuint64 round_id;\n\t}\n\t\n\tmethod get_start_round_param(uint64 round_id) {\n\t\tMatchmakeRefereeStartRoundParam param;\n\t}\n\t\n\tmethod end_round(MatchmakeRefereeEndRoundParam param) {}\n\tmethod end_round_without_report(uint64 round_id) {}\n\t\n\tmethod get_round_participants(uint64 round_id) {\n\t\tlist<pid> pids;\n\t}\n\t\n\tmethod get_not_summarized_round() {\n\t\tlist<MatchmakeRefereeRound> rounds;\n\t}\n\t\n\tmethod get_round(uint64 round) {\n\t\tMatchmakeRefereeRound round;\n\t}\n\t\n\tmethod get_stats_primary(MatchmakeRefereeStatsTarget target) {\n\t\tMatchmakeRefereeStats stats;\n\t}\n\t\n\tmethod get_stats_primaries(list<MatchmakeRefereeStatsTarget> targets) {\n\t\tlist<MatchmakeRefereeStats> stats;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod get_stats_all(MatchmakeRefereeStatsTarget target) {\n\t\tlist<MatchmakeRefereeStats> stats;\n\t}\n\t\n\tmethod create_stats(MatchmakeRefereeStatsInitParam param) {\n\t\tMatchmakeRefereeStats stats;\n\t}\n\t\n\tmethod get_or_create_stats(MatchmakeRefereeStatsInitParam param) {\n\t\tMatchmakeRefereeStats stats;\n\t}\n\t\n\tmethod reset_stats() {}\n}\n"
  },
  {
    "path": "nintendo/files/proto/matchmaking_eagle.proto",
    "content": "\nimport matchmaking;\n\nstruct MatchmakeRefereeStartRoundParam {\n\tuint32 personal_data_category;\n\tuint32 gid;\n\tlist<pid> pids;\n\tuint8 report_summary_mode;\n\tuint32 event_id;\n}\n\nstruct MatchmakeRefereePersonalRoundResult {\n\tpid pid;\n\tuint32 personal_round_result_flag;\n\tuint32 round_win_loss;\n\tsint32 rating_value_change;\n\tqbuffer buffer;\n\tuint8 report_summary_mode;\n\tuint32 event_id;\n}\n\nprotocol MatchmakeReferee : 120 {\n\tmethod start_round(MatchmakeRefereeStartRoundParam param) {\n\t\tuint64 round_id;\n\t}\n\t\n\tmethod get_start_round_param(uint64 round_id) {\n\t\tMatchmakeRefereeStartRoundParam param;\n\t}\n\t\n\tmethod end_round(MatchmakeRefereeEndRoundParam param) {}\n\tmethod end_round_with_partial_report(MatchmakeRefereeEndRoundParam param) {}\n\tmethod end_round_without_report(uint64 round_id) {}\n\t\n\tmethod get_round_participants(uint64 round_id) {\n\t\tlist<pid> pids;\n\t}\n\t\n\tmethod get_not_summarized_round() {\n\t\tlist<MatchmakeRefereeRound> rounds;\n\t}\n\t\n\tmethod get_round(uint64 round) {\n\t\tMatchmakeRefereeRound round;\n\t}\n\t\n\tmethod get_stats_primary(MatchmakeRefereeStatsTarget target) {\n\t\tMatchmakeRefereeStats stats;\n\t}\n\t\n\tmethod get_stats_primaries(list<MatchmakeRefereeStatsTarget> targets) {\n\t\tlist<MatchmakeRefereeStats> stats;\n\t\tlist<result> results;\n\t}\n\t\n\tmethod get_stats_all(MatchmakeRefereeStatsTarget target) {\n\t\tlist<MatchmakeRefereeStats> stats;\n\t}\n\t\n\tmethod create_stats(MatchmakeRefereeStatsInitParam param) {\n\t\tMatchmakeRefereeStats stats;\n\t}\n\t\n\tmethod get_or_create_stats(MatchmakeRefereeStatsInitParam param) {\n\t\tMatchmakeRefereeStats stats;\n\t}\n\t\n\tmethod reset_stats() {}\n\t\n\tmethod get_event_point;\n\tmethod reset_event_point;\n}\n"
  },
  {
    "path": "nintendo/files/proto/matchmaking_mhxx.proto",
    "content": "\r\nimport matchmaking;\r\n\r\nstruct FriendUserParam {\r\n    string name;\r\n}\r\n\r\nstruct FriendUserInfo {\r\n    uint64 pid;\r\n    string name;\r\n    uint32 presence;\r\n}\r\n\r\nprotocol MatchmakeExtension_MHXX : MatchmakeExtension {\r\n    method(54) update_friend_user_profile(FriendUserParam param) {}\r\n\r\n    method get_friend_user_profiles(list<uint64> pids) {\r\n        list<FriendUserInfo> infos;\r\n    }\r\n\r\n    method get_friends() {\r\n        list<FriendUserInfo> infos;\r\n    }\r\n\r\n    method add_friends(list<uint64> pids) {}\r\n    method remove_friend(uint64 pid) {}\r\n\r\n    method find_community_by_owner(uint64 id, ResultRange range) {\r\n        list<PersistentGathering> lst_community;\r\n    }\r\n}"
  },
  {
    "path": "nintendo/files/proto/matchmaking_mk8.proto",
    "content": "\r\nimport matchmaking;\r\n\r\nstruct SimpleSearchObject {\r\n    uint32 id;\r\n    pid owner;\r\n    list<uint32> attributes;\r\n    qbuffer metadata;\r\n    uint32 community_id;\r\n    string community_code;\r\n    SimpleSearchDateTimeAttribute datetime;\r\n}\r\n\r\nstruct SimpleSearchDateTimeAttribute {\r\n    uint32 unk1;\r\n    uint32 unk2;\r\n    uint32 unk3;\r\n    uint32 unk4;\r\n    datetime start_time;\r\n    datetime end_time;\r\n}\r\n\r\nstruct SimpleSearchParam {\r\n    uint32 unk1;\r\n    pid unk2;\r\n    list<SimpleSearchCondition> conditions;\r\n    string unk3;\r\n    ResultRange range;\r\n    datetime unk4;\r\n}\r\n\r\nstruct SimpleSearchCondition {\r\n    uint32 value;\r\n    uint32 operator;\r\n}\r\n\r\nprotocol MatchmakeExtension_MK8 : MatchmakeExtension {\r\n    method(36) create_simple_search_object(SimpleSearchObject object) {\r\n       uint32 id; \r\n    }\r\n    \r\n    method update_simple_search_object(uint32 id, SimpleSearchObject object) {}\r\n    method delete_simple_search_object(uint32 id) {}\r\n\r\n    method search_simple_search_object(SimpleSearchParam param) {\r\n\t\tlist<SimpleSearchObject> objects;\r\n\t}\r\n\r\n    method join_matchmake_session_with_extra_participants(uint32 gid, string join_message, bool ignore_blacklist, uint16 participation_count, uint32 extra_participants) {\r\n\t\tbuffer session_key;\r\n\t}\r\n\r\n    method search_simple_search_object_by_object_ids(list<uint32> ids) {\r\n\t\tlist<SimpleSearchObject> objects;\r\n\t}\r\n}"
  },
  {
    "path": "nintendo/files/proto/matchmaking_mk8d.proto",
    "content": "\nimport matchmaking;\n\nenum SimpleSearchConditionOperator {\n\tANY = 0,\n\tEQUAL = 1,\n\tGREATER_THAN = 2,\n\tLESS_THAN = 3,\n\tGREATER_THAN_OR_EQUAL  = 4,\n\tLESS_THAN_OR_EQUAL = 5\n}\n\nstruct SimpleSearchObject {\n\tuint32 id;\n\tpid owner;\n\tlist<uint32> attributes;\n\tqbuffer metadata;\n\tuint32 community_id;\n\tstring community_code;\n\tSimpleSearchDateTimeAttribute datetime;\n\t\n\tnex 40000 {\n\t\trevision 1 {\n\t\t\tuint32 liveliness_rate;\n\t\t\tdatetime liveliness_update_time;\n\t\t}\n\t}\n}\n\nstruct SimpleSearchDateTimeAttribute {\n\tuint32 start_daytime;\n\tuint32 end_daytime;\n\tuint32 start_time;\n\tuint32 end_time;\n\tdatetime start_datetime;\n\tdatetime end_datetime;\n}\n\nstruct SimpleSearchParam {\n\tuint32 id = 0;\n\tpid owner = 0;\n\tlist<SimpleSearchCondition> conditions = [];\n\tstring community_code = \"\";\n\tResultRange range;\n\tdatetime datetime = never;\n}\n\nstruct SimpleSearchCondition {\n\tuint32 value;\n\tuint32 operator;\n}\n\nprotocol MatchmakeExtension_MK8D : MatchmakeExtension {\n\tmethod(54) create_simple_search_object(SimpleSearchObject object) {\n\t\tuint32 id;\n\t}\n\t\n\tmethod update_simple_search_object(uint32 id, SimpleSearchObject object) {}\n\tmethod delete_simple_search_object(uint32 id) {}\n\t\n\tmethod search_simple_search_object(SimpleSearchParam param) {\n\t\tlist<SimpleSearchObject> objects;\n\t}\n\t\n\tmethod search_simple_search_object_by_object_ids(list<uint32> ids) {\n\t\tlist<SimpleSearchObject> objects;\n\t}\n\t\n\tmethod join_matchmake_session_with_extra_participants(uint32 gid, string join_message, bool ignore_blacklist, uint16 participation_count, uint32 extra_participants) {\n\t\tbuffer session_key;\n\t}\n\n\tmethod custom_get_simple_playing_session;\n\t\n\tmethod create_competition(SimpleSearchObject competition) {\n\t\tSimpleSearchObject competition;\n\t}\n\t\n\tmethod delete_competition(uint32 id) {}\n\tmethod register_favorite_competition(uint32 id) {}\n\tmethod unregister_favorite_competition(uint32 id) {}\n\t\n\tmethod get_favorite_competition() {\n\t\tlist<SimpleSearchObject> competitions;\n\t}\n\t\n\tmethod get_team_participants;\n\tmethod find_community_by_owner;\n}\n"
  },
  {
    "path": "nintendo/files/proto/messaging.proto",
    "content": "\r\nenum RecipientType {\r\n\tPRINCIPAL = 1,\r\n\tGATHERING = 2\r\n}\r\n\r\nstruct MessageRecipient {\r\n\tuint32 type;\r\n\tpid pid;\r\n\tuint32 gid;\r\n}\r\n\r\nstruct UserMessage : Data {\r\n\tuint32 id;\r\n\tuint32 parent_id;\r\n\tpid sender;\r\n\tdatetime reception_time;\r\n\tuint32 life_time;\r\n\tuint32 flags;\r\n\tstring subject;\r\n\tstring sender_name;\r\n\tMessageRecipient recipient;\r\n}\r\n\r\nstruct TextMessage : UserMessage {\r\n\tstring body;\r\n}\r\n\r\nstruct BinaryMessage : UserMessage {\r\n\tqbuffer body;\r\n}\r\n\r\nprotocol Messaging : 23 {\r\n\tmethod deliver_message(anydata message) {\r\n\t\tanydata modified_message;\r\n\t\tlist<uint32> sandbox_node_ids;\r\n\t\tlist<pid> participants;\r\n\t}\r\n\t\r\n\tmethod get_number_of_messages(MessageRecipient recipient) {\r\n\t\tuint32 number;\r\n\t}\r\n\t\r\n\tmethod get_message_headers(MessageRecipient recipient, ResultRange range) {\r\n\t\tlist<UserMessage> headers;\r\n\t}\r\n\t\r\n\tmethod retrieve_all_messages_within_range(MessageRecipient recipient, ResultRange range) {\r\n\t\tlist<anydata> messages;\r\n\t}\r\n\t\r\n\tmethod retrieve_messages(MessageRecipient recipient, list<uint32> message_ids, bool leave_on_server) {\r\n\t\tlist<anydata> messages;\r\n\t}\r\n\t\r\n\tmethod delete_messages(MessageRecipient recipient, list<uint32> message_ids) {}\r\n\t\r\n\tmethod delete_all_messages(MessageRecipient recipient) {\r\n\t\tuint32 number_deleted;\r\n\t}\r\n}\r\n\r\nprotocol MessageDelivery : 27 {\r\n\tset noresponse;\r\n\t\r\n\tmethod deliver_message(anydata message) {}\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/monitoring.proto",
    "content": "\nprotocol Monitoring : 19 {\n\tmethod ping_daemon() { bool result; }\n\tmethod get_cluster_members() {\n\t\tlist<string> members;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/nattraversal.proto",
    "content": "\nprotocol NATTraversal : 3 {\n\tmethod request_probe_initiation(list<stationurl> target_urls) {}\n\tmethod initiate_probe(stationurl station_to_probe) {}\n\tmethod request_probe_initiation_ext(\n\t\tlist<stationurl> target_urls, stationurl station_to_probe\n\t) {}\n\tmethod report_nat_traversal_result(uint32 cid, bool result) {}\n\tmethod report_nat_properties(uint32 natm, uint32 natf, uint32 rtt) {}\n\t\n\tmethod get_relay_signature_key() {\n\t\tsint32 mode;\n\t\tdatetime time;\n\t\tstring address;\n\t\tuint16 port;\n\t\tsint32 address_type;\n\t\tuint32 game_server_id;\n\t}\n\t\n\tmethod report_nat_traversal_result_detail(uint32 cid, bool result, sint32 detail, uint32 rtt) {}\n}\n"
  },
  {
    "path": "nintendo/files/proto/nintendonotification.proto",
    "content": "\r\nstruct u8KeyValue : Data {\r\n\tuint8 key;\r\n\tuint8 value;\r\n}\r\n\r\nstruct u32KeyValue : Data {\r\n\tuint8 key;\r\n\tuint32 value;\r\n}\r\n\r\nstruct u64KeyValue : Data {\r\n\tuint8 key;\r\n\tuint64 value;\r\n}\r\n\r\nstruct StringKeyValue : Data {\r\n\tuint8 key;\r\n\tstring value;\r\n}\r\n\r\nenum NintendoNotificationType {\r\n\tLOGOUT = 10,\r\n\tPRESENCE_CHANGE = 24,\r\n\tUNFRIENDED = 26,\r\n\tFRIENDED = 30,\r\n\tSTATUS_CHANGE = 33\r\n}\r\n\r\nstruct NintendoNotificationEvent {\r\n\tuint32 type;\r\n\tpid pid;\r\n\tanydata data;\r\n}\r\n\r\nstruct NintendoNotificationEventGeneral : Data {\r\n\tuint32 param1;\r\n\tuint64 param2;\r\n\tuint64 param3;\r\n\tstring text;\r\n}\r\n\r\nstruct NintendoNotificationEventKeyValue : Data {\r\n\tlist<u8KeyValue> u8;\r\n\tlist<u32KeyValue> u32;\r\n\tlist<u64KeyValue> u64;\r\n\tlist<StringKeyValue> string;\r\n}\r\n\r\nstruct NintendoNotificationEventProfile : Data {\r\n\tuint8 region;\r\n\tuint8 country;\r\n\tuint8 area;\r\n\tuint8 language;\r\n\tuint8 platform;\r\n}\r\n\r\nprotocol NintendoNotification : 100 {\r\n\tset noresponse;\r\n\t\r\n\tmethod process_nintendo_notification_event(NintendoNotificationEvent event) {}\r\n\tmethod process_nintendo_notification_event_alt(NintendoNotificationEvent event) {}\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/notification.proto",
    "content": "\nstruct NotificationEvent {\n\tpid pid;\n\tuint32 type;\n\tpid param1 = 0;\n\tpid param2 = 0;\n\tstring text = \"\";\n\t\n\tnex 30500 {\n\t\tpid param3 = 0;\n\t}\n\t\n\tnex 40000 {\n\t\trevision 1 {\n\t\t\tmap<string, variant> map = {};\n\t\t}\n\t}\n}\n\nprotocol Notification : 14 {\n\tset noresponse;\n\t\n\tmethod process_notification_event(NotificationEvent event) {}\n}\n"
  },
  {
    "path": "nintendo/files/proto/ranking.proto",
    "content": "\nenum RankingOrderCalc {\n\tSTANDARD = 0,\n\tORDINAL = 1\n}\n\nenum RankingMode {\n\tGLOBAL = 0,\n\tGLOBAL_AROUND_SELF = 1,\n\tSELF = 4\n}\n\nenum RankingStatFlags {\n\tRANKING_COUNT = 1,\n\tTOTAL_SCORE = 2,\n\tLOWEST_SCORE = 4,\n\tHIGHEST_SCORE = 8,\n\tAVERAGE_SCORE = 16,\n\tALL = 31\n}\n\nstruct RankingOrderParam {\n\tuint8 order_calc = 0;\n\tuint8 group_index = 255;\n\tuint8 group_num = 0;\n\tuint8 time_scope = 2;\n\tuint32 offset = 0;\n\tuint8 count = 10;\n}\n\nstruct RankingRankData {\n\tpid pid;\n\tuint64 unique_id;\n\tuint32 rank;\n\tuint32 category;\n\tuint32 score;\n\tlist<uint8> groups;\n\tuint64 param;\n\tbuffer common_data;\n\t\n\tnex 40000 {\n\t\tdatetime update_time;\n\t}\n}\n\nstruct RankingResult {\n\tlist<RankingRankData> data;\n\tuint32 total;\n\tdatetime since_time;\n}\n\nstruct RankingCachedResult : RankingResult {\n\tdatetime created_time;\n\tdatetime expired_time;\n\tuint8 max_length;\n}\n\nstruct RankingStats {\n\tlist<double> stats;\n}\n\nstruct RankingScoreData {\n\tuint32 category;\n\tuint32 score;\n\tuint8 order;\n\tuint8 update_mode;\n\tlist<uint8> groups;\n\tuint64 param;\n}\n\nstruct RankingChangeAttributesParam {\n\tuint8 flags;\n\tlist<uint8> groups;\n\tuint64 param;\n}\n\nprotocol Ranking : 112 {\n\tmethod upload_score(RankingScoreData score_data, uint64 unique_id) {}\n\t\n\tmethod delete_score(uint32 category, uint64 unique_id) {}\n\tmethod delete_all_scores(uint64 unique_id) {}\n\t\n\tmethod upload_common_data(buffer common_data, uint64 unique_id) {}\n\tmethod delete_common_data(uint64 unique_id) {}\n\t\n\tmethod get_common_data(uint64 unique_id) {\n\t\tbuffer data;\n\t}\n\t\n\tmethod change_attributes(uint32 category, RankingChangeAttributesParam param, uint64 unique_id) {}\n\tmethod change_all_attributes(RankingChangeAttributesParam param, uint64 unique_id) {}\n\t\n\tmethod get_ranking(uint8 mode, uint32 category, RankingOrderParam order, uint64 unique_id, pid pid) {\n\t\tRankingResult result;\n\t}\n\t\n\tmethod get_approx_order(uint32 category, RankingOrderParam order, uint32 score, uint64 unique_id, pid pid) {\n\t\tuint32 order;\n\t}\n\t\n\tmethod get_stats(uint32 category, RankingOrderParam order, uint32 flags) {\n\t\tRankingStats stats;\n\t}\n\t\n\tmethod get_ranking_by_pid_list(list<pid> pids, uint8 mode, uint32 category, RankingOrderParam order, uint64 unique_id) {\n\t\tRankingResult result;\n\t}\n\t\n\tmethod get_ranking_by_unique_id_list(list<uint64> ids, uint8 mode, uint32 category, RankingOrderParam order, uint64 unique_id) {\n\t\tRankingResult result;\n\t}\n\t\n\tmethod get_cached_topx_ranking(uint32 category, RankingOrderParam order) {\n\t\tRankingCachedResult result;\n\t}\n\t\n\tmethod get_cached_topx_rankings(list<uint32> categories, list<RankingOrderParam> order) {\n\t\tlist<RankingCachedResult> results;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/ranking2.proto",
    "content": "\nenum RankingMode {\n\tGLOBAL_AROUND_SELF = 1,\n\tGLOBAL = 2,\n\tFRIENDS = 3\n}\n\nstruct Ranking2CategorySetting {\n\tuint32 min_score;\n\tuint32 max_score;\n\tuint32 lowest_rank;\n\tuint16 reset_month;\n\tuint8 reset_day;\n\tuint8 reset_hour;\n\tuint8 reset_mode;\n\tuint8 max_seasons_to_go_back;\n\tbool score_order;\n}\n\nstruct Ranking2ChartInfo {\n\tdatetime create_time;\n\tuint32 index;\n\tuint32 category;\n\tsint32 season;\n\tuint8 bins_size;\n\tuint8 sampling_rate;\n\tbool score_order;\n\tuint32 estimate_length;\n\tuint32 estimate_highest_score;\n\tuint32 estimate_lowest_score;\n\tuint32 estimate_median_score;\n\tdouble estimate_average_score;\n\tuint32 highest_bins_score;\n\tuint32 lowest_bins_score;\n\tuint32 bins_width;\n\tuint32 attribute1;\n\tuint32 attribute2;\n\tlist<uint32> quantities;\n}\n\nstruct Ranking2ChartInfoInput {\n\tuint32 chart_index;\n\tuint8 seasons_to_go_back;\n}\n\nstruct Ranking2CommonData {\n\tstring username;\n\tqbuffer mii;\n\tqbuffer binary_data;\n}\n\nstruct Ranking2EstimateScoreRankInput {\n\tuint32 category;\n\tuint8 seasons_to_go_back;\n\tuint32 score;\n}\n\nstruct Ranking2EstimateScoreRankOutput {\n\tuint32 rank;\n\tuint32 length;\n\tuint32 score;\n\tuint32 category;\n\tsint32 season;\n\tuint8 sampling_rate;\n}\n\nstruct Ranking2GetByListParam {\n\tuint32 category;\n\tuint32 offset;\n\tuint32 length;\n\tuint32 sort_flags;\n\tuint32 option_flags;\n\tuint8 seasons_to_go_back;\n}\n\nstruct Ranking2GetParam {\n\tuint64 unique_id = 0;\n\tpid pid = 0;\n\tuint32 category;\n\tuint32 offset = 0;\n\tuint32 count = 10;\n\tuint32 sort_flags = 0;\n\tuint32 option_flags = 0;\n\tuint8 mode = 2;\n\tuint8 seasons_to_go_back = 0;\n}\n\nstruct Ranking2Info {\n\tlist<Ranking2RankData> data;\n\tuint32 lowest_rank;\n\tuint32 num_entries;\n\tsint32 season;\n}\n\nstruct Ranking2RankData {\n\tuint64 misc;\n\tuint64 unique_id;\n\tpid pid;\n\tuint32 rank;\n\tuint32 score;\n\tRanking2CommonData common_data;\n}\n\nstruct Ranking2ScoreData {\n\tuint64 misc;\n\tuint32 category;\n\tuint32 score;\n}\n\nprotocol Ranking2 : 122 {\n\tmethod put_score(list<Ranking2ScoreData> socres, uint64 unique_id) {}\n\t\n\tmethod get_common_data(uint32 option_flags, pid pid, uint64 unique_id) {\n\t\tRanking2CommonData common_data;\n\t}\n\t\n\tmethod put_common_data(Ranking2CommonData data, uint64 unique_id) {}\n\tmethod delete_common_data(uint64 unique_id) {}\n\t\n\tmethod get_ranking(Ranking2GetParam param) {\n\t\tRanking2Info info;\n\t}\n\t\n\tmethod get_ranking_by_principal_id(Ranking2GetByListParam param, list<pid> pids) {\n\t\tRanking2Info info;\n\t}\n\t\n\tmethod get_category_setting(uint32 category) {\n\t\tRanking2CategorySetting setting;\n\t}\n\t\n\tmethod get_ranking_chart(Ranking2ChartInfoInput input) {\n\t\tRanking2ChartInfo info;\n\t}\n\t\n\tmethod get_ranking_charts(list<Ranking2ChartInfoInput> inputs) {\n\t\tlist<Ranking2ChartInfo> infos;\n\t}\n\t\n\tmethod get_estimate_score_rank(Ranking2EstimateScoreRankInput input) {\n\t\tRanking2EstimateScoreRankOutput output;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/ranking2_eagle.proto",
    "content": "\nimport ranking2;\n\nstruct Ranking2EstimateMyScoreRankInput {\n\tuint32 category;\n\tuint8 seasons_to_go_back;\n}\n\nprotocol Ranking2 : Ranking2 {\n\tmethod(11) get_estimate_my_score_rank(Ranking2EstimateMyScoreRankInput input) {\n\t\tRanking2EstimateScoreRankOutput output;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/ranking_mk8.proto",
    "content": "\r\nimport ranking;\r\n\r\nstruct CompetitionRankingInfo {\r\n\tuint32 id;\r\n\tuint32 num_participants;\r\n\tlist<uint32> team_scores;\r\n}\r\n\r\nstruct CompetitionRankingInfoGetParam {\r\n\tuint8 rank_order;\r\n\tResultRange range;\r\n}\r\n\r\nstruct CompetitionRankingUploadScoreParam {\r\n\tuint32 id;\r\n\tuint32 season_id;\r\n\tuint32 unk3;\r\n\tuint32 score;\r\n\tuint8 team_id;\r\n\tuint32 team_score;\r\n\tbool is_first_upload;\r\n\tqbuffer metadata;\r\n}\r\n\r\nprotocol Ranking_MK8 : Ranking {\r\n\tmethod(14) get_competition_ranking_score;\r\n\t\r\n\tmethod upload_competition_ranking_score(CompetitionRankingUploadScoreParam param) {\r\n\t\tbool result;\r\n\t}\r\n\t\r\n\tmethod get_competition_info(CompetitionRankingInfoGetParam param) {\r\n\t\tlist<CompetitionRankingInfo> info;\r\n\t}\r\n}"
  },
  {
    "path": "nintendo/files/proto/ranking_mk8d.proto",
    "content": "\nimport ranking;\n\nstruct CommonDataList {\n\tlist<qbuffer> data;\n}\n\nstruct CompetitionRankingGetScoreParam {\n\tuint32 id;\n\tResultRange range;\n}\n\nstruct CompetitionRankingInfo {\n\tuint32 id;\n\tuint32 num_participants;\n\tlist<uint32> team_scores;\n}\n\nstruct CompetitionRankingInfoGetParam {\n\tuint8 rank_order;\n\tResultRange range;\n}\n\nstruct CompetitionRankingScoreData {\n\tuint32 rank;\n\tpid pid;\n\tuint32 score;\n\tdatetime last_update;\n\tuint8 team_id = 255;\n\tqbuffer metadata;\n}\n\nstruct CompetitionRankingScoreInfo {\n\tuint32 season_id;\n\tlist<CompetitionRankingScoreData> scores;\n\tuint32 num_participants;\n\tlist<uint32> team_scores;\n}\n\nstruct CompetitionRankingUploadScoreParam {\n\tuint32 id;\n\tuint32 season_id;\n\tuint32 unk3;\n\tuint32 score;\n\tuint8 team_id;\n\tuint32 team_score;\n\tbool is_first_upload;\n\tqbuffer metadata;\n}\n\nstruct ScorePack {\n\tlist<qbuffer> data;\n}\n\nprotocol Ranking_MK8D : Ranking {\n\tmethod(16) get_competition_ranking_score(CompetitionRankingGetScoreParam param) {\n\t\tlist<CompetitionRankingScoreInfo> info;\n\t}\n\t\n\tmethod upload_competition_ranking_score(CompetitionRankingUploadScoreParam param) {\n\t\tbool result;\n\t}\n\t\n\tmethod get_competition_info(CompetitionRankingInfoGetParam param) {\n\t\tlist<CompetitionRankingInfo> info;\n\t}\n\t\n\tmethod upload_score_pack(RankingScoreData score_data, qbuffer metadata) {}\n\n\tmethod get_score_pack(list<pid> pids, uint32 category) {\n\t\tScorePack result;\n\t}\n\n\tmethod execute_delete_score_job;\n\t\n\tmethod get_commmon_data_by_pid_list(list<pid> pids) {\n\t\tCommonDataList list;\n\t}\n}\n"
  },
  {
    "path": "nintendo/files/proto/remotelog.proto",
    "content": "\r\nprotocol RemoteLogDevice : 1 {\r\n\tmethod log(string message) {}\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/screening.proto",
    "content": "\r\nprotocol Screening : 124 {\r\n    method report_data_store_content;\r\n    method report_user;\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/secure.proto",
    "content": "\nstruct ConnectionData {\n\tstationurl station;\n\tuint32 connection_id;\n}\n\nstruct NintendoLoginData {\n\tstring token;\n}\n\nprotocol SecureConnection : 11 {\n\tmethod register(list<stationurl> urls) {\n\t\tresult result;\n\t\tuint32 connection_id;\n\t\tstationurl public_station;\n\t}\n\t\n\tmethod request_connection_data(uint32 cid, pid pid) {\n\t\tbool result;\n\t\tlist<ConnectionData> connection_data;\n\t}\n\t\n\tmethod request_urls(uint32 cid, pid pid) {\n\t\tbool result;\n\t\tlist<stationurl> urls;\n\t}\n\t\n\tmethod register_ex(list<stationurl> urls, anydata login_data) {\n\t\tresult result;\n\t\tuint32 connection_id;\n\t\tstationurl public_station;\n\t}\n\t\n\tmethod test_connectivity() {}\n\tmethod update_urls(list<stationurl> urls) {}\n\tmethod replace_url(stationurl url, stationurl new) {}\n\tmethod send_report(uint32 report_id, qbuffer data) {}\n}\n"
  },
  {
    "path": "nintendo/files/proto/subscriber.proto",
    "content": "\r\nprotocol Subscriber : 121 {\r\n\tmethod hello;\r\n\tmethod post_content;\r\n\tmethod get_content;\r\n\tmethod follow;\r\n\tmethod unfollow_all_and_follow;\r\n\tmethod unfollow;\r\n\tmethod get_following;\r\n\tmethod get_follower;\r\n\tmethod get_num_followers;\r\n\tmethod get_timeline;\r\n\tmethod delete_content;\r\n\tmethod get_content_multi;\r\n\tmethod update_user_status;\r\n\tmethod get_friend_user_statuses;\r\n\tmethod get_user_statuses;\r\n}\r\n"
  },
  {
    "path": "nintendo/files/proto/utility.proto",
    "content": "\nstruct UniqueIdInfo {\n\tuint64 unique_id = 0;\n\tuint64 password = 0;\n}\n\nprotocol Utility : 110 {\n\tmethod acquire_nex_unique_id() {\n\t\tuint64 unique_id;\n\t}\n\t\n\tmethod acquire_nex_unique_id_with_password() {\n\t\tUniqueIdInfo info;\n\t}\n\t\n\tmethod associate_nex_unique_id_with_my_principal_id(UniqueIdInfo info) {}\n\tmethod associate_nex_unique_ids_with_my_principal_id(list<UniqueIdInfo> infos) {}\n\t\n\tmethod get_associated_nex_unique_id_with_my_principal_id() {\n\t\tUniqueIdInfo info;\n\t}\n\t\n\tmethod get_associated_nex_unique_ids_with_my_principal_id() {\n\t\tlist<UniqueIdInfo> infos;\n\t}\n\t\n\tmethod get_integer_settings(uint32 index) {\n\t\tmap<uint16, sint32> settings;\n\t}\n\t\n\tmethod get_string_settings(uint32 index) {\n\t\tmap<uint16, string> settings;\n\t}\n}\n"
  },
  {
    "path": "nintendo/miis.py",
    "content": "\nfrom anynet import streams\nimport struct\n\n\ndef swap32(data, offs):\n\tstruct.pack_into(\"<I\", data, offs, struct.unpack_from(\">I\", data, offs)[0])\n\ndef swap16(data, offs):\n\tstruct.pack_into(\"<H\", data, offs, struct.unpack_from(\">H\", data, offs)[0])\n\ndef crc16(data):\n\thash = 0\n\tfor char in data:\n\t\tfor i in range(8):\n\t\t\tflag = hash & 0x8000\n\t\t\thash = (hash << 1) & 0xFFFF\n\t\t\tif flag:\n\t\t\t\thash ^= 0x1021\n\t\t\t\t\n\t\thash ^= char\n\treturn hash\n\n\nHairColors = [\n\t(.118, .102, .094),\n\t(.251, .125, .063),\n\t(.361, .094, .039),\n\t(.486, .227, .078),\n\t(.471, .471, .502),\n\t(.306, .243, .063),\n\t(.533, .345, .094),\n\t(.816, .627, .290)\n]\n\t\n\t\nclass MiiData:\n\t#This struct contains tightly packed bit fields holding\n\t#enough information to generate a model of this mii\n\t\n\t#Names may contain all characters except '%' and '\\'\n\t#Most other fields are also limited to a range of\n\t#values, as indicated by the comments behind them\n\n\t#If this struct contains invalid values the Wii U is likely\n\t#going to crash when it tries to render the mii model\n\t\n\tdef decode(self, stream):\n\t\tdata = stream.read(0x60)\n\t\tstream = streams.BitStreamIn(self.swap_endian(data), \">\")\n\n\t\t#FFLiMiiDataCore\n\t\tself.birth_platform = stream.bits(4) #1 - 7\n\t\tself.unk1 = stream.bits(4)\n\t\tself.unk2 = stream.bits(4) #0 - 9\n\t\tself.unk3 = stream.bits(4) #0 - 9\n\t\tself.font_region = stream.bits(4) #0 - 3\n\t\tself.region_move = stream.bits(2) #0 - 3\n\t\tself.unk4 = stream.bit()\n\t\tself.copyable = bool(stream.bit())\n\t\tself.mii_version = stream.u8()\n\t\t\n\t\tself.author_id = stream.repeat(stream.u8, 8)\n\t\tself.mii_id = stream.repeat(stream.u8, 10)\n\t\t\t\n\t\tself.unk5 = stream.read(2)\n\t\t\n\t\tself.unk6 = stream.bit() #Always 0?\n\t\tself.unk7 = stream.bit()\n\t\tself.color = stream.bits(4) #0 - 11\n\t\tself.birth_day = stream.bits(5) #1 - number of days in month\n\t\tself.birth_month = stream.bits(4) #1 - 12\n\t\tself.gender = stream.bit() #0=male, 1=female\n\t\t\n\t\tself.mii_name = stream.wchars(10).split(\"\\0\")[0]\n\t\tself.size = stream.u8() #0 - 0x80\n\t\tself.fatness = stream.u8() #0 - 0x80\n\n\t\tself.blush_type = stream.bits(4) #0 - 11\n\t\tself.face_style = stream.bits(4) #0 - 11\n\t\tself.face_color = stream.bits(3) #0 - 5\n\t\tself.face_type = stream.bits(4) #0 - 11\n\t\tself.local_only = bool(stream.bit())\n\t\tself.hair_mirrored = bool(stream.bits(5)) #0 - 1\n\t\tself.hair_color = stream.bits(3) #0 - 7\n\t\tself.hair_type = stream.u8() #0 - 131\n\t\t\n\t\tself.eye_thickness = stream.bits(3) #0 - 6\n\t\tself.eye_scale = stream.bits(4) #0 - 7\n\t\tself.eye_color = stream.bits(3) #0 - 5\n\t\tself.eye_type = stream.bits(6) #0 - 59\n\t\tself.eye_height = stream.bits(7) #0 - 18\n\t\tself.eye_distance = stream.bits(4) #0 - 12\n\t\tself.eye_rotation = stream.bits(5) #0 - 7\n\t\t\n\t\tself.eyebrow_thickness = stream.bits(4) #0 - 6\n\t\tself.eyebrow_scale = stream.bits(4) #0 - 8\n\t\tself.eyebrow_color = stream.bits(3) #0 - 7\n\t\tself.eyebrow_type = stream.bits(5) #0 - 23\n\t\tself.eyebrow_height = stream.bits(7) #3 - 18\n\t\tself.eyebrow_distance = stream.bits(4) #0 - 12\n\t\tself.eyebrow_rotation = stream.bits(5) #0 - 11\n\t\t\n\t\tself.nose_height = stream.bits(7) #0 - 18\n\t\tself.nose_scale = stream.bits(4) #0 - 8\n\t\tself.nose_type = stream.bits(5) #0 - 17\n\t\tself.mouth_thickness = stream.bits(3) #0 - 6\n\t\tself.mouth_scale = stream.bits(4) #0 - 8\n\t\tself.mouth_color = stream.bits(3) #0 - 4\n\t\tself.mouth_type = stream.bits(6) #0 - 35\n\n\t\tself.unk34 = stream.u8() #Always 0?\n\t\tself.mustache_type = stream.bits(3) #0 - 5\n\t\tself.mouth_height = stream.bits(5) #0 - 18\n\t\tself.mustache_height = stream.bits(6) #0 - 16\n\t\tself.mustache_scale = stream.bits(4) #0 - 8\n\t\tself.beard_color = stream.bits(3) #0 - 7\n\t\tself.beard_type = stream.bits(3) #0 - 5\n\t\t\n\t\tself.glass_height = stream.bits(5) #0 - 20\n\t\tself.glass_scale = stream.bits(4) #0 - 7\n\t\tself.glass_color = stream.bits(3) #0 - 5\n\t\tself.glass_type = stream.bits(4) #0 - 8\n\t\tself.unk43 = stream.bit() #Always 0?\n\t\tself.mole_ypos = stream.bits(5) #0 - 30\n\t\tself.mole_xpos = stream.bits(5) #0 - 16\n\t\tself.mole_scale = stream.bits(4) #0 - 8\n\t\tself.mole_enabled = stream.bit() #0 - 1\n\t\t\n\t\t#FFLiMiiDataOfficial\n\t\tself.creator_name = stream.wchars(10).split(\"\\0\")[0]\n\t\t\n\t\t#FFLStoreData\n\t\tself.unk48 = stream.read(2)\n\t\tstream.u16() #CRC16 of this whole struct\n\t\t\n\t\tif crc16(data) != 0:\n\t\t\traise ValueError(\"Mii data checksum not valid\")\n\t\t\n\tdef encode(self, outstream):\n\t\tstream = streams.BitStreamOut(\">\")\n\n\t\t#FFLiMiiDataCore\n\t\tstream.bits(self.birth_platform, 4)\n\t\tstream.bits(self.unk1, 4)\n\t\tstream.bits(self.unk2, 4)\n\t\tstream.bits(self.unk3, 4)\n\t\tstream.bits(self.font_region, 4)\n\t\tstream.bits(self.region_move, 2)\n\t\tstream.bit(self.unk4)\n\t\tstream.bit(self.copyable)\n\t\tstream.u8(self.mii_version)\n\t\t\n\t\tstream.repeat(self.author_id, stream.u8)\n\t\tstream.repeat(self.mii_id, stream.u8)\n\t\t\n\t\tstream.write(self.unk5)\n\t\t\n\t\tstream.bit(self.unk6)\n\t\tstream.bit(self.unk7)\n\t\tstream.bits(self.color, 4)\n\t\tstream.bits(self.birth_day, 5)\n\t\tstream.bits(self.birth_month, 4)\n\t\tstream.bit(self.gender)\n\t\t\n\t\tstream.wchars(self.mii_name + \"\\0\" * (10 - len(self.mii_name)))\n\t\tstream.u8(self.size)\n\t\tstream.u8(self.fatness)\n\t\t\n\t\tstream.bits(self.blush_type, 4)\n\t\tstream.bits(self.face_style, 4)\n\t\tstream.bits(self.face_color, 3)\n\t\tstream.bits(self.face_type, 4)\n\t\tstream.bit(self.local_only)\n\t\tstream.bits(self.hair_mirrored, 5)\n\t\tstream.bits(self.hair_color, 3)\n\t\tstream.u8(self.hair_type)\n\t\t\n\t\tstream.bits(self.eye_thickness, 3)\n\t\tstream.bits(self.eye_scale, 4)\n\t\tstream.bits(self.eye_color, 3)\n\t\tstream.bits(self.eye_type, 6)\n\t\tstream.bits(self.eye_height, 7)\n\t\tstream.bits(self.eye_distance, 4)\n\t\tstream.bits(self.eye_rotation, 5)\n\t\t\n\t\tstream.bits(self.eyebrow_thickness, 4)\n\t\tstream.bits(self.eyebrow_scale, 4)\n\t\tstream.bits(self.eyebrow_color, 3)\n\t\tstream.bits(self.eyebrow_type, 5)\n\t\tstream.bits(self.eyebrow_height, 7)\n\t\tstream.bits(self.eyebrow_distance, 4)\n\t\tstream.bits(self.eyebrow_rotation, 5)\n\t\t\n\t\tstream.bits(self.nose_height, 7)\n\t\tstream.bits(self.nose_scale, 4)\n\t\tstream.bits(self.nose_type, 5)\n\t\tstream.bits(self.mouth_thickness, 3)\n\t\tstream.bits(self.mouth_scale, 4)\n\t\tstream.bits(self.mouth_color, 3)\n\t\tstream.bits(self.mouth_type, 6)\n\t\t\n\t\tstream.u8(self.unk34)\n\t\tstream.bits(self.mustache_type, 3)\n\t\tstream.bits(self.mouth_height, 5)\n\t\tstream.bits(self.mustache_height, 6)\n\t\tstream.bits(self.mustache_scale, 4)\n\t\tstream.bits(self.beard_color, 3)\n\t\tstream.bits(self.beard_type, 3)\n\t\t\n\t\tstream.bits(self.glass_height, 5)\n\t\tstream.bits(self.glass_scale, 4)\n\t\tstream.bits(self.glass_color, 3)\n\t\tstream.bits(self.glass_type, 4)\n\t\tstream.bit(self.unk43)\n\t\tstream.bits(self.mole_ypos, 5)\n\t\tstream.bits(self.mole_xpos, 5)\n\t\tstream.bits(self.mole_scale, 4)\n\t\tstream.bit(self.mole_enabled)\n\t\t\n\t\t#FFLiMiiDataOfficial\n\t\tstream.wchars(self.creator_name + \"\\0\" * (10 - len(self.creator_name)))\n\t\t\n\t\t#FFLStoreData\n\t\tstream.write(self.unk48)\n\n\t\tdata = self.swap_endian(stream.get())\n\t\toutstream.write(data)\n\t\toutstream.u16(crc16(data + b\"\\0\\0\"))\n\t\t\n\tdef swap_endian(self, data):\n\t\tarray = bytearray(data)\n\t\t\n\t\t#FFLiMiiDataCore\n\t\tswap32(array, 0)\n\t\tfor i in range(0x18, 0x2E, 2):\n\t\t\tswap16(array, i)\n\t\tfor i in range(0x30, 0x48, 2):\n\t\t\tswap16(array, i)\n\t\t\t\n\t\t#FFLiMiiDataOfficial\n\t\tfor i in range(0x48, 0x5C, 2):\n\t\t\tswap16(array, i)\n\t\t\t\n\t\t#FFLStoreData\n\t\tswap16(array, 0x5C)\n\t\t\n\t\treturn bytes(array)\n\t\t\n\tdef build(self):\n\t\tstream = streams.StreamOut(\">\")\n\t\tself.encode(stream)\n\t\treturn stream.get()\n\t\n\t@classmethod\n\tdef parse(cls, data):\n\t\tinstance = cls()\n\t\tinstance.decode(streams.StreamIn(data, \">\"))\n\t\treturn instance\n"
  },
  {
    "path": "nintendo/nasc.py",
    "content": "\nfrom anynet import http, tls\nfrom nintendo import resources\nimport datetime\nimport secrets\nimport base64\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nMEDIA_TYPE_SYSTEM = 0\nMEDIA_TYPE_DIGITAL = 1\nMEDIA_TYPE_CARTRIDGE = 2\n\n\ndef b64decode(text):\n\ttext = text.replace(\".\", \"+\").replace(\"-\", \"/\").replace(\"*\", \"=\")\n\treturn base64.b64decode(text)\n\ndef b64encode(text):\n\t# Convert to bytes if necessary\n\tif isinstance(text, str):\n\t\ttext = text.encode()\n\t\n\ttext = base64.b64encode(text).decode()\n\treturn text.replace(\"+\", \".\").replace(\"/\", \"-\").replace(\"=\", \"*\")\n\ndef decode_form(form):\n\treturn {key: b64decode(value) for key, value in form.items()}\n\ndef encode_form(form):\n\treturn {key: b64encode(value) for key, value in form.items()}\n\ndef parse_date(text):\n\treturn datetime.datetime.strptime(text, \"%Y%m%d%H%M%S\")\n\n\n# Known error codes:\n#\t001: success\n#   109: missing or malformed parameter in request\n#   110: game server is no longer available\n#   119: fpd version is outdated\n#   121: device certificate is invalid\n#   122: uid hmac is invalid\n#   125: game id is invalid\n\nclass NASCError(Exception):\n\tdef __init__(self, status_code, form):\n\t\tself.status_code = status_code\n\t\t\n\t\treturncd = form[\"returncd\"].decode()\n\t\tself.return_code = None if returncd == \"null\" else int(returncd)\n\t\tself.retry = bool(int(form[\"retry\"].decode()))\n\t\tself.datetime = parse_date(form[\"datetime\"].decode())\n\t\n\tdef __str__(self):\n\t\tif self.return_code is None:\n\t\t\treturn \"NASC request failed with error code null\"\n\t\treturn \"NASC request failed with error code %i\" %self.return_code\n\n\nclass LoginResponse:\n\tdef __init__(self):\n\t\tself.host = None\n\t\tself.port = None\n\t\tself.token = None\n\t\tself.datetime = None\n\n\t@classmethod\n\tdef parse(cls, form):\n\t\thost, port = form[\"locator\"].decode().split(\":\")\n\t\t\n\t\tinst = cls()\n\t\tinst.host = host\n\t\tinst.port = int(port)\n\t\tinst.token = b64encode(form[\"token\"])\n\t\tinst.datetime = parse_date(form[\"datetime\"].decode())\n\t\treturn inst\n\n\nclass NASCClient:\n\tdef __init__(self):\n\t\tself.url = \"nasc.nintendowifi.net\"\n\n\t\tca = resources.certificate(\"Nintendo_CA_G3.der\")\n\t\tcert = resources.certificate(\"CTR_Common_Prod_1.der\")\n\t\tkey = resources.private_key(\"CTR_Common_Prod_1.key\")\n\n\t\tself.context = tls.TLSContext()\n\t\tself.context.set_authority(ca)\n\t\tself.context.set_certificate(cert, key)\n\t\t\n\t\tself.sdk_version_major = 0\n\t\tself.sdk_version_minor = 0\n\t\t\n\t\tself.title_id = None\n\t\tself.title_version = None\n\t\tself.product_code = \"----\"\n\t\tself.maker_code = \"00\"\n\t\tself.media_type = MEDIA_TYPE_SYSTEM\n\t\tself.rom_id = None\n\t\t\n\t\tself.serial_number = None\n\t\tself.mac_address = None\n\t\tself.fcd_cert = None\n\t\tself.device_name = \"\"\n\t\tself.unit_code = \"2\"\n\t\t\n\t\tself.bss_id = secrets.token_hex(6)\n\t\tself.ap_info = \"01:0000000000\"\n\t\t\n\t\tself.region = 3\n\t\tself.language = 2\n\t\t\n\t\tself.pid = None\n\t\tself.pid_hmac = None\n\t\tself.password = None\n\t\t\n\t\tself.fpd_version = 16\n\t\tself.environment = \"L1\"\n\t\n\tdef set_context(self, context):\n\t\tself.context = context\n\t\n\tdef set_url(self, url): self.url = url\n\t\n\tdef set_sdk_version(self, major_version, minor_version):\n\t\tself.sdk_major_version = major_version\n\t\tself.sdk_minor_version = minor_version\n\t\n\tdef set_title(\n\t\tself, title_id, title_version, product_code=\"----\", maker_code=\"00\",\n\t\tmedia_type=MEDIA_TYPE_SYSTEM, rom_id=None\n\t):\n\t\tif media_type == MEDIA_TYPE_CARTRIDGE and rom_id is None:\n\t\t\traise ValueError(\"Rom ID is required for cartridge media type\")\n\t\t\n\t\tself.title_id = title_id\n\t\tself.title_version = title_version\n\t\tself.product_code = product_code\n\t\tself.maker_code = maker_code\n\t\tself.media_type = media_type\n\t\tself.rom_id = rom_id\n\t\n\tdef set_device(self, serial_number, mac_address, fcd_cert, name=\"\", unit_code=\"2\"):\n\t\tself.serial_number = serial_number\n\t\tself.mac_address = mac_address\n\t\tself.fcd_cert = fcd_cert\n\t\tself.device_name = name\n\t\tself.unit_code = unit_code\n\t\n\tdef set_network(self, bss_id, ap_info):\n\t\tself.bss_id = bss_id\n\t\tself.ap_info = ap_info\n\t\n\tdef set_locale(self, region, language):\n\t\tself.region = region\n\t\tself.language = language\n\t\n\tdef set_user(self, pid, pid_hmac):\n\t\tself.pid = pid\n\t\tself.pid_hmac = pid_hmac\n\t\tself.password = None\n\t\t\n\tdef set_password(self, password):\n\t\tself.pid = None\n\t\tself.pid_hmac = None\n\t\tself.password = password\n\t\n\tdef set_fpd_version(self, version): self.fpd_version = version\n\tdef set_environment(self, environment): self.environment = environment\n\n\tasync def request(self, req):\n\t\t# Apply Nintendo's custom base64 encoding\n\t\treq.form = encode_form(req.form)\n\t\t\n\t\t# Must manually decode form here since server doesn't return correct content-type\n\t\tresponse = await http.request(self.url, req, self.context)\n\t\tresponse.form = decode_form(http.formdecode(response.text))\n\t\t\n\t\treturn_code = response.form[\"returncd\"].decode()\n\t\tif return_code == \"null\" or int(return_code) != 1:\n\t\t\traise NASCError(response.status_code, response.form)\n\t\t\n\t\treturn response\n\n\tasync def login(self, game_server_id, nickname=\"\"):\n\t\tif self.title_id is None:\n\t\t\traise ValueError(\"Please configure the title (set_title)\")\n\t\tif self.serial_number is None:\n\t\t\traise ValueError(\"Please configure the device (set_device)\")\n\t\tif self.pid is None and self.password is None:\n\t\t\traise ValueError(\"Please configure a user id or password (set_user / set_password)\")\n\t\t\n\t\treq = http.HTTPRequest.post(\"/ac\")\n\t\treq.headers[\"Host\"] = self.url\n\t\treq.headers[\"X-GameId\"] = \"%08X\" %game_server_id\n\t\treq.headers[\"User-Agent\"] = \"CTR FPD/%04X\" %self.fpd_version\n\t\t\n\t\t# The real 3DS seems to add this header twice for some reason\n\t\treq.headers.add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\t\treq.headers.add(\"Content-Type\", \"application/x-www-form-urlencoded\")\n\n\t\tnow = datetime.datetime.now()\n\t\tdevice_time = now.strftime(\"%y%m%d%H%M%S\")\n\n\t\treq.form = {}\n\t\treq.form[\"gameid\"] = \"%08X\" %game_server_id\n\t\treq.form[\"sdkver\"] = \"%03i%03i\" %(self.sdk_version_major, self.sdk_version_minor)\n\t\treq.form[\"titleid\"] = \"%016X\" %self.title_id\n\t\treq.form[\"gamecd\"] = self.product_code\n\t\treq.form[\"gamever\"] = \"%04X\" %self.title_version\n\t\treq.form[\"mediatype\"] = str(self.media_type)\n\t\tif self.media_type == MEDIA_TYPE_CARTRIDGE:\n\t\t\treq.form[\"romid\"] = self.rom_id\n\t\treq.form[\"makercd\"] = self.maker_code\n\t\treq.form[\"unitcd\"] = self.unit_code\n\t\treq.form[\"macadr\"] = self.mac_address\n\t\treq.form[\"bssid\"] = self.bss_id\n\t\treq.form[\"apinfo\"] = self.ap_info\n\t\treq.form[\"fcdcert\"] = self.fcd_cert\n\t\treq.form[\"devname\"] = self.device_name.encode(\"utf-16-le\")\n\t\treq.form[\"servertype\"] = self.environment\n\t\treq.form[\"fpdver\"] = \"%04X\" %self.fpd_version\n\t\treq.form[\"devtime\"] = device_time\n\t\treq.form[\"lang\"] = \"%02X\" %self.language\n\t\treq.form[\"region\"] = \"%02X\" %self.region\n\t\treq.form[\"csnum\"] = self.serial_number\n\t\tif self.pid_hmac is not None:\n\t\t\treq.form[\"uidhmac\"] = self.pid_hmac\n\t\t\treq.form[\"userid\"] = str(self.pid)\n\t\telse:\n\t\t\treq.form[\"passwd\"] = self.password\n\t\treq.form[\"action\"] = \"LOGIN\"\n\t\treq.form[\"ingamesn\"] = nickname\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn LoginResponse.parse(response.form)\n"
  },
  {
    "path": "nintendo/nex/__init__.py",
    "content": "\n\n"
  },
  {
    "path": "nintendo/nex/aauser.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass ApplicationInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.title_id = None\n\t\tself.title_version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['title_id', 'title_version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.title_id = stream.u64()\n\t\tself.title_version = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.title_id)\n\t\tstream.u16(self.title_version)\n\n\nclass AAUserProtocol:\n\tMETHOD_REGISTER_APPLICATION = 1\n\tMETHOD_UNREGISTER_APPLICATION = 2\n\tMETHOD_SET_APPLICATION_INFO = 3\n\tMETHOD_GET_APPLICATION_INFO = 4\n\t\n\tPROTOCOL_ID = 0x7B\n\n\nclass AAUserClient(AAUserProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register_application(self, title_id):\n\t\tlogger.info(\"AAUserClient.register_application()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(title_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_APPLICATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AAUserClient.register_application -> done\")\n\t\n\tasync def unregister_application(self, title_id):\n\t\tlogger.info(\"AAUserClient.unregister_application()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(title_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_APPLICATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AAUserClient.unregister_application -> done\")\n\t\n\tasync def set_application_info(self, application_info):\n\t\tlogger.info(\"AAUserClient.set_application_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(application_info, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SET_APPLICATION_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AAUserClient.set_application_info -> done\")\n\t\n\tasync def get_application_info(self):\n\t\tlogger.info(\"AAUserClient.get_application_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_APPLICATION_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.list(ApplicationInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AAUserClient.get_application_info -> done\")\n\t\treturn info\n\n\nclass AAUserServer(AAUserProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER_APPLICATION: self.handle_register_application,\n\t\t\tself.METHOD_UNREGISTER_APPLICATION: self.handle_unregister_application,\n\t\t\tself.METHOD_SET_APPLICATION_INFO: self.handle_set_application_info,\n\t\t\tself.METHOD_GET_APPLICATION_INFO: self.handle_get_application_info,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on AAUserServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register_application(self, client, input, output):\n\t\tlogger.info(\"AAUserServer.register_application()\")\n\t\t#--- request ---\n\t\ttitle_id = input.u64()\n\t\tawait self.register_application(client, title_id)\n\t\n\tasync def handle_unregister_application(self, client, input, output):\n\t\tlogger.info(\"AAUserServer.unregister_application()\")\n\t\t#--- request ---\n\t\ttitle_id = input.u64()\n\t\tawait self.unregister_application(client, title_id)\n\t\n\tasync def handle_set_application_info(self, client, input, output):\n\t\tlogger.info(\"AAUserServer.set_application_info()\")\n\t\t#--- request ---\n\t\tapplication_info = input.list(ApplicationInfo)\n\t\tawait self.set_application_info(client, application_info)\n\t\n\tasync def handle_get_application_info(self, client, input, output):\n\t\tlogger.info(\"AAUserServer.get_application_info()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_application_info(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def register_application(self, *args):\n\t\tlogger.warning(\"AAUserServer.register_application not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_application(self, *args):\n\t\tlogger.warning(\"AAUserServer.unregister_application not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def set_application_info(self, *args):\n\t\tlogger.warning(\"AAUserServer.set_application_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_application_info(self, *args):\n\t\tlogger.warning(\"AAUserServer.get_application_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/account.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass AccountData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.groups = None\n\t\tself.email = None\n\t\tself.creation_date = None\n\t\tself.effective_date = None\n\t\tself.not_effective_message = None\n\t\tself.expiry_date = None\n\t\tself.expired_message = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'groups', 'email', 'creation_date', 'effective_date', 'not_effective_message', 'expiry_date', 'expired_message']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.groups = stream.u32()\n\t\tself.email = stream.string()\n\t\tself.creation_date = stream.datetime()\n\t\tself.effective_date = stream.datetime()\n\t\tself.not_effective_message = stream.string()\n\t\tself.expiry_date = stream.datetime()\n\t\tself.expired_message = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.u32(self.groups)\n\t\tstream.string(self.email)\n\t\tstream.datetime(self.creation_date)\n\t\tstream.datetime(self.effective_date)\n\t\tstream.string(self.not_effective_message)\n\t\tstream.datetime(self.expiry_date)\n\t\tstream.string(self.expired_message)\n\n\nclass BasicAccountInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\n\nclass AccountProtocol:\n\tMETHOD_CREATE_ACCOUNT = 1\n\tMETHOD_DELETE_ACCOUNT = 2\n\tMETHOD_DISABLE_ACCOUNT = 3\n\tMETHOD_CHANGE_PASSWORD = 4\n\tMETHOD_TEST_CAPABILITY = 5\n\tMETHOD_GET_NAME = 6\n\tMETHOD_GET_ACCOUNT_DATA = 7\n\tMETHOD_GET_PRIVATE_DATA = 8\n\tMETHOD_GET_PUBLIC_DATA = 9\n\tMETHOD_GET_MULTIPLE_PUBLIC_DATA = 10\n\tMETHOD_UPDATE_ACCOUNT_NAME = 11\n\tMETHOD_UPDATE_ACCOUNT_EMAIL = 12\n\tMETHOD_UPDATE_CUSTOM_DATA = 13\n\tMETHOD_FIND_BY_NAME_REGEX = 14\n\tMETHOD_UPDATE_ACCOUNT_EXPIRY_DATE = 15\n\tMETHOD_UPDATE_ACCOUNT_EFFECTIVE_DATE = 16\n\tMETHOD_UPDATE_STATUS = 17\n\tMETHOD_GET_STATUS = 18\n\tMETHOD_GET_LAST_CONNECTION_STATS = 19\n\tMETHOD_RESET_PASSWORD = 20\n\tMETHOD_CREATE_ACCOUNT_WITH_CUSTOM_DATA = 21\n\tMETHOD_RETRIEVE_ACCOUNT = 22\n\tMETHOD_UPDATE_ACCOUNT = 23\n\tMETHOD_CHANGE_PASSWORD_BY_GUEST = 24\n\tMETHOD_FIND_BY_NAME_LIKE = 25\n\tMETHOD_CUSTOM_CREATE_ACCOUNT = 26\n\tMETHOD_NINTENDO_CREATE_ACCOUNT = 27\n\tMETHOD_LOOKUP_OR_CREATE_ACCOUNT = 28\n\tMETHOD_DISCONNECT_PRINCIPAL = 29\n\tMETHOD_DISCONNECT_ALL_PRINCIPALS = 30\n\t\n\tPROTOCOL_ID = 0x19\n\n\nclass AccountClient(AccountProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def create_account(self, name, key, groups, email):\n\t\tlogger.info(\"AccountClient.create_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tstream.string(key)\n\t\tstream.u32(groups)\n\t\tstream.string(email)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.result()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.create_account -> done\")\n\t\treturn result\n\t\n\tasync def delete_account(self, pid):\n\t\tlogger.info(\"AccountClient.delete_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.delete_account -> done\")\n\t\n\tasync def disable_account(self, pid, until, message):\n\t\tlogger.info(\"AccountClient.disable_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.datetime(until)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DISABLE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.result()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.disable_account -> done\")\n\t\treturn result\n\t\n\tasync def change_password(self, new_key):\n\t\tlogger.info(\"AccountClient.change_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(new_key)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.change_password -> done\")\n\t\treturn result\n\t\n\tasync def test_capability(self, capability):\n\t\tlogger.info(\"AccountClient.test_capability()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(capability)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_TEST_CAPABILITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.test_capability -> done\")\n\t\treturn result\n\t\n\tasync def get_name(self, pid):\n\t\tlogger.info(\"AccountClient.get_name()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NAME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tname = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_name -> done\")\n\t\treturn name\n\t\n\tasync def get_account_data(self):\n\t\tlogger.info(\"AccountClient.get_account_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ACCOUNT_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.data = stream.extract(AccountData)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_account_data -> done\")\n\t\treturn obj\n\t\n\tasync def get_private_data(self):\n\t\tlogger.info(\"AccountClient.get_private_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PRIVATE_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.data = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_private_data -> done\")\n\t\treturn obj\n\t\n\tasync def get_public_data(self, pid):\n\t\tlogger.info(\"AccountClient.get_public_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PUBLIC_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.data = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_public_data -> done\")\n\t\treturn obj\n\t\n\tasync def get_multiple_public_data(self, pids):\n\t\tlogger.info(\"AccountClient.get_multiple_public_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MULTIPLE_PUBLIC_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.data = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_multiple_public_data -> done\")\n\t\treturn obj\n\t\n\tasync def update_account_name(self, name):\n\t\tlogger.info(\"AccountClient.update_account_name()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_ACCOUNT_NAME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.result()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_account_name -> done\")\n\t\treturn result\n\t\n\tasync def update_account_email(self, email):\n\t\tlogger.info(\"AccountClient.update_account_email()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(email)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_ACCOUNT_EMAIL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.result()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_account_email -> done\")\n\t\treturn result\n\t\n\tasync def update_custom_data(self, public_data, private_data):\n\t\tlogger.info(\"AccountClient.update_custom_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(public_data)\n\t\tstream.anydata(private_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_CUSTOM_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.result()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_custom_data -> done\")\n\t\treturn result\n\t\n\tasync def find_by_name_regex(self, groups, regex, range):\n\t\tlogger.info(\"AccountClient.find_by_name_regex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(groups)\n\t\tstream.string(regex)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_NAME_REGEX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\taccounts = stream.list(BasicAccountInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.find_by_name_regex -> done\")\n\t\treturn accounts\n\t\n\tasync def update_account_expiry_date(self, pid, expiry, message):\n\t\tlogger.info(\"AccountClient.update_account_expiry_date()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.datetime(expiry)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_ACCOUNT_EXPIRY_DATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_account_expiry_date -> done\")\n\t\n\tasync def update_account_effective_date(self, pid, effective_from, message):\n\t\tlogger.info(\"AccountClient.update_account_effective_date()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.datetime(effective_from)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_ACCOUNT_EFFECTIVE_DATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_account_effective_date -> done\")\n\t\n\tasync def update_status(self, status):\n\t\tlogger.info(\"AccountClient.update_status()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(status)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_STATUS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_status -> done\")\n\t\n\tasync def get_status(self, pid):\n\t\tlogger.info(\"AccountClient.get_status()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATUS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstatus = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_status -> done\")\n\t\treturn status\n\t\n\tasync def get_last_connection_stats(self, pid):\n\t\tlogger.info(\"AccountClient.get_last_connection_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_LAST_CONNECTION_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.last_session_login = stream.datetime()\n\t\tobj.last_session_logout = stream.datetime()\n\t\tobj.current_session_login = stream.datetime()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.get_last_connection_stats -> done\")\n\t\treturn obj\n\t\n\tasync def reset_password(self):\n\t\tlogger.info(\"AccountClient.reset_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.reset_password -> done\")\n\t\treturn result\n\t\n\tasync def create_account_with_custom_data(self, name, key, groups, email, public_data, private_data):\n\t\tlogger.info(\"AccountClient.create_account_with_custom_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tstream.string(key)\n\t\tstream.u32(groups)\n\t\tstream.string(email)\n\t\tstream.anydata(public_data)\n\t\tstream.anydata(private_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_ACCOUNT_WITH_CUSTOM_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.create_account_with_custom_data -> done\")\n\t\n\tasync def retrieve_account(self):\n\t\tlogger.info(\"AccountClient.retrieve_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RETRIEVE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.account_data = stream.extract(AccountData)\n\t\tobj.public_data = stream.anydata()\n\t\tobj.private_data = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.retrieve_account -> done\")\n\t\treturn obj\n\t\n\tasync def update_account(self, key, email, public_data, private_data):\n\t\tlogger.info(\"AccountClient.update_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(key)\n\t\tstream.string(email)\n\t\tstream.anydata(public_data)\n\t\tstream.anydata(private_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.update_account -> done\")\n\t\n\tasync def change_password_by_guest(self, name, email, key):\n\t\tlogger.info(\"AccountClient.change_password_by_guest()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tstream.string(email)\n\t\tstream.string(key)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_PASSWORD_BY_GUEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.change_password_by_guest -> done\")\n\t\n\tasync def find_by_name_like(self, groups, like, range):\n\t\tlogger.info(\"AccountClient.find_by_name_like()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(groups)\n\t\tstream.string(like)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_NAME_LIKE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\taccounts = stream.list(BasicAccountInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.find_by_name_like -> done\")\n\t\treturn accounts\n\t\n\tasync def custom_create_account(self, name, key, groups, email, auth_data):\n\t\tlogger.info(\"AccountClient.custom_create_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tstream.string(key)\n\t\tstream.u32(groups)\n\t\tstream.string(email)\n\t\tstream.anydata(auth_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CUSTOM_CREATE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpid = stream.pid()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.custom_create_account -> done\")\n\t\treturn pid\n\t\n\tasync def nintendo_create_account(self, name, key, groups, email, auth_data):\n\t\tlogger.info(\"AccountClient.nintendo_create_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tstream.string(key)\n\t\tstream.u32(groups)\n\t\tstream.string(email)\n\t\tstream.anydata(auth_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_NINTENDO_CREATE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.pid = stream.pid()\n\t\tobj.pid_hmac = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.nintendo_create_account -> done\")\n\t\treturn obj\n\t\n\tasync def lookup_or_create_account(self, name, key, groups, email, auth_data):\n\t\tlogger.info(\"AccountClient.lookup_or_create_account()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tstream.string(key)\n\t\tstream.u32(groups)\n\t\tstream.string(email)\n\t\tstream.anydata(auth_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LOOKUP_OR_CREATE_ACCOUNT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpid = stream.pid()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.lookup_or_create_account -> done\")\n\t\treturn pid\n\t\n\tasync def disconnect_principal(self, pid):\n\t\tlogger.info(\"AccountClient.disconnect_principal()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DISCONNECT_PRINCIPAL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.disconnect_principal -> done\")\n\t\treturn result\n\t\n\tasync def disconnect_all_principals(self):\n\t\tlogger.info(\"AccountClient.disconnect_all_principals()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DISCONNECT_ALL_PRINCIPALS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AccountClient.disconnect_all_principals -> done\")\n\t\treturn result\n\n\nclass AccountServer(AccountProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_CREATE_ACCOUNT: self.handle_create_account,\n\t\t\tself.METHOD_DELETE_ACCOUNT: self.handle_delete_account,\n\t\t\tself.METHOD_DISABLE_ACCOUNT: self.handle_disable_account,\n\t\t\tself.METHOD_CHANGE_PASSWORD: self.handle_change_password,\n\t\t\tself.METHOD_TEST_CAPABILITY: self.handle_test_capability,\n\t\t\tself.METHOD_GET_NAME: self.handle_get_name,\n\t\t\tself.METHOD_GET_ACCOUNT_DATA: self.handle_get_account_data,\n\t\t\tself.METHOD_GET_PRIVATE_DATA: self.handle_get_private_data,\n\t\t\tself.METHOD_GET_PUBLIC_DATA: self.handle_get_public_data,\n\t\t\tself.METHOD_GET_MULTIPLE_PUBLIC_DATA: self.handle_get_multiple_public_data,\n\t\t\tself.METHOD_UPDATE_ACCOUNT_NAME: self.handle_update_account_name,\n\t\t\tself.METHOD_UPDATE_ACCOUNT_EMAIL: self.handle_update_account_email,\n\t\t\tself.METHOD_UPDATE_CUSTOM_DATA: self.handle_update_custom_data,\n\t\t\tself.METHOD_FIND_BY_NAME_REGEX: self.handle_find_by_name_regex,\n\t\t\tself.METHOD_UPDATE_ACCOUNT_EXPIRY_DATE: self.handle_update_account_expiry_date,\n\t\t\tself.METHOD_UPDATE_ACCOUNT_EFFECTIVE_DATE: self.handle_update_account_effective_date,\n\t\t\tself.METHOD_UPDATE_STATUS: self.handle_update_status,\n\t\t\tself.METHOD_GET_STATUS: self.handle_get_status,\n\t\t\tself.METHOD_GET_LAST_CONNECTION_STATS: self.handle_get_last_connection_stats,\n\t\t\tself.METHOD_RESET_PASSWORD: self.handle_reset_password,\n\t\t\tself.METHOD_CREATE_ACCOUNT_WITH_CUSTOM_DATA: self.handle_create_account_with_custom_data,\n\t\t\tself.METHOD_RETRIEVE_ACCOUNT: self.handle_retrieve_account,\n\t\t\tself.METHOD_UPDATE_ACCOUNT: self.handle_update_account,\n\t\t\tself.METHOD_CHANGE_PASSWORD_BY_GUEST: self.handle_change_password_by_guest,\n\t\t\tself.METHOD_FIND_BY_NAME_LIKE: self.handle_find_by_name_like,\n\t\t\tself.METHOD_CUSTOM_CREATE_ACCOUNT: self.handle_custom_create_account,\n\t\t\tself.METHOD_NINTENDO_CREATE_ACCOUNT: self.handle_nintendo_create_account,\n\t\t\tself.METHOD_LOOKUP_OR_CREATE_ACCOUNT: self.handle_lookup_or_create_account,\n\t\t\tself.METHOD_DISCONNECT_PRINCIPAL: self.handle_disconnect_principal,\n\t\t\tself.METHOD_DISCONNECT_ALL_PRINCIPALS: self.handle_disconnect_all_principals,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on AccountServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_create_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.create_account()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tkey = input.string()\n\t\tgroups = input.u32()\n\t\temail = input.string()\n\t\tresponse = await self.create_account(client, name, key, groups, email)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.Result):\n\t\t\traise RuntimeError(\"Expected common.Result, got %s\" %response.__class__.__name__)\n\t\toutput.result(response)\n\t\n\tasync def handle_delete_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.delete_account()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tawait self.delete_account(client, pid)\n\t\n\tasync def handle_disable_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.disable_account()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tuntil = input.datetime()\n\t\tmessage = input.string()\n\t\tresponse = await self.disable_account(client, pid, until, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.Result):\n\t\t\traise RuntimeError(\"Expected common.Result, got %s\" %response.__class__.__name__)\n\t\toutput.result(response)\n\t\n\tasync def handle_change_password(self, client, input, output):\n\t\tlogger.info(\"AccountServer.change_password()\")\n\t\t#--- request ---\n\t\tnew_key = input.string()\n\t\tresponse = await self.change_password(client, new_key)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_test_capability(self, client, input, output):\n\t\tlogger.info(\"AccountServer.test_capability()\")\n\t\t#--- request ---\n\t\tcapability = input.u32()\n\t\tresponse = await self.test_capability(client, capability)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_name(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_name()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.get_name(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_get_account_data(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_account_data()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_account_data(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.add(response.data)\n\t\n\tasync def handle_get_private_data(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_private_data()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_private_data(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.data)\n\t\n\tasync def handle_get_public_data(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_public_data()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.get_public_data(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.data)\n\t\n\tasync def handle_get_multiple_public_data(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_multiple_public_data()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_multiple_public_data(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.data, output.anydata)\n\t\n\tasync def handle_update_account_name(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_account_name()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tresponse = await self.update_account_name(client, name)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.Result):\n\t\t\traise RuntimeError(\"Expected common.Result, got %s\" %response.__class__.__name__)\n\t\toutput.result(response)\n\t\n\tasync def handle_update_account_email(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_account_email()\")\n\t\t#--- request ---\n\t\temail = input.string()\n\t\tresponse = await self.update_account_email(client, email)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.Result):\n\t\t\traise RuntimeError(\"Expected common.Result, got %s\" %response.__class__.__name__)\n\t\toutput.result(response)\n\t\n\tasync def handle_update_custom_data(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_custom_data()\")\n\t\t#--- request ---\n\t\tpublic_data = input.anydata()\n\t\tprivate_data = input.anydata()\n\t\tresponse = await self.update_custom_data(client, public_data, private_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.Result):\n\t\t\traise RuntimeError(\"Expected common.Result, got %s\" %response.__class__.__name__)\n\t\toutput.result(response)\n\t\n\tasync def handle_find_by_name_regex(self, client, input, output):\n\t\tlogger.info(\"AccountServer.find_by_name_regex()\")\n\t\t#--- request ---\n\t\tgroups = input.u32()\n\t\tregex = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_name_regex(client, groups, regex, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_account_expiry_date(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_account_expiry_date()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\texpiry = input.datetime()\n\t\tmessage = input.string()\n\t\tawait self.update_account_expiry_date(client, pid, expiry, message)\n\t\n\tasync def handle_update_account_effective_date(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_account_effective_date()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\teffective_from = input.datetime()\n\t\tmessage = input.string()\n\t\tawait self.update_account_effective_date(client, pid, effective_from, message)\n\t\n\tasync def handle_update_status(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_status()\")\n\t\t#--- request ---\n\t\tstatus = input.string()\n\t\tawait self.update_status(client, status)\n\t\n\tasync def handle_get_status(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_status()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.get_status(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_get_last_connection_stats(self, client, input, output):\n\t\tlogger.info(\"AccountServer.get_last_connection_stats()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.get_last_connection_stats(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['last_session_login', 'last_session_logout', 'current_session_login']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.datetime(response.last_session_login)\n\t\toutput.datetime(response.last_session_logout)\n\t\toutput.datetime(response.current_session_login)\n\t\n\tasync def handle_reset_password(self, client, input, output):\n\t\tlogger.info(\"AccountServer.reset_password()\")\n\t\t#--- request ---\n\t\tresponse = await self.reset_password(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_create_account_with_custom_data(self, client, input, output):\n\t\tlogger.info(\"AccountServer.create_account_with_custom_data()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tkey = input.string()\n\t\tgroups = input.u32()\n\t\temail = input.string()\n\t\tpublic_data = input.anydata()\n\t\tprivate_data = input.anydata()\n\t\tawait self.create_account_with_custom_data(client, name, key, groups, email, public_data, private_data)\n\t\n\tasync def handle_retrieve_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.retrieve_account()\")\n\t\t#--- request ---\n\t\tresponse = await self.retrieve_account(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['account_data', 'public_data', 'private_data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.account_data)\n\t\toutput.anydata(response.public_data)\n\t\toutput.anydata(response.private_data)\n\t\n\tasync def handle_update_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.update_account()\")\n\t\t#--- request ---\n\t\tkey = input.string()\n\t\temail = input.string()\n\t\tpublic_data = input.anydata()\n\t\tprivate_data = input.anydata()\n\t\tawait self.update_account(client, key, email, public_data, private_data)\n\t\n\tasync def handle_change_password_by_guest(self, client, input, output):\n\t\tlogger.info(\"AccountServer.change_password_by_guest()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\temail = input.string()\n\t\tkey = input.string()\n\t\tawait self.change_password_by_guest(client, name, email, key)\n\t\n\tasync def handle_find_by_name_like(self, client, input, output):\n\t\tlogger.info(\"AccountServer.find_by_name_like()\")\n\t\t#--- request ---\n\t\tgroups = input.u32()\n\t\tlike = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_name_like(client, groups, like, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_custom_create_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.custom_create_account()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tkey = input.string()\n\t\tgroups = input.u32()\n\t\temail = input.string()\n\t\tauth_data = input.anydata()\n\t\tresponse = await self.custom_create_account(client, name, key, groups, email, auth_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.pid(response)\n\t\n\tasync def handle_nintendo_create_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.nintendo_create_account()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tkey = input.string()\n\t\tgroups = input.u32()\n\t\temail = input.string()\n\t\tauth_data = input.anydata()\n\t\tresponse = await self.nintendo_create_account(client, name, key, groups, email, auth_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['pid', 'pid_hmac']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.pid(response.pid)\n\t\toutput.string(response.pid_hmac)\n\t\n\tasync def handle_lookup_or_create_account(self, client, input, output):\n\t\tlogger.info(\"AccountServer.lookup_or_create_account()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tkey = input.string()\n\t\tgroups = input.u32()\n\t\temail = input.string()\n\t\tauth_data = input.anydata()\n\t\tresponse = await self.lookup_or_create_account(client, name, key, groups, email, auth_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.pid(response)\n\t\n\tasync def handle_disconnect_principal(self, client, input, output):\n\t\tlogger.info(\"AccountServer.disconnect_principal()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.disconnect_principal(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_disconnect_all_principals(self, client, input, output):\n\t\tlogger.info(\"AccountServer.disconnect_all_principals()\")\n\t\t#--- request ---\n\t\tresponse = await self.disconnect_all_principals(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def create_account(self, *args):\n\t\tlogger.warning(\"AccountServer.create_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_account(self, *args):\n\t\tlogger.warning(\"AccountServer.delete_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def disable_account(self, *args):\n\t\tlogger.warning(\"AccountServer.disable_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_password(self, *args):\n\t\tlogger.warning(\"AccountServer.change_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def test_capability(self, *args):\n\t\tlogger.warning(\"AccountServer.test_capability not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_name(self, *args):\n\t\tlogger.warning(\"AccountServer.get_name not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_account_data(self, *args):\n\t\tlogger.warning(\"AccountServer.get_account_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_private_data(self, *args):\n\t\tlogger.warning(\"AccountServer.get_private_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_public_data(self, *args):\n\t\tlogger.warning(\"AccountServer.get_public_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_multiple_public_data(self, *args):\n\t\tlogger.warning(\"AccountServer.get_multiple_public_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_account_name(self, *args):\n\t\tlogger.warning(\"AccountServer.update_account_name not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_account_email(self, *args):\n\t\tlogger.warning(\"AccountServer.update_account_email not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_custom_data(self, *args):\n\t\tlogger.warning(\"AccountServer.update_custom_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_name_regex(self, *args):\n\t\tlogger.warning(\"AccountServer.find_by_name_regex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_account_expiry_date(self, *args):\n\t\tlogger.warning(\"AccountServer.update_account_expiry_date not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_account_effective_date(self, *args):\n\t\tlogger.warning(\"AccountServer.update_account_effective_date not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_status(self, *args):\n\t\tlogger.warning(\"AccountServer.update_status not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_status(self, *args):\n\t\tlogger.warning(\"AccountServer.get_status not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_last_connection_stats(self, *args):\n\t\tlogger.warning(\"AccountServer.get_last_connection_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_password(self, *args):\n\t\tlogger.warning(\"AccountServer.reset_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_account_with_custom_data(self, *args):\n\t\tlogger.warning(\"AccountServer.create_account_with_custom_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def retrieve_account(self, *args):\n\t\tlogger.warning(\"AccountServer.retrieve_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_account(self, *args):\n\t\tlogger.warning(\"AccountServer.update_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_password_by_guest(self, *args):\n\t\tlogger.warning(\"AccountServer.change_password_by_guest not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_name_like(self, *args):\n\t\tlogger.warning(\"AccountServer.find_by_name_like not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def custom_create_account(self, *args):\n\t\tlogger.warning(\"AccountServer.custom_create_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def nintendo_create_account(self, *args):\n\t\tlogger.warning(\"AccountServer.nintendo_create_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def lookup_or_create_account(self, *args):\n\t\tlogger.warning(\"AccountServer.lookup_or_create_account not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def disconnect_principal(self, *args):\n\t\tlogger.warning(\"AccountServer.disconnect_principal not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def disconnect_all_principals(self, *args):\n\t\tlogger.warning(\"AccountServer.disconnect_all_principals not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/authentication.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass AuthenticationInfo(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.token = None\n\t\tself.ngs_version = 3\n\t\tself.token_type = 1\n\t\tself.server_version = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['token']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.token = stream.string()\n\t\tself.ngs_version = stream.u32()\n\t\tself.token_type = stream.u8()\n\t\tself.server_version = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.token)\n\t\tstream.u32(self.ngs_version)\n\t\tstream.u8(self.token_type)\n\t\tstream.u32(self.server_version)\ncommon.DataHolder.register(AuthenticationInfo, \"AuthenticationInfo\")\n\n\nclass RVConnectionData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.main_station = common.StationURL.parse(\"prudp:/\")\n\t\tself.special_protocols = []\n\t\tself.special_station = common.StationURL.parse(\"prudp:/\")\n\t\tself.server_time = common.DateTime(0)\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tversion = 1\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tif version >= 1:\n\t\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.main_station = stream.stationurl()\n\t\tself.special_protocols = stream.list(stream.u8)\n\t\tself.special_station = stream.stationurl()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tif version >= 1:\n\t\t\t\tself.server_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.stationurl(self.main_station)\n\t\tstream.list(self.special_protocols, stream.u8)\n\t\tstream.stationurl(self.special_station)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tif version >= 1:\n\t\t\t\tstream.datetime(self.server_time)\n\n\nclass ValidateAndRequestTicketParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.platform = 3\n\t\tself.username = None\n\t\tself.data = None\n\t\tself.skip_version_check = False\n\t\tself.nex_version = None\n\t\tself.client_version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['username', 'data', 'nex_version', 'client_version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.platform = stream.u32()\n\t\tself.username = stream.string()\n\t\tself.data = stream.anydata()\n\t\tself.skip_version_check = stream.bool()\n\t\tself.nex_version = stream.u32()\n\t\tself.client_version = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.platform)\n\t\tstream.string(self.username)\n\t\tstream.anydata(self.data)\n\t\tstream.bool(self.skip_version_check)\n\t\tstream.u32(self.nex_version)\n\t\tstream.u32(self.client_version)\n\n\nclass ValidateAndRequestTicketResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.ticket = None\n\t\tself.server_url = None\n\t\tself.server_time = None\n\t\tself.server_name = None\n\t\tself.source_key = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'ticket', 'server_url', 'server_time', 'server_name', 'source_key']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.ticket = stream.buffer()\n\t\tself.server_url = stream.stationurl()\n\t\tself.server_time = stream.datetime()\n\t\tself.server_name = stream.string()\n\t\tself.source_key = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.buffer(self.ticket)\n\t\tstream.stationurl(self.server_url)\n\t\tstream.datetime(self.server_time)\n\t\tstream.string(self.server_name)\n\t\tstream.string(self.source_key)\n\n\nclass AuthenticationProtocol:\n\tMETHOD_LOGIN = 1\n\tMETHOD_LOGIN_EX = 2\n\tMETHOD_REQUEST_TICKET = 3\n\tMETHOD_GET_PID = 4\n\tMETHOD_GET_NAME = 5\n\tMETHOD_LOGIN_WITH_CONTEXT = 6\n\t\n\tPROTOCOL_ID = 0xA\n\n\nclass AuthenticationProtocolNX:\n\tMETHOD_VALIDATE_AND_REQUEST_TICKET = 1\n\tMETHOD_VALIDATE_AND_REQUEST_TICKET_WITH_CUSTOM_DATA = 2\n\tMETHOD_REQUEST_TICKET = 3\n\tMETHOD_GET_PID = 4\n\tMETHOD_GET_NAME = 5\n\tMETHOD_VALIDATE_AND_REQUEST_TICKET_WITH_PARAM = 6\n\t\n\tPROTOCOL_ID = 0xA\n\n\nclass AuthenticationClient(AuthenticationProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def login(self, username):\n\t\tlogger.info(\"AuthenticationClient.login()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(username)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LOGIN, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.pid = stream.pid()\n\t\tobj.ticket = stream.buffer()\n\t\tobj.connection_data = stream.extract(RVConnectionData)\n\t\tobj.server_name = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClient.login -> done\")\n\t\treturn obj\n\t\n\tasync def login_ex(self, username, extra_data):\n\t\tlogger.info(\"AuthenticationClient.login_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(username)\n\t\tstream.anydata(extra_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LOGIN_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.pid = stream.pid()\n\t\tobj.ticket = stream.buffer()\n\t\tobj.connection_data = stream.extract(RVConnectionData)\n\t\tobj.server_name = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClient.login_ex -> done\")\n\t\treturn obj\n\t\n\tasync def request_ticket(self, source, target):\n\t\tlogger.info(\"AuthenticationClient.request_ticket()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(source)\n\t\tstream.pid(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_TICKET, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.ticket = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClient.request_ticket -> done\")\n\t\treturn obj\n\t\n\tasync def get_pid(self, username):\n\t\tlogger.info(\"AuthenticationClient.get_pid()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(username)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpid = stream.pid()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClient.get_pid -> done\")\n\t\treturn pid\n\t\n\tasync def get_name(self, pid):\n\t\tlogger.info(\"AuthenticationClient.get_name()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NAME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tname = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClient.get_name -> done\")\n\t\treturn name\n\t\n\tasync def login_with_context(self, login_data):\n\t\tlogger.info(\"AuthenticationClient.login_with_context()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(login_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LOGIN_WITH_CONTEXT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.pid = stream.pid()\n\t\tobj.ticket = stream.buffer()\n\t\tobj.connection_data = stream.extract(RVConnectionData)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClient.login_with_context -> done\")\n\t\treturn obj\n\n\nclass AuthenticationClientNX(AuthenticationProtocolNX):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def validate_and_request_ticket(self, username):\n\t\tlogger.info(\"AuthenticationClientNX.validate_and_request_ticket()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(username)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_VALIDATE_AND_REQUEST_TICKET, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.pid = stream.pid()\n\t\tobj.ticket = stream.buffer()\n\t\tobj.connection_data = stream.extract(RVConnectionData)\n\t\tobj.server_name = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClientNX.validate_and_request_ticket -> done\")\n\t\treturn obj\n\t\n\tasync def validate_and_request_ticket_with_custom_data(self, username, extra_data):\n\t\tlogger.info(\"AuthenticationClientNX.validate_and_request_ticket_with_custom_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(username)\n\t\tstream.anydata(extra_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_VALIDATE_AND_REQUEST_TICKET_WITH_CUSTOM_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.pid = stream.pid()\n\t\tobj.ticket = stream.buffer()\n\t\tobj.connection_data = stream.extract(RVConnectionData)\n\t\tobj.server_name = stream.string()\n\t\tobj.source_key = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClientNX.validate_and_request_ticket_with_custom_data -> done\")\n\t\treturn obj\n\t\n\tasync def request_ticket(self, source, target):\n\t\tlogger.info(\"AuthenticationClientNX.request_ticket()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(source)\n\t\tstream.pid(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_TICKET, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.ticket = stream.buffer()\n\t\tobj.key = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClientNX.request_ticket -> done\")\n\t\treturn obj\n\t\n\tasync def get_pid(self, username):\n\t\tlogger.info(\"AuthenticationClientNX.get_pid()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(username)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpid = stream.pid()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClientNX.get_pid -> done\")\n\t\treturn pid\n\t\n\tasync def get_name(self, pid):\n\t\tlogger.info(\"AuthenticationClientNX.get_name()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NAME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tname = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClientNX.get_name -> done\")\n\t\treturn name\n\t\n\tasync def validate_and_request_ticket_with_param(self, param):\n\t\tlogger.info(\"AuthenticationClientNX.validate_and_request_ticket_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_VALIDATE_AND_REQUEST_TICKET_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(ValidateAndRequestTicketResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"AuthenticationClientNX.validate_and_request_ticket_with_param -> done\")\n\t\treturn result\n\n\nclass AuthenticationServer(AuthenticationProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_LOGIN: self.handle_login,\n\t\t\tself.METHOD_LOGIN_EX: self.handle_login_ex,\n\t\t\tself.METHOD_REQUEST_TICKET: self.handle_request_ticket,\n\t\t\tself.METHOD_GET_PID: self.handle_get_pid,\n\t\t\tself.METHOD_GET_NAME: self.handle_get_name,\n\t\t\tself.METHOD_LOGIN_WITH_CONTEXT: self.handle_login_with_context,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on AuthenticationServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_login(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServer.login()\")\n\t\t#--- request ---\n\t\tusername = input.string()\n\t\tresponse = await self.login(client, username)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'pid', 'ticket', 'connection_data', 'server_name']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.pid(response.pid)\n\t\toutput.buffer(response.ticket)\n\t\toutput.add(response.connection_data)\n\t\toutput.string(response.server_name)\n\t\n\tasync def handle_login_ex(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServer.login_ex()\")\n\t\t#--- request ---\n\t\tusername = input.string()\n\t\textra_data = input.anydata()\n\t\tresponse = await self.login_ex(client, username, extra_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'pid', 'ticket', 'connection_data', 'server_name']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.pid(response.pid)\n\t\toutput.buffer(response.ticket)\n\t\toutput.add(response.connection_data)\n\t\toutput.string(response.server_name)\n\t\n\tasync def handle_request_ticket(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServer.request_ticket()\")\n\t\t#--- request ---\n\t\tsource = input.pid()\n\t\ttarget = input.pid()\n\t\tresponse = await self.request_ticket(client, source, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'ticket']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.buffer(response.ticket)\n\t\n\tasync def handle_get_pid(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServer.get_pid()\")\n\t\t#--- request ---\n\t\tusername = input.string()\n\t\tresponse = await self.get_pid(client, username)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.pid(response)\n\t\n\tasync def handle_get_name(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServer.get_name()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.get_name(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_login_with_context(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServer.login_with_context()\")\n\t\t#--- request ---\n\t\tlogin_data = input.anydata()\n\t\tresponse = await self.login_with_context(client, login_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'pid', 'ticket', 'connection_data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.pid(response.pid)\n\t\toutput.buffer(response.ticket)\n\t\toutput.add(response.connection_data)\n\t\n\tasync def login(self, *args):\n\t\tlogger.warning(\"AuthenticationServer.login not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def login_ex(self, *args):\n\t\tlogger.warning(\"AuthenticationServer.login_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_ticket(self, *args):\n\t\tlogger.warning(\"AuthenticationServer.request_ticket not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pid(self, *args):\n\t\tlogger.warning(\"AuthenticationServer.get_pid not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_name(self, *args):\n\t\tlogger.warning(\"AuthenticationServer.get_name not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def login_with_context(self, *args):\n\t\tlogger.warning(\"AuthenticationServer.login_with_context not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass AuthenticationServerNX(AuthenticationProtocolNX):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_VALIDATE_AND_REQUEST_TICKET: self.handle_validate_and_request_ticket,\n\t\t\tself.METHOD_VALIDATE_AND_REQUEST_TICKET_WITH_CUSTOM_DATA: self.handle_validate_and_request_ticket_with_custom_data,\n\t\t\tself.METHOD_REQUEST_TICKET: self.handle_request_ticket,\n\t\t\tself.METHOD_GET_PID: self.handle_get_pid,\n\t\t\tself.METHOD_GET_NAME: self.handle_get_name,\n\t\t\tself.METHOD_VALIDATE_AND_REQUEST_TICKET_WITH_PARAM: self.handle_validate_and_request_ticket_with_param,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on AuthenticationServerNX: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_validate_and_request_ticket(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServerNX.validate_and_request_ticket()\")\n\t\t#--- request ---\n\t\tusername = input.string()\n\t\tresponse = await self.validate_and_request_ticket(client, username)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'pid', 'ticket', 'connection_data', 'server_name']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.pid(response.pid)\n\t\toutput.buffer(response.ticket)\n\t\toutput.add(response.connection_data)\n\t\toutput.string(response.server_name)\n\t\n\tasync def handle_validate_and_request_ticket_with_custom_data(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServerNX.validate_and_request_ticket_with_custom_data()\")\n\t\t#--- request ---\n\t\tusername = input.string()\n\t\textra_data = input.anydata()\n\t\tresponse = await self.validate_and_request_ticket_with_custom_data(client, username, extra_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'pid', 'ticket', 'connection_data', 'server_name', 'source_key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.pid(response.pid)\n\t\toutput.buffer(response.ticket)\n\t\toutput.add(response.connection_data)\n\t\toutput.string(response.server_name)\n\t\toutput.string(response.source_key)\n\t\n\tasync def handle_request_ticket(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServerNX.request_ticket()\")\n\t\t#--- request ---\n\t\tsource = input.pid()\n\t\ttarget = input.pid()\n\t\tresponse = await self.request_ticket(client, source, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'ticket', 'key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.buffer(response.ticket)\n\t\toutput.string(response.key)\n\t\n\tasync def handle_get_pid(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServerNX.get_pid()\")\n\t\t#--- request ---\n\t\tusername = input.string()\n\t\tresponse = await self.get_pid(client, username)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.pid(response)\n\t\n\tasync def handle_get_name(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServerNX.get_name()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.get_name(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_validate_and_request_ticket_with_param(self, client, input, output):\n\t\tlogger.info(\"AuthenticationServerNX.validate_and_request_ticket_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(ValidateAndRequestTicketParam)\n\t\tresponse = await self.validate_and_request_ticket_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, ValidateAndRequestTicketResult):\n\t\t\traise RuntimeError(\"Expected ValidateAndRequestTicketResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def validate_and_request_ticket(self, *args):\n\t\tlogger.warning(\"AuthenticationServerNX.validate_and_request_ticket not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def validate_and_request_ticket_with_custom_data(self, *args):\n\t\tlogger.warning(\"AuthenticationServerNX.validate_and_request_ticket_with_custom_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_ticket(self, *args):\n\t\tlogger.warning(\"AuthenticationServerNX.request_ticket not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pid(self, *args):\n\t\tlogger.warning(\"AuthenticationServerNX.get_pid not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_name(self, *args):\n\t\tlogger.warning(\"AuthenticationServerNX.get_name not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def validate_and_request_ticket_with_param(self, *args):\n\t\tlogger.warning(\"AuthenticationServerNX.validate_and_request_ticket_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/backend.py",
    "content": "\nfrom nintendo.nex import rmc, authentication, kerberos, common\nfrom anynet import tls\nimport contextlib\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass LoginResult:\n\tdef __init__(self, pid, ticket, source_key, secure_station):\n\t\tself.pid = pid\n\t\tself.ticket = ticket\n\t\tself.source_key = source_key\n\t\tself.secure_station = secure_station\n\n\nclass BackEndClient:\n\tdef __init__(self, settings, client, host, port):\n\t\tself.settings = settings\n\t\tself.auth_client = client\n\t\tself.auth_host = host\n\t\tself.auth_port = port\n\t\t\n\t\tif self.settings[\"nex.version\"] < 40000:\n\t\t\tself.auth_proto = authentication.AuthenticationClient(client)\n\t\telse:\n\t\t\tself.auth_proto = authentication.AuthenticationClientNX(client)\n\t\t\n\t\tif self.settings[\"kerberos.key_derivation\"] == 0:\n\t\t\tself.key_derivation = kerberos.KeyDerivationOld(65000, 1024)\n\t\telse:\n\t\t\tself.key_derivation = kerberos.KeyDerivationNew(1, 1)\n\t\n\t@contextlib.asynccontextmanager\n\tasync def login(self, username, password=None, auth_info=None, servers=[]):\n\t\tif self.settings[\"nex.version\"] < 40000:\n\t\t\tresult = await self.login_old(username, auth_info)\n\t\telif self.settings[\"nex.version\"] < 40400:\n\t\t\tresult = await self.login_switch(username, auth_info)\n\t\telse:\n\t\t\tresult = await self.login_with_param(username, auth_info)\n\t\t\n\t\tsecure_station = result.secure_station\n\t\t\n\t\tkerberos_key = result.source_key\n\t\tif not kerberos_key:\n\t\t\tif password is None:\n\t\t\t\traise ValueError(\"A password is required for this account\")\n\t\t\t\n\t\t\t# Derive kerberos key from password\n\t\t\tkerberos_key = self.key_derivation.derive_key(\n\t\t\t\tpassword.encode(), result.pid\n\t\t\t)\n\t\t\n\t\t# Decrypt ticket from login response\n\t\tticket = kerberos.ClientTicket.decrypt(result.ticket, kerberos_key, self.settings)\n\t\tif ticket.target != secure_station[\"PID\"]:\n\t\t\t# Request ticket for secure server\n\t\t\tresponse = await self.auth_proto.request_ticket(\n\t\t\t\tresult.pid, secure_station[\"PID\"]\n\t\t\t)\n\t\t\t\n\t\t\t# Check for errors and decrypt ticket\n\t\t\tresponse.result.raise_if_error()\n\t\t\tticket = kerberos.ClientTicket.decrypt(response.ticket, kerberos_key, self.settings)\n\t\t\n\t\tcreds = kerberos.Credentials(ticket, result.pid, secure_station[\"CID\"])\n\t\t\n\t\t# The secure server may reside at the same\n\t\t# address as the authentication server\n\t\thost = secure_station[\"address\"]\n\t\tport = secure_station[\"port\"]\n\t\tif host == \"0.0.0.1\":\n\t\t\thost, port = self.auth_host, self.auth_port\n\n\t\t# Connect to secure server\n\t\tstream_id = secure_station[\"sid\"]\n\t\t\n\t\tcontext = tls.TLSContext()\n\t\tasync with rmc.connect(self.settings, host, port, stream_id, context, creds, servers) as client:\n\t\t\tyield client\n\t\n\tasync def login_old(self, username, auth_info):\n\t\tif auth_info:\n\t\t\tresponse = await self.auth_proto.login_ex(username, auth_info)\n\t\telse:\n\t\t\tresponse = await self.auth_proto.login(username)\n\t\tresponse.result.raise_if_error()\n\t\treturn LoginResult(\n\t\t\tresponse.pid, response.ticket, None,\n\t\t\tresponse.connection_data.main_station\n\t\t)\n\t\n\tasync def login_switch(self, username, auth_info):\n\t\tif auth_info:\n\t\t\tresponse = await self.auth_proto.validate_and_request_ticket_with_custom_data(\n\t\t\t\tusername, auth_info\n\t\t\t)\n\t\t\tresponse.result.raise_if_error()\n\t\t\treturn LoginResult(\n\t\t\t\tresponse.pid, response.ticket, bytes.fromhex(response.source_key),\n\t\t\t\tresponse.connection_data.main_station\n\t\t\t)\n\t\telse:\n\t\t\tresponse = await self.auth_proto.validate_and_request_ticket(username)\n\t\t\tresponse.result.raise_if_error()\n\t\t\treturn LoginResult(\n\t\t\t\tresponse.pid, response.ticket, None,\n\t\t\t\tresponse.connection_data.main_station\n\t\t\t)\n\t\t\n\tasync def login_with_param(self, username, auth_info):\n\t\tparam = authentication.ValidateAndRequestTicketParam()\n\t\tparam.username = username\n\t\tif auth_info:\n\t\t\tparam.data = auth_info\n\t\telse:\n\t\t\tparam.data = common.NullData()\n\t\tparam.nex_version = self.settings[\"nex.version\"]\n\t\tparam.client_version = self.settings[\"nex.client_version\"]\n\t\t\n\t\tresponse = await self.auth_proto.validate_and_request_ticket_with_param(param)\n\t\treturn LoginResult(\n\t\t\tresponse.pid, response.ticket,\n\t\t\tbytes.fromhex(response.source_key),\n\t\t\tresponse.server_url\n\t\t)\n\t\n\tdef login_guest(self):\n\t\treturn self.login(\"guest\", \"MMQea3n!fsik\")\n\n\n@contextlib.asynccontextmanager\nasync def connect(settings, host, port):\n\tcontext = tls.TLSContext()\n\tasync with rmc.connect(settings, host, port, context=context) as client:\n\t\tyield BackEndClient(settings, client, host, port)\n"
  },
  {
    "path": "nintendo/nex/common.py",
    "content": "\nfrom nintendo.nex.errors import error_names, error_codes\nfrom nintendo.nex import streams\nimport datetime, time\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nERROR_MASK = 1 << 31\n\nclass RMCError(Exception):\n\tdef __init__(self, code=\"Core::Unknown\"):\n\t\tself.res = Result.error(code)\n\t\n\tdef __str__(self):\n\t\treturn str(self.res)\n\t\n\tdef result(self):\n\t\treturn self.res\n\t\t\n\tdef name(self):\n\t\treturn self.res.name()\n\t\n\tdef code(self):\n\t\treturn self.res.code()\n\n\t\nclass Result:\n\tdef __init__(self, code=0x10001):\n\t\tself.error_code = code\n\t\n\tdef __str__(self):\n\t\treturn \"%s (0x%08X)\" %(self.name(), self.code())\n\t\t\n\t@staticmethod\n\tdef success(code=\"Core::Unknown\"):\n\t\tif type(code) == str:\n\t\t\tcode = error_codes[code]\n\t\treturn Result(code & ~ERROR_MASK)\n\t\t\n\t@staticmethod\n\tdef error(code=\"Core::Unknown\"):\n\t\tif type(code) == str:\n\t\t\tcode = error_codes[code]\n\t\treturn Result(code | ERROR_MASK)\n\t\n\tdef is_success(self):\n\t\treturn not self.error_code & ERROR_MASK\n\t\t\n\tdef is_error(self):\n\t\treturn bool(self.error_code & ERROR_MASK)\n\t\n\tdef code(self):\n\t\treturn self.error_code\n\t\t\n\tdef name(self):\n\t\tif self.is_success():\n\t\t\treturn \"success\"\n\t\treturn error_names.get(self.error_code & ~ERROR_MASK, \"unknown error\")\n\t\t\n\tdef raise_if_error(self):\n\t\tif self.is_error():\n\t\t\traise RMCError(self.error_code)\n\n\n# Black magic going on here\nclass Structure:\n\tdef max_version(self, settings): return 0\n\t\t\t\n\tdef get_hierarchy(self):\n\t\thierarchy = []\n\t\tcls = self.__class__\n\t\twhile cls != Structure:\n\t\t\thierarchy.append(cls)\n\t\t\tcls = cls.__bases__[0]\n\t\treturn hierarchy[::-1]\n\t\n\tdef encode(self, stream):\n\t\thierarchy = self.get_hierarchy()\n\t\tfor cls in hierarchy:\n\t\t\tif stream.settings[\"nex.struct_header\"]:\n\t\t\t\tversion = cls.max_version(self, stream.settings)\n\t\t\t\t\n\t\t\t\tsubstream = streams.StreamOut(stream.settings)\n\t\t\t\tcls.save(self, substream, version)\n\t\t\t\t\n\t\t\t\tstream.u8(version)\n\t\t\t\tstream.buffer(substream.get())\n\t\t\telse:\n\t\t\t\tcls.save(self, stream, 0)\n\n\tdef decode(self, stream):\n\t\thierarchy = self.get_hierarchy()\n\t\tfor cls in hierarchy:\n\t\t\tif stream.settings[\"nex.struct_header\"]:\n\t\t\t\tmax_version = cls.max_version(self, stream.settings)\n\t\t\t\t\n\t\t\t\tversion = stream.u8()\n\t\t\t\tif version > max_version:\n\t\t\t\t\tlogger.warning(\n\t\t\t\t\t\t\"Struct %s version is higher than expected (%i > %i)\",\n\t\t\t\t\t\tcls.__name__, version, max_version\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\tsubstream = stream.substream()\n\t\t\t\tcls.load(self, substream, version)\n\t\t\t\t\n\t\t\t\tif not substream.eof():\n\t\t\t\t\tlogger.warning(\n\t\t\t\t\t\t\"Struct %s has unexpected size (got %i bytes, but only %i were read)\",\n\t\t\t\t\t\tcls.__name__, substream.size(), substream.tell()\n\t\t\t\t\t)\n\t\t\telse:\n\t\t\t\tcls.load(self, stream, 0)\n\t\t\t\t\n\tdef load(self, stream, version): raise NotImplementedError(\"%s.load()\" %self.__class__.__name__)\n\tdef save(self, stream, version): raise NotImplementedError(\"%s.save()\" %self.__class__.__name__)\n\t\n\t\nclass Data(Structure):\n\tdef save(self, stream, version): pass\n\tdef load(self, stream, version): pass\n\n\nclass DataHolder:\n\n\tobject_map = {}\n\n\tdef __init__(self):\n\t\tself.data = None\n\t\t\n\tdef encode(self, stream):\t\n\t\tstream.string(self.data.__class__.__name__)\n\t\t\n\t\tsubstream = streams.StreamOut(stream.settings)\n\t\tsubstream.add(self.data)\n\t\t\n\t\tstream.u32(len(substream.get()) + 4)\n\t\tstream.buffer(substream.get())\n\t\t\n\tdef decode(self, stream):\n\t\tname = stream.string()\n\t\tsubstream = stream.substream().substream()\n\t\tself.data = substream.extract(self.object_map[name])\n\t\t\n\t@classmethod\n\tdef register(cls, object, name):\n\t\tcls.object_map[name] = object\n\t\t\n\t\t\nclass NullData(Data):\n\tdef save(self, stream, version): pass\n\tdef load(self, stream, version): pass\nDataHolder.register(NullData, \"NullData\")\n\t\t\n\t\t\nclass StationURL:\n\n\tstr_params = [\"address\", \"Uri\", \"Rsa\", \"Ra\", \"Ntrpa\"]\n\tint_params = [\n\t\t\"port\", \"stream\", \"sid\", \"PID\", \"CID\", \"type\", \"RVCID\",\n\t\t\"natm\", \"natf\", \"upnp\", \"pmp\", \"probeinit\", \"PRID\",\n\t\t\"fastproberesponse\", \"NodeID\", \"R\", \"Rsp\", \"Rp\",\n\t\t\"Tpt\", \"Pl\", \"Ntrpp\"\n\t]\n\n\tdef __init__(self, scheme=\"prudp\", **kwargs):\n\t\tself.urlscheme = scheme\n\t\tself.params = kwargs\n\n\tdef __repr__(self):\n\t\tparams = \";\".join(\n\t\t\t[\"%s=%s\" %(key, value) for key, value in self.params.items()]\n\t\t)\n\t\tif self.urlscheme:\n\t\t\treturn \"%s:/%s\" %(self.urlscheme, params)\n\t\treturn params\n\t\t\n\tdef __getitem__(self, field):\n\t\tif field in self.str_params:\n\t\t\treturn str(self.params.get(field, \"\"))\n\t\tif field in self.int_params:\n\t\t\treturn int(self.params.get(field, 0))\n\t\traise KeyError(field)\n\t\t\n\tdef __setitem__(self, field, value):\n\t\tself.params[field] = value\n\t\n\tdef scheme(self):\n\t\treturn self.urlscheme\n\t\t\n\tdef address(self):\n\t\treturn self[\"address\"], self[\"port\"]\n\t\t\n\tdef is_public(self): return bool(self[\"type\"] & 2)\n\tdef is_behind_nat(self): return bool(self[\"type\"] & 1)\n\tdef is_global(self): return self.is_public() and not self.is_behind_nat()\n\t\t\n\tdef copy(self):\n\t\treturn StationURL(self.urlscheme, **self.params)\n\t\t\n\t@classmethod\n\tdef parse(cls, string):\n\t\tif string:\n\t\t\tscheme, fields = string.split(\":/\")\n\t\t\tparams = {}\n\t\t\tif fields:\n\t\t\t\tparams = dict(field.split(\"=\") for field in fields.split(\";\"))\n\t\t\treturn cls(scheme, **params)\n\t\telse:\n\t\t\treturn cls()\n\n\t\t\nclass DateTime:\n\tdef __init__(self, value):\n\t\tself.val = value\n\t\t\n\tdef second(self): return self.val & 63\n\tdef minute(self): return (self.val >> 6) & 63\n\tdef hour(self): return (self.val >> 12) & 31\n\tdef day(self): return (self.val >> 17) & 31\n\tdef month(self): return (self.val >> 22) & 15\n\tdef year(self): return self.val >> 26\n\t\n\tdef value(self): return self.val\n\n\tdef standard_datetime(self):\n\t\treturn datetime.datetime(\n\t\t\tself.year(), self.month(), self.day(),\n\t\t\tself.hour(), self.minute(), self.second(),\n\t\t\ttzinfo=datetime.UTC\n\t\t)\n\t\n\tdef timestamp(self):\n\t\treturn int(self.standard_datetime().timestamp())\n\t\n\tdef __repr__(self):\n\t\treturn \"%i-%i-%i %i:%02i:%02i\" %(self.day(), self.month(), self.year(), self.hour(), self.minute(), self.second())\n\n\t@classmethod\n\tdef never(cls):\n\t\treturn cls(0)\n\t\n\t@classmethod\n\tdef future(cls):\n\t\treturn cls.make(9999, 12, 31, 23, 59, 59)\n\t\t\n\t@classmethod\n\tdef make(cls, year, month=1, day=1, hour=0, minute=0, second=0):\n\t\treturn cls(second | (minute << 6) | (hour << 12) | (day << 17) | (month << 22) | (year << 26))\n\t\t\n\t@classmethod\n\tdef fromtimestamp(cls, timestamp):\n\t\tdt = datetime.datetime.fromtimestamp(timestamp, datetime.UTC)\n\t\treturn cls.make(dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second)\n\t\n\t@classmethod\n\tdef now(cls):\n\t\treturn cls.fromtimestamp(time.time())\n\t\t\n\t\t\nclass ResultRange(Structure):\n\tdef __init__(self, offset=0, size=10):\n\t\tself.offset = offset\n\t\tself.size = size\n\n\tdef load(self, stream, version):\n\t\tself.offset = stream.u32()\n\t\tself.size = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tstream.u32(self.offset)\n\t\tstream.u32(self.size)\n"
  },
  {
    "path": "nintendo/nex/datastore.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass DataStoreChangeMetaCompareParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.comparison_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['comparison_flag', 'name', 'period', 'meta_binary', 'tags', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.comparison_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.comparison_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\n\nclass DataStoreChangeMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\tself.compare_param = DataStoreChangeMetaCompareParam()\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.compare_param = stream.extract(DataStoreChangeMetaCompareParam)\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\t\tstream.add(self.compare_param)\n\t\tstream.add(self.persistence_target)\n\n\nclass DataStoreChangeMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreCompletePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompletePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompleteUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.version = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'version', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.version = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.version)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreDeleteParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreGetMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.result_option = 0\n\t\tself.access_password = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.result_option = stream.u8()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u8(self.result_option)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreGetNewArrivedNotificationsParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.last_notification_id = None\n\t\tself.limit = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['last_notification_id', 'limit']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.last_notification_id = stream.u64()\n\t\tself.limit = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.last_notification_id)\n\t\tstream.u16(self.limit)\n\n\nclass DataStoreGetNotificationUrlParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.previous_url = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['previous_url']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.previous_url = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.previous_url)\n\n\nclass DataStoreGetSpecificMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u64)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u64)\n\n\nclass DataStoreGetSpecificMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u32)\n\n\nclass DataStoreKeyValue(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.string()\n\t\tself.value = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.key)\n\t\tstream.string(self.value)\n\n\nclass DataStoreMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.create_time = None\n\t\tself.update_time = None\n\t\tself.period = None\n\t\tself.status = None\n\t\tself.referred_count = None\n\t\tself.refer_data_id = None\n\t\tself.flag = None\n\t\tself.referred_time = None\n\t\tself.expire_time = None\n\t\tself.tags = None\n\t\tself.ratings = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'name', 'data_type', 'meta_binary', 'create_time', 'update_time', 'period', 'status', 'referred_count', 'refer_data_id', 'flag', 'referred_time', 'expire_time', 'tags', 'ratings']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.create_time = stream.datetime()\n\t\tself.update_time = stream.datetime()\n\t\tself.period = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.referred_count = stream.u32()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.flag = stream.u32()\n\t\tself.referred_time = stream.datetime()\n\t\tself.expire_time = stream.datetime()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.ratings = stream.list(DataStoreRatingInfoWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.datetime(self.create_time)\n\t\tstream.datetime(self.update_time)\n\t\tstream.u16(self.period)\n\t\tstream.u8(self.status)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.u32(self.flag)\n\t\tstream.datetime(self.referred_time)\n\t\tstream.datetime(self.expire_time)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.ratings, stream.add)\n\n\nclass DataStoreNotification(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStoreNotificationV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u32(self.data_id)\n\n\nclass DataStorePasswordInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.access_password = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'access_password', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.access_password = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.access_password)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStorePermission(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.permission = 3\n\t\tself.recipients = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.permission = stream.u8()\n\t\tself.recipients = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.permission)\n\t\tstream.list(self.recipients, stream.pid)\n\n\nclass DataStorePersistenceInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.slot_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'slot_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.slot_id = stream.u16()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.slot_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStorePersistenceInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.persistence_id = 65535\n\t\tself.delete_last_object = True\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.persistence_id = stream.u16()\n\t\tself.delete_last_object = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u16(self.persistence_id)\n\t\tstream.bool(self.delete_last_object)\n\n\nclass DataStorePersistenceTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = 0\n\t\tself.persistence_id = 65535\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.persistence_id = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.persistence_id)\n\n\nclass DataStorePrepareGetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.lock_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.access_password = 0\n\t\tself.extra_data = []\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.access_password = stream.u64()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u64(self.access_password)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePrepareGetParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.lock_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.u32(self.lock_id)\n\n\nclass DataStorePreparePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.rating_init_param = []\n\t\tself.persistence_init_param = DataStorePersistenceInitParam()\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'data_type', 'meta_binary', 'flag', 'period']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['extra_data']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\tself.persistence_init_param = stream.extract(DataStorePersistenceInitParam)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\t\tstream.add(self.persistence_init_param)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePreparePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = 0\n\t\tself.meta_binary = b\"\"\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = None\n\t\tself.rating_init_param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'flag', 'period', 'tags', 'rating_init_param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\n\nclass DataStorePrepareUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.size = None\n\t\tself.update_password = None\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'size', 'update_password', 'extra_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.size = stream.u32()\n\t\tself.update_password = stream.u64()\n\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.size)\n\t\tstream.u64(self.update_password)\n\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStoreRateObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rating_value = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rating_value', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rating_value = stream.s32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s32(self.rating_value)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreRatingInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_value = None\n\t\tself.count = None\n\t\tself.initial_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_value', 'count', 'initial_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_value = stream.s64()\n\t\tself.count = stream.u32()\n\t\tself.initial_value = stream.s64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s64(self.total_value)\n\t\tstream.u32(self.count)\n\t\tstream.s64(self.initial_value)\n\n\nclass DataStoreRatingInfoWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.info = DataStoreRatingInfo()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.u8()\n\t\tself.info = stream.extract(DataStoreRatingInfo)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.slot)\n\t\tstream.add(self.info)\n\n\nclass DataStoreRatingInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flag = None\n\t\tself.internal_flag = None\n\t\tself.lock_type = None\n\t\tself.initial_value = None\n\t\tself.range_min = None\n\t\tself.range_max = None\n\t\tself.period_hour = None\n\t\tself.period_duration = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flag', 'internal_flag', 'lock_type', 'initial_value', 'range_min', 'range_max', 'period_hour', 'period_duration']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flag = stream.u8()\n\t\tself.internal_flag = stream.u8()\n\t\tself.lock_type = stream.u8()\n\t\tself.initial_value = stream.s64()\n\t\tself.range_min = stream.s32()\n\t\tself.range_max = stream.s32()\n\t\tself.period_hour = stream.s8()\n\t\tself.period_duration = stream.s16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flag)\n\t\tstream.u8(self.internal_flag)\n\t\tstream.u8(self.lock_type)\n\t\tstream.s64(self.initial_value)\n\t\tstream.s32(self.range_min)\n\t\tstream.s32(self.range_max)\n\t\tstream.s8(self.period_hour)\n\t\tstream.s16(self.period_duration)\n\n\nclass DataStoreRatingInitParamWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.param = DataStoreRatingInitParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.s8()\n\t\tself.param = stream.extract(DataStoreRatingInitParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s8(self.slot)\n\t\tstream.add(self.param)\n\n\nclass DataStoreRatingLog(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.is_rated = None\n\t\tself.pid = None\n\t\tself.rating_value = None\n\t\tself.lock_expiration_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['is_rated', 'pid', 'rating_value', 'lock_expiration_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.is_rated = stream.bool()\n\t\tself.pid = stream.pid()\n\t\tself.rating_value = stream.s32()\n\t\tself.lock_expiration_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.bool(self.is_rated)\n\t\tstream.pid(self.pid)\n\t\tstream.s32(self.rating_value)\n\t\tstream.datetime(self.lock_expiration_time)\n\n\nclass DataStoreRatingTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.slot = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.slot = stream.s8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.s8(self.slot)\n\n\nclass DataStoreReqGetAdditionalMeta(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\tself.meta_binary = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'data_type', 'version', 'meta_binary']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\t\tstream.qbuffer(self.meta_binary)\n\n\nclass DataStoreReqGetInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['data_id']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u64(self.data_id)\n\n\nclass DataStoreReqGetInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqGetNotificationUrlInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.key = None\n\t\tself.query = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'key', 'query', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.key = stream.string()\n\t\tself.query = stream.string()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.string(self.key)\n\t\tstream.string(self.query)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqUpdateInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.version = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['version', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.version = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.search_target = 1\n\t\tself.owner_ids = []\n\t\tself.owner_type = 0\n\t\tself.destination_ids = []\n\t\tself.data_type = 65535\n\t\tself.created_after = common.DateTime(671076024059)\n\t\tself.created_before = common.DateTime(671076024059)\n\t\tself.updated_after = common.DateTime(671076024059)\n\t\tself.updated_before = common.DateTime(671076024059)\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.result_order_column = 0\n\t\tself.result_order = 0\n\t\tself.result_range = common.ResultRange()\n\t\tself.result_option = 0\n\t\tself.minimal_rating_frequency = 0\n\t\tself.use_cache = False\n\t\tself.total_count_enabled = True\n\t\tself.data_types = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.search_target = stream.u8()\n\t\tself.owner_ids = stream.list(stream.pid)\n\t\tself.owner_type = stream.u8()\n\t\tself.destination_ids = stream.list(stream.u64)\n\t\tself.data_type = stream.u16()\n\t\tself.created_after = stream.datetime()\n\t\tself.created_before = stream.datetime()\n\t\tself.updated_after = stream.datetime()\n\t\tself.updated_before = stream.datetime()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.result_order_column = stream.u8()\n\t\tself.result_order = stream.u8()\n\t\tself.result_range = stream.extract(common.ResultRange)\n\t\tself.result_option = stream.u8()\n\t\tself.minimal_rating_frequency = stream.u32()\n\t\tself.use_cache = stream.bool()\n\t\tself.total_count_enabled = stream.bool()\n\t\tself.data_types = stream.list(stream.u16)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.search_target)\n\t\tstream.list(self.owner_ids, stream.pid)\n\t\tstream.u8(self.owner_type)\n\t\tstream.list(self.destination_ids, stream.u64)\n\t\tstream.u16(self.data_type)\n\t\tstream.datetime(self.created_after)\n\t\tstream.datetime(self.created_before)\n\t\tstream.datetime(self.updated_after)\n\t\tstream.datetime(self.updated_before)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u8(self.result_order_column)\n\t\tstream.u8(self.result_order)\n\t\tstream.add(self.result_range)\n\t\tstream.u8(self.result_option)\n\t\tstream.u32(self.minimal_rating_frequency)\n\t\tstream.bool(self.use_cache)\n\t\tstream.bool(self.total_count_enabled)\n\t\tstream.list(self.data_types, stream.u16)\n\n\nclass DataStoreSearchResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_count = None\n\t\tself.result = None\n\t\tself.total_count_type = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_count', 'result', 'total_count_type']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_count = stream.u32()\n\t\tself.result = stream.list(DataStoreMetaInfo)\n\t\tself.total_count_type = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.total_count)\n\t\tstream.list(self.result, stream.add)\n\t\tstream.u8(self.total_count_type)\n\n\nclass DataStoreSpecificMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u32(self.version)\n\n\nclass DataStoreSpecificMetaInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\n\nclass DataStoreTouchObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'lock_id', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreProtocol:\n\tMETHOD_PREPARE_GET_OBJECT_V1 = 1\n\tMETHOD_PREPARE_POST_OBJECT_V1 = 2\n\tMETHOD_COMPLETE_POST_OBJECT_V1 = 3\n\tMETHOD_DELETE_OBJECT = 4\n\tMETHOD_DELETE_OBJECTS = 5\n\tMETHOD_CHANGE_META_V1 = 6\n\tMETHOD_CHANGE_METAS_V1 = 7\n\tMETHOD_GET_META = 8\n\tMETHOD_GET_METAS = 9\n\tMETHOD_PREPARE_UPDATE_OBJECT = 10\n\tMETHOD_COMPLETE_UPDATE_OBJECT = 11\n\tMETHOD_SEARCH_OBJECT = 12\n\tMETHOD_GET_NOTIFICATION_URL = 13\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1 = 14\n\tMETHOD_RATE_OBJECT = 15\n\tMETHOD_GET_RATING = 16\n\tMETHOD_GET_RATINGS = 17\n\tMETHOD_RESET_RATING = 18\n\tMETHOD_RESET_RATINGS = 19\n\tMETHOD_GET_SPECIFIC_META_V1 = 20\n\tMETHOD_POST_META_BINARY = 21\n\tMETHOD_TOUCH_OBJECT = 22\n\tMETHOD_GET_RATING_WITH_LOG = 23\n\tMETHOD_PREPARE_POST_OBJECT = 24\n\tMETHOD_PREPARE_GET_OBJECT = 25\n\tMETHOD_COMPLETE_POST_OBJECT = 26\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS = 27\n\tMETHOD_GET_SPECIFIC_META = 28\n\tMETHOD_GET_PERSISTENCE_INFO = 29\n\tMETHOD_GET_PERSISTENCE_INFOS = 30\n\tMETHOD_PERPETUATE_OBJECT = 31\n\tMETHOD_UNPERPETUATE_OBJECT = 32\n\tMETHOD_PREPARE_GET_OBJECT_OR_META_BINARY = 33\n\tMETHOD_GET_PASSWORD_INFO = 34\n\tMETHOD_GET_PASSWORD_INFOS = 35\n\tMETHOD_GET_METAS_MULTIPLE_PARAM = 36\n\tMETHOD_COMPLETE_POST_OBJECTS = 37\n\tMETHOD_CHANGE_META = 38\n\tMETHOD_CHANGE_METAS = 39\n\tMETHOD_RATE_OBJECTS = 40\n\tMETHOD_POST_META_BINARY_WITH_DATA_ID = 41\n\tMETHOD_POST_META_BINARIES_WITH_DATA_ID = 42\n\tMETHOD_RATE_OBJECT_WITH_POSTING = 43\n\tMETHOD_RATE_OBJECTS_WITH_POSTING = 44\n\tMETHOD_GET_OBJECT_INFOS = 45\n\tMETHOD_SEARCH_OBJECT_LIGHT = 46\n\t\n\tPROTOCOL_ID = 0x73\n\n\nclass DataStoreClient(DataStoreProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def prepare_get_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClient.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.prepare_get_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def prepare_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClient.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.prepare_post_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClient.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.complete_post_object_v1 -> done\")\n\t\n\tasync def delete_object(self, param):\n\t\tlogger.info(\"DataStoreClient.delete_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.delete_object -> done\")\n\t\n\tasync def delete_objects(self, param, transactional):\n\t\tlogger.info(\"DataStoreClient.delete_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.delete_objects -> done\")\n\t\treturn results\n\t\n\tasync def change_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClient.change_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.change_meta_v1 -> done\")\n\t\n\tasync def change_metas_v1(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClient.change_metas_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.change_metas_v1 -> done\")\n\t\treturn results\n\t\n\tasync def get_meta(self, param):\n\t\tlogger.info(\"DataStoreClient.get_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_meta -> done\")\n\t\treturn info\n\t\n\tasync def get_metas(self, data_ids, param):\n\t\tlogger.info(\"DataStoreClient.get_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.info = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_metas -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_update_object(self, param):\n\t\tlogger.info(\"DataStoreClient.prepare_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqUpdateInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.prepare_update_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_update_object(self, param):\n\t\tlogger.info(\"DataStoreClient.complete_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.complete_update_object -> done\")\n\t\n\tasync def search_object(self, param):\n\t\tlogger.info(\"DataStoreClient.search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.search_object -> done\")\n\t\treturn result\n\t\n\tasync def get_notification_url(self, param):\n\t\tlogger.info(\"DataStoreClient.get_notification_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOTIFICATION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetNotificationUrlInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_notification_url -> done\")\n\t\treturn info\n\t\n\tasync def get_new_arrived_notifications_v1(self, param):\n\t\tlogger.info(\"DataStoreClient.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotificationV1)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_new_arrived_notifications_v1 -> done\")\n\t\treturn obj\n\t\n\tasync def rate_object(self, target, param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClient.rate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.rate_object -> done\")\n\t\treturn info\n\t\n\tasync def get_rating(self, target, access_password):\n\t\tlogger.info(\"DataStoreClient.get_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trating = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_rating -> done\")\n\t\treturn rating\n\t\n\tasync def get_ratings(self, data_ids, access_password):\n\t\tlogger.info(\"DataStoreClient.get_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(lambda: stream.list(DataStoreRatingInfoWithSlot))\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_ratings -> done\")\n\t\treturn obj\n\t\n\tasync def reset_rating(self, target, update_password):\n\t\tlogger.info(\"DataStoreClient.reset_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(update_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.reset_rating -> done\")\n\t\n\tasync def reset_ratings(self, data_ids, transactional):\n\t\tlogger.info(\"DataStoreClient.reset_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.reset_ratings -> done\")\n\t\treturn results\n\t\n\tasync def get_specific_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClient.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_specific_meta_v1 -> done\")\n\t\treturn infos\n\t\n\tasync def post_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClient.post_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.post_meta_binary -> done\")\n\t\treturn data_id\n\t\n\tasync def touch_object(self, param):\n\t\tlogger.info(\"DataStoreClient.touch_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_TOUCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.touch_object -> done\")\n\t\n\tasync def get_rating_with_log(self, target, access_password):\n\t\tlogger.info(\"DataStoreClient.get_rating_with_log()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING_WITH_LOG, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.rating = stream.extract(DataStoreRatingInfo)\n\t\tobj.log = stream.extract(DataStoreRatingLog)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_rating_with_log -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_post_object(self, param):\n\t\tlogger.info(\"DataStoreClient.prepare_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.prepare_post_object -> done\")\n\t\treturn info\n\t\n\tasync def prepare_get_object(self, param):\n\t\tlogger.info(\"DataStoreClient.prepare_get_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.prepare_get_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object(self, param):\n\t\tlogger.info(\"DataStoreClient.complete_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.complete_post_object -> done\")\n\t\n\tasync def get_new_arrived_notifications(self, param):\n\t\tlogger.info(\"DataStoreClient.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotification)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_new_arrived_notifications -> done\")\n\t\treturn obj\n\t\n\tasync def get_specific_meta(self, param):\n\t\tlogger.info(\"DataStoreClient.get_specific_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_specific_meta -> done\")\n\t\treturn infos\n\t\n\tasync def get_persistence_info(self, owner_id, slot_id):\n\t\tlogger.info(\"DataStoreClient.get_persistence_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.u16(slot_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePersistenceInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_persistence_info -> done\")\n\t\treturn info\n\t\n\tasync def get_persistence_infos(self, owner_id, slot_ids):\n\t\tlogger.info(\"DataStoreClient.get_persistence_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.list(slot_ids, stream.u16)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePersistenceInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_persistence_infos -> done\")\n\t\treturn obj\n\t\n\tasync def perpetuate_object(self, persistence_slot_id, data_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClient.perpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.u64(data_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.perpetuate_object -> done\")\n\t\n\tasync def unperpetuate_object(self, persistence_slot_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClient.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNPERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.unperpetuate_object -> done\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClient.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.get_info = stream.extract(DataStoreReqGetInfo)\n\t\tobj.additional_meta = stream.extract(DataStoreReqGetAdditionalMeta)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.prepare_get_object_or_meta_binary -> done\")\n\t\treturn obj\n\t\n\tasync def get_password_info(self, data_id):\n\t\tlogger.info(\"DataStoreClient.get_password_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePasswordInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_password_info -> done\")\n\t\treturn info\n\t\n\tasync def get_password_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClient.get_password_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePasswordInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_password_infos -> done\")\n\t\treturn obj\n\t\n\tasync def get_metas_multiple_param(self, params):\n\t\tlogger.info(\"DataStoreClient.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(params, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS_MULTIPLE_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_metas_multiple_param -> done\")\n\t\treturn obj\n\t\n\tasync def complete_post_objects(self, data_ids):\n\t\tlogger.info(\"DataStoreClient.complete_post_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.complete_post_objects -> done\")\n\t\n\tasync def change_meta(self, param):\n\t\tlogger.info(\"DataStoreClient.change_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.change_meta -> done\")\n\t\n\tasync def change_metas(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClient.change_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.change_metas -> done\")\n\t\treturn results\n\t\n\tasync def rate_objects(self, targets, param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClient.rate_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.rate_objects -> done\")\n\t\treturn obj\n\t\n\tasync def post_meta_binary_with_data_id(self, data_id, param):\n\t\tlogger.info(\"DataStoreClient.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.post_meta_binary_with_data_id -> done\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClient.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARIES_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.post_meta_binaries_with_data_id -> done\")\n\t\treturn results\n\t\n\tasync def rate_object_with_posting(self, target, rate_param, post_param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClient.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(rate_param)\n\t\tstream.add(post_param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.rate_object_with_posting -> done\")\n\t\treturn info\n\t\n\tasync def rate_objects_with_posting(self, targets, rate_param, post_param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClient.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(rate_param, stream.add)\n\t\tstream.list(post_param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.rate_objects_with_posting -> done\")\n\t\treturn obj\n\t\n\tasync def get_object_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClient.get_object_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OBJECT_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreReqGetInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.get_object_infos -> done\")\n\t\treturn obj\n\t\n\tasync def search_object_light(self, param):\n\t\tlogger.info(\"DataStoreClient.search_object_light()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT_LIGHT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClient.search_object_light -> done\")\n\t\treturn result\n\n\nclass DataStoreServer(DataStoreProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_V1: self.handle_prepare_get_object_v1,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT_V1: self.handle_prepare_post_object_v1,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT_V1: self.handle_complete_post_object_v1,\n\t\t\tself.METHOD_DELETE_OBJECT: self.handle_delete_object,\n\t\t\tself.METHOD_DELETE_OBJECTS: self.handle_delete_objects,\n\t\t\tself.METHOD_CHANGE_META_V1: self.handle_change_meta_v1,\n\t\t\tself.METHOD_CHANGE_METAS_V1: self.handle_change_metas_v1,\n\t\t\tself.METHOD_GET_META: self.handle_get_meta,\n\t\t\tself.METHOD_GET_METAS: self.handle_get_metas,\n\t\t\tself.METHOD_PREPARE_UPDATE_OBJECT: self.handle_prepare_update_object,\n\t\t\tself.METHOD_COMPLETE_UPDATE_OBJECT: self.handle_complete_update_object,\n\t\t\tself.METHOD_SEARCH_OBJECT: self.handle_search_object,\n\t\t\tself.METHOD_GET_NOTIFICATION_URL: self.handle_get_notification_url,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1: self.handle_get_new_arrived_notifications_v1,\n\t\t\tself.METHOD_RATE_OBJECT: self.handle_rate_object,\n\t\t\tself.METHOD_GET_RATING: self.handle_get_rating,\n\t\t\tself.METHOD_GET_RATINGS: self.handle_get_ratings,\n\t\t\tself.METHOD_RESET_RATING: self.handle_reset_rating,\n\t\t\tself.METHOD_RESET_RATINGS: self.handle_reset_ratings,\n\t\t\tself.METHOD_GET_SPECIFIC_META_V1: self.handle_get_specific_meta_v1,\n\t\t\tself.METHOD_POST_META_BINARY: self.handle_post_meta_binary,\n\t\t\tself.METHOD_TOUCH_OBJECT: self.handle_touch_object,\n\t\t\tself.METHOD_GET_RATING_WITH_LOG: self.handle_get_rating_with_log,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT: self.handle_prepare_post_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT: self.handle_prepare_get_object,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT: self.handle_complete_post_object,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS: self.handle_get_new_arrived_notifications,\n\t\t\tself.METHOD_GET_SPECIFIC_META: self.handle_get_specific_meta,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFO: self.handle_get_persistence_info,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFOS: self.handle_get_persistence_infos,\n\t\t\tself.METHOD_PERPETUATE_OBJECT: self.handle_perpetuate_object,\n\t\t\tself.METHOD_UNPERPETUATE_OBJECT: self.handle_unperpetuate_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY: self.handle_prepare_get_object_or_meta_binary,\n\t\t\tself.METHOD_GET_PASSWORD_INFO: self.handle_get_password_info,\n\t\t\tself.METHOD_GET_PASSWORD_INFOS: self.handle_get_password_infos,\n\t\t\tself.METHOD_GET_METAS_MULTIPLE_PARAM: self.handle_get_metas_multiple_param,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECTS: self.handle_complete_post_objects,\n\t\t\tself.METHOD_CHANGE_META: self.handle_change_meta,\n\t\t\tself.METHOD_CHANGE_METAS: self.handle_change_metas,\n\t\t\tself.METHOD_RATE_OBJECTS: self.handle_rate_objects,\n\t\t\tself.METHOD_POST_META_BINARY_WITH_DATA_ID: self.handle_post_meta_binary_with_data_id,\n\t\t\tself.METHOD_POST_META_BINARIES_WITH_DATA_ID: self.handle_post_meta_binaries_with_data_id,\n\t\t\tself.METHOD_RATE_OBJECT_WITH_POSTING: self.handle_rate_object_with_posting,\n\t\t\tself.METHOD_RATE_OBJECTS_WITH_POSTING: self.handle_rate_objects_with_posting,\n\t\t\tself.METHOD_GET_OBJECT_INFOS: self.handle_get_object_infos,\n\t\t\tself.METHOD_SEARCH_OBJECT_LIGHT: self.handle_search_object_light,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on DataStoreServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_prepare_get_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParamV1)\n\t\tresponse = await self.prepare_get_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParamV1)\n\t\tresponse = await self.prepare_post_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParamV1)\n\t\tawait self.complete_post_object_v1(client, param)\n\t\n\tasync def handle_delete_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.delete_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreDeleteParam)\n\t\tawait self.delete_object(client, param)\n\t\n\tasync def handle_delete_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.delete_objects()\")\n\t\t#--- request ---\n\t\tparam = input.list(DataStoreDeleteParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.delete_objects(client, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_change_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.change_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParamV1)\n\t\tawait self.change_meta_v1(client, param)\n\t\n\tasync def handle_change_metas_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.change_metas_v1()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParamV1)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas_v1(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreMetaInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreMetaInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas(client, data_ids, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['info', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.info, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_prepare_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.prepare_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareUpdateParam)\n\t\tresponse = await self.prepare_update_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqUpdateInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqUpdateInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.complete_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompleteUpdateParam)\n\t\tawait self.complete_update_object(client, param)\n\t\n\tasync def handle_search_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.search_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_notification_url(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_notification_url()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNotificationUrlParam)\n\t\tresponse = await self.get_notification_url(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetNotificationUrlInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetNotificationUrlInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_new_arrived_notifications_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_rate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.rate_object()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tparam = input.extract(DataStoreRateObjectParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object(client, target, param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_ratings(client, data_ids, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, lambda x: output.list(x, output.add))\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_reset_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.reset_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tupdate_password = input.u64()\n\t\tawait self.reset_rating(client, target, update_password)\n\t\n\tasync def handle_reset_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.reset_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.reset_ratings(client, data_ids, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_specific_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParamV1)\n\t\tresponse = await self.get_specific_meta_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_post_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.post_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.post_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_touch_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.touch_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreTouchObjectParam)\n\t\tawait self.touch_object(client, param)\n\t\n\tasync def handle_get_rating_with_log(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_rating_with_log()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating_with_log(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['rating', 'log']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.rating)\n\t\toutput.add(response.log)\n\t\n\tasync def handle_prepare_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.prepare_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.prepare_post_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_get_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.prepare_get_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.complete_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParam)\n\t\tawait self.complete_post_object(client, param)\n\t\n\tasync def handle_get_new_arrived_notifications(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_get_specific_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_specific_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParam)\n\t\tresponse = await self.get_specific_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_persistence_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_persistence_info()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_id = input.u16()\n\t\tresponse = await self.get_persistence_info(client, owner_id, slot_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePersistenceInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePersistenceInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_persistence_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_persistence_infos()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_ids = input.list(input.u16)\n\t\tresponse = await self.get_persistence_infos(client, owner_id, slot_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_perpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.perpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdata_id = input.u64()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.perpetuate_object(client, persistence_slot_id, data_id, delete_last_object)\n\t\n\tasync def handle_unperpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.unperpetuate_object(client, persistence_slot_id, delete_last_object)\n\t\n\tasync def handle_prepare_get_object_or_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object_or_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['get_info', 'additional_meta']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.get_info)\n\t\toutput.add(response.additional_meta)\n\t\n\tasync def handle_get_password_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_password_info()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tresponse = await self.get_password_info(client, data_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePasswordInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePasswordInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_password_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_password_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_password_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_metas_multiple_param(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tparams = input.list(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas_multiple_param(client, params)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_complete_post_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.complete_post_objects()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tawait self.complete_post_objects(client, data_ids)\n\t\n\tasync def handle_change_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.change_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParam)\n\t\tawait self.change_meta(client, param)\n\t\n\tasync def handle_change_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.change_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.rate_objects()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\tparam = input.list(DataStoreRateObjectParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects(client, targets, param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_post_meta_binary_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tawait self.post_meta_binary_with_data_id(client, data_id, param)\n\t\n\tasync def handle_post_meta_binaries_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.post_meta_binaries_with_data_id(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_object_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\trate_param = input.extract(DataStoreRateObjectParam)\n\t\tpost_param = input.extract(DataStorePreparePostParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object_with_posting(client, target, rate_param, post_param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_rate_objects_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\trate_param = input.list(DataStoreRateObjectParam)\n\t\tpost_param = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects_with_posting(client, targets, rate_param, post_param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_object_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.get_object_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_object_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_object_light(self, client, input, output):\n\t\tlogger.info(\"DataStoreServer.search_object_light()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object_light(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def prepare_get_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.prepare_get_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.prepare_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.complete_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.delete_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServer.delete_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.change_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.change_metas_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.prepare_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.complete_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_notification_url(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_notification_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_new_arrived_notifications_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.rate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServer.reset_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServer.reset_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_specific_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServer.post_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def touch_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.touch_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating_with_log(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_rating_with_log not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.prepare_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.prepare_get_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.complete_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_new_arrived_notifications not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_specific_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_info(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_persistence_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_persistence_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def perpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.perpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unperpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServer.unperpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServer.prepare_get_object_or_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_info(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_password_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_password_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas_multiple_param(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_metas_multiple_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServer.complete_post_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServer.change_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServer.change_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServer.rate_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServer.post_meta_binary_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServer.post_meta_binaries_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServer.rate_object_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServer.rate_objects_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_object_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServer.get_object_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object_light(self, *args):\n\t\tlogger.warning(\"DataStoreServer.search_object_light not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/datastore_miitopia_3ds.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass Gender:\n\tMALE = 0\n\tFEMALE = 1\n\tANY = 2\n\n\nclass Category:\n\tSINGING = 0\n\tSPORT = 1\n\tACTING = 2\n\tCOMEDY = 3\n\tMUSIC = 4\n\tMARTIAL_ARTS = 5\n\tDANCING = 6\n\tADVENTURING = 7\n\tFILM_DIRECTING = 8\n\tCOOKING = 9\n\tCHATTING = 10\n\tPUBLIC_SPEAKING = 11\n\tCRAFTWORK = 12\n\tDRAWING = 13\n\tSTUDYING = 14\n\tWRITING = 15\n\tFASHION = 16\n\tDINING = 17\n\tNOT_TELLING = 18\n\tANY = 255\n\n\nclass DataStoreChangeMetaCompareParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.comparison_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['comparison_flag', 'name', 'period', 'meta_binary', 'tags', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.comparison_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.comparison_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\n\nclass DataStoreChangeMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\tself.compare_param = DataStoreChangeMetaCompareParam()\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.compare_param = stream.extract(DataStoreChangeMetaCompareParam)\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\t\tstream.add(self.compare_param)\n\t\tstream.add(self.persistence_target)\n\n\nclass DataStoreChangeMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreCompletePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompletePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompleteUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.version = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'version', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.version = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.version)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreDeleteParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreGetMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.result_option = 0\n\t\tself.access_password = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.result_option = stream.u8()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u8(self.result_option)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreGetNewArrivedNotificationsParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.last_notification_id = None\n\t\tself.limit = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['last_notification_id', 'limit']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.last_notification_id = stream.u64()\n\t\tself.limit = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.last_notification_id)\n\t\tstream.u16(self.limit)\n\n\nclass DataStoreGetNotificationUrlParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.previous_url = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['previous_url']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.previous_url = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.previous_url)\n\n\nclass DataStoreGetSpecificMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u64)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u64)\n\n\nclass DataStoreGetSpecificMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u32)\n\n\nclass DataStoreKeyValue(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.string()\n\t\tself.value = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.key)\n\t\tstream.string(self.value)\n\n\nclass DataStoreMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.create_time = None\n\t\tself.update_time = None\n\t\tself.period = None\n\t\tself.status = None\n\t\tself.referred_count = None\n\t\tself.refer_data_id = None\n\t\tself.flag = None\n\t\tself.referred_time = None\n\t\tself.expire_time = None\n\t\tself.tags = None\n\t\tself.ratings = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'name', 'data_type', 'meta_binary', 'create_time', 'update_time', 'period', 'status', 'referred_count', 'refer_data_id', 'flag', 'referred_time', 'expire_time', 'tags', 'ratings']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.create_time = stream.datetime()\n\t\tself.update_time = stream.datetime()\n\t\tself.period = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.referred_count = stream.u32()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.flag = stream.u32()\n\t\tself.referred_time = stream.datetime()\n\t\tself.expire_time = stream.datetime()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.ratings = stream.list(DataStoreRatingInfoWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.datetime(self.create_time)\n\t\tstream.datetime(self.update_time)\n\t\tstream.u16(self.period)\n\t\tstream.u8(self.status)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.u32(self.flag)\n\t\tstream.datetime(self.referred_time)\n\t\tstream.datetime(self.expire_time)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.ratings, stream.add)\n\n\nclass DataStoreNotification(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStoreNotificationV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u32(self.data_id)\n\n\nclass DataStorePasswordInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.access_password = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'access_password', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.access_password = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.access_password)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStorePermission(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.permission = 3\n\t\tself.recipients = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.permission = stream.u8()\n\t\tself.recipients = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.permission)\n\t\tstream.list(self.recipients, stream.pid)\n\n\nclass DataStorePersistenceInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.slot_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'slot_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.slot_id = stream.u16()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.slot_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStorePersistenceInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.persistence_id = 65535\n\t\tself.delete_last_object = True\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.persistence_id = stream.u16()\n\t\tself.delete_last_object = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u16(self.persistence_id)\n\t\tstream.bool(self.delete_last_object)\n\n\nclass DataStorePersistenceTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = 0\n\t\tself.persistence_id = 65535\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.persistence_id = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.persistence_id)\n\n\nclass DataStorePrepareGetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.lock_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.access_password = 0\n\t\tself.extra_data = []\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.access_password = stream.u64()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u64(self.access_password)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePrepareGetParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.lock_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.u32(self.lock_id)\n\n\nclass DataStorePreparePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.rating_init_param = []\n\t\tself.persistence_init_param = DataStorePersistenceInitParam()\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'data_type', 'meta_binary', 'flag', 'period']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['extra_data']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\tself.persistence_init_param = stream.extract(DataStorePersistenceInitParam)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\t\tstream.add(self.persistence_init_param)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePreparePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = 0\n\t\tself.meta_binary = b\"\"\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = None\n\t\tself.rating_init_param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'flag', 'period', 'tags', 'rating_init_param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\n\nclass DataStorePrepareUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.size = None\n\t\tself.update_password = None\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'size', 'update_password', 'extra_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.size = stream.u32()\n\t\tself.update_password = stream.u64()\n\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.size)\n\t\tstream.u64(self.update_password)\n\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStoreRateObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rating_value = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rating_value', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rating_value = stream.s32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s32(self.rating_value)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreRatingInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_value = None\n\t\tself.count = None\n\t\tself.initial_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_value', 'count', 'initial_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_value = stream.s64()\n\t\tself.count = stream.u32()\n\t\tself.initial_value = stream.s64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s64(self.total_value)\n\t\tstream.u32(self.count)\n\t\tstream.s64(self.initial_value)\n\n\nclass DataStoreRatingInfoWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.info = DataStoreRatingInfo()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.u8()\n\t\tself.info = stream.extract(DataStoreRatingInfo)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.slot)\n\t\tstream.add(self.info)\n\n\nclass DataStoreRatingInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flag = None\n\t\tself.internal_flag = None\n\t\tself.lock_type = None\n\t\tself.initial_value = None\n\t\tself.range_min = None\n\t\tself.range_max = None\n\t\tself.period_hour = None\n\t\tself.period_duration = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flag', 'internal_flag', 'lock_type', 'initial_value', 'range_min', 'range_max', 'period_hour', 'period_duration']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flag = stream.u8()\n\t\tself.internal_flag = stream.u8()\n\t\tself.lock_type = stream.u8()\n\t\tself.initial_value = stream.s64()\n\t\tself.range_min = stream.s32()\n\t\tself.range_max = stream.s32()\n\t\tself.period_hour = stream.s8()\n\t\tself.period_duration = stream.s16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flag)\n\t\tstream.u8(self.internal_flag)\n\t\tstream.u8(self.lock_type)\n\t\tstream.s64(self.initial_value)\n\t\tstream.s32(self.range_min)\n\t\tstream.s32(self.range_max)\n\t\tstream.s8(self.period_hour)\n\t\tstream.s16(self.period_duration)\n\n\nclass DataStoreRatingInitParamWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.param = DataStoreRatingInitParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.s8()\n\t\tself.param = stream.extract(DataStoreRatingInitParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s8(self.slot)\n\t\tstream.add(self.param)\n\n\nclass DataStoreRatingLog(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.is_rated = None\n\t\tself.pid = None\n\t\tself.rating_value = None\n\t\tself.lock_expiration_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['is_rated', 'pid', 'rating_value', 'lock_expiration_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.is_rated = stream.bool()\n\t\tself.pid = stream.pid()\n\t\tself.rating_value = stream.s32()\n\t\tself.lock_expiration_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.bool(self.is_rated)\n\t\tstream.pid(self.pid)\n\t\tstream.s32(self.rating_value)\n\t\tstream.datetime(self.lock_expiration_time)\n\n\nclass DataStoreRatingTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.slot = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.slot = stream.s8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.s8(self.slot)\n\n\nclass DataStoreReqGetAdditionalMeta(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\tself.meta_binary = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'data_type', 'version', 'meta_binary']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\t\tstream.qbuffer(self.meta_binary)\n\n\nclass DataStoreReqGetInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['data_id']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u64(self.data_id)\n\n\nclass DataStoreReqGetInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqGetNotificationUrlInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.key = None\n\t\tself.query = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'key', 'query', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.key = stream.string()\n\t\tself.query = stream.string()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.string(self.key)\n\t\tstream.string(self.query)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqUpdateInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.version = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['version', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.version = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.search_target = 1\n\t\tself.owner_ids = []\n\t\tself.owner_type = 0\n\t\tself.destination_ids = []\n\t\tself.data_type = 65535\n\t\tself.created_after = common.DateTime(671076024059)\n\t\tself.created_before = common.DateTime(671076024059)\n\t\tself.updated_after = common.DateTime(671076024059)\n\t\tself.updated_before = common.DateTime(671076024059)\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.result_order_column = 0\n\t\tself.result_order = 0\n\t\tself.result_range = common.ResultRange()\n\t\tself.result_option = 0\n\t\tself.minimal_rating_frequency = 0\n\t\tself.use_cache = False\n\t\tself.total_count_enabled = True\n\t\tself.data_types = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.search_target = stream.u8()\n\t\tself.owner_ids = stream.list(stream.pid)\n\t\tself.owner_type = stream.u8()\n\t\tself.destination_ids = stream.list(stream.u64)\n\t\tself.data_type = stream.u16()\n\t\tself.created_after = stream.datetime()\n\t\tself.created_before = stream.datetime()\n\t\tself.updated_after = stream.datetime()\n\t\tself.updated_before = stream.datetime()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.result_order_column = stream.u8()\n\t\tself.result_order = stream.u8()\n\t\tself.result_range = stream.extract(common.ResultRange)\n\t\tself.result_option = stream.u8()\n\t\tself.minimal_rating_frequency = stream.u32()\n\t\tself.use_cache = stream.bool()\n\t\tself.total_count_enabled = stream.bool()\n\t\tself.data_types = stream.list(stream.u16)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.search_target)\n\t\tstream.list(self.owner_ids, stream.pid)\n\t\tstream.u8(self.owner_type)\n\t\tstream.list(self.destination_ids, stream.u64)\n\t\tstream.u16(self.data_type)\n\t\tstream.datetime(self.created_after)\n\t\tstream.datetime(self.created_before)\n\t\tstream.datetime(self.updated_after)\n\t\tstream.datetime(self.updated_before)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u8(self.result_order_column)\n\t\tstream.u8(self.result_order)\n\t\tstream.add(self.result_range)\n\t\tstream.u8(self.result_option)\n\t\tstream.u32(self.minimal_rating_frequency)\n\t\tstream.bool(self.use_cache)\n\t\tstream.bool(self.total_count_enabled)\n\t\tstream.list(self.data_types, stream.u16)\n\n\nclass DataStoreSearchResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_count = None\n\t\tself.result = None\n\t\tself.total_count_type = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_count', 'result', 'total_count_type']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_count = stream.u32()\n\t\tself.result = stream.list(DataStoreMetaInfo)\n\t\tself.total_count_type = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.total_count)\n\t\tstream.list(self.result, stream.add)\n\t\tstream.u8(self.total_count_type)\n\n\nclass DataStoreSpecificMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u32(self.version)\n\n\nclass DataStoreSpecificMetaInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\n\nclass DataStoreTouchObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'lock_id', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.u64(self.access_password)\n\n\nclass MiiTubeSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\tself.page = 0\n\t\tself.category = 255\n\t\tself.gender = 2\n\t\tself.country = None\n\t\tself.search_type = 0\n\t\tself.result_option = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name', 'country']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\tself.page = stream.u32()\n\t\tself.category = stream.u8()\n\t\tself.gender = stream.u8()\n\t\tself.country = stream.u8()\n\t\tself.search_type = stream.u8()\n\t\tself.result_option = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\t\tstream.u32(self.page)\n\t\tstream.u8(self.category)\n\t\tstream.u8(self.gender)\n\t\tstream.u8(self.country)\n\t\tstream.u8(self.search_type)\n\t\tstream.u8(self.result_option)\n\n\nclass MiiTubeMiiInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.meta_info = DataStoreMetaInfo()\n\t\tself.category = None\n\t\tself.ranking_type = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'ranking_type']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.meta_info = stream.extract(DataStoreMetaInfo)\n\t\tself.category = stream.u8()\n\t\tself.ranking_type = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.meta_info)\n\t\tstream.u8(self.category)\n\t\tstream.u8(self.ranking_type)\n\n\nclass MiiTubeSearchResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.result = None\n\t\tself.count = None\n\t\tself.page = None\n\t\tself.has_next = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['result', 'count', 'page', 'has_next']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.result = stream.list(MiiTubeMiiInfo)\n\t\tself.count = stream.u32()\n\t\tself.page = stream.u32()\n\t\tself.has_next = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.result, stream.add)\n\t\tstream.u32(self.count)\n\t\tstream.u32(self.page)\n\t\tstream.bool(self.has_next)\n\n\nclass DataStoreProtocolMiitopia3DS:\n\tMETHOD_PREPARE_GET_OBJECT_V1 = 1\n\tMETHOD_PREPARE_POST_OBJECT_V1 = 2\n\tMETHOD_COMPLETE_POST_OBJECT_V1 = 3\n\tMETHOD_DELETE_OBJECT = 4\n\tMETHOD_DELETE_OBJECTS = 5\n\tMETHOD_CHANGE_META_V1 = 6\n\tMETHOD_CHANGE_METAS_V1 = 7\n\tMETHOD_GET_META = 8\n\tMETHOD_GET_METAS = 9\n\tMETHOD_PREPARE_UPDATE_OBJECT = 10\n\tMETHOD_COMPLETE_UPDATE_OBJECT = 11\n\tMETHOD_SEARCH_OBJECT = 12\n\tMETHOD_GET_NOTIFICATION_URL = 13\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1 = 14\n\tMETHOD_RATE_OBJECT = 15\n\tMETHOD_GET_RATING = 16\n\tMETHOD_GET_RATINGS = 17\n\tMETHOD_RESET_RATING = 18\n\tMETHOD_RESET_RATINGS = 19\n\tMETHOD_GET_SPECIFIC_META_V1 = 20\n\tMETHOD_POST_META_BINARY = 21\n\tMETHOD_TOUCH_OBJECT = 22\n\tMETHOD_GET_RATING_WITH_LOG = 23\n\tMETHOD_PREPARE_POST_OBJECT = 24\n\tMETHOD_PREPARE_GET_OBJECT = 25\n\tMETHOD_COMPLETE_POST_OBJECT = 26\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS = 27\n\tMETHOD_GET_SPECIFIC_META = 28\n\tMETHOD_GET_PERSISTENCE_INFO = 29\n\tMETHOD_GET_PERSISTENCE_INFOS = 30\n\tMETHOD_PERPETUATE_OBJECT = 31\n\tMETHOD_UNPERPETUATE_OBJECT = 32\n\tMETHOD_PREPARE_GET_OBJECT_OR_META_BINARY = 33\n\tMETHOD_GET_PASSWORD_INFO = 34\n\tMETHOD_GET_PASSWORD_INFOS = 35\n\tMETHOD_GET_METAS_MULTIPLE_PARAM = 36\n\tMETHOD_COMPLETE_POST_OBJECTS = 37\n\tMETHOD_CHANGE_META = 38\n\tMETHOD_CHANGE_METAS = 39\n\tMETHOD_RATE_OBJECTS = 40\n\tMETHOD_POST_META_BINARY_WITH_DATA_ID = 41\n\tMETHOD_POST_META_BINARIES_WITH_DATA_ID = 42\n\tMETHOD_RATE_OBJECT_WITH_POSTING = 43\n\tMETHOD_RATE_OBJECTS_WITH_POSTING = 44\n\tMETHOD_GET_OBJECT_INFOS = 45\n\tMETHOD_SEARCH_OBJECT_LIGHT = 46\n\tMETHOD_SEARCH_MII = 47\n\t\n\tPROTOCOL_ID = 0x73\n\n\nclass DataStoreClientMiitopia3DS(DataStoreProtocolMiitopia3DS):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def prepare_get_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_get_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def prepare_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_post_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_post_object_v1 -> done\")\n\t\n\tasync def delete_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.delete_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.delete_object -> done\")\n\t\n\tasync def delete_objects(self, param, transactional):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.delete_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.delete_objects -> done\")\n\t\treturn results\n\t\n\tasync def change_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_meta_v1 -> done\")\n\t\n\tasync def change_metas_v1(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_metas_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_metas_v1 -> done\")\n\t\treturn results\n\t\n\tasync def get_meta(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_meta -> done\")\n\t\treturn info\n\t\n\tasync def get_metas(self, data_ids, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.info = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_metas -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_update_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqUpdateInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_update_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_update_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_update_object -> done\")\n\t\n\tasync def search_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.search_object -> done\")\n\t\treturn result\n\t\n\tasync def get_notification_url(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_notification_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOTIFICATION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetNotificationUrlInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_notification_url -> done\")\n\t\treturn info\n\t\n\tasync def get_new_arrived_notifications_v1(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotificationV1)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_new_arrived_notifications_v1 -> done\")\n\t\treturn obj\n\t\n\tasync def rate_object(self, target, param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_object -> done\")\n\t\treturn info\n\t\n\tasync def get_rating(self, target, access_password):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trating = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_rating -> done\")\n\t\treturn rating\n\t\n\tasync def get_ratings(self, data_ids, access_password):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(lambda: stream.list(DataStoreRatingInfoWithSlot))\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_ratings -> done\")\n\t\treturn obj\n\t\n\tasync def reset_rating(self, target, update_password):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.reset_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(update_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.reset_rating -> done\")\n\t\n\tasync def reset_ratings(self, data_ids, transactional):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.reset_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.reset_ratings -> done\")\n\t\treturn results\n\t\n\tasync def get_specific_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_specific_meta_v1 -> done\")\n\t\treturn infos\n\t\n\tasync def post_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.post_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.post_meta_binary -> done\")\n\t\treturn data_id\n\t\n\tasync def touch_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.touch_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_TOUCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.touch_object -> done\")\n\t\n\tasync def get_rating_with_log(self, target, access_password):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_rating_with_log()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING_WITH_LOG, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.rating = stream.extract(DataStoreRatingInfo)\n\t\tobj.log = stream.extract(DataStoreRatingLog)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_rating_with_log -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_post_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_post_object -> done\")\n\t\treturn info\n\t\n\tasync def prepare_get_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_get_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_get_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_post_object -> done\")\n\t\n\tasync def get_new_arrived_notifications(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotification)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_new_arrived_notifications -> done\")\n\t\treturn obj\n\t\n\tasync def get_specific_meta(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_specific_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_specific_meta -> done\")\n\t\treturn infos\n\t\n\tasync def get_persistence_info(self, owner_id, slot_id):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_persistence_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.u16(slot_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePersistenceInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_persistence_info -> done\")\n\t\treturn info\n\t\n\tasync def get_persistence_infos(self, owner_id, slot_ids):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_persistence_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.list(slot_ids, stream.u16)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePersistenceInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_persistence_infos -> done\")\n\t\treturn obj\n\t\n\tasync def perpetuate_object(self, persistence_slot_id, data_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.perpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.u64(data_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.perpetuate_object -> done\")\n\t\n\tasync def unperpetuate_object(self, persistence_slot_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNPERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.unperpetuate_object -> done\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.get_info = stream.extract(DataStoreReqGetInfo)\n\t\tobj.additional_meta = stream.extract(DataStoreReqGetAdditionalMeta)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.prepare_get_object_or_meta_binary -> done\")\n\t\treturn obj\n\t\n\tasync def get_password_info(self, data_id):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_password_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePasswordInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_password_info -> done\")\n\t\treturn info\n\t\n\tasync def get_password_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_password_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePasswordInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_password_infos -> done\")\n\t\treturn obj\n\t\n\tasync def get_metas_multiple_param(self, params):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(params, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS_MULTIPLE_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_metas_multiple_param -> done\")\n\t\treturn obj\n\t\n\tasync def complete_post_objects(self, data_ids):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_post_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.complete_post_objects -> done\")\n\t\n\tasync def change_meta(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_meta -> done\")\n\t\n\tasync def change_metas(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.change_metas -> done\")\n\t\treturn results\n\t\n\tasync def rate_objects(self, targets, param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_objects -> done\")\n\t\treturn obj\n\t\n\tasync def post_meta_binary_with_data_id(self, data_id, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.post_meta_binary_with_data_id -> done\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARIES_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.post_meta_binaries_with_data_id -> done\")\n\t\treturn results\n\t\n\tasync def rate_object_with_posting(self, target, rate_param, post_param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(rate_param)\n\t\tstream.add(post_param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_object_with_posting -> done\")\n\t\treturn info\n\t\n\tasync def rate_objects_with_posting(self, targets, rate_param, post_param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(rate_param, stream.add)\n\t\tstream.list(post_param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.rate_objects_with_posting -> done\")\n\t\treturn obj\n\t\n\tasync def get_object_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_object_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OBJECT_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreReqGetInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.get_object_infos -> done\")\n\t\treturn obj\n\t\n\tasync def search_object_light(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.search_object_light()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT_LIGHT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.search_object_light -> done\")\n\t\treturn result\n\t\n\tasync def search_mii(self, param):\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.search_mii()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_MII, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsearch_result = stream.extract(MiiTubeSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientMiitopia3DS.search_mii -> done\")\n\t\treturn search_result\n\n\nclass DataStoreServerMiitopia3DS(DataStoreProtocolMiitopia3DS):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_V1: self.handle_prepare_get_object_v1,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT_V1: self.handle_prepare_post_object_v1,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT_V1: self.handle_complete_post_object_v1,\n\t\t\tself.METHOD_DELETE_OBJECT: self.handle_delete_object,\n\t\t\tself.METHOD_DELETE_OBJECTS: self.handle_delete_objects,\n\t\t\tself.METHOD_CHANGE_META_V1: self.handle_change_meta_v1,\n\t\t\tself.METHOD_CHANGE_METAS_V1: self.handle_change_metas_v1,\n\t\t\tself.METHOD_GET_META: self.handle_get_meta,\n\t\t\tself.METHOD_GET_METAS: self.handle_get_metas,\n\t\t\tself.METHOD_PREPARE_UPDATE_OBJECT: self.handle_prepare_update_object,\n\t\t\tself.METHOD_COMPLETE_UPDATE_OBJECT: self.handle_complete_update_object,\n\t\t\tself.METHOD_SEARCH_OBJECT: self.handle_search_object,\n\t\t\tself.METHOD_GET_NOTIFICATION_URL: self.handle_get_notification_url,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1: self.handle_get_new_arrived_notifications_v1,\n\t\t\tself.METHOD_RATE_OBJECT: self.handle_rate_object,\n\t\t\tself.METHOD_GET_RATING: self.handle_get_rating,\n\t\t\tself.METHOD_GET_RATINGS: self.handle_get_ratings,\n\t\t\tself.METHOD_RESET_RATING: self.handle_reset_rating,\n\t\t\tself.METHOD_RESET_RATINGS: self.handle_reset_ratings,\n\t\t\tself.METHOD_GET_SPECIFIC_META_V1: self.handle_get_specific_meta_v1,\n\t\t\tself.METHOD_POST_META_BINARY: self.handle_post_meta_binary,\n\t\t\tself.METHOD_TOUCH_OBJECT: self.handle_touch_object,\n\t\t\tself.METHOD_GET_RATING_WITH_LOG: self.handle_get_rating_with_log,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT: self.handle_prepare_post_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT: self.handle_prepare_get_object,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT: self.handle_complete_post_object,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS: self.handle_get_new_arrived_notifications,\n\t\t\tself.METHOD_GET_SPECIFIC_META: self.handle_get_specific_meta,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFO: self.handle_get_persistence_info,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFOS: self.handle_get_persistence_infos,\n\t\t\tself.METHOD_PERPETUATE_OBJECT: self.handle_perpetuate_object,\n\t\t\tself.METHOD_UNPERPETUATE_OBJECT: self.handle_unperpetuate_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY: self.handle_prepare_get_object_or_meta_binary,\n\t\t\tself.METHOD_GET_PASSWORD_INFO: self.handle_get_password_info,\n\t\t\tself.METHOD_GET_PASSWORD_INFOS: self.handle_get_password_infos,\n\t\t\tself.METHOD_GET_METAS_MULTIPLE_PARAM: self.handle_get_metas_multiple_param,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECTS: self.handle_complete_post_objects,\n\t\t\tself.METHOD_CHANGE_META: self.handle_change_meta,\n\t\t\tself.METHOD_CHANGE_METAS: self.handle_change_metas,\n\t\t\tself.METHOD_RATE_OBJECTS: self.handle_rate_objects,\n\t\t\tself.METHOD_POST_META_BINARY_WITH_DATA_ID: self.handle_post_meta_binary_with_data_id,\n\t\t\tself.METHOD_POST_META_BINARIES_WITH_DATA_ID: self.handle_post_meta_binaries_with_data_id,\n\t\t\tself.METHOD_RATE_OBJECT_WITH_POSTING: self.handle_rate_object_with_posting,\n\t\t\tself.METHOD_RATE_OBJECTS_WITH_POSTING: self.handle_rate_objects_with_posting,\n\t\t\tself.METHOD_GET_OBJECT_INFOS: self.handle_get_object_infos,\n\t\t\tself.METHOD_SEARCH_OBJECT_LIGHT: self.handle_search_object_light,\n\t\t\tself.METHOD_SEARCH_MII: self.handle_search_mii,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on DataStoreServerMiitopia3DS: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_prepare_get_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParamV1)\n\t\tresponse = await self.prepare_get_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParamV1)\n\t\tresponse = await self.prepare_post_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParamV1)\n\t\tawait self.complete_post_object_v1(client, param)\n\t\n\tasync def handle_delete_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.delete_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreDeleteParam)\n\t\tawait self.delete_object(client, param)\n\t\n\tasync def handle_delete_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.delete_objects()\")\n\t\t#--- request ---\n\t\tparam = input.list(DataStoreDeleteParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.delete_objects(client, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_change_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.change_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParamV1)\n\t\tawait self.change_meta_v1(client, param)\n\t\n\tasync def handle_change_metas_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.change_metas_v1()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParamV1)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas_v1(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreMetaInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreMetaInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas(client, data_ids, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['info', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.info, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_prepare_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.prepare_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareUpdateParam)\n\t\tresponse = await self.prepare_update_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqUpdateInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqUpdateInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.complete_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompleteUpdateParam)\n\t\tawait self.complete_update_object(client, param)\n\t\n\tasync def handle_search_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.search_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_notification_url(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_notification_url()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNotificationUrlParam)\n\t\tresponse = await self.get_notification_url(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetNotificationUrlInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetNotificationUrlInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_new_arrived_notifications_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_rate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.rate_object()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tparam = input.extract(DataStoreRateObjectParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object(client, target, param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_ratings(client, data_ids, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, lambda x: output.list(x, output.add))\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_reset_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.reset_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tupdate_password = input.u64()\n\t\tawait self.reset_rating(client, target, update_password)\n\t\n\tasync def handle_reset_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.reset_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.reset_ratings(client, data_ids, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_specific_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParamV1)\n\t\tresponse = await self.get_specific_meta_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_post_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.post_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.post_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_touch_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.touch_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreTouchObjectParam)\n\t\tawait self.touch_object(client, param)\n\t\n\tasync def handle_get_rating_with_log(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_rating_with_log()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating_with_log(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['rating', 'log']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.rating)\n\t\toutput.add(response.log)\n\t\n\tasync def handle_prepare_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.prepare_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.prepare_post_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_get_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.prepare_get_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.complete_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParam)\n\t\tawait self.complete_post_object(client, param)\n\t\n\tasync def handle_get_new_arrived_notifications(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_get_specific_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_specific_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParam)\n\t\tresponse = await self.get_specific_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_persistence_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_persistence_info()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_id = input.u16()\n\t\tresponse = await self.get_persistence_info(client, owner_id, slot_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePersistenceInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePersistenceInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_persistence_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_persistence_infos()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_ids = input.list(input.u16)\n\t\tresponse = await self.get_persistence_infos(client, owner_id, slot_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_perpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.perpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdata_id = input.u64()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.perpetuate_object(client, persistence_slot_id, data_id, delete_last_object)\n\t\n\tasync def handle_unperpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.unperpetuate_object(client, persistence_slot_id, delete_last_object)\n\t\n\tasync def handle_prepare_get_object_or_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object_or_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['get_info', 'additional_meta']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.get_info)\n\t\toutput.add(response.additional_meta)\n\t\n\tasync def handle_get_password_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_password_info()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tresponse = await self.get_password_info(client, data_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePasswordInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePasswordInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_password_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_password_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_password_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_metas_multiple_param(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tparams = input.list(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas_multiple_param(client, params)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_complete_post_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.complete_post_objects()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tawait self.complete_post_objects(client, data_ids)\n\t\n\tasync def handle_change_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.change_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParam)\n\t\tawait self.change_meta(client, param)\n\t\n\tasync def handle_change_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.change_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.rate_objects()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\tparam = input.list(DataStoreRateObjectParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects(client, targets, param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_post_meta_binary_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tawait self.post_meta_binary_with_data_id(client, data_id, param)\n\t\n\tasync def handle_post_meta_binaries_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.post_meta_binaries_with_data_id(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_object_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\trate_param = input.extract(DataStoreRateObjectParam)\n\t\tpost_param = input.extract(DataStorePreparePostParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object_with_posting(client, target, rate_param, post_param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_rate_objects_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\trate_param = input.list(DataStoreRateObjectParam)\n\t\tpost_param = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects_with_posting(client, targets, rate_param, post_param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_object_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.get_object_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_object_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_object_light(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.search_object_light()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object_light(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_search_mii(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerMiitopia3DS.search_mii()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MiiTubeSearchParam)\n\t\tresponse = await self.search_mii(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MiiTubeSearchResult):\n\t\t\traise RuntimeError(\"Expected MiiTubeSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def prepare_get_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.prepare_get_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.prepare_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.complete_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.delete_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.delete_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.change_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.change_metas_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.prepare_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.complete_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_notification_url(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_notification_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_new_arrived_notifications_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.rate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.reset_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.reset_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_specific_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.post_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def touch_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.touch_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating_with_log(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_rating_with_log not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.prepare_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.prepare_get_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.complete_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_new_arrived_notifications not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_specific_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_persistence_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_persistence_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def perpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.perpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unperpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.unperpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.prepare_get_object_or_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_password_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_password_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas_multiple_param(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_metas_multiple_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.complete_post_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.change_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.change_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.rate_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.post_meta_binary_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.post_meta_binaries_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.rate_object_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.rate_objects_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_object_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.get_object_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object_light(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.search_object_light not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_mii(self, *args):\n\t\tlogger.warning(\"DataStoreServerMiitopia3DS.search_mii not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/datastore_smm.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass DataStoreChangeMetaCompareParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.comparison_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['comparison_flag', 'name', 'period', 'meta_binary', 'tags', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.comparison_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.comparison_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\n\nclass DataStoreChangeMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\tself.compare_param = DataStoreChangeMetaCompareParam()\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.compare_param = stream.extract(DataStoreChangeMetaCompareParam)\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\t\tstream.add(self.compare_param)\n\t\tstream.add(self.persistence_target)\n\n\nclass DataStoreChangeMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreCompletePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompletePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompleteUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.version = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'version', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.version = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.version)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreDeleteParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreGetMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.result_option = 0\n\t\tself.access_password = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.result_option = stream.u8()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u8(self.result_option)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreGetNewArrivedNotificationsParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.last_notification_id = None\n\t\tself.limit = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['last_notification_id', 'limit']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.last_notification_id = stream.u64()\n\t\tself.limit = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.last_notification_id)\n\t\tstream.u16(self.limit)\n\n\nclass DataStoreGetNotificationUrlParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.previous_url = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['previous_url']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.previous_url = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.previous_url)\n\n\nclass DataStoreGetSpecificMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u64)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u64)\n\n\nclass DataStoreGetSpecificMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u32)\n\n\nclass DataStoreKeyValue(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.string()\n\t\tself.value = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.key)\n\t\tstream.string(self.value)\n\n\nclass DataStoreMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.create_time = None\n\t\tself.update_time = None\n\t\tself.period = None\n\t\tself.status = None\n\t\tself.referred_count = None\n\t\tself.refer_data_id = None\n\t\tself.flag = None\n\t\tself.referred_time = None\n\t\tself.expire_time = None\n\t\tself.tags = None\n\t\tself.ratings = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'name', 'data_type', 'meta_binary', 'create_time', 'update_time', 'period', 'status', 'referred_count', 'refer_data_id', 'flag', 'referred_time', 'expire_time', 'tags', 'ratings']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.create_time = stream.datetime()\n\t\tself.update_time = stream.datetime()\n\t\tself.period = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.referred_count = stream.u32()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.flag = stream.u32()\n\t\tself.referred_time = stream.datetime()\n\t\tself.expire_time = stream.datetime()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.ratings = stream.list(DataStoreRatingInfoWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.datetime(self.create_time)\n\t\tstream.datetime(self.update_time)\n\t\tstream.u16(self.period)\n\t\tstream.u8(self.status)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.u32(self.flag)\n\t\tstream.datetime(self.referred_time)\n\t\tstream.datetime(self.expire_time)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.ratings, stream.add)\n\n\nclass DataStoreNotification(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStoreNotificationV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u32(self.data_id)\n\n\nclass DataStorePasswordInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.access_password = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'access_password', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.access_password = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.access_password)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStorePermission(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.permission = 3\n\t\tself.recipients = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.permission = stream.u8()\n\t\tself.recipients = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.permission)\n\t\tstream.list(self.recipients, stream.pid)\n\n\nclass DataStorePersistenceInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.slot_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'slot_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.slot_id = stream.u16()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.slot_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStorePersistenceInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.persistence_id = 65535\n\t\tself.delete_last_object = True\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.persistence_id = stream.u16()\n\t\tself.delete_last_object = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u16(self.persistence_id)\n\t\tstream.bool(self.delete_last_object)\n\n\nclass DataStorePersistenceTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = 0\n\t\tself.persistence_id = 65535\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.persistence_id = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.persistence_id)\n\n\nclass DataStorePrepareGetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.lock_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.access_password = 0\n\t\tself.extra_data = []\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.access_password = stream.u64()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u64(self.access_password)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePrepareGetParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.lock_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.u32(self.lock_id)\n\n\nclass DataStorePreparePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.rating_init_param = []\n\t\tself.persistence_init_param = DataStorePersistenceInitParam()\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'data_type', 'meta_binary', 'flag', 'period']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['extra_data']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\tself.persistence_init_param = stream.extract(DataStorePersistenceInitParam)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\t\tstream.add(self.persistence_init_param)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePreparePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = 0\n\t\tself.meta_binary = b\"\"\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = None\n\t\tself.rating_init_param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'flag', 'period', 'tags', 'rating_init_param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\n\nclass DataStorePrepareUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.size = None\n\t\tself.update_password = None\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'size', 'update_password', 'extra_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.size = stream.u32()\n\t\tself.update_password = stream.u64()\n\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.size)\n\t\tstream.u64(self.update_password)\n\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStoreRateObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rating_value = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rating_value', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rating_value = stream.s32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s32(self.rating_value)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreRatingInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_value = None\n\t\tself.count = None\n\t\tself.initial_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_value', 'count', 'initial_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_value = stream.s64()\n\t\tself.count = stream.u32()\n\t\tself.initial_value = stream.s64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s64(self.total_value)\n\t\tstream.u32(self.count)\n\t\tstream.s64(self.initial_value)\n\n\nclass DataStoreRatingInfoWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.info = DataStoreRatingInfo()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.u8()\n\t\tself.info = stream.extract(DataStoreRatingInfo)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.slot)\n\t\tstream.add(self.info)\n\n\nclass DataStoreRatingInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flag = None\n\t\tself.internal_flag = None\n\t\tself.lock_type = None\n\t\tself.initial_value = None\n\t\tself.range_min = None\n\t\tself.range_max = None\n\t\tself.period_hour = None\n\t\tself.period_duration = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flag', 'internal_flag', 'lock_type', 'initial_value', 'range_min', 'range_max', 'period_hour', 'period_duration']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flag = stream.u8()\n\t\tself.internal_flag = stream.u8()\n\t\tself.lock_type = stream.u8()\n\t\tself.initial_value = stream.s64()\n\t\tself.range_min = stream.s32()\n\t\tself.range_max = stream.s32()\n\t\tself.period_hour = stream.s8()\n\t\tself.period_duration = stream.s16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flag)\n\t\tstream.u8(self.internal_flag)\n\t\tstream.u8(self.lock_type)\n\t\tstream.s64(self.initial_value)\n\t\tstream.s32(self.range_min)\n\t\tstream.s32(self.range_max)\n\t\tstream.s8(self.period_hour)\n\t\tstream.s16(self.period_duration)\n\n\nclass DataStoreRatingInitParamWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.param = DataStoreRatingInitParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.s8()\n\t\tself.param = stream.extract(DataStoreRatingInitParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s8(self.slot)\n\t\tstream.add(self.param)\n\n\nclass DataStoreRatingLog(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.is_rated = None\n\t\tself.pid = None\n\t\tself.rating_value = None\n\t\tself.lock_expiration_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['is_rated', 'pid', 'rating_value', 'lock_expiration_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.is_rated = stream.bool()\n\t\tself.pid = stream.pid()\n\t\tself.rating_value = stream.s32()\n\t\tself.lock_expiration_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.bool(self.is_rated)\n\t\tstream.pid(self.pid)\n\t\tstream.s32(self.rating_value)\n\t\tstream.datetime(self.lock_expiration_time)\n\n\nclass DataStoreRatingTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.slot = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.slot = stream.s8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.s8(self.slot)\n\n\nclass DataStoreReqGetAdditionalMeta(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\tself.meta_binary = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'data_type', 'version', 'meta_binary']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\t\tstream.qbuffer(self.meta_binary)\n\n\nclass DataStoreReqGetInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['data_id']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u64(self.data_id)\n\n\nclass DataStoreReqGetInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqGetNotificationUrlInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.key = None\n\t\tself.query = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'key', 'query', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.key = stream.string()\n\t\tself.query = stream.string()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.string(self.key)\n\t\tstream.string(self.query)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqUpdateInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.version = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['version', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.version = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.search_target = 1\n\t\tself.owner_ids = []\n\t\tself.owner_type = 0\n\t\tself.destination_ids = []\n\t\tself.data_type = 65535\n\t\tself.created_after = common.DateTime(671076024059)\n\t\tself.created_before = common.DateTime(671076024059)\n\t\tself.updated_after = common.DateTime(671076024059)\n\t\tself.updated_before = common.DateTime(671076024059)\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.result_order_column = 0\n\t\tself.result_order = 0\n\t\tself.result_range = common.ResultRange()\n\t\tself.result_option = 0\n\t\tself.minimal_rating_frequency = 0\n\t\tself.use_cache = False\n\t\tself.total_count_enabled = True\n\t\tself.data_types = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.search_target = stream.u8()\n\t\tself.owner_ids = stream.list(stream.pid)\n\t\tself.owner_type = stream.u8()\n\t\tself.destination_ids = stream.list(stream.u64)\n\t\tself.data_type = stream.u16()\n\t\tself.created_after = stream.datetime()\n\t\tself.created_before = stream.datetime()\n\t\tself.updated_after = stream.datetime()\n\t\tself.updated_before = stream.datetime()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.result_order_column = stream.u8()\n\t\tself.result_order = stream.u8()\n\t\tself.result_range = stream.extract(common.ResultRange)\n\t\tself.result_option = stream.u8()\n\t\tself.minimal_rating_frequency = stream.u32()\n\t\tself.use_cache = stream.bool()\n\t\tself.total_count_enabled = stream.bool()\n\t\tself.data_types = stream.list(stream.u16)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.search_target)\n\t\tstream.list(self.owner_ids, stream.pid)\n\t\tstream.u8(self.owner_type)\n\t\tstream.list(self.destination_ids, stream.u64)\n\t\tstream.u16(self.data_type)\n\t\tstream.datetime(self.created_after)\n\t\tstream.datetime(self.created_before)\n\t\tstream.datetime(self.updated_after)\n\t\tstream.datetime(self.updated_before)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u8(self.result_order_column)\n\t\tstream.u8(self.result_order)\n\t\tstream.add(self.result_range)\n\t\tstream.u8(self.result_option)\n\t\tstream.u32(self.minimal_rating_frequency)\n\t\tstream.bool(self.use_cache)\n\t\tstream.bool(self.total_count_enabled)\n\t\tstream.list(self.data_types, stream.u16)\n\n\nclass DataStoreSearchResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_count = None\n\t\tself.result = None\n\t\tself.total_count_type = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_count', 'result', 'total_count_type']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_count = stream.u32()\n\t\tself.result = stream.list(DataStoreMetaInfo)\n\t\tself.total_count_type = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.total_count)\n\t\tstream.list(self.result, stream.add)\n\t\tstream.u8(self.total_count_type)\n\n\nclass DataStoreSpecificMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u32(self.version)\n\n\nclass DataStoreSpecificMetaInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\n\nclass DataStoreTouchObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'lock_id', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreProtocolSMM:\n\tMETHOD_PREPARE_GET_OBJECT_V1 = 1\n\tMETHOD_PREPARE_POST_OBJECT_V1 = 2\n\tMETHOD_COMPLETE_POST_OBJECT_V1 = 3\n\tMETHOD_DELETE_OBJECT = 4\n\tMETHOD_DELETE_OBJECTS = 5\n\tMETHOD_CHANGE_META_V1 = 6\n\tMETHOD_CHANGE_METAS_V1 = 7\n\tMETHOD_GET_META = 8\n\tMETHOD_GET_METAS = 9\n\tMETHOD_PREPARE_UPDATE_OBJECT = 10\n\tMETHOD_COMPLETE_UPDATE_OBJECT = 11\n\tMETHOD_SEARCH_OBJECT = 12\n\tMETHOD_GET_NOTIFICATION_URL = 13\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1 = 14\n\tMETHOD_RATE_OBJECT = 15\n\tMETHOD_GET_RATING = 16\n\tMETHOD_GET_RATINGS = 17\n\tMETHOD_RESET_RATING = 18\n\tMETHOD_RESET_RATINGS = 19\n\tMETHOD_GET_SPECIFIC_META_V1 = 20\n\tMETHOD_POST_META_BINARY = 21\n\tMETHOD_TOUCH_OBJECT = 22\n\tMETHOD_GET_RATING_WITH_LOG = 23\n\tMETHOD_PREPARE_POST_OBJECT = 24\n\tMETHOD_PREPARE_GET_OBJECT = 25\n\tMETHOD_COMPLETE_POST_OBJECT = 26\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS = 27\n\tMETHOD_GET_SPECIFIC_META = 28\n\tMETHOD_GET_PERSISTENCE_INFO = 29\n\tMETHOD_GET_PERSISTENCE_INFOS = 30\n\tMETHOD_PERPETUATE_OBJECT = 31\n\tMETHOD_UNPERPETUATE_OBJECT = 32\n\tMETHOD_PREPARE_GET_OBJECT_OR_META_BINARY = 33\n\tMETHOD_GET_PASSWORD_INFO = 34\n\tMETHOD_GET_PASSWORD_INFOS = 35\n\tMETHOD_GET_METAS_MULTIPLE_PARAM = 36\n\tMETHOD_COMPLETE_POST_OBJECTS = 37\n\tMETHOD_CHANGE_META = 38\n\tMETHOD_CHANGE_METAS = 39\n\tMETHOD_RATE_OBJECTS = 40\n\tMETHOD_POST_META_BINARY_WITH_DATA_ID = 41\n\tMETHOD_POST_META_BINARIES_WITH_DATA_ID = 42\n\tMETHOD_RATE_OBJECT_WITH_POSTING = 43\n\tMETHOD_RATE_OBJECTS_WITH_POSTING = 44\n\tMETHOD_GET_OBJECT_INFOS = 45\n\tMETHOD_SEARCH_OBJECT_LIGHT = 46\n\tMETHOD_GET_APPLICATION_CONFIG = 61\n\tMETHOD_GET_APPLICATION_CONFIG_STRING = 74\n\t\n\tPROTOCOL_ID = 0x73\n\n\nclass DataStoreClientSMM(DataStoreProtocolSMM):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def prepare_get_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.prepare_get_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def prepare_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.prepare_post_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.complete_post_object_v1 -> done\")\n\t\n\tasync def delete_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.delete_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.delete_object -> done\")\n\t\n\tasync def delete_objects(self, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM.delete_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.delete_objects -> done\")\n\t\treturn results\n\t\n\tasync def change_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.change_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.change_meta_v1 -> done\")\n\t\n\tasync def change_metas_v1(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM.change_metas_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.change_metas_v1 -> done\")\n\t\treturn results\n\t\n\tasync def get_meta(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_meta -> done\")\n\t\treturn info\n\t\n\tasync def get_metas(self, data_ids, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.info = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_metas -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_update_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.prepare_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqUpdateInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.prepare_update_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_update_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.complete_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.complete_update_object -> done\")\n\t\n\tasync def search_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.search_object -> done\")\n\t\treturn result\n\t\n\tasync def get_notification_url(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_notification_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOTIFICATION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetNotificationUrlInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_notification_url -> done\")\n\t\treturn info\n\t\n\tasync def get_new_arrived_notifications_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotificationV1)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_new_arrived_notifications_v1 -> done\")\n\t\treturn obj\n\t\n\tasync def rate_object(self, target, param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM.rate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.rate_object -> done\")\n\t\treturn info\n\t\n\tasync def get_rating(self, target, access_password):\n\t\tlogger.info(\"DataStoreClientSMM.get_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trating = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_rating -> done\")\n\t\treturn rating\n\t\n\tasync def get_ratings(self, data_ids, access_password):\n\t\tlogger.info(\"DataStoreClientSMM.get_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(lambda: stream.list(DataStoreRatingInfoWithSlot))\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_ratings -> done\")\n\t\treturn obj\n\t\n\tasync def reset_rating(self, target, update_password):\n\t\tlogger.info(\"DataStoreClientSMM.reset_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(update_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.reset_rating -> done\")\n\t\n\tasync def reset_ratings(self, data_ids, transactional):\n\t\tlogger.info(\"DataStoreClientSMM.reset_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.reset_ratings -> done\")\n\t\treturn results\n\t\n\tasync def get_specific_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_specific_meta_v1 -> done\")\n\t\treturn infos\n\t\n\tasync def post_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.post_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.post_meta_binary -> done\")\n\t\treturn data_id\n\t\n\tasync def touch_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.touch_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_TOUCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.touch_object -> done\")\n\t\n\tasync def get_rating_with_log(self, target, access_password):\n\t\tlogger.info(\"DataStoreClientSMM.get_rating_with_log()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING_WITH_LOG, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.rating = stream.extract(DataStoreRatingInfo)\n\t\tobj.log = stream.extract(DataStoreRatingLog)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_rating_with_log -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_post_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.prepare_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.prepare_post_object -> done\")\n\t\treturn info\n\t\n\tasync def prepare_get_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.prepare_get_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.prepare_get_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.complete_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.complete_post_object -> done\")\n\t\n\tasync def get_new_arrived_notifications(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotification)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_new_arrived_notifications -> done\")\n\t\treturn obj\n\t\n\tasync def get_specific_meta(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.get_specific_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_specific_meta -> done\")\n\t\treturn infos\n\t\n\tasync def get_persistence_info(self, owner_id, slot_id):\n\t\tlogger.info(\"DataStoreClientSMM.get_persistence_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.u16(slot_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePersistenceInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_persistence_info -> done\")\n\t\treturn info\n\t\n\tasync def get_persistence_infos(self, owner_id, slot_ids):\n\t\tlogger.info(\"DataStoreClientSMM.get_persistence_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.list(slot_ids, stream.u16)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePersistenceInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_persistence_infos -> done\")\n\t\treturn obj\n\t\n\tasync def perpetuate_object(self, persistence_slot_id, data_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClientSMM.perpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.u64(data_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.perpetuate_object -> done\")\n\t\n\tasync def unperpetuate_object(self, persistence_slot_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClientSMM.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNPERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.unperpetuate_object -> done\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.get_info = stream.extract(DataStoreReqGetInfo)\n\t\tobj.additional_meta = stream.extract(DataStoreReqGetAdditionalMeta)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.prepare_get_object_or_meta_binary -> done\")\n\t\treturn obj\n\t\n\tasync def get_password_info(self, data_id):\n\t\tlogger.info(\"DataStoreClientSMM.get_password_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePasswordInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_password_info -> done\")\n\t\treturn info\n\t\n\tasync def get_password_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClientSMM.get_password_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePasswordInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_password_infos -> done\")\n\t\treturn obj\n\t\n\tasync def get_metas_multiple_param(self, params):\n\t\tlogger.info(\"DataStoreClientSMM.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(params, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS_MULTIPLE_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_metas_multiple_param -> done\")\n\t\treturn obj\n\t\n\tasync def complete_post_objects(self, data_ids):\n\t\tlogger.info(\"DataStoreClientSMM.complete_post_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.complete_post_objects -> done\")\n\t\n\tasync def change_meta(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.change_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.change_meta -> done\")\n\t\n\tasync def change_metas(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM.change_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.change_metas -> done\")\n\t\treturn results\n\t\n\tasync def rate_objects(self, targets, param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM.rate_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.rate_objects -> done\")\n\t\treturn obj\n\t\n\tasync def post_meta_binary_with_data_id(self, data_id, param):\n\t\tlogger.info(\"DataStoreClientSMM.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.post_meta_binary_with_data_id -> done\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARIES_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.post_meta_binaries_with_data_id -> done\")\n\t\treturn results\n\t\n\tasync def rate_object_with_posting(self, target, rate_param, post_param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(rate_param)\n\t\tstream.add(post_param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.rate_object_with_posting -> done\")\n\t\treturn info\n\t\n\tasync def rate_objects_with_posting(self, targets, rate_param, post_param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(rate_param, stream.add)\n\t\tstream.list(post_param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.rate_objects_with_posting -> done\")\n\t\treturn obj\n\t\n\tasync def get_object_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClientSMM.get_object_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OBJECT_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreReqGetInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_object_infos -> done\")\n\t\treturn obj\n\t\n\tasync def search_object_light(self, param):\n\t\tlogger.info(\"DataStoreClientSMM.search_object_light()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT_LIGHT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.search_object_light -> done\")\n\t\treturn result\n\t\n\tasync def get_application_config(self, id):\n\t\tlogger.info(\"DataStoreClientSMM.get_application_config()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_APPLICATION_CONFIG, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tconfig = stream.list(stream.u32)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_application_config -> done\")\n\t\treturn config\n\t\n\tasync def get_application_config_string(self, id):\n\t\tlogger.info(\"DataStoreClientSMM.get_application_config_string()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_APPLICATION_CONFIG_STRING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tconfig = stream.list(stream.string)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM.get_application_config_string -> done\")\n\t\treturn config\n\n\nclass DataStoreServerSMM(DataStoreProtocolSMM):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_V1: self.handle_prepare_get_object_v1,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT_V1: self.handle_prepare_post_object_v1,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT_V1: self.handle_complete_post_object_v1,\n\t\t\tself.METHOD_DELETE_OBJECT: self.handle_delete_object,\n\t\t\tself.METHOD_DELETE_OBJECTS: self.handle_delete_objects,\n\t\t\tself.METHOD_CHANGE_META_V1: self.handle_change_meta_v1,\n\t\t\tself.METHOD_CHANGE_METAS_V1: self.handle_change_metas_v1,\n\t\t\tself.METHOD_GET_META: self.handle_get_meta,\n\t\t\tself.METHOD_GET_METAS: self.handle_get_metas,\n\t\t\tself.METHOD_PREPARE_UPDATE_OBJECT: self.handle_prepare_update_object,\n\t\t\tself.METHOD_COMPLETE_UPDATE_OBJECT: self.handle_complete_update_object,\n\t\t\tself.METHOD_SEARCH_OBJECT: self.handle_search_object,\n\t\t\tself.METHOD_GET_NOTIFICATION_URL: self.handle_get_notification_url,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1: self.handle_get_new_arrived_notifications_v1,\n\t\t\tself.METHOD_RATE_OBJECT: self.handle_rate_object,\n\t\t\tself.METHOD_GET_RATING: self.handle_get_rating,\n\t\t\tself.METHOD_GET_RATINGS: self.handle_get_ratings,\n\t\t\tself.METHOD_RESET_RATING: self.handle_reset_rating,\n\t\t\tself.METHOD_RESET_RATINGS: self.handle_reset_ratings,\n\t\t\tself.METHOD_GET_SPECIFIC_META_V1: self.handle_get_specific_meta_v1,\n\t\t\tself.METHOD_POST_META_BINARY: self.handle_post_meta_binary,\n\t\t\tself.METHOD_TOUCH_OBJECT: self.handle_touch_object,\n\t\t\tself.METHOD_GET_RATING_WITH_LOG: self.handle_get_rating_with_log,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT: self.handle_prepare_post_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT: self.handle_prepare_get_object,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT: self.handle_complete_post_object,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS: self.handle_get_new_arrived_notifications,\n\t\t\tself.METHOD_GET_SPECIFIC_META: self.handle_get_specific_meta,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFO: self.handle_get_persistence_info,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFOS: self.handle_get_persistence_infos,\n\t\t\tself.METHOD_PERPETUATE_OBJECT: self.handle_perpetuate_object,\n\t\t\tself.METHOD_UNPERPETUATE_OBJECT: self.handle_unperpetuate_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY: self.handle_prepare_get_object_or_meta_binary,\n\t\t\tself.METHOD_GET_PASSWORD_INFO: self.handle_get_password_info,\n\t\t\tself.METHOD_GET_PASSWORD_INFOS: self.handle_get_password_infos,\n\t\t\tself.METHOD_GET_METAS_MULTIPLE_PARAM: self.handle_get_metas_multiple_param,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECTS: self.handle_complete_post_objects,\n\t\t\tself.METHOD_CHANGE_META: self.handle_change_meta,\n\t\t\tself.METHOD_CHANGE_METAS: self.handle_change_metas,\n\t\t\tself.METHOD_RATE_OBJECTS: self.handle_rate_objects,\n\t\t\tself.METHOD_POST_META_BINARY_WITH_DATA_ID: self.handle_post_meta_binary_with_data_id,\n\t\t\tself.METHOD_POST_META_BINARIES_WITH_DATA_ID: self.handle_post_meta_binaries_with_data_id,\n\t\t\tself.METHOD_RATE_OBJECT_WITH_POSTING: self.handle_rate_object_with_posting,\n\t\t\tself.METHOD_RATE_OBJECTS_WITH_POSTING: self.handle_rate_objects_with_posting,\n\t\t\tself.METHOD_GET_OBJECT_INFOS: self.handle_get_object_infos,\n\t\t\tself.METHOD_SEARCH_OBJECT_LIGHT: self.handle_search_object_light,\n\t\t\tself.METHOD_GET_APPLICATION_CONFIG: self.handle_get_application_config,\n\t\t\tself.METHOD_GET_APPLICATION_CONFIG_STRING: self.handle_get_application_config_string,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on DataStoreServerSMM: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_prepare_get_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParamV1)\n\t\tresponse = await self.prepare_get_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParamV1)\n\t\tresponse = await self.prepare_post_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParamV1)\n\t\tawait self.complete_post_object_v1(client, param)\n\t\n\tasync def handle_delete_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.delete_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreDeleteParam)\n\t\tawait self.delete_object(client, param)\n\t\n\tasync def handle_delete_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.delete_objects()\")\n\t\t#--- request ---\n\t\tparam = input.list(DataStoreDeleteParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.delete_objects(client, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_change_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.change_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParamV1)\n\t\tawait self.change_meta_v1(client, param)\n\t\n\tasync def handle_change_metas_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.change_metas_v1()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParamV1)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas_v1(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreMetaInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreMetaInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas(client, data_ids, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['info', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.info, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_prepare_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.prepare_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareUpdateParam)\n\t\tresponse = await self.prepare_update_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqUpdateInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqUpdateInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.complete_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompleteUpdateParam)\n\t\tawait self.complete_update_object(client, param)\n\t\n\tasync def handle_search_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.search_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_notification_url(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_notification_url()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNotificationUrlParam)\n\t\tresponse = await self.get_notification_url(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetNotificationUrlInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetNotificationUrlInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_new_arrived_notifications_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_rate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.rate_object()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tparam = input.extract(DataStoreRateObjectParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object(client, target, param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_ratings(client, data_ids, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, lambda x: output.list(x, output.add))\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_reset_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.reset_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tupdate_password = input.u64()\n\t\tawait self.reset_rating(client, target, update_password)\n\t\n\tasync def handle_reset_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.reset_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.reset_ratings(client, data_ids, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_specific_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParamV1)\n\t\tresponse = await self.get_specific_meta_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_post_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.post_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.post_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_touch_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.touch_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreTouchObjectParam)\n\t\tawait self.touch_object(client, param)\n\t\n\tasync def handle_get_rating_with_log(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_rating_with_log()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating_with_log(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['rating', 'log']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.rating)\n\t\toutput.add(response.log)\n\t\n\tasync def handle_prepare_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.prepare_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.prepare_post_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_get_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.prepare_get_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.complete_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParam)\n\t\tawait self.complete_post_object(client, param)\n\t\n\tasync def handle_get_new_arrived_notifications(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_get_specific_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_specific_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParam)\n\t\tresponse = await self.get_specific_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_persistence_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_persistence_info()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_id = input.u16()\n\t\tresponse = await self.get_persistence_info(client, owner_id, slot_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePersistenceInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePersistenceInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_persistence_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_persistence_infos()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_ids = input.list(input.u16)\n\t\tresponse = await self.get_persistence_infos(client, owner_id, slot_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_perpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.perpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdata_id = input.u64()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.perpetuate_object(client, persistence_slot_id, data_id, delete_last_object)\n\t\n\tasync def handle_unperpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.unperpetuate_object(client, persistence_slot_id, delete_last_object)\n\t\n\tasync def handle_prepare_get_object_or_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object_or_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['get_info', 'additional_meta']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.get_info)\n\t\toutput.add(response.additional_meta)\n\t\n\tasync def handle_get_password_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_password_info()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tresponse = await self.get_password_info(client, data_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePasswordInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePasswordInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_password_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_password_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_password_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_metas_multiple_param(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tparams = input.list(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas_multiple_param(client, params)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_complete_post_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.complete_post_objects()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tawait self.complete_post_objects(client, data_ids)\n\t\n\tasync def handle_change_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.change_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParam)\n\t\tawait self.change_meta(client, param)\n\t\n\tasync def handle_change_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.change_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.rate_objects()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\tparam = input.list(DataStoreRateObjectParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects(client, targets, param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_post_meta_binary_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tawait self.post_meta_binary_with_data_id(client, data_id, param)\n\t\n\tasync def handle_post_meta_binaries_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.post_meta_binaries_with_data_id(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_object_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\trate_param = input.extract(DataStoreRateObjectParam)\n\t\tpost_param = input.extract(DataStorePreparePostParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object_with_posting(client, target, rate_param, post_param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_rate_objects_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\trate_param = input.list(DataStoreRateObjectParam)\n\t\tpost_param = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects_with_posting(client, targets, rate_param, post_param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_object_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_object_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_object_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_object_light(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.search_object_light()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object_light(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_application_config(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_application_config()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tresponse = await self.get_application_config(client, id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.u32)\n\t\n\tasync def handle_get_application_config_string(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM.get_application_config_string()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tresponse = await self.get_application_config_string(client, id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.string)\n\t\n\tasync def prepare_get_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.prepare_get_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.prepare_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.complete_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.delete_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.delete_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.change_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.change_metas_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.prepare_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.complete_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_notification_url(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_notification_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_new_arrived_notifications_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.rate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.reset_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.reset_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_specific_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.post_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def touch_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.touch_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating_with_log(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_rating_with_log not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.prepare_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.prepare_get_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.complete_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_new_arrived_notifications not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_specific_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_persistence_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_persistence_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def perpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.perpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unperpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.unperpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.prepare_get_object_or_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_password_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_password_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas_multiple_param(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_metas_multiple_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.complete_post_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.change_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.change_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.rate_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.post_meta_binary_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.post_meta_binaries_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.rate_object_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.rate_objects_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_object_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_object_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object_light(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.search_object_light not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_application_config(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_application_config not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_application_config_string(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM.get_application_config_string not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/datastore_smm2.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass ClearCondition:\n\tNORMAL = 0\n\tCOLLECT_COINS = 4116396131\n\tKILL_SKIPSQUEAKS = 4042480826\n\n\nclass CourseDifficulty:\n\tEASY = 0\n\tSTANDARD = 1\n\tEXPERT = 2\n\tSUPER_EXPERT = 3\n\n\nclass CourseTag:\n\tNONE = 0\n\tSTANDARD = 1\n\tPUZZLE_SOLVING = 2\n\tSPEEDRUN = 3\n\tAUTOSCROLL = 4\n\tAUTO_MARIO = 5\n\tSHORT_AND_SWEET = 6\n\tMULTIPLAYER_VS = 7\n\tTHEMED = 8\n\tMUSIC = 9\n\n\nclass CourseTheme:\n\tGROUND = 0\n\tUNDERGROUND = 1\n\tCASTLE = 2\n\tAIRSHIP = 3\n\tUNDERWATER = 4\n\tGHOST_HOUSE = 5\n\tSNOW = 6\n\tDESERT = 7\n\tSKY = 8\n\tFOREST = 9\n\n\nclass GameStyle:\n\tSMB1 = 0\n\tSMB3 = 1\n\tSMW = 2\n\tNSMBU = 3\n\tSM3DW = 4\n\n\nclass MultiplayerStatsKeys:\n\tMULTIPLAYER_SCORE = 0\n\tVERSUS_PLAYS = 2\n\tVERSUS_WINS = 3\n\tCOOP_PLAYS = 10\n\tCOOP_WINS = 11\n\n\nclass PlayStatsKeys:\n\tPLAYS = 0\n\tCLEARS = 1\n\tATTEMPTS = 2\n\tDEATHS = 3\n\n\nclass CourseOption:\n\tPLAY_STATS = 1\n\tRATINGS = 2\n\tTIME_STATS = 4\n\tCOMMENT_STATS = 8\n\tUNK9 = 16\n\tUNK10 = 32\n\tUNK8 = 64\n\tONE_SCREEN_THUMBNAIL = 128\n\tENTIRE_THUMBNAIL = 256\n\tALL = 511\n\n\nclass EventCourseOption:\n\tUNK3 = 1\n\tGET_INFO = 2\n\tBEST_TIME = 8\n\tONE_SCREEN_THUMBNAIL = 16\n\tENTIRE_THUMBNAIL = 32\n\tUNK1 = 64\n\tMEDAL_TIME = 256\n\tGHOST = 512\n\tALL = 1023\n\n\nclass UserOption:\n\tPLAY_STATS = 1\n\tMAKER_STATS = 2\n\tUNK2 = 4\n\tENDLESS_MODE = 8\n\tMULTIPLAYER_STATS = 16\n\tBADGE_INFO = 32\n\tUNK8 = 64\n\tUNK9 = 128\n\tUNK1 = 512\n\tUNK7 = 1024\n\tUNK11 = 4096\n\tUNK13 = 8192\n\tUNK15 = 32768\n\tALL = 65535\n\n\nclass DataStoreChangeMetaCompareParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.comparison_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['comparison_flag', 'name', 'period', 'meta_binary', 'tags', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.comparison_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.comparison_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\n\nclass DataStoreChangeMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\tself.referred_count = None\n\t\tself.data_type = None\n\t\tself.status = None\n\t\tself.compare_param = DataStoreChangeMetaCompareParam()\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password', 'referred_count', 'data_type', 'status']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\tself.referred_count = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.compare_param = stream.extract(DataStoreChangeMetaCompareParam)\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u16(self.data_type)\n\t\tstream.u8(self.status)\n\t\tstream.add(self.compare_param)\n\t\tstream.add(self.persistence_target)\n\n\nclass DataStoreChangeMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.modifies_flag = None\n\t\tself.name = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.period = None\n\t\tself.meta_binary = None\n\t\tself.tags = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'modifies_flag', 'name', 'period', 'meta_binary', 'tags', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.modifies_flag = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.period = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.modifies_flag)\n\t\tstream.string(self.name)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u16(self.period)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreCompletePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompletePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreCompleteUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.version = None\n\t\tself.success = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'version', 'success']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.version = stream.u32()\n\t\tself.success = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.version)\n\t\tstream.bool(self.success)\n\n\nclass DataStoreDeleteParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStoreGetMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.result_option = 0\n\t\tself.access_password = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.result_option = stream.u8()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u8(self.result_option)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreGetNewArrivedNotificationsParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.last_notification_id = None\n\t\tself.limit = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['last_notification_id', 'limit']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.last_notification_id = stream.u64()\n\t\tself.limit = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.last_notification_id)\n\t\tstream.u16(self.limit)\n\n\nclass DataStoreGetNotificationUrlParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.previous_url = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['previous_url']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.previous_url = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.previous_url)\n\n\nclass DataStoreGetSpecificMetaParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u64)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u64)\n\n\nclass DataStoreGetSpecificMetaParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u32)\n\n\nclass DataStoreKeyValue(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.string()\n\t\tself.value = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.key)\n\t\tstream.string(self.value)\n\n\nclass DataStoreMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.create_time = None\n\t\tself.update_time = None\n\t\tself.period = None\n\t\tself.status = None\n\t\tself.referred_count = None\n\t\tself.refer_data_id = None\n\t\tself.flag = None\n\t\tself.referred_time = None\n\t\tself.expire_time = None\n\t\tself.tags = None\n\t\tself.ratings = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'name', 'data_type', 'meta_binary', 'create_time', 'update_time', 'period', 'status', 'referred_count', 'refer_data_id', 'flag', 'referred_time', 'expire_time', 'tags', 'ratings']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.create_time = stream.datetime()\n\t\tself.update_time = stream.datetime()\n\t\tself.period = stream.u16()\n\t\tself.status = stream.u8()\n\t\tself.referred_count = stream.u32()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.flag = stream.u32()\n\t\tself.referred_time = stream.datetime()\n\t\tself.expire_time = stream.datetime()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.ratings = stream.list(DataStoreRatingInfoWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.datetime(self.create_time)\n\t\tstream.datetime(self.update_time)\n\t\tstream.u16(self.period)\n\t\tstream.u8(self.status)\n\t\tstream.u32(self.referred_count)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.u32(self.flag)\n\t\tstream.datetime(self.referred_time)\n\t\tstream.datetime(self.expire_time)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.ratings, stream.add)\n\n\nclass DataStoreNotification(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStoreNotificationV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.notification_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['notification_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.notification_id = stream.u64()\n\t\tself.data_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.notification_id)\n\t\tstream.u32(self.data_id)\n\n\nclass DataStorePasswordInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.access_password = None\n\t\tself.update_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'access_password', 'update_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.access_password = stream.u64()\n\t\tself.update_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u64(self.access_password)\n\t\tstream.u64(self.update_password)\n\n\nclass DataStorePermission(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.permission = 3\n\t\tself.recipients = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.permission = stream.u8()\n\t\tself.recipients = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.permission)\n\t\tstream.list(self.recipients, stream.pid)\n\n\nclass DataStorePersistenceInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.slot_id = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'slot_id', 'data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.slot_id = stream.u16()\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.slot_id)\n\t\tstream.u64(self.data_id)\n\n\nclass DataStorePersistenceInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.persistence_id = 65535\n\t\tself.delete_last_object = True\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.persistence_id = stream.u16()\n\t\tself.delete_last_object = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u16(self.persistence_id)\n\t\tstream.bool(self.delete_last_object)\n\n\nclass DataStorePersistenceTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = 0\n\t\tself.persistence_id = 65535\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.persistence_id = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.persistence_id)\n\n\nclass DataStorePrepareGetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = 0\n\t\tself.lock_id = 0\n\t\tself.persistence_target = DataStorePersistenceTarget()\n\t\tself.access_password = 0\n\t\tself.extra_data = []\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.persistence_target = stream.extract(DataStorePersistenceTarget)\n\t\tself.access_password = stream.u64()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.add(self.persistence_target)\n\t\tstream.u64(self.access_password)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePrepareGetParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.lock_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.u32(self.lock_id)\n\n\nclass DataStorePreparePostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = None\n\t\tself.meta_binary = None\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.rating_init_param = []\n\t\tself.persistence_init_param = DataStorePersistenceInitParam()\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'data_type', 'meta_binary', 'flag', 'period']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['extra_data']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\tself.persistence_init_param = stream.extract(DataStorePersistenceInitParam)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\t\tstream.add(self.persistence_init_param)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStorePreparePostParamV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.size = None\n\t\tself.name = None\n\t\tself.data_type = 0\n\t\tself.meta_binary = b\"\"\n\t\tself.permission = DataStorePermission()\n\t\tself.delete_permission = DataStorePermission()\n\t\tself.flag = None\n\t\tself.period = None\n\t\tself.refer_data_id = 0\n\t\tself.tags = None\n\t\tself.rating_init_param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['size', 'name', 'flag', 'period', 'tags', 'rating_init_param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.size = stream.u32()\n\t\tself.name = stream.string()\n\t\tself.data_type = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\tself.permission = stream.extract(DataStorePermission)\n\t\tself.delete_permission = stream.extract(DataStorePermission)\n\t\tself.flag = stream.u32()\n\t\tself.period = stream.u16()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.rating_init_param = stream.list(DataStoreRatingInitParamWithSlot)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.size)\n\t\tstream.string(self.name)\n\t\tstream.u16(self.data_type)\n\t\tstream.qbuffer(self.meta_binary)\n\t\tstream.add(self.permission)\n\t\tstream.add(self.delete_permission)\n\t\tstream.u32(self.flag)\n\t\tstream.u16(self.period)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.list(self.rating_init_param, stream.add)\n\n\nclass DataStorePrepareUpdateParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.size = None\n\t\tself.update_password = None\n\t\tself.extra_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'size', 'update_password', 'extra_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.size = stream.u32()\n\t\tself.update_password = stream.u64()\n\t\tself.extra_data = stream.list(stream.string)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.size)\n\t\tstream.u64(self.update_password)\n\t\tstream.list(self.extra_data, stream.string)\n\n\nclass DataStoreRateObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rating_value = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rating_value', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rating_value = stream.s32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s32(self.rating_value)\n\t\tstream.u64(self.access_password)\n\n\nclass DataStoreRatingInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_value = None\n\t\tself.count = None\n\t\tself.initial_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_value', 'count', 'initial_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_value = stream.s64()\n\t\tself.count = stream.u32()\n\t\tself.initial_value = stream.s64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s64(self.total_value)\n\t\tstream.u32(self.count)\n\t\tstream.s64(self.initial_value)\n\n\nclass DataStoreRatingInfoWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.info = DataStoreRatingInfo()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.u8()\n\t\tself.info = stream.extract(DataStoreRatingInfo)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.slot)\n\t\tstream.add(self.info)\n\n\nclass DataStoreRatingInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flag = None\n\t\tself.internal_flag = None\n\t\tself.lock_type = None\n\t\tself.initial_value = None\n\t\tself.range_min = None\n\t\tself.range_max = None\n\t\tself.period_hour = None\n\t\tself.period_duration = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flag', 'internal_flag', 'lock_type', 'initial_value', 'range_min', 'range_max', 'period_hour', 'period_duration']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flag = stream.u8()\n\t\tself.internal_flag = stream.u8()\n\t\tself.lock_type = stream.u8()\n\t\tself.initial_value = stream.s64()\n\t\tself.range_min = stream.s32()\n\t\tself.range_max = stream.s32()\n\t\tself.period_hour = stream.s8()\n\t\tself.period_duration = stream.s16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flag)\n\t\tstream.u8(self.internal_flag)\n\t\tstream.u8(self.lock_type)\n\t\tstream.s64(self.initial_value)\n\t\tstream.s32(self.range_min)\n\t\tstream.s32(self.range_max)\n\t\tstream.s8(self.period_hour)\n\t\tstream.s16(self.period_duration)\n\n\nclass DataStoreRatingInitParamWithSlot(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.slot = None\n\t\tself.param = DataStoreRatingInitParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.slot = stream.s8()\n\t\tself.param = stream.extract(DataStoreRatingInitParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.s8(self.slot)\n\t\tstream.add(self.param)\n\n\nclass DataStoreRatingLog(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.is_rated = None\n\t\tself.pid = None\n\t\tself.rating_value = None\n\t\tself.lock_expiration_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['is_rated', 'pid', 'rating_value', 'lock_expiration_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.is_rated = stream.bool()\n\t\tself.pid = stream.pid()\n\t\tself.rating_value = stream.s32()\n\t\tself.lock_expiration_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.bool(self.is_rated)\n\t\tstream.pid(self.pid)\n\t\tstream.s32(self.rating_value)\n\t\tstream.datetime(self.lock_expiration_time)\n\n\nclass DataStoreRatingTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.slot = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'slot']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.slot = stream.s8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.s8(self.slot)\n\n\nclass DataStoreReqGetAdditionalMeta(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.owner_id = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\tself.meta_binary = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['owner_id', 'data_type', 'version', 'meta_binary']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.owner_id = stream.pid()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\tself.meta_binary = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\t\tstream.qbuffer(self.meta_binary)\n\n\nclass DataStoreReqGetInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tfor field in ['data_id']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u64(self.data_id)\n\n\nclass DataStoreReqGetInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.size = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'size', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.size = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqGetNotificationUrlInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.key = None\n\t\tself.query = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'key', 'query', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.key = stream.string()\n\t\tself.query = stream.string()\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.string(self.key)\n\t\tstream.string(self.query)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqPostInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreReqUpdateInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.version = None\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.form = None\n\t\tself.root_ca_cert = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['version', 'url', 'headers', 'form', 'root_ca_cert']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.version = stream.u32()\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.form = stream.list(DataStoreKeyValue)\n\t\tself.root_ca_cert = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.list(self.form, stream.add)\n\t\tstream.buffer(self.root_ca_cert)\n\n\nclass DataStoreSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.search_target = 1\n\t\tself.owner_ids = []\n\t\tself.owner_type = 0\n\t\tself.destination_ids = []\n\t\tself.data_type = 65535\n\t\tself.created_after = common.DateTime(671076024059)\n\t\tself.created_before = common.DateTime(671076024059)\n\t\tself.updated_after = common.DateTime(671076024059)\n\t\tself.updated_before = common.DateTime(671076024059)\n\t\tself.refer_data_id = 0\n\t\tself.tags = []\n\t\tself.result_order_column = 0\n\t\tself.result_order = 0\n\t\tself.result_range = common.ResultRange()\n\t\tself.result_option = 0\n\t\tself.minimal_rating_frequency = 0\n\t\tself.use_cache = False\n\t\tself.total_count_enabled = True\n\t\tself.data_types = []\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.search_target = stream.u8()\n\t\tself.owner_ids = stream.list(stream.pid)\n\t\tself.owner_type = stream.u8()\n\t\tself.destination_ids = stream.list(stream.u64)\n\t\tself.data_type = stream.u16()\n\t\tself.created_after = stream.datetime()\n\t\tself.created_before = stream.datetime()\n\t\tself.updated_after = stream.datetime()\n\t\tself.updated_before = stream.datetime()\n\t\tself.refer_data_id = stream.u32()\n\t\tself.tags = stream.list(stream.string)\n\t\tself.result_order_column = stream.u8()\n\t\tself.result_order = stream.u8()\n\t\tself.result_range = stream.extract(common.ResultRange)\n\t\tself.result_option = stream.u8()\n\t\tself.minimal_rating_frequency = stream.u32()\n\t\tself.use_cache = stream.bool()\n\t\tself.total_count_enabled = stream.bool()\n\t\tself.data_types = stream.list(stream.u16)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.search_target)\n\t\tstream.list(self.owner_ids, stream.pid)\n\t\tstream.u8(self.owner_type)\n\t\tstream.list(self.destination_ids, stream.u64)\n\t\tstream.u16(self.data_type)\n\t\tstream.datetime(self.created_after)\n\t\tstream.datetime(self.created_before)\n\t\tstream.datetime(self.updated_after)\n\t\tstream.datetime(self.updated_before)\n\t\tstream.u32(self.refer_data_id)\n\t\tstream.list(self.tags, stream.string)\n\t\tstream.u8(self.result_order_column)\n\t\tstream.u8(self.result_order)\n\t\tstream.add(self.result_range)\n\t\tstream.u8(self.result_option)\n\t\tstream.u32(self.minimal_rating_frequency)\n\t\tstream.bool(self.use_cache)\n\t\tstream.bool(self.total_count_enabled)\n\t\tstream.list(self.data_types, stream.u16)\n\n\nclass DataStoreSearchResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.total_count = None\n\t\tself.result = None\n\t\tself.total_count_type = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['total_count', 'result', 'total_count_type']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.total_count = stream.u32()\n\t\tself.result = stream.list(DataStoreMetaInfo)\n\t\tself.total_count_type = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.total_count)\n\t\tstream.list(self.result, stream.add)\n\t\tstream.u8(self.total_count_type)\n\n\nclass DataStoreSpecificMetaInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u32(self.version)\n\n\nclass DataStoreSpecificMetaInfoV1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.owner_id = None\n\t\tself.size = None\n\t\tself.data_type = None\n\t\tself.version = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'owner_id', 'size', 'data_type', 'version']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u32()\n\t\tself.owner_id = stream.pid()\n\t\tself.size = stream.u32()\n\t\tself.data_type = stream.u16()\n\t\tself.version = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.data_id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.u32(self.size)\n\t\tstream.u16(self.data_type)\n\t\tstream.u16(self.version)\n\n\nclass DataStoreTouchObjectParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.lock_id = None\n\t\tself.access_password = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'lock_id', 'access_password']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.lock_id = stream.u32()\n\t\tself.access_password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.lock_id)\n\t\tstream.u64(self.access_password)\n\n\nclass GetCoursesParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_ids = None\n\t\tself.option = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_ids = stream.list(stream.u64)\n\t\tself.option = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data_ids, stream.u64)\n\t\tstream.u32(self.option)\n\n\nclass GetCoursesEventParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tpass\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\n\nclass SearchCommentsInOrderParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.add(self.range)\n\n\nclass GetEventCourseGhostParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.time = None\n\t\tself.count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'time', 'count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.time = stream.u32()\n\t\tself.count = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.time)\n\t\tstream.u8(self.count)\n\n\nclass GetEventCourseHistogramParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\n\nclass GetUserOrCourseParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.code = None\n\t\tself.user_option = 0\n\t\tself.course_option = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['code']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.code = stream.string()\n\t\tself.user_option = stream.u32()\n\t\tself.course_option = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.code)\n\t\tstream.u32(self.user_option)\n\t\tstream.u32(self.course_option)\n\n\nclass GetUsersParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pids = None\n\t\tself.option = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.option = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u32(self.option)\n\n\nclass RegisterUserParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\tself.unk1 = UnknownStruct1()\n\t\tself.unk2 = None\n\t\tself.language = None\n\t\tself.country = None\n\t\tself.device_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name', 'unk2', 'language', 'country', 'device_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\tself.unk1 = stream.extract(UnknownStruct1)\n\t\tself.unk2 = stream.qbuffer()\n\t\tself.language = stream.u8()\n\t\tself.country = stream.string()\n\t\tself.device_id = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\t\tstream.add(self.unk1)\n\t\tstream.qbuffer(self.unk2)\n\t\tstream.u8(self.language)\n\t\tstream.string(self.country)\n\t\tstream.string(self.device_id)\n\n\nclass SearchCoursesPostedByParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.range = common.ResultRange()\n\t\tself.pids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\tself.pids = stream.list(stream.u64)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.add(self.range)\n\t\tstream.list(self.pids, stream.u64)\n\n\nclass SearchCoursesPositiveRatedByParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.count = None\n\t\tself.pid = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['count', 'pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.count = stream.u32()\n\t\tself.pid = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.u32(self.count)\n\t\tstream.u64(self.pid)\n\n\nclass SearchCoursesPlayedByParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.count = None\n\t\tself.pid = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['count', 'pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.count = stream.u32()\n\t\tself.pid = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.u32(self.count)\n\t\tstream.u64(self.pid)\n\n\nclass SearchCoursesEndlessModeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.count = None\n\t\tself.difficulty = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['count', 'difficulty']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.count = stream.u32()\n\t\tself.difficulty = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.u32(self.count)\n\t\tstream.u8(self.difficulty)\n\n\nclass SearchCoursesFirstClearParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.option = 0\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.u64()\n\t\tself.option = stream.u32()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.pid)\n\t\tstream.u32(self.option)\n\t\tstream.add(self.range)\n\n\nclass SearchCoursesBestTimeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.option = 0\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.u64()\n\t\tself.option = stream.u32()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.pid)\n\t\tstream.u32(self.option)\n\t\tstream.add(self.range)\n\n\nclass SearchCoursesEventParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\n\nclass SearchCoursesLatestParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.add(self.range)\n\n\nclass SearchUsersPlayedCourseParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.option = 0\n\t\tself.count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.option = stream.u32()\n\t\tself.count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.option)\n\t\tstream.u32(self.count)\n\n\nclass SearchUsersClearedCourseParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.option = 0\n\t\tself.count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.option = stream.u32()\n\t\tself.count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.option)\n\t\tstream.u32(self.count)\n\n\nclass SearchUsersPositiveRatedCourseParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.option = 0\n\t\tself.count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.option = stream.u32()\n\t\tself.count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.option)\n\t\tstream.u32(self.count)\n\n\nclass SearchCoursesPointRankingParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.range = common.ResultRange()\n\t\tself.difficulty = None\n\t\tself.reject_regions = []\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['difficulty']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\tself.difficulty = stream.u8()\n\t\tself.reject_regions = stream.list(stream.u8)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.add(self.range)\n\t\tstream.u8(self.difficulty)\n\t\tstream.list(self.reject_regions, stream.u8)\n\n\nclass SearchUsersUserPointParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.option = 0\n\t\tself.buffer = None\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['buffer']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.option = stream.u32()\n\t\tself.buffer = stream.buffer()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.option)\n\t\tstream.buffer(self.buffer)\n\t\tstream.add(self.range)\n\n\nclass SyncUserProfileParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.username = None\n\t\tself.unk1 = UnknownStruct1()\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.country = None\n\t\tself.unk4 = None\n\t\tself.unk5 = None\n\t\tself.unk_guid = None\n\t\tself.unk6 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['username', 'unk2', 'unk3', 'country', 'unk4', 'unk5', 'unk_guid', 'unk6']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.username = stream.string()\n\t\tself.unk1 = stream.extract(UnknownStruct1)\n\t\tself.unk2 = stream.qbuffer()\n\t\tself.unk3 = stream.u8()\n\t\tself.country = stream.string()\n\t\tself.unk4 = stream.bool()\n\t\tself.unk5 = stream.bool()\n\t\tself.unk_guid = stream.string()\n\t\tself.unk6 = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.username)\n\t\tstream.add(self.unk1)\n\t\tstream.qbuffer(self.unk2)\n\t\tstream.u8(self.unk3)\n\t\tstream.string(self.country)\n\t\tstream.bool(self.unk4)\n\t\tstream.bool(self.unk5)\n\t\tstream.string(self.unk_guid)\n\t\tstream.u32(self.unk6)\n\n\nclass GetWorldMapParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.ids = None\n\t\tself.option = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['ids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.ids = stream.list(stream.string)\n\t\tself.option = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.ids, stream.string)\n\t\tstream.u32(self.option)\n\n\nclass SearchWorldMapPickUpParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.count)\n\n\nclass SearchWorldMapPlayedByParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u32()\n\t\tself.unk2 = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.unk1)\n\t\tstream.u32(self.unk2)\n\n\nclass BadgeInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u16()\n\t\tself.unk2 = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u16(self.unk1)\n\t\tstream.u8(self.unk2)\n\n\nclass CommentInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.unk4 = None\n\t\tself.unk5 = None\n\t\tself.unk6 = None\n\t\tself.unk7 = None\n\t\tself.unk8 = None\n\t\tself.unk9 = None\n\t\tself.unk10 = None\n\t\tself.unk11 = None\n\t\tself.unk12 = None\n\t\tself.unk13 = None\n\t\tself.unk14 = None\n\t\tself.unk15 = None\n\t\tself.picture = CommentPictureReqGetInfoWithoutHeaders()\n\t\tself.unk16 = None\n\t\tself.unk17 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'unk3', 'unk4', 'unk5', 'unk6', 'unk7', 'unk8', 'unk9', 'unk10', 'unk11', 'unk12', 'unk13', 'unk14', 'unk15', 'unk16', 'unk17']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u64()\n\t\tself.unk2 = stream.string()\n\t\tself.unk3 = stream.u8()\n\t\tself.unk4 = stream.u8()\n\t\tself.unk5 = stream.u64()\n\t\tself.unk6 = stream.u16()\n\t\tself.unk7 = stream.u16()\n\t\tself.unk8 = stream.u8()\n\t\tself.unk9 = stream.u8()\n\t\tself.unk10 = stream.u16()\n\t\tself.unk11 = stream.bool()\n\t\tself.unk12 = stream.bool()\n\t\tself.unk13 = stream.datetime()\n\t\tself.unk14 = stream.qbuffer()\n\t\tself.unk15 = stream.string()\n\t\tself.picture = stream.extract(CommentPictureReqGetInfoWithoutHeaders)\n\t\tself.unk16 = stream.u16()\n\t\tself.unk17 = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unk1)\n\t\tstream.string(self.unk2)\n\t\tstream.u8(self.unk3)\n\t\tstream.u8(self.unk4)\n\t\tstream.u64(self.unk5)\n\t\tstream.u16(self.unk6)\n\t\tstream.u16(self.unk7)\n\t\tstream.u8(self.unk8)\n\t\tstream.u8(self.unk9)\n\t\tstream.u16(self.unk10)\n\t\tstream.bool(self.unk11)\n\t\tstream.bool(self.unk12)\n\t\tstream.datetime(self.unk13)\n\t\tstream.qbuffer(self.unk14)\n\t\tstream.string(self.unk15)\n\t\tstream.add(self.picture)\n\t\tstream.u16(self.unk16)\n\t\tstream.u8(self.unk17)\n\n\nclass DeathPositionInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.x = None\n\t\tself.y = None\n\t\tself.is_subworld = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'x', 'y', 'is_subworld']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.x = stream.u16()\n\t\tself.y = stream.u16()\n\t\tself.is_subworld = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u16(self.x)\n\t\tstream.u16(self.y)\n\t\tstream.bool(self.is_subworld)\n\n\nclass CommentPictureReqGetInfoWithoutHeaders(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.data_type = None\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.filename = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'data_type', 'unk1', 'unk2', 'filename']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.data_type = stream.u8()\n\t\tself.unk1 = stream.u32()\n\t\tself.unk2 = stream.buffer()\n\t\tself.filename = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.u8(self.data_type)\n\t\tstream.u32(self.unk1)\n\t\tstream.buffer(self.unk2)\n\t\tstream.string(self.filename)\n\n\nclass CourseInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.code = None\n\t\tself.owner_id = None\n\t\tself.name = None\n\t\tself.description = None\n\t\tself.game_style = None\n\t\tself.course_theme = None\n\t\tself.upload_time = None\n\t\tself.difficulty = None\n\t\tself.tag1 = None\n\t\tself.tag2 = None\n\t\tself.unk1 = None\n\t\tself.clear_condition = None\n\t\tself.clear_condition_magnitude = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.play_stats = None\n\t\tself.ratings = None\n\t\tself.unk4 = None\n\t\tself.time_stats = CourseTimeStats()\n\t\tself.comment_stats = None\n\t\tself.unk9 = None\n\t\tself.unk10 = None\n\t\tself.unk11 = None\n\t\tself.unk12 = None\n\t\tself.one_screen_thumbnail = RelationObjectReqGetInfo()\n\t\tself.entire_thumbnail = RelationObjectReqGetInfo()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'code', 'owner_id', 'name', 'description', 'game_style', 'course_theme', 'upload_time', 'difficulty', 'tag1', 'tag2', 'unk1', 'clear_condition', 'clear_condition_magnitude', 'unk2', 'unk3', 'play_stats', 'ratings', 'unk4', 'comment_stats', 'unk9', 'unk10', 'unk11', 'unk12']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.code = stream.string()\n\t\tself.owner_id = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.description = stream.string()\n\t\tself.game_style = stream.u8()\n\t\tself.course_theme = stream.u8()\n\t\tself.upload_time = stream.datetime()\n\t\tself.difficulty = stream.u8()\n\t\tself.tag1 = stream.u8()\n\t\tself.tag2 = stream.u8()\n\t\tself.unk1 = stream.u8()\n\t\tself.clear_condition = stream.u32()\n\t\tself.clear_condition_magnitude = stream.u16()\n\t\tself.unk2 = stream.u16()\n\t\tself.unk3 = stream.qbuffer()\n\t\tself.play_stats = stream.map(stream.u8, stream.u32)\n\t\tself.ratings = stream.map(stream.u8, stream.u32)\n\t\tself.unk4 = stream.map(stream.u8, stream.u32)\n\t\tself.time_stats = stream.extract(CourseTimeStats)\n\t\tself.comment_stats = stream.map(stream.u8, stream.u32)\n\t\tself.unk9 = stream.u8()\n\t\tself.unk10 = stream.u8()\n\t\tself.unk11 = stream.u8()\n\t\tself.unk12 = stream.u8()\n\t\tself.one_screen_thumbnail = stream.extract(RelationObjectReqGetInfo)\n\t\tself.entire_thumbnail = stream.extract(RelationObjectReqGetInfo)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.string(self.code)\n\t\tstream.pid(self.owner_id)\n\t\tstream.string(self.name)\n\t\tstream.string(self.description)\n\t\tstream.u8(self.game_style)\n\t\tstream.u8(self.course_theme)\n\t\tstream.datetime(self.upload_time)\n\t\tstream.u8(self.difficulty)\n\t\tstream.u8(self.tag1)\n\t\tstream.u8(self.tag2)\n\t\tstream.u8(self.unk1)\n\t\tstream.u32(self.clear_condition)\n\t\tstream.u16(self.clear_condition_magnitude)\n\t\tstream.u16(self.unk2)\n\t\tstream.qbuffer(self.unk3)\n\t\tstream.map(self.play_stats, stream.u8, stream.u32)\n\t\tstream.map(self.ratings, stream.u8, stream.u32)\n\t\tstream.map(self.unk4, stream.u8, stream.u32)\n\t\tstream.add(self.time_stats)\n\t\tstream.map(self.comment_stats, stream.u8, stream.u32)\n\t\tstream.u8(self.unk9)\n\t\tstream.u8(self.unk10)\n\t\tstream.u8(self.unk11)\n\t\tstream.u8(self.unk12)\n\t\tstream.add(self.one_screen_thumbnail)\n\t\tstream.add(self.entire_thumbnail)\n\n\nclass WorldMapInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.owner_id = None\n\t\tself.unk1 = None\n\t\tself.thumbnail = RelationObjectReqGetInfo()\n\t\tself.worlds = None\n\t\tself.levels = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.data_ids = None\n\t\tself.unk4 = None\n\t\tself.unk5 = None\n\t\tself.unk6 = None\n\t\tself.unk7 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'owner_id', 'unk1', 'worlds', 'levels', 'unk2', 'unk3', 'data_ids', 'unk4', 'unk5', 'unk6', 'unk7']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.string()\n\t\tself.owner_id = stream.pid()\n\t\tself.unk1 = stream.qbuffer()\n\t\tself.thumbnail = stream.extract(RelationObjectReqGetInfo)\n\t\tself.worlds = stream.u8()\n\t\tself.levels = stream.u8()\n\t\tself.unk2 = stream.u8()\n\t\tself.unk3 = stream.datetime()\n\t\tself.data_ids = stream.list(stream.u64)\n\t\tself.unk4 = stream.map(stream.u8, stream.u32)\n\t\tself.unk5 = stream.u32()\n\t\tself.unk6 = stream.u8()\n\t\tself.unk7 = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.id)\n\t\tstream.pid(self.owner_id)\n\t\tstream.qbuffer(self.unk1)\n\t\tstream.add(self.thumbnail)\n\t\tstream.u8(self.worlds)\n\t\tstream.u8(self.levels)\n\t\tstream.u8(self.unk2)\n\t\tstream.datetime(self.unk3)\n\t\tstream.list(self.data_ids, stream.u64)\n\t\tstream.map(self.unk4, stream.u8, stream.u32)\n\t\tstream.u32(self.unk5)\n\t\tstream.u8(self.unk6)\n\t\tstream.u8(self.unk7)\n\n\nclass CourseTimeStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.first_completion = None\n\t\tself.world_record_holder = None\n\t\tself.world_record = None\n\t\tself.upload_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['first_completion', 'world_record_holder', 'world_record', 'upload_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.first_completion = stream.pid()\n\t\tself.world_record_holder = stream.pid()\n\t\tself.world_record = stream.u32()\n\t\tself.upload_time = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.first_completion)\n\t\tstream.pid(self.world_record_holder)\n\t\tstream.u32(self.world_record)\n\t\tstream.u32(self.upload_time)\n\n\nclass EventCourseGhostInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.replay_file = RelationObjectReqGetInfo()\n\t\tself.time = None\n\t\tself.pid = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['time', 'pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.replay_file = stream.extract(RelationObjectReqGetInfo)\n\t\tself.time = stream.u32()\n\t\tself.pid = stream.pid()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.replay_file)\n\t\tstream.u32(self.time)\n\t\tstream.pid(self.pid)\n\n\nclass EventCourseHistogram(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.values = None\n\t\tself.medals = None\n\t\tself.unk4 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'unk1', 'unk2', 'unk3', 'values', 'medals', 'unk4']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.unk1 = stream.u32()\n\t\tself.unk2 = stream.u32()\n\t\tself.unk3 = stream.u32()\n\t\tself.values = stream.list(stream.u32)\n\t\tself.medals = stream.map(stream.u8, stream.u32)\n\t\tself.unk4 = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.u32(self.unk1)\n\t\tstream.u32(self.unk2)\n\t\tstream.u32(self.unk3)\n\t\tstream.list(self.values, stream.u32)\n\t\tstream.map(self.medals, stream.u8, stream.u32)\n\t\tstream.u32(self.unk4)\n\n\nclass EventCourseInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data_id = None\n\t\tself.name = None\n\t\tself.description = None\n\t\tself.game_style = None\n\t\tself.course_theme = None\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.upload_time = None\n\t\tself.get_info = DataStoreReqGetInfo()\n\t\tself.unk3 = None\n\t\tself.unk4 = UnknownStruct6()\n\t\tself.unk5 = None\n\t\tself.one_screen_thumbnail = EventCourseThumbnail()\n\t\tself.entire_thumbnail = EventCourseThumbnail()\n\t\tself.end_time = None\n\t\tself.unk6 = None\n\t\tself.unk7 = None\n\t\tself.unk8 = None\n\t\tself.unk9 = None\n\t\tself.best_time = None\n\t\tself.unk10 = None\n\t\tself.medal_time = None\n\t\tself.personal_ghost = RelationObjectReqGetInfo()\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tversion = 1\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data_id', 'name', 'description', 'game_style', 'course_theme', 'unk1', 'unk2', 'upload_time', 'unk3', 'unk5']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif version >= 1:\n\t\t\tfor field in ['end_time', 'unk6', 'unk7', 'unk8', 'unk9', 'best_time', 'unk10', 'medal_time']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data_id = stream.u64()\n\t\tself.name = stream.string()\n\t\tself.description = stream.string()\n\t\tself.game_style = stream.u8()\n\t\tself.course_theme = stream.u8()\n\t\tself.unk1 = stream.bool()\n\t\tself.unk2 = stream.bool()\n\t\tself.upload_time = stream.datetime()\n\t\tself.get_info = stream.extract(DataStoreReqGetInfo)\n\t\tself.unk3 = stream.map(stream.u8, stream.u32)\n\t\tself.unk4 = stream.extract(UnknownStruct6)\n\t\tself.unk5 = stream.u8()\n\t\tself.one_screen_thumbnail = stream.extract(EventCourseThumbnail)\n\t\tself.entire_thumbnail = stream.extract(EventCourseThumbnail)\n\t\tif version >= 1:\n\t\t\tself.end_time = stream.datetime()\n\t\t\tself.unk6 = stream.u8()\n\t\t\tself.unk7 = stream.u32()\n\t\t\tself.unk8 = stream.u16()\n\t\t\tself.unk9 = stream.u16()\n\t\t\tself.best_time = stream.u32()\n\t\t\tself.unk10 = stream.u32()\n\t\t\tself.medal_time = stream.u32()\n\t\t\tself.personal_ghost = stream.extract(RelationObjectReqGetInfo)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.data_id)\n\t\tstream.string(self.name)\n\t\tstream.string(self.description)\n\t\tstream.u8(self.game_style)\n\t\tstream.u8(self.course_theme)\n\t\tstream.bool(self.unk1)\n\t\tstream.bool(self.unk2)\n\t\tstream.datetime(self.upload_time)\n\t\tstream.add(self.get_info)\n\t\tstream.map(self.unk3, stream.u8, stream.u32)\n\t\tstream.add(self.unk4)\n\t\tstream.u8(self.unk5)\n\t\tstream.add(self.one_screen_thumbnail)\n\t\tstream.add(self.entire_thumbnail)\n\t\tif version >= 1:\n\t\t\tstream.datetime(self.end_time)\n\t\t\tstream.u8(self.unk6)\n\t\t\tstream.u32(self.unk7)\n\t\t\tstream.u16(self.unk8)\n\t\t\tstream.u16(self.unk9)\n\t\t\tstream.u32(self.best_time)\n\t\t\tstream.u32(self.unk10)\n\t\t\tstream.u32(self.medal_time)\n\t\t\tstream.add(self.personal_ghost)\n\n\nclass EventCourseStatusInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'unk3']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u64()\n\t\tself.unk2 = stream.bool()\n\t\tself.unk3 = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unk1)\n\t\tstream.bool(self.unk2)\n\t\tstream.datetime(self.unk3)\n\n\nclass EventCourseThumbnail(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.headers = None\n\t\tself.filesize = None\n\t\tself.root_ca_cert = None\n\t\tself.filename = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'headers', 'filesize', 'root_ca_cert', 'filename']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.filesize = stream.u32()\n\t\tself.root_ca_cert = stream.buffer()\n\t\tself.filename = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.filesize)\n\t\tstream.buffer(self.root_ca_cert)\n\t\tstream.string(self.filename)\n\n\nclass RelationObjectReqGetInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.url = None\n\t\tself.data_type = None\n\t\tself.size = None\n\t\tself.unk = None\n\t\tself.filename = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['url', 'data_type', 'size', 'unk', 'filename']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.url = stream.string()\n\t\tself.data_type = stream.u8()\n\t\tself.size = stream.u32()\n\t\tself.unk = stream.buffer()\n\t\tself.filename = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.url)\n\t\tstream.u8(self.data_type)\n\t\tstream.u32(self.size)\n\t\tstream.buffer(self.unk)\n\t\tstream.string(self.filename)\n\n\nclass ReqGetInfoHeadersInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.headers = None\n\t\tself.expiration = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['headers', 'expiration']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.headers = stream.list(DataStoreKeyValue)\n\t\tself.expiration = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.headers, stream.add)\n\t\tstream.u32(self.expiration)\n\n\nclass SyncUserProfileResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.username = None\n\t\tself.unk1 = UnknownStruct1()\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.country = None\n\t\tself.unk4 = None\n\t\tself.unk5 = None\n\t\tself.unk6 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'username', 'unk2', 'unk3', 'country', 'unk4', 'unk5', 'unk6']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.u64()\n\t\tself.username = stream.string()\n\t\tself.unk1 = stream.extract(UnknownStruct1)\n\t\tself.unk2 = stream.qbuffer()\n\t\tself.unk3 = stream.u8()\n\t\tself.country = stream.string()\n\t\tself.unk4 = stream.u8()\n\t\tself.unk5 = stream.bool()\n\t\tself.unk6 = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.pid)\n\t\tstream.string(self.username)\n\t\tstream.add(self.unk1)\n\t\tstream.qbuffer(self.unk2)\n\t\tstream.u8(self.unk3)\n\t\tstream.string(self.country)\n\t\tstream.u8(self.unk4)\n\t\tstream.bool(self.unk5)\n\t\tstream.bool(self.unk6)\n\n\nclass UserInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.code = None\n\t\tself.name = None\n\t\tself.unk1 = UnknownStruct1()\n\t\tself.unk2 = None\n\t\tself.country = None\n\t\tself.region = None\n\t\tself.last_active = None\n\t\tself.unk3 = None\n\t\tself.unk4 = None\n\t\tself.unk5 = None\n\t\tself.play_stats = None\n\t\tself.maker_stats = None\n\t\tself.endless_challenge_high_scores = None\n\t\tself.multiplayer_stats = None\n\t\tself.unk7 = None\n\t\tself.badges = None\n\t\tself.unk8 = None\n\t\tself.unk9 = None\n\t\tself.unk10 = None\n\t\tself.unk11 = None\n\t\tself.unk12 = None\n\t\tself.unk13 = UnknownStruct3()\n\t\tself.unk14 = None\n\t\tself.unk15 = None\n\t\tself.unk16 = None\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tversion = 1\n\t\tversion = 2\n\t\tversion = 3\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'code', 'name', 'unk2', 'country', 'region', 'last_active', 'unk3', 'unk4', 'unk5', 'play_stats', 'maker_stats', 'endless_challenge_high_scores', 'multiplayer_stats', 'unk7', 'badges', 'unk8', 'unk9']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif version >= 1:\n\t\t\tfor field in ['unk10', 'unk11', 'unk12']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif version >= 2:\n\t\t\tpass\n\t\tif version >= 3:\n\t\t\tfor field in ['unk14', 'unk15', 'unk16']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.code = stream.string()\n\t\tself.name = stream.string()\n\t\tself.unk1 = stream.extract(UnknownStruct1)\n\t\tself.unk2 = stream.qbuffer()\n\t\tself.country = stream.string()\n\t\tself.region = stream.u8()\n\t\tself.last_active = stream.datetime()\n\t\tself.unk3 = stream.bool()\n\t\tself.unk4 = stream.bool()\n\t\tself.unk5 = stream.bool()\n\t\tself.play_stats = stream.map(stream.u8, stream.u32)\n\t\tself.maker_stats = stream.map(stream.u8, stream.u32)\n\t\tself.endless_challenge_high_scores = stream.map(stream.u8, stream.u32)\n\t\tself.multiplayer_stats = stream.map(stream.u8, stream.u32)\n\t\tself.unk7 = stream.map(stream.u8, stream.u32)\n\t\tself.badges = stream.list(BadgeInfo)\n\t\tself.unk8 = stream.map(stream.u8, stream.u32)\n\t\tself.unk9 = stream.map(stream.u8, stream.u32)\n\t\tif version >= 1:\n\t\t\tself.unk10 = stream.bool()\n\t\t\tself.unk11 = stream.datetime()\n\t\t\tself.unk12 = stream.bool()\n\t\tif version >= 2:\n\t\t\tself.unk13 = stream.extract(UnknownStruct3)\n\t\tif version >= 3:\n\t\t\tself.unk14 = stream.string()\n\t\t\tself.unk15 = stream.map(stream.u8, stream.u32)\n\t\t\tself.unk16 = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.code)\n\t\tstream.string(self.name)\n\t\tstream.add(self.unk1)\n\t\tstream.qbuffer(self.unk2)\n\t\tstream.string(self.country)\n\t\tstream.u8(self.region)\n\t\tstream.datetime(self.last_active)\n\t\tstream.bool(self.unk3)\n\t\tstream.bool(self.unk4)\n\t\tstream.bool(self.unk5)\n\t\tstream.map(self.play_stats, stream.u8, stream.u32)\n\t\tstream.map(self.maker_stats, stream.u8, stream.u32)\n\t\tstream.map(self.endless_challenge_high_scores, stream.u8, stream.u32)\n\t\tstream.map(self.multiplayer_stats, stream.u8, stream.u32)\n\t\tstream.map(self.unk7, stream.u8, stream.u32)\n\t\tstream.list(self.badges, stream.add)\n\t\tstream.map(self.unk8, stream.u8, stream.u32)\n\t\tstream.map(self.unk9, stream.u8, stream.u32)\n\t\tif version >= 1:\n\t\t\tstream.bool(self.unk10)\n\t\t\tstream.datetime(self.unk11)\n\t\t\tstream.bool(self.unk12)\n\t\tif version >= 2:\n\t\t\tstream.add(self.unk13)\n\t\tif version >= 3:\n\t\t\tstream.string(self.unk14)\n\t\t\tstream.map(self.unk15, stream.u8, stream.u32)\n\t\t\tstream.bool(self.unk16)\n\n\nclass UnknownStruct1(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.unk4 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'unk3', 'unk4']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u16()\n\t\tself.unk2 = stream.u16()\n\t\tself.unk3 = stream.u16()\n\t\tself.unk4 = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u16(self.unk1)\n\t\tstream.u16(self.unk2)\n\t\tstream.u16(self.unk3)\n\t\tstream.u16(self.unk4)\n\n\nclass UnknownStruct3(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.bool()\n\t\tself.unk2 = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.bool(self.unk1)\n\t\tstream.datetime(self.unk2)\n\n\nclass UnknownStruct6(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u64()\n\t\tself.unk2 = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unk1)\n\t\tstream.u32(self.unk2)\n\n\nclass DataStoreProtocolSMM2:\n\tMETHOD_PREPARE_GET_OBJECT_V1 = 1\n\tMETHOD_PREPARE_POST_OBJECT_V1 = 2\n\tMETHOD_COMPLETE_POST_OBJECT_V1 = 3\n\tMETHOD_DELETE_OBJECT = 4\n\tMETHOD_DELETE_OBJECTS = 5\n\tMETHOD_CHANGE_META_V1 = 6\n\tMETHOD_CHANGE_METAS_V1 = 7\n\tMETHOD_GET_META = 8\n\tMETHOD_GET_METAS = 9\n\tMETHOD_PREPARE_UPDATE_OBJECT = 10\n\tMETHOD_COMPLETE_UPDATE_OBJECT = 11\n\tMETHOD_SEARCH_OBJECT = 12\n\tMETHOD_GET_NOTIFICATION_URL = 13\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1 = 14\n\tMETHOD_RATE_OBJECT = 15\n\tMETHOD_GET_RATING = 16\n\tMETHOD_GET_RATINGS = 17\n\tMETHOD_RESET_RATING = 18\n\tMETHOD_RESET_RATINGS = 19\n\tMETHOD_GET_SPECIFIC_META_V1 = 20\n\tMETHOD_POST_META_BINARY = 21\n\tMETHOD_TOUCH_OBJECT = 22\n\tMETHOD_GET_RATING_WITH_LOG = 23\n\tMETHOD_PREPARE_POST_OBJECT = 24\n\tMETHOD_PREPARE_GET_OBJECT = 25\n\tMETHOD_COMPLETE_POST_OBJECT = 26\n\tMETHOD_GET_NEW_ARRIVED_NOTIFICATIONS = 27\n\tMETHOD_GET_SPECIFIC_META = 28\n\tMETHOD_GET_PERSISTENCE_INFO = 29\n\tMETHOD_GET_PERSISTENCE_INFOS = 30\n\tMETHOD_PERPETUATE_OBJECT = 31\n\tMETHOD_UNPERPETUATE_OBJECT = 32\n\tMETHOD_PREPARE_GET_OBJECT_OR_META_BINARY = 33\n\tMETHOD_GET_PASSWORD_INFO = 34\n\tMETHOD_GET_PASSWORD_INFOS = 35\n\tMETHOD_GET_METAS_MULTIPLE_PARAM = 36\n\tMETHOD_COMPLETE_POST_OBJECTS = 37\n\tMETHOD_CHANGE_META = 38\n\tMETHOD_CHANGE_METAS = 39\n\tMETHOD_RATE_OBJECTS = 40\n\tMETHOD_POST_META_BINARY_WITH_DATA_ID = 41\n\tMETHOD_POST_META_BINARIES_WITH_DATA_ID = 42\n\tMETHOD_RATE_OBJECT_WITH_POSTING = 43\n\tMETHOD_RATE_OBJECTS_WITH_POSTING = 44\n\tMETHOD_GET_OBJECT_INFOS = 45\n\tMETHOD_SEARCH_OBJECT_LIGHT = 46\n\tMETHOD_REGISTER_USER = 47\n\tMETHOD_GET_USERS = 48\n\tMETHOD_SYNC_USER_PROFILE = 49\n\tMETHOD_SEARCH_USERS_USER_POINT = 50\n\tMETHOD_SEARCH_USERS_PLAYED_COURSE = 53\n\tMETHOD_SEARCH_USERS_CLEARED_COURSE = 54\n\tMETHOD_SEARCH_USERS_POSITIVE_RATED_COURSE = 55\n\tMETHOD_UPDATE_LAST_LOGIN_TIME = 59\n\tMETHOD_GET_USERNAME_NG_TYPE = 65\n\tMETHOD_GET_COURSES = 70\n\tMETHOD_SEARCH_COURSES_POINT_RANKING = 71\n\tMETHOD_SEARCH_COURSES_LATEST = 73\n\tMETHOD_SEARCH_COURSES_POSTED_BY = 74\n\tMETHOD_SEARCH_COURSES_POSITIVE_RATED_BY = 75\n\tMETHOD_SEARCH_COURSES_PLAYED_BY = 76\n\tMETHOD_SEARCH_COURSES_ENDLESS_MODE = 79\n\tMETHOD_SEARCH_COURSES_FIRST_CLEAR = 80\n\tMETHOD_SEARCH_COURSES_BEST_TIME = 81\n\tMETHOD_GET_COURSES_EVENT = 85\n\tMETHOD_SEARCH_COURSES_EVENT = 86\n\tMETHOD_SEARCH_COMMENTS_IN_ORDER = 94\n\tMETHOD_SEARCH_COMMENTS = 95\n\tMETHOD_GET_DEATH_POSITIONS = 103\n\tMETHOD_GET_USER_OR_COURSE = 131\n\tMETHOD_GET_REQ_GET_INFO_HEADERS_INFO = 134\n\tMETHOD_GET_EVENT_COURSE_STAMP = 153\n\tMETHOD_GET_EVENT_COURSE_STATUS = 154\n\tMETHOD_GET_EVENT_COURSE_HISTOGRAM = 156\n\tMETHOD_GET_EVENT_COURSE_GHOST = 157\n\tMETHOD_GET_WORLD_MAP = 160\n\tMETHOD_SEARCH_WORLD_MAP_PICK_UP = 162\n\t\n\tPROTOCOL_ID = 0x73\n\n\nclass DataStoreClientSMM2(DataStoreProtocolSMM2):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def prepare_get_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_get_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def prepare_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_post_object_v1 -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.complete_post_object_v1 -> done\")\n\t\n\tasync def delete_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.delete_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.delete_object -> done\")\n\t\n\tasync def delete_objects(self, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM2.delete_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.delete_objects -> done\")\n\t\treturn results\n\t\n\tasync def change_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.change_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.change_meta_v1 -> done\")\n\t\n\tasync def change_metas_v1(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM2.change_metas_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.change_metas_v1 -> done\")\n\t\treturn results\n\t\n\tasync def get_meta(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_meta -> done\")\n\t\treturn info\n\t\n\tasync def get_metas(self, data_ids, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.info = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_metas -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_update_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqUpdateInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_update_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_update_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.complete_update_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_UPDATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.complete_update_object -> done\")\n\t\n\tasync def search_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_object -> done\")\n\t\treturn result\n\t\n\tasync def get_notification_url(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_notification_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOTIFICATION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetNotificationUrlInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_notification_url -> done\")\n\t\treturn info\n\t\n\tasync def get_new_arrived_notifications_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotificationV1)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_new_arrived_notifications_v1 -> done\")\n\t\treturn obj\n\t\n\tasync def rate_object(self, target, param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM2.rate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.rate_object -> done\")\n\t\treturn info\n\t\n\tasync def get_rating(self, target, access_password):\n\t\tlogger.info(\"DataStoreClientSMM2.get_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trating = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_rating -> done\")\n\t\treturn rating\n\t\n\tasync def get_ratings(self, data_ids, access_password):\n\t\tlogger.info(\"DataStoreClientSMM2.get_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(lambda: stream.list(DataStoreRatingInfoWithSlot))\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_ratings -> done\")\n\t\treturn obj\n\t\n\tasync def reset_rating(self, target, update_password):\n\t\tlogger.info(\"DataStoreClientSMM2.reset_rating()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(update_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.reset_rating -> done\")\n\t\n\tasync def reset_ratings(self, data_ids, transactional):\n\t\tlogger.info(\"DataStoreClientSMM2.reset_ratings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_RATINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.reset_ratings -> done\")\n\t\treturn results\n\t\n\tasync def get_specific_meta_v1(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfoV1)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_specific_meta_v1 -> done\")\n\t\treturn infos\n\t\n\tasync def post_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.post_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.post_meta_binary -> done\")\n\t\treturn data_id\n\t\n\tasync def touch_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.touch_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_TOUCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.touch_object -> done\")\n\t\n\tasync def get_rating_with_log(self, target, access_password):\n\t\tlogger.info(\"DataStoreClientSMM2.get_rating_with_log()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.u64(access_password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RATING_WITH_LOG, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.rating = stream.extract(DataStoreRatingInfo)\n\t\tobj.log = stream.extract(DataStoreRatingLog)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_rating_with_log -> done\")\n\t\treturn obj\n\t\n\tasync def prepare_post_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqPostInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_post_object -> done\")\n\t\treturn info\n\t\n\tasync def prepare_get_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_get_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreReqGetInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_get_object -> done\")\n\t\treturn info\n\t\n\tasync def complete_post_object(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.complete_post_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.complete_post_object -> done\")\n\t\n\tasync def get_new_arrived_notifications(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.list(DataStoreNotification)\n\t\tobj.has_next = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_new_arrived_notifications -> done\")\n\t\treturn obj\n\t\n\tasync def get_specific_meta(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_specific_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SPECIFIC_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(DataStoreSpecificMetaInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_specific_meta -> done\")\n\t\treturn infos\n\t\n\tasync def get_persistence_info(self, owner_id, slot_id):\n\t\tlogger.info(\"DataStoreClientSMM2.get_persistence_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.u16(slot_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePersistenceInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_persistence_info -> done\")\n\t\treturn info\n\t\n\tasync def get_persistence_infos(self, owner_id, slot_ids):\n\t\tlogger.info(\"DataStoreClientSMM2.get_persistence_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner_id)\n\t\tstream.list(slot_ids, stream.u16)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PERSISTENCE_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePersistenceInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_persistence_infos -> done\")\n\t\treturn obj\n\t\n\tasync def perpetuate_object(self, persistence_slot_id, data_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClientSMM2.perpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.u64(data_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.perpetuate_object -> done\")\n\t\n\tasync def unperpetuate_object(self, persistence_slot_id, delete_last_object):\n\t\tlogger.info(\"DataStoreClientSMM2.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u16(persistence_slot_id)\n\t\tstream.bool(delete_last_object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNPERPETUATE_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.unperpetuate_object -> done\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.get_info = stream.extract(DataStoreReqGetInfo)\n\t\tobj.additional_meta = stream.extract(DataStoreReqGetAdditionalMeta)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.prepare_get_object_or_meta_binary -> done\")\n\t\treturn obj\n\t\n\tasync def get_password_info(self, data_id):\n\t\tlogger.info(\"DataStoreClientSMM2.get_password_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStorePasswordInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_password_info -> done\")\n\t\treturn info\n\t\n\tasync def get_password_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClientSMM2.get_password_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PASSWORD_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStorePasswordInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_password_infos -> done\")\n\t\treturn obj\n\t\n\tasync def get_metas_multiple_param(self, params):\n\t\tlogger.info(\"DataStoreClientSMM2.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(params, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_METAS_MULTIPLE_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreMetaInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_metas_multiple_param -> done\")\n\t\treturn obj\n\t\n\tasync def complete_post_objects(self, data_ids):\n\t\tlogger.info(\"DataStoreClientSMM2.complete_post_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_COMPLETE_POST_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.complete_post_objects -> done\")\n\t\n\tasync def change_meta(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.change_meta()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_META, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.change_meta -> done\")\n\t\n\tasync def change_metas(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM2.change_metas()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_METAS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.change_metas -> done\")\n\t\treturn results\n\t\n\tasync def rate_objects(self, targets, param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM2.rate_objects()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.rate_objects -> done\")\n\t\treturn obj\n\t\n\tasync def post_meta_binary_with_data_id(self, data_id, param):\n\t\tlogger.info(\"DataStoreClientSMM2.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARY_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.post_meta_binary_with_data_id -> done\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, data_ids, param, transactional):\n\t\tlogger.info(\"DataStoreClientSMM2.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tstream.list(param, stream.add)\n\t\tstream.bool(transactional)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_POST_META_BINARIES_WITH_DATA_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.post_meta_binaries_with_data_id -> done\")\n\t\treturn results\n\t\n\tasync def rate_object_with_posting(self, target, rate_param, post_param, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM2.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tstream.add(rate_param)\n\t\tstream.add(post_param)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECT_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(DataStoreRatingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.rate_object_with_posting -> done\")\n\t\treturn info\n\t\n\tasync def rate_objects_with_posting(self, targets, rate_param, post_param, transactional, fetch_ratings):\n\t\tlogger.info(\"DataStoreClientSMM2.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tstream.list(rate_param, stream.add)\n\t\tstream.list(post_param, stream.add)\n\t\tstream.bool(transactional)\n\t\tstream.bool(fetch_ratings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RATE_OBJECTS_WITH_POSTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.ratings = stream.list(DataStoreRatingInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.rate_objects_with_posting -> done\")\n\t\treturn obj\n\t\n\tasync def get_object_infos(self, data_ids):\n\t\tlogger.info(\"DataStoreClientSMM2.get_object_infos()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(data_ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OBJECT_INFOS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.infos = stream.list(DataStoreReqGetInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_object_infos -> done\")\n\t\treturn obj\n\t\n\tasync def search_object_light(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_object_light()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_OBJECT_LIGHT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(DataStoreSearchResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_object_light -> done\")\n\t\treturn result\n\t\n\tasync def register_user(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.register_user()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_USER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.register_user -> done\")\n\t\n\tasync def get_users(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_users()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_USERS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.users = stream.list(UserInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_users -> done\")\n\t\treturn obj\n\t\n\tasync def sync_user_profile(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.sync_user_profile()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SYNC_USER_PROFILE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(SyncUserProfileResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.sync_user_profile -> done\")\n\t\treturn result\n\t\n\tasync def search_users_user_point(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_user_point()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_USERS_USER_POINT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.users = stream.list(UserInfo)\n\t\tobj.ranks = stream.list(stream.u32)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_user_point -> done\")\n\t\treturn obj\n\t\n\tasync def search_users_played_course(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_played_course()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_USERS_PLAYED_COURSE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tusers = stream.list(UserInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_played_course -> done\")\n\t\treturn users\n\t\n\tasync def search_users_cleared_course(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_cleared_course()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_USERS_CLEARED_COURSE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tusers = stream.list(UserInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_cleared_course -> done\")\n\t\treturn users\n\t\n\tasync def search_users_positive_rated_course(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_positive_rated_course()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_USERS_POSITIVE_RATED_COURSE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tusers = stream.list(UserInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_users_positive_rated_course -> done\")\n\t\treturn users\n\t\n\tasync def update_last_login_time(self):\n\t\tlogger.info(\"DataStoreClientSMM2.update_last_login_time()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_LAST_LOGIN_TIME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.update_last_login_time -> done\")\n\t\n\tasync def get_username_ng_type(self):\n\t\tlogger.info(\"DataStoreClientSMM2.get_username_ng_type()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_USERNAME_NG_TYPE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tunk = stream.u8()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_username_ng_type -> done\")\n\t\treturn unk\n\t\n\tasync def get_courses(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_courses()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COURSES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(CourseInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_courses -> done\")\n\t\treturn obj\n\t\n\tasync def search_courses_point_ranking(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_point_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_POINT_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(CourseInfo)\n\t\tobj.ranks = stream.list(stream.u32)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_point_ranking -> done\")\n\t\treturn obj\n\t\n\tasync def search_courses_latest(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_latest()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_LATEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(CourseInfo)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_latest -> done\")\n\t\treturn obj\n\t\n\tasync def search_courses_posted_by(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_posted_by()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_POSTED_BY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(CourseInfo)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_posted_by -> done\")\n\t\treturn obj\n\t\n\tasync def search_courses_positive_rated_by(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_positive_rated_by()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_POSITIVE_RATED_BY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcourses = stream.list(CourseInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_positive_rated_by -> done\")\n\t\treturn courses\n\t\n\tasync def search_courses_played_by(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_played_by()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_PLAYED_BY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcourses = stream.list(CourseInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_played_by -> done\")\n\t\treturn courses\n\t\n\tasync def search_courses_endless_mode(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_endless_mode()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_ENDLESS_MODE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcourses = stream.list(CourseInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_endless_mode -> done\")\n\t\treturn courses\n\t\n\tasync def search_courses_first_clear(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_first_clear()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_FIRST_CLEAR, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(CourseInfo)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_first_clear -> done\")\n\t\treturn obj\n\t\n\tasync def search_courses_best_time(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_best_time()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_BEST_TIME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(CourseInfo)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_best_time -> done\")\n\t\treturn obj\n\t\n\tasync def get_courses_event(self, param, dummy):\n\t\tlogger.info(\"DataStoreClientSMM2.get_courses_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tstream.add(dummy)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COURSES_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.courses = stream.list(EventCourseInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_courses_event -> done\")\n\t\treturn obj\n\t\n\tasync def search_courses_event(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COURSES_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcourses = stream.list(EventCourseInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_courses_event -> done\")\n\t\treturn courses\n\t\n\tasync def search_comments_in_order(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_comments_in_order()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COMMENTS_IN_ORDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.comments = stream.list(CommentInfo)\n\t\tobj.result = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_comments_in_order -> done\")\n\t\treturn obj\n\t\n\tasync def search_comments(self, data_id):\n\t\tlogger.info(\"DataStoreClientSMM2.search_comments()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_COMMENTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcomments = stream.list(CommentInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_comments -> done\")\n\t\treturn comments\n\t\n\tasync def get_death_positions(self, data_id):\n\t\tlogger.info(\"DataStoreClientSMM2.get_death_positions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(data_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DEATH_POSITIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpositions = stream.list(DeathPositionInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_death_positions -> done\")\n\t\treturn positions\n\t\n\tasync def get_user_or_course(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_user_or_course()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_USER_OR_COURSE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.user = stream.extract(UserInfo)\n\t\tobj.course = stream.extract(CourseInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_user_or_course -> done\")\n\t\treturn obj\n\t\n\tasync def get_req_get_info_headers_info(self, type):\n\t\tlogger.info(\"DataStoreClientSMM2.get_req_get_info_headers_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u8(type)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_REQ_GET_INFO_HEADERS_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(ReqGetInfoHeadersInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_req_get_info_headers_info -> done\")\n\t\treturn result\n\t\n\tasync def get_event_course_stamp(self):\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_stamp()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_EVENT_COURSE_STAMP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstamps = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_stamp -> done\")\n\t\treturn stamps\n\t\n\tasync def get_event_course_status(self):\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_status()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_EVENT_COURSE_STATUS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(EventCourseStatusInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_status -> done\")\n\t\treturn info\n\t\n\tasync def get_event_course_histogram(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_histogram()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_EVENT_COURSE_HISTOGRAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\thistogram = stream.extract(EventCourseHistogram)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_histogram -> done\")\n\t\treturn histogram\n\t\n\tasync def get_event_course_ghost(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_ghost()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_EVENT_COURSE_GHOST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tghosts = stream.list(EventCourseGhostInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_event_course_ghost -> done\")\n\t\treturn ghosts\n\t\n\tasync def get_world_map(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.get_world_map()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_WORLD_MAP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.maps = stream.list(WorldMapInfo)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.get_world_map -> done\")\n\t\treturn obj\n\t\n\tasync def search_world_map_pick_up(self, param):\n\t\tlogger.info(\"DataStoreClientSMM2.search_world_map_pick_up()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_WORLD_MAP_PICK_UP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tmaps = stream.list(WorldMapInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DataStoreClientSMM2.search_world_map_pick_up -> done\")\n\t\treturn maps\n\n\nclass DataStoreServerSMM2(DataStoreProtocolSMM2):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_V1: self.handle_prepare_get_object_v1,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT_V1: self.handle_prepare_post_object_v1,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT_V1: self.handle_complete_post_object_v1,\n\t\t\tself.METHOD_DELETE_OBJECT: self.handle_delete_object,\n\t\t\tself.METHOD_DELETE_OBJECTS: self.handle_delete_objects,\n\t\t\tself.METHOD_CHANGE_META_V1: self.handle_change_meta_v1,\n\t\t\tself.METHOD_CHANGE_METAS_V1: self.handle_change_metas_v1,\n\t\t\tself.METHOD_GET_META: self.handle_get_meta,\n\t\t\tself.METHOD_GET_METAS: self.handle_get_metas,\n\t\t\tself.METHOD_PREPARE_UPDATE_OBJECT: self.handle_prepare_update_object,\n\t\t\tself.METHOD_COMPLETE_UPDATE_OBJECT: self.handle_complete_update_object,\n\t\t\tself.METHOD_SEARCH_OBJECT: self.handle_search_object,\n\t\t\tself.METHOD_GET_NOTIFICATION_URL: self.handle_get_notification_url,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS_V1: self.handle_get_new_arrived_notifications_v1,\n\t\t\tself.METHOD_RATE_OBJECT: self.handle_rate_object,\n\t\t\tself.METHOD_GET_RATING: self.handle_get_rating,\n\t\t\tself.METHOD_GET_RATINGS: self.handle_get_ratings,\n\t\t\tself.METHOD_RESET_RATING: self.handle_reset_rating,\n\t\t\tself.METHOD_RESET_RATINGS: self.handle_reset_ratings,\n\t\t\tself.METHOD_GET_SPECIFIC_META_V1: self.handle_get_specific_meta_v1,\n\t\t\tself.METHOD_POST_META_BINARY: self.handle_post_meta_binary,\n\t\t\tself.METHOD_TOUCH_OBJECT: self.handle_touch_object,\n\t\t\tself.METHOD_GET_RATING_WITH_LOG: self.handle_get_rating_with_log,\n\t\t\tself.METHOD_PREPARE_POST_OBJECT: self.handle_prepare_post_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT: self.handle_prepare_get_object,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECT: self.handle_complete_post_object,\n\t\t\tself.METHOD_GET_NEW_ARRIVED_NOTIFICATIONS: self.handle_get_new_arrived_notifications,\n\t\t\tself.METHOD_GET_SPECIFIC_META: self.handle_get_specific_meta,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFO: self.handle_get_persistence_info,\n\t\t\tself.METHOD_GET_PERSISTENCE_INFOS: self.handle_get_persistence_infos,\n\t\t\tself.METHOD_PERPETUATE_OBJECT: self.handle_perpetuate_object,\n\t\t\tself.METHOD_UNPERPETUATE_OBJECT: self.handle_unperpetuate_object,\n\t\t\tself.METHOD_PREPARE_GET_OBJECT_OR_META_BINARY: self.handle_prepare_get_object_or_meta_binary,\n\t\t\tself.METHOD_GET_PASSWORD_INFO: self.handle_get_password_info,\n\t\t\tself.METHOD_GET_PASSWORD_INFOS: self.handle_get_password_infos,\n\t\t\tself.METHOD_GET_METAS_MULTIPLE_PARAM: self.handle_get_metas_multiple_param,\n\t\t\tself.METHOD_COMPLETE_POST_OBJECTS: self.handle_complete_post_objects,\n\t\t\tself.METHOD_CHANGE_META: self.handle_change_meta,\n\t\t\tself.METHOD_CHANGE_METAS: self.handle_change_metas,\n\t\t\tself.METHOD_RATE_OBJECTS: self.handle_rate_objects,\n\t\t\tself.METHOD_POST_META_BINARY_WITH_DATA_ID: self.handle_post_meta_binary_with_data_id,\n\t\t\tself.METHOD_POST_META_BINARIES_WITH_DATA_ID: self.handle_post_meta_binaries_with_data_id,\n\t\t\tself.METHOD_RATE_OBJECT_WITH_POSTING: self.handle_rate_object_with_posting,\n\t\t\tself.METHOD_RATE_OBJECTS_WITH_POSTING: self.handle_rate_objects_with_posting,\n\t\t\tself.METHOD_GET_OBJECT_INFOS: self.handle_get_object_infos,\n\t\t\tself.METHOD_SEARCH_OBJECT_LIGHT: self.handle_search_object_light,\n\t\t\tself.METHOD_REGISTER_USER: self.handle_register_user,\n\t\t\tself.METHOD_GET_USERS: self.handle_get_users,\n\t\t\tself.METHOD_SYNC_USER_PROFILE: self.handle_sync_user_profile,\n\t\t\tself.METHOD_SEARCH_USERS_USER_POINT: self.handle_search_users_user_point,\n\t\t\tself.METHOD_SEARCH_USERS_PLAYED_COURSE: self.handle_search_users_played_course,\n\t\t\tself.METHOD_SEARCH_USERS_CLEARED_COURSE: self.handle_search_users_cleared_course,\n\t\t\tself.METHOD_SEARCH_USERS_POSITIVE_RATED_COURSE: self.handle_search_users_positive_rated_course,\n\t\t\tself.METHOD_UPDATE_LAST_LOGIN_TIME: self.handle_update_last_login_time,\n\t\t\tself.METHOD_GET_USERNAME_NG_TYPE: self.handle_get_username_ng_type,\n\t\t\tself.METHOD_GET_COURSES: self.handle_get_courses,\n\t\t\tself.METHOD_SEARCH_COURSES_POINT_RANKING: self.handle_search_courses_point_ranking,\n\t\t\tself.METHOD_SEARCH_COURSES_LATEST: self.handle_search_courses_latest,\n\t\t\tself.METHOD_SEARCH_COURSES_POSTED_BY: self.handle_search_courses_posted_by,\n\t\t\tself.METHOD_SEARCH_COURSES_POSITIVE_RATED_BY: self.handle_search_courses_positive_rated_by,\n\t\t\tself.METHOD_SEARCH_COURSES_PLAYED_BY: self.handle_search_courses_played_by,\n\t\t\tself.METHOD_SEARCH_COURSES_ENDLESS_MODE: self.handle_search_courses_endless_mode,\n\t\t\tself.METHOD_SEARCH_COURSES_FIRST_CLEAR: self.handle_search_courses_first_clear,\n\t\t\tself.METHOD_SEARCH_COURSES_BEST_TIME: self.handle_search_courses_best_time,\n\t\t\tself.METHOD_GET_COURSES_EVENT: self.handle_get_courses_event,\n\t\t\tself.METHOD_SEARCH_COURSES_EVENT: self.handle_search_courses_event,\n\t\t\tself.METHOD_SEARCH_COMMENTS_IN_ORDER: self.handle_search_comments_in_order,\n\t\t\tself.METHOD_SEARCH_COMMENTS: self.handle_search_comments,\n\t\t\tself.METHOD_GET_DEATH_POSITIONS: self.handle_get_death_positions,\n\t\t\tself.METHOD_GET_USER_OR_COURSE: self.handle_get_user_or_course,\n\t\t\tself.METHOD_GET_REQ_GET_INFO_HEADERS_INFO: self.handle_get_req_get_info_headers_info,\n\t\t\tself.METHOD_GET_EVENT_COURSE_STAMP: self.handle_get_event_course_stamp,\n\t\t\tself.METHOD_GET_EVENT_COURSE_STATUS: self.handle_get_event_course_status,\n\t\t\tself.METHOD_GET_EVENT_COURSE_HISTOGRAM: self.handle_get_event_course_histogram,\n\t\t\tself.METHOD_GET_EVENT_COURSE_GHOST: self.handle_get_event_course_ghost,\n\t\t\tself.METHOD_GET_WORLD_MAP: self.handle_get_world_map,\n\t\t\tself.METHOD_SEARCH_WORLD_MAP_PICK_UP: self.handle_search_world_map_pick_up,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on DataStoreServerSMM2: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_prepare_get_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.prepare_get_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParamV1)\n\t\tresponse = await self.prepare_get_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.prepare_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParamV1)\n\t\tresponse = await self.prepare_post_object_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfoV1):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfoV1, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.complete_post_object_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParamV1)\n\t\tawait self.complete_post_object_v1(client, param)\n\t\n\tasync def handle_delete_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.delete_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreDeleteParam)\n\t\tawait self.delete_object(client, param)\n\t\n\tasync def handle_delete_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.delete_objects()\")\n\t\t#--- request ---\n\t\tparam = input.list(DataStoreDeleteParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.delete_objects(client, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_change_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.change_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParamV1)\n\t\tawait self.change_meta_v1(client, param)\n\t\n\tasync def handle_change_metas_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.change_metas_v1()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParamV1)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas_v1(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreMetaInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreMetaInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.extract(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas(client, data_ids, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['info', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.info, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_prepare_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.prepare_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareUpdateParam)\n\t\tresponse = await self.prepare_update_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqUpdateInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqUpdateInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_update_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.complete_update_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompleteUpdateParam)\n\t\tawait self.complete_update_object(client, param)\n\t\n\tasync def handle_search_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_notification_url(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_notification_url()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNotificationUrlParam)\n\t\tresponse = await self.get_notification_url(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetNotificationUrlInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetNotificationUrlInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_new_arrived_notifications_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_new_arrived_notifications_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_rate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.rate_object()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tparam = input.extract(DataStoreRateObjectParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object(client, target, param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_ratings(client, data_ids, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, lambda x: output.list(x, output.add))\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_reset_rating(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.reset_rating()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\tupdate_password = input.u64()\n\t\tawait self.reset_rating(client, target, update_password)\n\t\n\tasync def handle_reset_ratings(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.reset_ratings()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.reset_ratings(client, data_ids, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_get_specific_meta_v1(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_specific_meta_v1()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParamV1)\n\t\tresponse = await self.get_specific_meta_v1(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_post_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.post_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.post_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_touch_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.touch_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreTouchObjectParam)\n\t\tawait self.touch_object(client, param)\n\t\n\tasync def handle_get_rating_with_log(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_rating_with_log()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\taccess_password = input.u64()\n\t\tresponse = await self.get_rating_with_log(client, target, access_password)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['rating', 'log']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.rating)\n\t\toutput.add(response.log)\n\t\n\tasync def handle_prepare_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.prepare_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tresponse = await self.prepare_post_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqPostInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqPostInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_prepare_get_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.prepare_get_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreReqGetInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreReqGetInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_complete_post_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.complete_post_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreCompletePostParam)\n\t\tawait self.complete_post_object(client, param)\n\t\n\tasync def handle_get_new_arrived_notifications(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_new_arrived_notifications()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetNewArrivedNotificationsParam)\n\t\tresponse = await self.get_new_arrived_notifications(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'has_next']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.result, output.add)\n\t\toutput.bool(response.has_next)\n\t\n\tasync def handle_get_specific_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_specific_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreGetSpecificMetaParam)\n\t\tresponse = await self.get_specific_meta(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_persistence_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_persistence_info()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_id = input.u16()\n\t\tresponse = await self.get_persistence_info(client, owner_id, slot_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePersistenceInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePersistenceInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_persistence_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_persistence_infos()\")\n\t\t#--- request ---\n\t\towner_id = input.pid()\n\t\tslot_ids = input.list(input.u16)\n\t\tresponse = await self.get_persistence_infos(client, owner_id, slot_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_perpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.perpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdata_id = input.u64()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.perpetuate_object(client, persistence_slot_id, data_id, delete_last_object)\n\t\n\tasync def handle_unperpetuate_object(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.unperpetuate_object()\")\n\t\t#--- request ---\n\t\tpersistence_slot_id = input.u16()\n\t\tdelete_last_object = input.bool()\n\t\tawait self.unperpetuate_object(client, persistence_slot_id, delete_last_object)\n\t\n\tasync def handle_prepare_get_object_or_meta_binary(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.prepare_get_object_or_meta_binary()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStorePrepareGetParam)\n\t\tresponse = await self.prepare_get_object_or_meta_binary(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['get_info', 'additional_meta']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.get_info)\n\t\toutput.add(response.additional_meta)\n\t\n\tasync def handle_get_password_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_password_info()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tresponse = await self.get_password_info(client, data_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStorePasswordInfo):\n\t\t\traise RuntimeError(\"Expected DataStorePasswordInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_password_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_password_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_password_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_metas_multiple_param(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_metas_multiple_param()\")\n\t\t#--- request ---\n\t\tparams = input.list(DataStoreGetMetaParam)\n\t\tresponse = await self.get_metas_multiple_param(client, params)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_complete_post_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.complete_post_objects()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tawait self.complete_post_objects(client, data_ids)\n\t\n\tasync def handle_change_meta(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.change_meta()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreChangeMetaParam)\n\t\tawait self.change_meta(client, param)\n\t\n\tasync def handle_change_metas(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.change_metas()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStoreChangeMetaParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.change_metas(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_objects(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.rate_objects()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\tparam = input.list(DataStoreRateObjectParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects(client, targets, param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_post_meta_binary_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.post_meta_binary_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tparam = input.extract(DataStorePreparePostParam)\n\t\tawait self.post_meta_binary_with_data_id(client, data_id, param)\n\t\n\tasync def handle_post_meta_binaries_with_data_id(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.post_meta_binaries_with_data_id()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tparam = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tresponse = await self.post_meta_binaries_with_data_id(client, data_ids, param, transactional)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.result)\n\t\n\tasync def handle_rate_object_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.rate_object_with_posting()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(DataStoreRatingTarget)\n\t\trate_param = input.extract(DataStoreRateObjectParam)\n\t\tpost_param = input.extract(DataStorePreparePostParam)\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_object_with_posting(client, target, rate_param, post_param, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreRatingInfo):\n\t\t\traise RuntimeError(\"Expected DataStoreRatingInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_rate_objects_with_posting(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.rate_objects_with_posting()\")\n\t\t#--- request ---\n\t\ttargets = input.list(DataStoreRatingTarget)\n\t\trate_param = input.list(DataStoreRateObjectParam)\n\t\tpost_param = input.list(DataStorePreparePostParam)\n\t\ttransactional = input.bool()\n\t\tfetch_ratings = input.bool()\n\t\tresponse = await self.rate_objects_with_posting(client, targets, rate_param, post_param, transactional, fetch_ratings)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['ratings', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.ratings, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_object_infos(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_object_infos()\")\n\t\t#--- request ---\n\t\tdata_ids = input.list(input.u64)\n\t\tresponse = await self.get_object_infos(client, data_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['infos', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.infos, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_object_light(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_object_light()\")\n\t\t#--- request ---\n\t\tparam = input.extract(DataStoreSearchParam)\n\t\tresponse = await self.search_object_light(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, DataStoreSearchResult):\n\t\t\traise RuntimeError(\"Expected DataStoreSearchResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_register_user(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.register_user()\")\n\t\t#--- request ---\n\t\tparam = input.extract(RegisterUserParam)\n\t\tawait self.register_user(client, param)\n\t\n\tasync def handle_get_users(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_users()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetUsersParam)\n\t\tresponse = await self.get_users(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['users', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.users, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_sync_user_profile(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.sync_user_profile()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SyncUserProfileParam)\n\t\tresponse = await self.sync_user_profile(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, SyncUserProfileResult):\n\t\t\traise RuntimeError(\"Expected SyncUserProfileResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_search_users_user_point(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_users_user_point()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchUsersUserPointParam)\n\t\tresponse = await self.search_users_user_point(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['users', 'ranks', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.users, output.add)\n\t\toutput.list(response.ranks, output.u32)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_search_users_played_course(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_users_played_course()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchUsersPlayedCourseParam)\n\t\tresponse = await self.search_users_played_course(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_users_cleared_course(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_users_cleared_course()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchUsersClearedCourseParam)\n\t\tresponse = await self.search_users_cleared_course(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_users_positive_rated_course(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_users_positive_rated_course()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchUsersPositiveRatedCourseParam)\n\t\tresponse = await self.search_users_positive_rated_course(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_last_login_time(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.update_last_login_time()\")\n\t\t#--- request ---\n\t\tawait self.update_last_login_time(client)\n\t\n\tasync def handle_get_username_ng_type(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_username_ng_type()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_username_ng_type(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u8(response)\n\t\n\tasync def handle_get_courses(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_courses()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetCoursesParam)\n\t\tresponse = await self.get_courses(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_courses_point_ranking(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_point_ranking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesPointRankingParam)\n\t\tresponse = await self.search_courses_point_ranking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'ranks', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.list(response.ranks, output.u32)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_search_courses_latest(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_latest()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesLatestParam)\n\t\tresponse = await self.search_courses_latest(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_search_courses_posted_by(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_posted_by()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesPostedByParam)\n\t\tresponse = await self.search_courses_posted_by(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_search_courses_positive_rated_by(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_positive_rated_by()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesPositiveRatedByParam)\n\t\tresponse = await self.search_courses_positive_rated_by(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_courses_played_by(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_played_by()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesPlayedByParam)\n\t\tresponse = await self.search_courses_played_by(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_courses_endless_mode(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_endless_mode()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesEndlessModeParam)\n\t\tresponse = await self.search_courses_endless_mode(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_courses_first_clear(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_first_clear()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesFirstClearParam)\n\t\tresponse = await self.search_courses_first_clear(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_search_courses_best_time(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_best_time()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesBestTimeParam)\n\t\tresponse = await self.search_courses_best_time(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_get_courses_event(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_courses_event()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetCoursesParam)\n\t\tdummy = input.extract(GetCoursesEventParam)\n\t\tresponse = await self.get_courses_event(client, param, dummy)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['courses', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.courses, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_courses_event(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_courses_event()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCoursesEventParam)\n\t\tresponse = await self.search_courses_event(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_comments_in_order(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_comments_in_order()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchCommentsInOrderParam)\n\t\tresponse = await self.search_comments_in_order(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['comments', 'result']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.comments, output.add)\n\t\toutput.bool(response.result)\n\t\n\tasync def handle_search_comments(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_comments()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tresponse = await self.search_comments(client, data_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_death_positions(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_death_positions()\")\n\t\t#--- request ---\n\t\tdata_id = input.u64()\n\t\tresponse = await self.get_death_positions(client, data_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_user_or_course(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_user_or_course()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetUserOrCourseParam)\n\t\tresponse = await self.get_user_or_course(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['user', 'course']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.user)\n\t\toutput.add(response.course)\n\t\n\tasync def handle_get_req_get_info_headers_info(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_req_get_info_headers_info()\")\n\t\t#--- request ---\n\t\ttype = input.u8()\n\t\tresponse = await self.get_req_get_info_headers_info(client, type)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, ReqGetInfoHeadersInfo):\n\t\t\traise RuntimeError(\"Expected ReqGetInfoHeadersInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_event_course_stamp(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_event_course_stamp()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_event_course_stamp(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_get_event_course_status(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_event_course_status()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_event_course_status(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, EventCourseStatusInfo):\n\t\t\traise RuntimeError(\"Expected EventCourseStatusInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_event_course_histogram(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_event_course_histogram()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetEventCourseHistogramParam)\n\t\tresponse = await self.get_event_course_histogram(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, EventCourseHistogram):\n\t\t\traise RuntimeError(\"Expected EventCourseHistogram, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_event_course_ghost(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_event_course_ghost()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetEventCourseGhostParam)\n\t\tresponse = await self.get_event_course_ghost(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_world_map(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.get_world_map()\")\n\t\t#--- request ---\n\t\tparam = input.extract(GetWorldMapParam)\n\t\tresponse = await self.get_world_map(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['maps', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.maps, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_search_world_map_pick_up(self, client, input, output):\n\t\tlogger.info(\"DataStoreServerSMM2.search_world_map_pick_up()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SearchWorldMapPickUpParam)\n\t\tresponse = await self.search_world_map_pick_up(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def prepare_get_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.prepare_get_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.prepare_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.complete_post_object_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.delete_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.delete_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.change_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.change_metas_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.prepare_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_update_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.complete_update_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_notification_url(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_notification_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_new_arrived_notifications_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.rate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_rating(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.reset_rating not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_ratings(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.reset_ratings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta_v1(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_specific_meta_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.post_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def touch_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.touch_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_rating_with_log(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_rating_with_log not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.prepare_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.prepare_get_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.complete_post_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_new_arrived_notifications(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_new_arrived_notifications not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_specific_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_specific_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_persistence_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_persistence_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_persistence_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def perpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.perpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unperpetuate_object(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.unperpetuate_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def prepare_get_object_or_meta_binary(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.prepare_get_object_or_meta_binary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_password_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_password_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_password_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_metas_multiple_param(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_metas_multiple_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def complete_post_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.complete_post_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_meta(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.change_meta not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_metas(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.change_metas not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.rate_objects not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binary_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.post_meta_binary_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def post_meta_binaries_with_data_id(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.post_meta_binaries_with_data_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_object_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.rate_object_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def rate_objects_with_posting(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.rate_objects_with_posting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_object_infos(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_object_infos not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_object_light(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_object_light not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_user(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.register_user not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_users(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_users not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def sync_user_profile(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.sync_user_profile not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_users_user_point(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_users_user_point not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_users_played_course(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_users_played_course not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_users_cleared_course(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_users_cleared_course not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_users_positive_rated_course(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_users_positive_rated_course not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_last_login_time(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.update_last_login_time not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_username_ng_type(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_username_ng_type not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_courses(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_courses not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_point_ranking(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_point_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_latest(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_latest not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_posted_by(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_posted_by not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_positive_rated_by(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_positive_rated_by not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_played_by(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_played_by not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_endless_mode(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_endless_mode not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_first_clear(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_first_clear not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_best_time(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_best_time not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_courses_event(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_courses_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_courses_event(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_courses_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_comments_in_order(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_comments_in_order not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_comments(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_comments not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_death_positions(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_death_positions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_user_or_course(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_user_or_course not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_req_get_info_headers_info(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_req_get_info_headers_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_event_course_stamp(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_event_course_stamp not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_event_course_status(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_event_course_status not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_event_course_histogram(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_event_course_histogram not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_event_course_ghost(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_event_course_ghost not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_world_map(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.get_world_map not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_world_map_pick_up(self, *args):\n\t\tlogger.warning(\"DataStoreServerSMM2.search_world_map_pick_up not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/debug.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass ApiCall(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\tself.time = None\n\t\tself.pid = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name', 'time', 'pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\tself.time = stream.datetime()\n\t\tself.pid = stream.pid()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\t\tstream.datetime(self.time)\n\t\tstream.pid(self.pid)\n\n\nclass ApiCallSummary(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\tself.limit_exceeded = None\n\t\tself.duration = None\n\t\tself.limit = None\n\t\tself.start = None\n\t\tself.limit_exceeded_count = None\n\t\tself.total_count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name', 'limit_exceeded', 'duration', 'limit', 'start', 'limit_exceeded_count', 'total_count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\tself.limit_exceeded = stream.u32()\n\t\tself.duration = stream.u32()\n\t\tself.limit = stream.u32()\n\t\tself.start = stream.datetime()\n\t\tself.limit_exceeded_count = stream.u32()\n\t\tself.total_count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\t\tstream.u32(self.limit_exceeded)\n\t\tstream.u32(self.duration)\n\t\tstream.u32(self.limit)\n\t\tstream.datetime(self.start)\n\t\tstream.u32(self.limit_exceeded_count)\n\t\tstream.u32(self.total_count)\n\n\nclass DebugProtocol:\n\tMETHOD_ENABLE_API_RECORDER = 1\n\tMETHOD_DISABLE_API_RECORDER = 2\n\tMETHOD_IS_API_RECORDER_ENABLED = 3\n\tMETHOD_GET_API_CALLS = 4\n\tMETHOD_SET_EXCLUDE_JOINED_MATCHMAKE_SESSION = 5\n\tMETHOD_GET_EXCLUDE_JOINED_MATCHMAKE_SESSION = 6\n\tMETHOD_GET_API_CALL_SUMMARY = 7\n\t\n\tPROTOCOL_ID = 0x74\n\n\nclass DebugClient(DebugProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def enable_api_recorder(self):\n\t\tlogger.info(\"DebugClient.enable_api_recorder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ENABLE_API_RECORDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DebugClient.enable_api_recorder -> done\")\n\t\n\tasync def disable_api_recorder(self):\n\t\tlogger.info(\"DebugClient.disable_api_recorder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DISABLE_API_RECORDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DebugClient.disable_api_recorder -> done\")\n\t\n\tasync def is_api_recorder_enabled(self):\n\t\tlogger.info(\"DebugClient.is_api_recorder_enabled()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_API_RECORDER_ENABLED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tenabled = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DebugClient.is_api_recorder_enabled -> done\")\n\t\treturn enabled\n\t\n\tasync def get_api_calls(self, pids, start, end):\n\t\tlogger.info(\"DebugClient.get_api_calls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.datetime(start)\n\t\tstream.datetime(end)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_API_CALLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcalls = stream.list(ApiCall)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DebugClient.get_api_calls -> done\")\n\t\treturn calls\n\t\n\tasync def get_api_call_summary(self, pid, start, end, only_limit_exceeded):\n\t\tlogger.info(\"DebugClient.get_api_call_summary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.datetime(start)\n\t\tstream.datetime(end)\n\t\tstream.bool(only_limit_exceeded)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_API_CALL_SUMMARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsummaries = stream.list(ApiCallSummary)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"DebugClient.get_api_call_summary -> done\")\n\t\treturn summaries\n\n\nclass DebugServer(DebugProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_ENABLE_API_RECORDER: self.handle_enable_api_recorder,\n\t\t\tself.METHOD_DISABLE_API_RECORDER: self.handle_disable_api_recorder,\n\t\t\tself.METHOD_IS_API_RECORDER_ENABLED: self.handle_is_api_recorder_enabled,\n\t\t\tself.METHOD_GET_API_CALLS: self.handle_get_api_calls,\n\t\t\tself.METHOD_SET_EXCLUDE_JOINED_MATCHMAKE_SESSION: self.handle_set_exclude_joined_matchmake_session,\n\t\t\tself.METHOD_GET_EXCLUDE_JOINED_MATCHMAKE_SESSION: self.handle_get_exclude_joined_matchmake_session,\n\t\t\tself.METHOD_GET_API_CALL_SUMMARY: self.handle_get_api_call_summary,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on DebugServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_enable_api_recorder(self, client, input, output):\n\t\tlogger.info(\"DebugServer.enable_api_recorder()\")\n\t\t#--- request ---\n\t\tawait self.enable_api_recorder(client)\n\t\n\tasync def handle_disable_api_recorder(self, client, input, output):\n\t\tlogger.info(\"DebugServer.disable_api_recorder()\")\n\t\t#--- request ---\n\t\tawait self.disable_api_recorder(client)\n\t\n\tasync def handle_is_api_recorder_enabled(self, client, input, output):\n\t\tlogger.info(\"DebugServer.is_api_recorder_enabled()\")\n\t\t#--- request ---\n\t\tresponse = await self.is_api_recorder_enabled(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_api_calls(self, client, input, output):\n\t\tlogger.info(\"DebugServer.get_api_calls()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tstart = input.datetime()\n\t\tend = input.datetime()\n\t\tresponse = await self.get_api_calls(client, pids, start, end)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_set_exclude_joined_matchmake_session(self, client, input, output):\n\t\tlogger.warning(\"DebugServer.set_exclude_joined_matchmake_session is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_exclude_joined_matchmake_session(self, client, input, output):\n\t\tlogger.warning(\"DebugServer.get_exclude_joined_matchmake_session is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_api_call_summary(self, client, input, output):\n\t\tlogger.info(\"DebugServer.get_api_call_summary()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tstart = input.datetime()\n\t\tend = input.datetime()\n\t\tonly_limit_exceeded = input.bool()\n\t\tresponse = await self.get_api_call_summary(client, pid, start, end, only_limit_exceeded)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def enable_api_recorder(self, *args):\n\t\tlogger.warning(\"DebugServer.enable_api_recorder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def disable_api_recorder(self, *args):\n\t\tlogger.warning(\"DebugServer.disable_api_recorder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_api_recorder_enabled(self, *args):\n\t\tlogger.warning(\"DebugServer.is_api_recorder_enabled not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_api_calls(self, *args):\n\t\tlogger.warning(\"DebugServer.get_api_calls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_api_call_summary(self, *args):\n\t\tlogger.warning(\"DebugServer.get_api_call_summary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/errors.py",
    "content": "\nerror_names = {\n\t0x00010001: \"Core::Unknown\",\n\t0x00010002: \"Core::NotImplemented\",\n\t0x00010003: \"Core::InvalidPointer\",\n\t0x00010004: \"Core::OperationAborted\",\n\t0x00010005: \"Core::Exception\",\n\t0x00010006: \"Core::AccessDenied\",\n\t0x00010007: \"Core::InvalidHandle\",\n\t0x00010008: \"Core::InvalidIndex\",\n\t0x00010009: \"Core::OutOfMemory\",\n\t0x0001000A: \"Core::InvalidArgument\",\n\t0x0001000B: \"Core::Timeout\",\n\t0x0001000C: \"Core::InitializationFailure\",\n\t0x0001000D: \"Core::CallInitiationFailure\",\n\t0x0001000E: \"Core::RegistrationError\",\n\t0x0001000F: \"Core::BufferOverflow\",\n\t0x00010010: \"Core::InvalidLockState\",\n\t0x00010011: \"Core::InvalidSequence\",\n\t0x00010012: \"Core::SystemError\",\n\t0x00010013: \"Core::Cancelled\",\n\t\n\t0x00020001: \"DDL::InvalidSignature\",\n\t0x00020002: \"DDL::IncorrectVersion\",\n\t\n\t0x00030001: \"RendezVous::ConnectionFailure\",\n\t0x00030002: \"RendezVous::NotAuthenticated\",\n\n\t0x00030064: \"RendezVous::InvalidUsername\",\n\t0x00030065: \"RendezVous::InvalidPassword\",\n\t0x00030066: \"RendezVous::UsernameAlreadyExists\",\n\t0x00030067: \"RendezVous::AccountDisabled\",\n\t0x00030068: \"RendezVous::AccountExpired\",\n\t0x00030069: \"RendezVous::ConcurrentLoginDenied\",\n\t0x0003006A: \"RendezVous::EncryptionFailure\",\n\t0x0003006B: \"RendezVous::InvalidPID\",\n\t0x0003006C: \"RendezVous::MaxConnectionsReached\",\n\t0x0003006D: \"RendezVous::InvalidGID\",\n\t0x0003006E: \"RendezVous::InvalidControlScriptID\",\n\t0x0003006F: \"RendezVous::InvalidOperationInLiveEnvironment\",\n\t0x00030070: \"RendezVous::DuplicateEntry\",\n\t0x00030071: \"RendezVous::ControlScriptFailure\",\n\t0x00030072: \"RendezVous::ClassNotFound\",\n\t0x00030073: \"RendezVous::SessionVoid\",\n\t0x00030075: \"RendezVous::DDLMismatch\",\n\t0x00030076: \"RendezVous::InvalidConfiguration\",\n\t\n\t0x000300C8: \"RendezVous::SessionFull\",\n\t0x000300C9: \"RendezVous::InvalidGatheringPassword\",\n\t0x000300CA: \"RendezVous::WithoutParticipationPeriod\",\n\t0x000300CB: \"RendezVous::PersistentGatheringCreationMax\",\n\t0x000300CC: \"RendezVous::PersistentGatheringParticipationMax\",\n\t0x000300CD: \"RendezVous::DeniedByParticipants\",\n\t0x000300CE: \"RendezVous::ParticipantInBlackList\",\n\t0x000300CF: \"RendezVous::GameServerMaintenance\",\n\t0x000300D0: \"RendezVous::OperationPostpone\",\n\t0x000300D1: \"RendezVous::OutOfRatingRange\",\n\t0x000300D2: \"RendezVous::ConnectionDisconnected\",\n\t0x000300D3: \"RendezVous::InvalidOperation\",\n\t0x000300D4: \"RendezVous::NotParticipatedGathering\",\n\t0x000300D5: \"RendezVous::MatchmakeSessionUserPasswordUnmatch\",\n\t0x000300D6: \"RendezVous::MatchmakeSessionSystemPasswordUnmatch\",\n\t0x000300D7: \"RendezVous::UserIsOffline\",\n\t0x000300D8: \"RendezVous::AlreadyParticipatedGathering\",\n\t0x000300D9: \"RendezVous::PermissionDenied\",\n\t0x000300DA: \"RendezVous::NotFriend\",\n\t0x000300DB: \"RendezVous::SessionClosed\",\n\t0x000300DC: \"RendezVous::DatabaseTemporarilyUnavailable\",\n\t0x000300DD: \"RendezVous::InvalidUniqueId\",\n\t0x000300DE: \"RendezVous::MatchmakingWithdrawn\",\n\t0x000300DF: \"RendezVous::LimitExceeded\",\n\t0x000300E0: \"RendezVous::AccountTemporarilyDisabled\",\n\t0x000300E1: \"RendezVous::PartiallyServiceClosed\",\n\t0x000300E2: \"RendezVous::ConnectionDisconnectedForConcurrentLogin\",\n\t\n\t0x00040001: \"PythonCore::Exception\",\n\t0x00040002: \"PythonCore::TypeError\",\n\t0x00040003: \"PythonCore::IndexError\",\n\t0x00040004: \"PythonCore::InvalidReference\",\n\t0x00040005: \"PythonCore::CallFailure\",\n\t0x00040006: \"PythonCore::MemoryError\",\n\t0x00040007: \"PythonCore::KeyError\",\n\t0x00040008: \"PythonCore::OperationError\",\n\t0x00040009: \"PythonCore::ConversionError\",\n\t0x0004000A: \"PythonCore::ValidationError\",\n\t\n\t0x00050001: \"Transport::Unknown\",\n\t0x00050002: \"Transport::ConnectionFailure\",\n\t0x00050003: \"Transport::InvalidUrl\",\n\t0x00050004: \"Transport::InvalidKey\",\n\t0x00050005: \"Transport::InvalidURLType\",\n\t0x00050006: \"Transport::DuplicateEndpoint\",\n\t0x00050007: \"Transport::IOError\",\n\t0x00050008: \"Transport::Timeout\",\n\t0x00050009: \"Transport::ConnectionReset\",\n\t0x0005000A: \"Transport::IncorrectRemoteAuthentication\",\n\t0x0005000B: \"Transport::ServerRequestError\",\n\t0x0005000C: \"Transport::DecompressionFailure\",\n\t0x0005000D: \"Transport::ReliableSendBufferFullFatal\",\n\t0x0005000E: \"Transport::UPnPCannotInit\",\n\t0x0005000F: \"Transport::UPnPCannotAddMapping\",\n\t0x00050010: \"Transport::NatPMPCannotInit\",\n\t0x00050011: \"Transport::NatPMPCannotAddMapping\",\n\t0x00050013: \"Transport::UnsupportedNAT\",\n\t0x00050014: \"Transport::DnsError\",\n\t0x00050015: \"Transport::ProxyError\",\n\t0x00050016: \"Transport::DataRemaining\",\n\t0x00050017: \"Transport::NoBuffer\",\n\t0x00050018: \"Transport::NotFound\",\n\t0x00050019: \"Transport::TemporaryServerError\",\n\t0x0005001A: \"Transport::PermanentServerError\",\n\t0x0005001B: \"Transport::ServiceUnavailable\",\n\t0x0005001C: \"Transport::ReliableSendBufferFull\",\n\t0x0005001D: \"Transport::InvalidStation\",\n\t0x0005001E: \"Transport::InvalidSubStreamID\",\n\t0x0005001F: \"Transport::PacketBufferFull\",\n\t0x00050020: \"Transport::NatTraversalError\",\n\t0x00050021: \"Transport::NatCheckError\",\n\t\n\t0x00060001: \"DOCore::StationNotReached\",\n\t0x00060002: \"DOCore::TargetStationDisconnect\",\n\t0x00060003: \"DOCore::LocalStationLeaving\",\n\t0x00060004: \"DOCore::ObjectNotFound\",\n\t0x00060005: \"DOCore::InvalidRole\",\n\t0x00060006: \"DOCore::CallTimeout\",\n\t0x00060007: \"DOCore::RMCDispatchFailed\",\n\t0x00060008: \"DOCore::MigrationInProgress\",\n\t0x00060009: \"DOCore::NoAuthority\",\n\t0x0006000A: \"DOCore::NoTargetStationSpecified\",\n\t0x0006000B: \"DOCore::JoinFailed\",\n\t0x0006000C: \"DOCore::JoinDenied\",\n\t0x0006000D: \"DOCore::ConnectivityTestFailed\",\n\t0x0006000E: \"DOCore::Unknown\",\n\t0x0006000F: \"DOCore::UnfreedReferences\",\n\t0x00060010: \"DOCore::JobTerminationFailed\",\n\t0x00060011: \"DOCore::InvalidState\",\n\t0x00060012: \"DOCore::FaultRecoveryFatal\",\n\t0x00060013: \"DOCore::FaultRecoveryJobProcessFailed\",\n\t0x00060014: \"DOCore::StationInconsitency\",\n\t0x00060015: \"DOCore::AbnormalMasterState\",\n\t0x00060016: \"DOCore::VersionMismatch\",\n\t\n\t0x00650000: \"FPD::NotInitialized\",\n\t0x00650001: \"FPD::AlreadyInitialized\",\n\t0x00650002: \"FPD::NotConnected\",\n\t0x00650003: \"FPD::Connected\",\n\t0x00650004: \"FPD::InitializationFailure\",\n\t0x00650005: \"FPD::OutOfMemory\",\n\t0x00650006: \"FPD::RmcFailed\",\n\t0x00650007: \"FPD::InvalidArgument\",\n\t0x00650008: \"FPD::InvalidLocalAccountID\",\n\t0x00650009: \"FPD::InvalidPrincipalID\",\n\t0x0065000A: \"FPD::InvalidLocalFriendCode\",\n\t0x0065000B: \"FPD::LocalAccountNotExists\",\n\t0x0065000C: \"FPD::LocalAccountNotLoaded\",\n\t0x0065000D: \"FPD::LocalAccountAlreadyLoaded\",\n\t0x0065000E: \"FPD::FriendAlreadyExists\",\n\t0x0065000F: \"FPD::FriendNotExists\",\n\t0x00650010: \"FPD::FriendNumMax\",\n\t0x00650011: \"FPD::NotFriend\",\n\t0x00650012: \"FPD::FileIO\",\n\t0x00650013: \"FPD::P2PInternetProhibited\",\n\t0x00650014: \"FPD::Unknown\",\n\t0x00650015: \"FPD::InvalidState\",\n\t0x00650017: \"FPD::AddFriendProhibited\",\n\t0x00650019: \"FPD::InvalidAccount\",\n\t0x0065001A: \"FPD::BlacklistedByMe\",\n\t0x0065001C: \"FPD::FriendAlreadyAdded\",\n\t0x0065001D: \"FPD::MyFriendListLimitExceed\",\n\t0x0065001E: \"FPD::RequestLimitExceed\",\n\t0x0065001F: \"FPD::InvalidMessageID\",\n\t0x00650020: \"FPD::MessageIsNotMine\",\n\t0x00650021: \"FPD::MessageIsNotForMe\",\n\t0x00650022: \"FPD::FriendRequestBlocked\",\n\t0x00650023: \"FPD::NotInMyFriendList\",\n\t0x00650024: \"FPD::FriendListedByMe\",\n\t0x00650025: \"FPD::NotInMyBlacklist\",\n\t0x00650026: \"FPD::IncompatibleAccount\",\n\t0x00650027: \"FPD::BlockSettingChangeNotAllowed\",\n\t0x00650028: \"FPD::SizeLimitExceeded\",\n\t0x00650029: \"FPD::OperationNotAllowed\",\n\t0x0065002A: \"FPD::NotNetworkAccount\",\n\t0x0065002B: \"FPD::NotificationNotFound\",\n\t0x0065002C: \"FPD::PreferenceNotInitialized\",\n\t0x0065002D: \"FPD::FriendRequestNotAllowed\",\n\t\n\t0x00670001: \"Ranking::NotInitialized\",\n\t0x00670002: \"Ranking::InvalidArgument\",\n\t0x00670003: \"Ranking::RegistrationError\",\n\t0x00670005: \"Ranking::NotFound\",\n\t0x00670006: \"Ranking::InvalidScore\",\n\t0x00670007: \"Ranking::InvalidDataSize\",\n\t0x00670009: \"Ranking::PermissionDenied\",\n\t0x0067000A: \"Ranking::Unknown\",\n\t0x0067000B: \"Ranking::NotImplemented\",\n\t\n\t0x00680001: \"Authentication::NASAuthenticateError\",\n\t0x00680002: \"Authentication::TokenParseError\",\n\t0x00680003: \"Authentication::HttpConnectionError\",\n\t0x00680004: \"Authentication::HttpDNSError\",\n\t0x00680005: \"Authentication::HttpGetProxySetting\",\n\t0x00680006: \"Authentication::TokenExpired\",\n\t0x00680007: \"Authentication::ValidationFailed\",\n\t0x00680008: \"Authentication::InvalidParam\",\n\t0x00680009: \"Authentication::PrincipalIdUnmatched\",\n\t0x0068000A: \"Authentication::MoveCountUnmatch\",\n\t0x0068000B: \"Authentication::UnderMaintenance\",\n\t0x0068000C: \"Authentication::UnsupportedVersion\",\n\t0x0068000D: \"Authentication::ServerVersionIsOld\",\n\t0x0068000E: \"Authentication::Unknown\",\n\t0x0068000F: \"Authentication::ClientVersionIsOld\",\n\t0x00680010: \"Authentication::AccountLibraryError\",\n\t0x00680011: \"Authentication::ServiceNoLongerAvailable\",\n\t0x00680012: \"Authentication::UnknownApplication\",\n\t0x00680013: \"Authentication::ApplicationVersionIsOld\",\n\t0x00680014: \"Authentication::OutOfService\",\n\t0x00680015: \"Authentication::NetworkServiceLicenseRequired\",\n\t0x00680016: \"Authentication::NetworkServiceLicenseSystemError\",\n\t0x00680017: \"Authentication::NetworkServiceLicenseError3\",\n\t0x00680018: \"Authentication::NetworkServiceLicenseError4\",\n\t\n\t0x00690001: \"DataStore::Unknown\",\n\t0x00690002: \"DataStore::InvalidArgument\",\n\t0x00690003: \"DataStore::PermissionDenied\",\n\t0x00690004: \"DataStore::NotFound\",\n\t0x00690005: \"DataStore::AlreadyLocked\",\n\t0x00690006: \"DataStore::UnderReviewing\",\n\t0x00690007: \"DataStore::Expired\",\n\t0x00690008: \"DataStore::InvalidCheckToken\",\n\t0x00690009: \"DataStore::SystemFileError\",\n\t0x0069000A: \"DataStore::OverCapacity\",\n\t0x0069000B: \"DataStore::OperationNotAllowed\",\n\t0x0069000C: \"DataStore::InvalidPassword\",\n\t0x0069000D: \"DataStore::ValueNotEqual\",\n\t\n\t0x006C0001: \"ServiceItem::Unknown\",\n\t0x006C0002: \"ServiceItem::InvalidArgument\",\n\t0x006C0003: \"ServiceItem::EShopUnknownHttpError\",\n\t0x006C0004: \"ServiceItem::EShopResponseParseError\",\n\t0x006C0005: \"ServiceItem::NotOwned\",\n\t0x006C0006: \"ServiceItem::InvalidLimitationType\",\n\t0x006C0007: \"ServiceItem::ConsumptionRightShortage\",\n\t\n\t0x006F0001: \"MatchmakeReferee::Unknown\",\n\t0x006F0002: \"MatchmakeReferee::InvalidArgument\",\n\t0x006F0003: \"MatchmakeReferee::AlreadyExists\",\n\t0x006F0004: \"MatchmakeReferee::NotParticipatedGathering\",\n\t0x006F0005: \"MatchmakeReferee::NotParticipatedRound\",\n\t0x006F0006: \"MatchmakeReferee::StatsNotFound\",\n\t0x006F0007: \"MatchmakeReferee::RoundNotFound\",\n\t0x006F0008: \"MatchmakeReferee::RoundArbitrated\",\n\t0x006F0009: \"MatchmakeReferee::RoundNotArbitrated\",\n\t\n\t0x00700001: \"Subscriber::Unknown\",\n\t0x00700002: \"Subscriber::InvalidArgument\",\n\t0x00700003: \"Subscriber::OverLimit\",\n\t0x00700004: \"Subscriber::PermissionDenied\",\n\t\n\t0x00710001: \"Ranking2::Unknown\",\n\t0x00710002: \"Ranking2::InvalidArgument\",\n\t0x00710003: \"Ranking2::InvalidScore\",\n\t\n\t0x00720001: \"SmartDeviceVoiceChat::Unknown\",\n\t0x00720002: \"SmartDeviceVoiceChat::InvalidArgument\",\n\t0x00720003: \"SmartDeviceVoiceChat::InvalidResponse\",\n\t0x00720004: \"SmartDeviceVoiceChat::InvalidAccessToken\",\n\t0x00720005: \"SmartDeviceVoiceChat::Unauthorized\",\n\t0x00720006: \"SmartDeviceVoiceChat::AccessError\",\n\t0x00720007: \"SmartDeviceVoiceChat::UserNotFound\",\n\t0x00720008: \"SmartDeviceVoiceChat::RoomNotFound\",\n\t0x00720009: \"SmartDeviceVoiceChat::RoomNotActivated\",\n\t0x0072000A: \"SmartDeviceVoiceChat::ApplicationNotSupported\",\n\t0x0072000B: \"SmartDeviceVoiceChat::InternalServerError\",\n\t0x0072000C: \"SmartDeviceVoiceChat::ServiceUnavailable\",\n\t0x0072000D: \"SmartDeviceVoiceChat::UnexpectedError\",\n\t0x0072000E: \"SmartDeviceVoiceChat::UnderMaintenance\",\n\t0x0072000F: \"SmartDeviceVoiceChat::ServiceNoLongerAvailable\",\n\t0x00720010: \"SmartDeviceVoiceChat::AccountTemporarilyDisabled\",\n\t0x00720011: \"SmartDeviceVoiceChat::PermissionDenied\",\n\t0x00720012: \"SmartDeviceVoiceChat::NetworkServiceLicenseRequired\",\n\t0x00720013: \"SmartDeviceVoiceChat::AccountLibraryError\",\n\t0x00720014: \"SmartDeviceVoiceChat::GameModeNotFound\",\n\t\n\t0x00730001: \"Screening::Unknown\",\n\t0x00730002: \"Screening::InvalidArgument\",\n\t0x00730003: \"Screening::NotFound\",\n\t\n\t0x00740001: \"Custom::Unknown\",\n\n\t0x00750001: \"Ess::Unknown\",\n\t0x00750002: \"Ess::GameSessionError\",\n\t0x00750003: \"Ess::GameSessionMaintenance\"\n}\n\nerror_codes = {name: code for code, name in error_names.items()}\n"
  },
  {
    "path": "nintendo/nex/friends.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass AccountExtraInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.local_friend_code = None\n\t\tself.move_count = None\n\t\tself.token = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['local_friend_code', 'move_count', 'token']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.local_friend_code = stream.u64()\n\t\tself.move_count = stream.u32()\n\t\tself.token = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.local_friend_code)\n\t\tstream.u32(self.move_count)\n\t\tstream.string(self.token)\n\n\nclass FriendComment(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.comment = None\n\t\tself.modified_at = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'comment', 'modified_at']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.u32()\n\t\tself.comment = stream.string()\n\t\tself.modified_at = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.pid)\n\t\tstream.string(self.comment)\n\t\tstream.datetime(self.modified_at)\ncommon.DataHolder.register(FriendComment, \"FriendComment\")\n\n\nclass FriendKey(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u32()\n\t\tself.unk2 = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.unk1)\n\t\tstream.datetime(self.unk2)\n\n\nclass FriendMii(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.mii = Mii()\n\t\tself.modified_at = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'modified_at']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.mii = stream.extract(Mii)\n\t\tself.modified_at = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.mii)\n\t\tstream.datetime(self.modified_at)\ncommon.DataHolder.register(FriendMii, \"FriendMii\")\n\n\nclass FriendMiiList(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.mii = MiiList()\n\t\tself.unk2 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u32()\n\t\tself.mii = stream.extract(MiiList)\n\t\tself.unk2 = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.unk1)\n\t\tstream.add(self.mii)\n\t\tstream.datetime(self.unk2)\ncommon.DataHolder.register(FriendMiiList, \"FriendMiiList\")\n\n\nclass FriendPersistentInfo(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.region = None\n\t\tself.country = None\n\t\tself.area = None\n\t\tself.language = None\n\t\tself.platform = None\n\t\tself.game_key = GameKey()\n\t\tself.message = None\n\t\tself.message_updated = None\n\t\tself.friended = None\n\t\tself.last_online = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'region', 'country', 'area', 'language', 'platform', 'message', 'message_updated', 'friended', 'last_online']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.region = stream.u8()\n\t\tself.country = stream.u8()\n\t\tself.area = stream.u8()\n\t\tself.language = stream.u8()\n\t\tself.platform = stream.u8()\n\t\tself.game_key = stream.extract(GameKey)\n\t\tself.message = stream.string()\n\t\tself.message_updated = stream.datetime()\n\t\tself.friended = stream.datetime()\n\t\tself.last_online = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u8(self.region)\n\t\tstream.u8(self.country)\n\t\tstream.u8(self.area)\n\t\tstream.u8(self.language)\n\t\tstream.u8(self.platform)\n\t\tstream.add(self.game_key)\n\t\tstream.string(self.message)\n\t\tstream.datetime(self.message_updated)\n\t\tstream.datetime(self.friended)\n\t\tstream.datetime(self.last_online)\ncommon.DataHolder.register(FriendPersistentInfo, \"FriendPersistentInfo\")\n\n\nclass FriendPicture(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk = None\n\t\tself.data = None\n\t\tself.datetime = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk', 'data', 'datetime']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk = stream.u32()\n\t\tself.data = stream.buffer()\n\t\tself.datetime = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.unk)\n\t\tstream.buffer(self.data)\n\t\tstream.datetime(self.datetime)\ncommon.DataHolder.register(FriendPicture, \"FriendPicture\")\n\n\nclass FriendPresence(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.presence = NintendoPresence()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.presence = stream.extract(NintendoPresence)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.presence)\ncommon.DataHolder.register(FriendPresence, \"FriendPresence\")\n\n\nclass FriendRelationship(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.friend_code = None\n\t\tself.is_complete = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'friend_code', 'is_complete']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.friend_code = stream.u64()\n\t\tself.is_complete = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u64(self.friend_code)\n\t\tstream.u8(self.is_complete)\ncommon.DataHolder.register(FriendRelationship, \"FriendRelationship\")\n\n\nclass GameKey(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.title_id = 0\n\t\tself.title_version = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.title_id = stream.u64()\n\t\tself.title_version = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.title_id)\n\t\tstream.u16(self.title_version)\ncommon.DataHolder.register(GameKey, \"GameKey\")\n\n\nclass Mii(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.mii_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name', 'unk1', 'unk2', 'mii_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\tself.unk1 = stream.bool()\n\t\tself.unk2 = stream.u8()\n\t\tself.mii_data = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\t\tstream.bool(self.unk1)\n\t\tstream.u8(self.unk2)\n\t\tstream.buffer(self.mii_data)\ncommon.DataHolder.register(Mii, \"Mii\")\n\n\nclass MiiList(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.mii_datas = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'unk3', 'mii_datas']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.string()\n\t\tself.unk2 = stream.bool()\n\t\tself.unk3 = stream.u8()\n\t\tself.mii_datas = stream.list(stream.buffer)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.unk1)\n\t\tstream.bool(self.unk2)\n\t\tstream.u8(self.unk3)\n\t\tstream.list(self.mii_datas, stream.buffer)\ncommon.DataHolder.register(MiiList, \"MiiList\")\n\n\nclass MyProfile(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.region = None\n\t\tself.country = None\n\t\tself.area = None\n\t\tself.language = None\n\t\tself.platform = None\n\t\tself.local_friend_code_seed = None\n\t\tself.mac_address = None\n\t\tself.serial_number = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['region', 'country', 'area', 'language', 'platform', 'local_friend_code_seed', 'mac_address', 'serial_number']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.region = stream.u8()\n\t\tself.country = stream.u8()\n\t\tself.area = stream.u8()\n\t\tself.language = stream.u8()\n\t\tself.platform = stream.u8()\n\t\tself.local_friend_code_seed = stream.u64()\n\t\tself.mac_address = stream.string()\n\t\tself.serial_number = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.region)\n\t\tstream.u8(self.country)\n\t\tstream.u8(self.area)\n\t\tstream.u8(self.language)\n\t\tstream.u8(self.platform)\n\t\tstream.u64(self.local_friend_code_seed)\n\t\tstream.string(self.mac_address)\n\t\tstream.string(self.serial_number)\ncommon.DataHolder.register(MyProfile, \"MyProfile\")\n\n\nclass NintendoPresence(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.changed_bit_flag = None\n\t\tself.game_key = GameKey()\n\t\tself.game_mode_description = None\n\t\tself.join_availability_flag = None\n\t\tself.matchmake_system_type = None\n\t\tself.join_game_id = None\n\t\tself.join_game_mode = None\n\t\tself.owner_pid = None\n\t\tself.join_group_id = None\n\t\tself.application_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['changed_bit_flag', 'game_mode_description', 'join_availability_flag', 'matchmake_system_type', 'join_game_id', 'join_game_mode', 'owner_pid', 'join_group_id', 'application_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.changed_bit_flag = stream.u32()\n\t\tself.game_key = stream.extract(GameKey)\n\t\tself.game_mode_description = stream.string()\n\t\tself.join_availability_flag = stream.u32()\n\t\tself.matchmake_system_type = stream.u8()\n\t\tself.join_game_id = stream.u32()\n\t\tself.join_game_mode = stream.u32()\n\t\tself.owner_pid = stream.pid()\n\t\tself.join_group_id = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.changed_bit_flag)\n\t\tstream.add(self.game_key)\n\t\tstream.string(self.game_mode_description)\n\t\tstream.u32(self.join_availability_flag)\n\t\tstream.u8(self.matchmake_system_type)\n\t\tstream.u32(self.join_game_id)\n\t\tstream.u32(self.join_game_mode)\n\t\tstream.pid(self.owner_pid)\n\t\tstream.u32(self.join_group_id)\n\t\tstream.buffer(self.application_data)\ncommon.DataHolder.register(NintendoPresence, \"NintendoPresence\")\n\n\nclass PlayedGame(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.game_key = GameKey()\n\t\tself.datetime = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['datetime']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.game_key = stream.extract(GameKey)\n\t\tself.datetime = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.game_key)\n\t\tstream.datetime(self.datetime)\ncommon.DataHolder.register(PlayedGame, \"PlayedGame\")\n\n\nclass BlacklistedPrincipal(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.principal_info = PrincipalBasicInfo()\n\t\tself.game_key = GameKey()\n\t\tself.since = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['since']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.principal_info = stream.extract(PrincipalBasicInfo)\n\t\tself.game_key = stream.extract(GameKey)\n\t\tself.since = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.principal_info)\n\t\tstream.add(self.game_key)\n\t\tstream.datetime(self.since)\ncommon.DataHolder.register(BlacklistedPrincipal, \"BlacklistedPrincipal\")\n\n\nclass Comment(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk = None\n\t\tself.text = None\n\t\tself.changed = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk', 'text', 'changed']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk = stream.u8()\n\t\tself.text = stream.string()\n\t\tself.changed = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.unk)\n\t\tstream.string(self.text)\n\t\tstream.datetime(self.changed)\ncommon.DataHolder.register(Comment, \"Comment\")\n\n\nclass FriendInfo(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.nna_info = NNAInfo()\n\t\tself.presence = NintendoPresenceV2()\n\t\tself.comment = Comment()\n\t\tself.befriended = None\n\t\tself.last_online = None\n\t\tself.unk = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['befriended', 'last_online', 'unk']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.nna_info = stream.extract(NNAInfo)\n\t\tself.presence = stream.extract(NintendoPresenceV2)\n\t\tself.comment = stream.extract(Comment)\n\t\tself.befriended = stream.datetime()\n\t\tself.last_online = stream.datetime()\n\t\tself.unk = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.nna_info)\n\t\tstream.add(self.presence)\n\t\tstream.add(self.comment)\n\t\tstream.datetime(self.befriended)\n\t\tstream.datetime(self.last_online)\n\t\tstream.u64(self.unk)\ncommon.DataHolder.register(FriendInfo, \"FriendInfo\")\n\n\nclass FriendRequest(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.principal_info = PrincipalBasicInfo()\n\t\tself.message = FriendRequestMessage()\n\t\tself.sent = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['sent']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.principal_info = stream.extract(PrincipalBasicInfo)\n\t\tself.message = stream.extract(FriendRequestMessage)\n\t\tself.sent = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.principal_info)\n\t\tstream.add(self.message)\n\t\tstream.datetime(self.sent)\ncommon.DataHolder.register(FriendRequest, \"FriendRequest\")\n\n\nclass FriendRequestMessage(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.friend_request_id = None\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.message = None\n\t\tself.unk3 = None\n\t\tself.string = None\n\t\tself.game_key = GameKey()\n\t\tself.datetime = None\n\t\tself.expires = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['friend_request_id', 'unk1', 'unk2', 'message', 'unk3', 'string', 'datetime', 'expires']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.friend_request_id = stream.u64()\n\t\tself.unk1 = stream.u8()\n\t\tself.unk2 = stream.u8()\n\t\tself.message = stream.string()\n\t\tself.unk3 = stream.u8()\n\t\tself.string = stream.string()\n\t\tself.game_key = stream.extract(GameKey)\n\t\tself.datetime = stream.datetime()\n\t\tself.expires = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.friend_request_id)\n\t\tstream.u8(self.unk1)\n\t\tstream.u8(self.unk2)\n\t\tstream.string(self.message)\n\t\tstream.u8(self.unk3)\n\t\tstream.string(self.string)\n\t\tstream.add(self.game_key)\n\t\tstream.datetime(self.datetime)\n\t\tstream.datetime(self.expires)\ncommon.DataHolder.register(FriendRequestMessage, \"FriendRequestMessage\")\n\n\nclass MiiV2(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\tself.unk1 = 0\n\t\tself.unk2 = 0\n\t\tself.data = None\n\t\tself.datetime = common.DateTime(0)\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name', 'data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\tself.unk1 = stream.u8()\n\t\tself.unk2 = stream.u8()\n\t\tself.data = stream.buffer()\n\t\tself.datetime = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\t\tstream.u8(self.unk1)\n\t\tstream.u8(self.unk2)\n\t\tstream.buffer(self.data)\n\t\tstream.datetime(self.datetime)\ncommon.DataHolder.register(MiiV2, \"MiiV2\")\n\n\nclass NNAInfo(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.principal_info = PrincipalBasicInfo()\n\t\tself.unk1 = 94\n\t\tself.unk2 = 11\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.principal_info = stream.extract(PrincipalBasicInfo)\n\t\tself.unk1 = stream.u8()\n\t\tself.unk2 = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.principal_info)\n\t\tstream.u8(self.unk1)\n\t\tstream.u8(self.unk2)\ncommon.DataHolder.register(NNAInfo, \"NNAInfo\")\n\n\nclass NintendoCreateAccountData(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.info = NNAInfo()\n\t\tself.token = None\n\t\tself.birthday = None\n\t\tself.unk = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['token', 'birthday', 'unk']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.info = stream.extract(NNAInfo)\n\t\tself.token = stream.string()\n\t\tself.birthday = stream.datetime()\n\t\tself.unk = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.info)\n\t\tstream.string(self.token)\n\t\tstream.datetime(self.birthday)\n\t\tstream.u64(self.unk)\ncommon.DataHolder.register(NintendoCreateAccountData, \"NintendoCreateAccountData\")\n\n\nclass NintendoPresenceV2(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flags = 0\n\t\tself.is_online = False\n\t\tself.game_key = GameKey()\n\t\tself.unk1 = 0\n\t\tself.message = \"\"\n\t\tself.unk2 = 0\n\t\tself.unk3 = 0\n\t\tself.game_server_id = 0\n\t\tself.unk4 = 0\n\t\tself.pid = 0\n\t\tself.gathering_id = 0\n\t\tself.application_data = b\"\"\n\t\tself.unk5 = 3\n\t\tself.unk6 = 3\n\t\tself.unk7 = 3\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.flags = stream.u32()\n\t\tself.is_online = stream.bool()\n\t\tself.game_key = stream.extract(GameKey)\n\t\tself.unk1 = stream.u8()\n\t\tself.message = stream.string()\n\t\tself.unk2 = stream.u32()\n\t\tself.unk3 = stream.u8()\n\t\tself.game_server_id = stream.u32()\n\t\tself.unk4 = stream.u32()\n\t\tself.pid = stream.u32()\n\t\tself.gathering_id = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\tself.unk5 = stream.u8()\n\t\tself.unk6 = stream.u8()\n\t\tself.unk7 = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.flags)\n\t\tstream.bool(self.is_online)\n\t\tstream.add(self.game_key)\n\t\tstream.u8(self.unk1)\n\t\tstream.string(self.message)\n\t\tstream.u32(self.unk2)\n\t\tstream.u8(self.unk3)\n\t\tstream.u32(self.game_server_id)\n\t\tstream.u32(self.unk4)\n\t\tstream.u32(self.pid)\n\t\tstream.u32(self.gathering_id)\n\t\tstream.buffer(self.application_data)\n\t\tstream.u8(self.unk5)\n\t\tstream.u8(self.unk6)\n\t\tstream.u8(self.unk7)\ncommon.DataHolder.register(NintendoPresenceV2, \"NintendoPresenceV2\")\n\n\nclass PersistentNotification(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.unk4 = None\n\t\tself.string = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'unk3', 'unk4', 'string']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u64()\n\t\tself.unk2 = stream.u32()\n\t\tself.unk3 = stream.u32()\n\t\tself.unk4 = stream.u32()\n\t\tself.string = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unk1)\n\t\tstream.u32(self.unk2)\n\t\tstream.u32(self.unk3)\n\t\tstream.u32(self.unk4)\n\t\tstream.string(self.string)\ncommon.DataHolder.register(PersistentNotification, \"PersistentNotification\")\n\n\nclass PrincipalBasicInfo(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.nnid = None\n\t\tself.mii = MiiV2()\n\t\tself.unk = 2\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'nnid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.nnid = stream.string()\n\t\tself.mii = stream.extract(MiiV2)\n\t\tself.unk = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.nnid)\n\t\tstream.add(self.mii)\n\t\tstream.u8(self.unk)\ncommon.DataHolder.register(PrincipalBasicInfo, \"PrincipalBasicInfo\")\n\n\nclass PrincipalPreference(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.show_online_status = None\n\t\tself.show_current_title = None\n\t\tself.block_friend_requests = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['show_online_status', 'show_current_title', 'block_friend_requests']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.show_online_status = stream.bool()\n\t\tself.show_current_title = stream.bool()\n\t\tself.block_friend_requests = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.bool(self.show_online_status)\n\t\tstream.bool(self.show_current_title)\n\t\tstream.bool(self.block_friend_requests)\ncommon.DataHolder.register(PrincipalPreference, \"PrincipalPreference\")\n\n\nclass PrincipalRequestBlockSetting(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.blocked = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'blocked']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.u32()\n\t\tself.blocked = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.pid)\n\t\tstream.bool(self.blocked)\ncommon.DataHolder.register(PrincipalRequestBlockSetting, \"PrincipalRequestBlockSetting\")\n\n\nclass FriendsProtocolV1:\n\tMETHOD_UPDATE_PROFILE = 1\n\tMETHOD_UPDATE_MII = 2\n\tMETHOD_UPDATE_MII_LIST = 3\n\tMETHOD_UPDATE_PLAYED_GAMES = 4\n\tMETHOD_UPDATE_PREFERENCE = 5\n\tMETHOD_GET_FRIEND_MII = 6\n\tMETHOD_GET_FRIEND_MII_LIST = 7\n\tMETHOD_IS_ACTIVE_GAME = 8\n\tMETHOD_GET_PRINCIPAL_ID_BY_LOCAL_FRIEND_CODE = 9\n\tMETHOD_GET_FRIEND_RELATIONSHIPS = 10\n\tMETHOD_ADD_FRIEND_BY_PRINCIPAL_ID = 11\n\tMETHOD_ADD_FRIEND_BY_PRINCIPAL_IDS = 12\n\tMETHOD_REMOVE_FRIEND_BY_LOCAL_FRIEND_CODE = 13\n\tMETHOD_REMOVE_FRIEND_BY_PRINCIPAL_ID = 14\n\tMETHOD_GET_ALL_FRIENDS = 15\n\tMETHOD_UPDATE_BLACK_LIST = 16\n\tMETHOD_SYNC_FRIEND = 17\n\tMETHOD_UPDATE_PRESENCE = 18\n\tMETHOD_UPDATE_FAVORITE_GAME_KEY = 19\n\tMETHOD_UPDATE_COMMENT = 20\n\tMETHOD_UPDATE_PICTURE = 21\n\tMETHOD_GET_FRIEND_PRESENCE = 22\n\tMETHOD_GET_FRIEND_COMMENT = 23\n\tMETHOD_GET_FRIEND_PICTURE = 24\n\tMETHOD_GET_FRIEND_PERSISTENT_INFO = 25\n\tMETHOD_SEND_INVITATION = 26\n\t\n\tPROTOCOL_ID = 0x65\n\n\nclass FriendsProtocolV2:\n\tMETHOD_UPDATE_AND_GET_ALL_INFORMATION = 1\n\tMETHOD_ADD_FRIEND = 2\n\tMETHOD_ADD_FRIEND_BY_NAME = 3\n\tMETHOD_REMOVE_FRIEND = 4\n\tMETHOD_ADD_FRIEND_REQUEST = 5\n\tMETHOD_CANCEL_FRIEND_REQUEST = 6\n\tMETHOD_ACCEPT_FRIEND_REQUEST = 7\n\tMETHOD_DELETE_FRIEND_REQUEST = 8\n\tMETHOD_DENY_FRIEND_REQUEST = 9\n\tMETHOD_MARK_FRIEND_REQUESTS_AS_RECEIVED = 10\n\tMETHOD_ADD_BLACK_LIST = 11\n\tMETHOD_REMOVE_BLACK_LIST = 12\n\tMETHOD_UPDATE_PRESENCE = 13\n\tMETHOD_UPDATE_MII = 14\n\tMETHOD_UPDATE_COMMENT = 15\n\tMETHOD_UPDATE_PREFERENCE = 16\n\tMETHOD_GET_BASIC_INFO = 17\n\tMETHOD_DELETE_PERSISTENT_NOTIFICATION = 18\n\tMETHOD_CHECK_SETTING_STATUS = 19\n\tMETHOD_GET_REQUEST_BLOCK_SETTINGS = 20\n\t\n\tPROTOCOL_ID = 0x66\n\n\nclass FriendsClientV1(FriendsProtocolV1):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def update_profile(self, profile_data):\n\t\tlogger.info(\"FriendsClientV1.update_profile()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(profile_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PROFILE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_profile -> done\")\n\t\n\tasync def update_mii(self, mii):\n\t\tlogger.info(\"FriendsClientV1.update_mii()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(mii)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MII, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_mii -> done\")\n\t\n\tasync def update_mii_list(self, mii_list):\n\t\tlogger.info(\"FriendsClientV1.update_mii_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(mii_list)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MII_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_mii_list -> done\")\n\t\n\tasync def update_played_games(self, played_games):\n\t\tlogger.info(\"FriendsClientV1.update_played_games()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(played_games, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PLAYED_GAMES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_played_games -> done\")\n\t\n\tasync def update_preference(self, show_online_status, show_current_title, block_friend_requests):\n\t\tlogger.info(\"FriendsClientV1.update_preference()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(show_online_status)\n\t\tstream.bool(show_current_title)\n\t\tstream.bool(block_friend_requests)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PREFERENCE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_preference -> done\")\n\t\n\tasync def get_friend_mii(self, friends):\n\t\tlogger.info(\"FriendsClientV1.get_friend_mii()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(friends, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_MII, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tmiis = stream.list(FriendMii)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_mii -> done\")\n\t\treturn miis\n\t\n\tasync def get_friend_mii_list(self, friends):\n\t\tlogger.info(\"FriendsClientV1.get_friend_mii_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(friends, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_MII_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tmii_lists = stream.list(FriendMiiList)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_mii_list -> done\")\n\t\treturn mii_lists\n\t\n\tasync def is_active_game(self, unk1, game_key):\n\t\tlogger.info(\"FriendsClientV1.is_active_game()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(unk1, stream.u32)\n\t\tstream.add(game_key)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_ACTIVE_GAME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tunk = stream.list(stream.u32)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.is_active_game -> done\")\n\t\treturn unk\n\t\n\tasync def get_principal_id_by_local_friend_code(self, unk1, unk2):\n\t\tlogger.info(\"FriendsClientV1.get_principal_id_by_local_friend_code()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unk1)\n\t\tstream.list(unk2, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PRINCIPAL_ID_BY_LOCAL_FRIEND_CODE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_relationships = stream.list(FriendRelationship)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_principal_id_by_local_friend_code -> done\")\n\t\treturn friend_relationships\n\t\n\tasync def get_friend_relationships(self, principal_ids):\n\t\tlogger.info(\"FriendsClientV1.get_friend_relationships()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(principal_ids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_RELATIONSHIPS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_relationships = stream.list(FriendRelationship)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_relationships -> done\")\n\t\treturn friend_relationships\n\t\n\tasync def add_friend_by_principal_id(self, friend_seed, pid):\n\t\tlogger.info(\"FriendsClientV1.add_friend_by_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(friend_seed)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_FRIEND_BY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_relationship = stream.extract(FriendRelationship)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.add_friend_by_principal_id -> done\")\n\t\treturn friend_relationship\n\t\n\tasync def add_friend_by_principal_ids(self, unk, pids):\n\t\tlogger.info(\"FriendsClientV1.add_friend_by_principal_ids()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unk)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_FRIEND_BY_PRINCIPAL_IDS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_relationships = stream.list(FriendRelationship)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.add_friend_by_principal_ids -> done\")\n\t\treturn friend_relationships\n\t\n\tasync def remove_friend_by_local_friend_code(self, friend_code):\n\t\tlogger.info(\"FriendsClientV1.remove_friend_by_local_friend_code()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(friend_code)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FRIEND_BY_LOCAL_FRIEND_CODE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.remove_friend_by_local_friend_code -> done\")\n\t\n\tasync def remove_friend_by_principal_id(self, pid):\n\t\tlogger.info(\"FriendsClientV1.remove_friend_by_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FRIEND_BY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.remove_friend_by_principal_id -> done\")\n\t\n\tasync def get_all_friends(self):\n\t\tlogger.info(\"FriendsClientV1.get_all_friends()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ALL_FRIENDS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_relationships = stream.list(FriendRelationship)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_all_friends -> done\")\n\t\treturn friend_relationships\n\t\n\tasync def update_black_list(self, unk):\n\t\tlogger.info(\"FriendsClientV1.update_black_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(unk, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_BLACK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_black_list -> done\")\n\t\n\tasync def sync_friend(self, friend_seed, principal_ids, unk):\n\t\tlogger.info(\"FriendsClientV1.sync_friend()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(friend_seed)\n\t\tstream.list(principal_ids, stream.pid)\n\t\tstream.list(unk, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SYNC_FRIEND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_list = stream.list(FriendRelationship)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.sync_friend -> done\")\n\t\treturn friend_list\n\t\n\tasync def update_presence(self, presence_info, unk):\n\t\tlogger.info(\"FriendsClientV1.update_presence()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(presence_info)\n\t\tstream.bool(unk)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRESENCE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_presence -> done\")\n\t\n\tasync def update_favorite_game_key(self, game_key):\n\t\tlogger.info(\"FriendsClientV1.update_favorite_game_key()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(game_key)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_FAVORITE_GAME_KEY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_favorite_game_key -> done\")\n\t\n\tasync def update_comment(self, comment):\n\t\tlogger.info(\"FriendsClientV1.update_comment()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(comment)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_comment -> done\")\n\t\n\tasync def update_picture(self, unk, picture):\n\t\tlogger.info(\"FriendsClientV1.update_picture()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(unk)\n\t\tstream.buffer(picture)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PICTURE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.update_picture -> done\")\n\t\n\tasync def get_friend_presence(self, principal_ids):\n\t\tlogger.info(\"FriendsClientV1.get_friend_presence()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(principal_ids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_PRESENCE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_presence_list = stream.list(FriendPresence)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_presence -> done\")\n\t\treturn friend_presence_list\n\t\n\tasync def get_friend_comment(self, friends):\n\t\tlogger.info(\"FriendsClientV1.get_friend_comment()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(friends, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_COMMENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcomments = stream.list(FriendComment)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_comment -> done\")\n\t\treturn comments\n\t\n\tasync def get_friend_picture(self, principal_ids):\n\t\tlogger.info(\"FriendsClientV1.get_friend_picture()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(principal_ids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_PICTURE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tfriend_pictures = stream.list(FriendPicture)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_picture -> done\")\n\t\treturn friend_pictures\n\t\n\tasync def get_friend_persistent_info(self, principal_ids):\n\t\tlogger.info(\"FriendsClientV1.get_friend_persistent_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(principal_ids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_PERSISTENT_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpersistent_infos = stream.list(FriendPersistentInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.get_friend_persistent_info -> done\")\n\t\treturn persistent_infos\n\t\n\tasync def send_invitation(self, unk):\n\t\tlogger.info(\"FriendsClientV1.send_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(unk, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEND_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV1.send_invitation -> done\")\n\n\nclass FriendsClientV2(FriendsProtocolV2):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def update_and_get_all_information(self, nna_info, presence, birthday):\n\t\tlogger.info(\"FriendsClientV2.update_and_get_all_information()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(nna_info)\n\t\tstream.add(presence)\n\t\tstream.datetime(birthday)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_AND_GET_ALL_INFORMATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.principal_preference = stream.extract(PrincipalPreference)\n\t\tobj.comment = stream.extract(Comment)\n\t\tobj.friends = stream.list(FriendInfo)\n\t\tobj.sent_requests = stream.list(FriendRequest)\n\t\tobj.received_requests = stream.list(FriendRequest)\n\t\tobj.blacklist = stream.list(BlacklistedPrincipal)\n\t\tobj.unk1 = stream.bool()\n\t\tobj.notifications = stream.list(PersistentNotification)\n\t\tobj.unk2 = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.update_and_get_all_information -> done\")\n\t\treturn obj\n\t\n\tasync def add_friend(self, pid):\n\t\tlogger.info(\"FriendsClientV2.add_friend()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_FRIEND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.request = stream.extract(FriendRequest)\n\t\tobj.info = stream.extract(FriendInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.add_friend -> done\")\n\t\treturn obj\n\t\n\tasync def add_friend_by_name(self, name):\n\t\tlogger.info(\"FriendsClientV2.add_friend_by_name()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(name)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_FRIEND_BY_NAME, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.request = stream.extract(FriendRequest)\n\t\tobj.info = stream.extract(FriendInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.add_friend_by_name -> done\")\n\t\treturn obj\n\t\n\tasync def remove_friend(self, pid):\n\t\tlogger.info(\"FriendsClientV2.remove_friend()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FRIEND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.remove_friend -> done\")\n\t\n\tasync def add_friend_request(self, unk1, unk2, unk3, unk4, unk5, game_key, unk6):\n\t\tlogger.info(\"FriendsClientV2.add_friend_request()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(unk1)\n\t\tstream.u8(unk2)\n\t\tstream.string(unk3)\n\t\tstream.u8(unk4)\n\t\tstream.string(unk5)\n\t\tstream.add(game_key)\n\t\tstream.datetime(unk6)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_FRIEND_REQUEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.request = stream.extract(FriendRequest)\n\t\tobj.info = stream.extract(FriendInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.add_friend_request -> done\")\n\t\treturn obj\n\t\n\tasync def cancel_friend_request(self, id):\n\t\tlogger.info(\"FriendsClientV2.cancel_friend_request()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_FRIEND_REQUEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.cancel_friend_request -> done\")\n\t\n\tasync def accept_friend_request(self, id):\n\t\tlogger.info(\"FriendsClientV2.accept_friend_request()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACCEPT_FRIEND_REQUEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(FriendInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.accept_friend_request -> done\")\n\t\treturn info\n\t\n\tasync def delete_friend_request(self, id):\n\t\tlogger.info(\"FriendsClientV2.delete_friend_request()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FRIEND_REQUEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.delete_friend_request -> done\")\n\t\n\tasync def deny_friend_request(self, id):\n\t\tlogger.info(\"FriendsClientV2.deny_friend_request()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DENY_FRIEND_REQUEST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tblacklist = stream.extract(BlacklistedPrincipal)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.deny_friend_request -> done\")\n\t\treturn blacklist\n\t\n\tasync def mark_friend_requests_as_received(self, ids):\n\t\tlogger.info(\"FriendsClientV2.mark_friend_requests_as_received()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MARK_FRIEND_REQUESTS_AS_RECEIVED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.mark_friend_requests_as_received -> done\")\n\t\n\tasync def add_black_list(self, principal):\n\t\tlogger.info(\"FriendsClientV2.add_black_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(principal)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_BLACK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tprincipal = stream.extract(BlacklistedPrincipal)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.add_black_list -> done\")\n\t\treturn principal\n\t\n\tasync def remove_black_list(self, pid):\n\t\tlogger.info(\"FriendsClientV2.remove_black_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_BLACK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.remove_black_list -> done\")\n\t\n\tasync def update_presence(self, presence):\n\t\tlogger.info(\"FriendsClientV2.update_presence()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(presence)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRESENCE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.update_presence -> done\")\n\t\n\tasync def update_mii(self, mii):\n\t\tlogger.info(\"FriendsClientV2.update_mii()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(mii)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MII, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tunk = stream.datetime()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.update_mii -> done\")\n\t\treturn unk\n\t\n\tasync def update_comment(self, comment):\n\t\tlogger.info(\"FriendsClientV2.update_comment()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(comment)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tunk = stream.datetime()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.update_comment -> done\")\n\t\treturn unk\n\t\n\tasync def update_preference(self, preference):\n\t\tlogger.info(\"FriendsClientV2.update_preference()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(preference)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PREFERENCE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.update_preference -> done\")\n\t\n\tasync def get_basic_info(self, pids):\n\t\tlogger.info(\"FriendsClientV2.get_basic_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_BASIC_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.list(PrincipalBasicInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.get_basic_info -> done\")\n\t\treturn info\n\t\n\tasync def delete_persistent_notification(self, notifications):\n\t\tlogger.info(\"FriendsClientV2.delete_persistent_notification()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(notifications, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_PERSISTENT_NOTIFICATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.delete_persistent_notification -> done\")\n\t\n\tasync def check_setting_status(self):\n\t\tlogger.info(\"FriendsClientV2.check_setting_status()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHECK_SETTING_STATUS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tunk = stream.u8()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.check_setting_status -> done\")\n\t\treturn unk\n\t\n\tasync def get_request_block_settings(self, unk):\n\t\tlogger.info(\"FriendsClientV2.get_request_block_settings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(unk, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_REQUEST_BLOCK_SETTINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsettings = stream.list(PrincipalRequestBlockSetting)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"FriendsClientV2.get_request_block_settings -> done\")\n\t\treturn settings\n\n\nclass FriendsServerV1(FriendsProtocolV1):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_UPDATE_PROFILE: self.handle_update_profile,\n\t\t\tself.METHOD_UPDATE_MII: self.handle_update_mii,\n\t\t\tself.METHOD_UPDATE_MII_LIST: self.handle_update_mii_list,\n\t\t\tself.METHOD_UPDATE_PLAYED_GAMES: self.handle_update_played_games,\n\t\t\tself.METHOD_UPDATE_PREFERENCE: self.handle_update_preference,\n\t\t\tself.METHOD_GET_FRIEND_MII: self.handle_get_friend_mii,\n\t\t\tself.METHOD_GET_FRIEND_MII_LIST: self.handle_get_friend_mii_list,\n\t\t\tself.METHOD_IS_ACTIVE_GAME: self.handle_is_active_game,\n\t\t\tself.METHOD_GET_PRINCIPAL_ID_BY_LOCAL_FRIEND_CODE: self.handle_get_principal_id_by_local_friend_code,\n\t\t\tself.METHOD_GET_FRIEND_RELATIONSHIPS: self.handle_get_friend_relationships,\n\t\t\tself.METHOD_ADD_FRIEND_BY_PRINCIPAL_ID: self.handle_add_friend_by_principal_id,\n\t\t\tself.METHOD_ADD_FRIEND_BY_PRINCIPAL_IDS: self.handle_add_friend_by_principal_ids,\n\t\t\tself.METHOD_REMOVE_FRIEND_BY_LOCAL_FRIEND_CODE: self.handle_remove_friend_by_local_friend_code,\n\t\t\tself.METHOD_REMOVE_FRIEND_BY_PRINCIPAL_ID: self.handle_remove_friend_by_principal_id,\n\t\t\tself.METHOD_GET_ALL_FRIENDS: self.handle_get_all_friends,\n\t\t\tself.METHOD_UPDATE_BLACK_LIST: self.handle_update_black_list,\n\t\t\tself.METHOD_SYNC_FRIEND: self.handle_sync_friend,\n\t\t\tself.METHOD_UPDATE_PRESENCE: self.handle_update_presence,\n\t\t\tself.METHOD_UPDATE_FAVORITE_GAME_KEY: self.handle_update_favorite_game_key,\n\t\t\tself.METHOD_UPDATE_COMMENT: self.handle_update_comment,\n\t\t\tself.METHOD_UPDATE_PICTURE: self.handle_update_picture,\n\t\t\tself.METHOD_GET_FRIEND_PRESENCE: self.handle_get_friend_presence,\n\t\t\tself.METHOD_GET_FRIEND_COMMENT: self.handle_get_friend_comment,\n\t\t\tself.METHOD_GET_FRIEND_PICTURE: self.handle_get_friend_picture,\n\t\t\tself.METHOD_GET_FRIEND_PERSISTENT_INFO: self.handle_get_friend_persistent_info,\n\t\t\tself.METHOD_SEND_INVITATION: self.handle_send_invitation,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on FriendsServerV1: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_update_profile(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_profile()\")\n\t\t#--- request ---\n\t\tprofile_data = input.extract(MyProfile)\n\t\tawait self.update_profile(client, profile_data)\n\t\n\tasync def handle_update_mii(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_mii()\")\n\t\t#--- request ---\n\t\tmii = input.extract(Mii)\n\t\tawait self.update_mii(client, mii)\n\t\n\tasync def handle_update_mii_list(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_mii_list()\")\n\t\t#--- request ---\n\t\tmii_list = input.extract(MiiList)\n\t\tawait self.update_mii_list(client, mii_list)\n\t\n\tasync def handle_update_played_games(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_played_games()\")\n\t\t#--- request ---\n\t\tplayed_games = input.list(PlayedGame)\n\t\tawait self.update_played_games(client, played_games)\n\t\n\tasync def handle_update_preference(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_preference()\")\n\t\t#--- request ---\n\t\tshow_online_status = input.bool()\n\t\tshow_current_title = input.bool()\n\t\tblock_friend_requests = input.bool()\n\t\tawait self.update_preference(client, show_online_status, show_current_title, block_friend_requests)\n\t\n\tasync def handle_get_friend_mii(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_mii()\")\n\t\t#--- request ---\n\t\tfriends = input.list(FriendKey)\n\t\tresponse = await self.get_friend_mii(client, friends)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_friend_mii_list(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_mii_list()\")\n\t\t#--- request ---\n\t\tfriends = input.list(FriendKey)\n\t\tresponse = await self.get_friend_mii_list(client, friends)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_is_active_game(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.is_active_game()\")\n\t\t#--- request ---\n\t\tunk1 = input.list(input.u32)\n\t\tgame_key = input.extract(GameKey)\n\t\tresponse = await self.is_active_game(client, unk1, game_key)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.u32)\n\t\n\tasync def handle_get_principal_id_by_local_friend_code(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_principal_id_by_local_friend_code()\")\n\t\t#--- request ---\n\t\tunk1 = input.u64()\n\t\tunk2 = input.list(input.u64)\n\t\tresponse = await self.get_principal_id_by_local_friend_code(client, unk1, unk2)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_friend_relationships(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_relationships()\")\n\t\t#--- request ---\n\t\tprincipal_ids = input.list(input.pid)\n\t\tresponse = await self.get_friend_relationships(client, principal_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_add_friend_by_principal_id(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.add_friend_by_principal_id()\")\n\t\t#--- request ---\n\t\tfriend_seed = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.add_friend_by_principal_id(client, friend_seed, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, FriendRelationship):\n\t\t\traise RuntimeError(\"Expected FriendRelationship, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_add_friend_by_principal_ids(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.add_friend_by_principal_ids()\")\n\t\t#--- request ---\n\t\tunk = input.u64()\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.add_friend_by_principal_ids(client, unk, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_remove_friend_by_local_friend_code(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.remove_friend_by_local_friend_code()\")\n\t\t#--- request ---\n\t\tfriend_code = input.u64()\n\t\tawait self.remove_friend_by_local_friend_code(client, friend_code)\n\t\n\tasync def handle_remove_friend_by_principal_id(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.remove_friend_by_principal_id()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tawait self.remove_friend_by_principal_id(client, pid)\n\t\n\tasync def handle_get_all_friends(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_all_friends()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_all_friends(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_black_list(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_black_list()\")\n\t\t#--- request ---\n\t\tunk = input.list(input.u32)\n\t\tawait self.update_black_list(client, unk)\n\t\n\tasync def handle_sync_friend(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.sync_friend()\")\n\t\t#--- request ---\n\t\tfriend_seed = input.u64()\n\t\tprincipal_ids = input.list(input.pid)\n\t\tunk = input.list(input.u64)\n\t\tresponse = await self.sync_friend(client, friend_seed, principal_ids, unk)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_presence(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_presence()\")\n\t\t#--- request ---\n\t\tpresence_info = input.extract(NintendoPresence)\n\t\tunk = input.bool()\n\t\tawait self.update_presence(client, presence_info, unk)\n\t\n\tasync def handle_update_favorite_game_key(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_favorite_game_key()\")\n\t\t#--- request ---\n\t\tgame_key = input.extract(GameKey)\n\t\tawait self.update_favorite_game_key(client, game_key)\n\t\n\tasync def handle_update_comment(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_comment()\")\n\t\t#--- request ---\n\t\tcomment = input.string()\n\t\tawait self.update_comment(client, comment)\n\t\n\tasync def handle_update_picture(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.update_picture()\")\n\t\t#--- request ---\n\t\tunk = input.u32()\n\t\tpicture = input.buffer()\n\t\tawait self.update_picture(client, unk, picture)\n\t\n\tasync def handle_get_friend_presence(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_presence()\")\n\t\t#--- request ---\n\t\tprincipal_ids = input.list(input.pid)\n\t\tresponse = await self.get_friend_presence(client, principal_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_friend_comment(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_comment()\")\n\t\t#--- request ---\n\t\tfriends = input.list(FriendKey)\n\t\tresponse = await self.get_friend_comment(client, friends)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_friend_picture(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_picture()\")\n\t\t#--- request ---\n\t\tprincipal_ids = input.list(input.pid)\n\t\tresponse = await self.get_friend_picture(client, principal_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_friend_persistent_info(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.get_friend_persistent_info()\")\n\t\t#--- request ---\n\t\tprincipal_ids = input.list(input.pid)\n\t\tresponse = await self.get_friend_persistent_info(client, principal_ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_send_invitation(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV1.send_invitation()\")\n\t\t#--- request ---\n\t\tunk = input.list(input.u32)\n\t\tawait self.send_invitation(client, unk)\n\t\n\tasync def update_profile(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_profile not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_mii(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_mii not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_mii_list(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_mii_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_played_games(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_played_games not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_preference(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_preference not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_mii(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_mii not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_mii_list(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_mii_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_active_game(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.is_active_game not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_principal_id_by_local_friend_code(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_principal_id_by_local_friend_code not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_relationships(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_relationships not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_friend_by_principal_id(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.add_friend_by_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_friend_by_principal_ids(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.add_friend_by_principal_ids not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_friend_by_local_friend_code(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.remove_friend_by_local_friend_code not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_friend_by_principal_id(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.remove_friend_by_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_all_friends(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_all_friends not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_black_list(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_black_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def sync_friend(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.sync_friend not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_presence(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_presence not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_favorite_game_key(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_favorite_game_key not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_comment(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_comment not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_picture(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.update_picture not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_presence(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_presence not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_comment(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_comment not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_picture(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_picture not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_persistent_info(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.get_friend_persistent_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def send_invitation(self, *args):\n\t\tlogger.warning(\"FriendsServerV1.send_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass FriendsServerV2(FriendsProtocolV2):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_UPDATE_AND_GET_ALL_INFORMATION: self.handle_update_and_get_all_information,\n\t\t\tself.METHOD_ADD_FRIEND: self.handle_add_friend,\n\t\t\tself.METHOD_ADD_FRIEND_BY_NAME: self.handle_add_friend_by_name,\n\t\t\tself.METHOD_REMOVE_FRIEND: self.handle_remove_friend,\n\t\t\tself.METHOD_ADD_FRIEND_REQUEST: self.handle_add_friend_request,\n\t\t\tself.METHOD_CANCEL_FRIEND_REQUEST: self.handle_cancel_friend_request,\n\t\t\tself.METHOD_ACCEPT_FRIEND_REQUEST: self.handle_accept_friend_request,\n\t\t\tself.METHOD_DELETE_FRIEND_REQUEST: self.handle_delete_friend_request,\n\t\t\tself.METHOD_DENY_FRIEND_REQUEST: self.handle_deny_friend_request,\n\t\t\tself.METHOD_MARK_FRIEND_REQUESTS_AS_RECEIVED: self.handle_mark_friend_requests_as_received,\n\t\t\tself.METHOD_ADD_BLACK_LIST: self.handle_add_black_list,\n\t\t\tself.METHOD_REMOVE_BLACK_LIST: self.handle_remove_black_list,\n\t\t\tself.METHOD_UPDATE_PRESENCE: self.handle_update_presence,\n\t\t\tself.METHOD_UPDATE_MII: self.handle_update_mii,\n\t\t\tself.METHOD_UPDATE_COMMENT: self.handle_update_comment,\n\t\t\tself.METHOD_UPDATE_PREFERENCE: self.handle_update_preference,\n\t\t\tself.METHOD_GET_BASIC_INFO: self.handle_get_basic_info,\n\t\t\tself.METHOD_DELETE_PERSISTENT_NOTIFICATION: self.handle_delete_persistent_notification,\n\t\t\tself.METHOD_CHECK_SETTING_STATUS: self.handle_check_setting_status,\n\t\t\tself.METHOD_GET_REQUEST_BLOCK_SETTINGS: self.handle_get_request_block_settings,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on FriendsServerV2: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_update_and_get_all_information(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.update_and_get_all_information()\")\n\t\t#--- request ---\n\t\tnna_info = input.extract(NNAInfo)\n\t\tpresence = input.extract(NintendoPresenceV2)\n\t\tbirthday = input.datetime()\n\t\tresponse = await self.update_and_get_all_information(client, nna_info, presence, birthday)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['principal_preference', 'comment', 'friends', 'sent_requests', 'received_requests', 'blacklist', 'unk1', 'notifications', 'unk2']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.principal_preference)\n\t\toutput.add(response.comment)\n\t\toutput.list(response.friends, output.add)\n\t\toutput.list(response.sent_requests, output.add)\n\t\toutput.list(response.received_requests, output.add)\n\t\toutput.list(response.blacklist, output.add)\n\t\toutput.bool(response.unk1)\n\t\toutput.list(response.notifications, output.add)\n\t\toutput.bool(response.unk2)\n\t\n\tasync def handle_add_friend(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.add_friend()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tresponse = await self.add_friend(client, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['request', 'info']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.request)\n\t\toutput.add(response.info)\n\t\n\tasync def handle_add_friend_by_name(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.add_friend_by_name()\")\n\t\t#--- request ---\n\t\tname = input.string()\n\t\tresponse = await self.add_friend_by_name(client, name)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['request', 'info']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.request)\n\t\toutput.add(response.info)\n\t\n\tasync def handle_remove_friend(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.remove_friend()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tawait self.remove_friend(client, pid)\n\t\n\tasync def handle_add_friend_request(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.add_friend_request()\")\n\t\t#--- request ---\n\t\tunk1 = input.u32()\n\t\tunk2 = input.u8()\n\t\tunk3 = input.string()\n\t\tunk4 = input.u8()\n\t\tunk5 = input.string()\n\t\tgame_key = input.extract(GameKey)\n\t\tunk6 = input.datetime()\n\t\tresponse = await self.add_friend_request(client, unk1, unk2, unk3, unk4, unk5, game_key, unk6)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['request', 'info']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.add(response.request)\n\t\toutput.add(response.info)\n\t\n\tasync def handle_cancel_friend_request(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.cancel_friend_request()\")\n\t\t#--- request ---\n\t\tid = input.u64()\n\t\tawait self.cancel_friend_request(client, id)\n\t\n\tasync def handle_accept_friend_request(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.accept_friend_request()\")\n\t\t#--- request ---\n\t\tid = input.u64()\n\t\tresponse = await self.accept_friend_request(client, id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, FriendInfo):\n\t\t\traise RuntimeError(\"Expected FriendInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_delete_friend_request(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.delete_friend_request()\")\n\t\t#--- request ---\n\t\tid = input.u64()\n\t\tawait self.delete_friend_request(client, id)\n\t\n\tasync def handle_deny_friend_request(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.deny_friend_request()\")\n\t\t#--- request ---\n\t\tid = input.u64()\n\t\tresponse = await self.deny_friend_request(client, id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, BlacklistedPrincipal):\n\t\t\traise RuntimeError(\"Expected BlacklistedPrincipal, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_mark_friend_requests_as_received(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.mark_friend_requests_as_received()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u64)\n\t\tawait self.mark_friend_requests_as_received(client, ids)\n\t\n\tasync def handle_add_black_list(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.add_black_list()\")\n\t\t#--- request ---\n\t\tprincipal = input.extract(BlacklistedPrincipal)\n\t\tresponse = await self.add_black_list(client, principal)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, BlacklistedPrincipal):\n\t\t\traise RuntimeError(\"Expected BlacklistedPrincipal, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_remove_black_list(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.remove_black_list()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tawait self.remove_black_list(client, pid)\n\t\n\tasync def handle_update_presence(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.update_presence()\")\n\t\t#--- request ---\n\t\tpresence = input.extract(NintendoPresenceV2)\n\t\tawait self.update_presence(client, presence)\n\t\n\tasync def handle_update_mii(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.update_mii()\")\n\t\t#--- request ---\n\t\tmii = input.extract(MiiV2)\n\t\tresponse = await self.update_mii(client, mii)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.DateTime):\n\t\t\traise RuntimeError(\"Expected common.DateTime, got %s\" %response.__class__.__name__)\n\t\toutput.datetime(response)\n\t\n\tasync def handle_update_comment(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.update_comment()\")\n\t\t#--- request ---\n\t\tcomment = input.extract(Comment)\n\t\tresponse = await self.update_comment(client, comment)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, common.DateTime):\n\t\t\traise RuntimeError(\"Expected common.DateTime, got %s\" %response.__class__.__name__)\n\t\toutput.datetime(response)\n\t\n\tasync def handle_update_preference(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.update_preference()\")\n\t\t#--- request ---\n\t\tpreference = input.extract(PrincipalPreference)\n\t\tawait self.update_preference(client, preference)\n\t\n\tasync def handle_get_basic_info(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.get_basic_info()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_basic_info(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_delete_persistent_notification(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.delete_persistent_notification()\")\n\t\t#--- request ---\n\t\tnotifications = input.list(PersistentNotification)\n\t\tawait self.delete_persistent_notification(client, notifications)\n\t\n\tasync def handle_check_setting_status(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.check_setting_status()\")\n\t\t#--- request ---\n\t\tresponse = await self.check_setting_status(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u8(response)\n\t\n\tasync def handle_get_request_block_settings(self, client, input, output):\n\t\tlogger.info(\"FriendsServerV2.get_request_block_settings()\")\n\t\t#--- request ---\n\t\tunk = input.list(input.u32)\n\t\tresponse = await self.get_request_block_settings(client, unk)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def update_and_get_all_information(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.update_and_get_all_information not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_friend(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.add_friend not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_friend_by_name(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.add_friend_by_name not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_friend(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.remove_friend not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_friend_request(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.add_friend_request not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_friend_request(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.cancel_friend_request not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def accept_friend_request(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.accept_friend_request not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_friend_request(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.delete_friend_request not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def deny_friend_request(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.deny_friend_request not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def mark_friend_requests_as_received(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.mark_friend_requests_as_received not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_black_list(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.add_black_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_black_list(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.remove_black_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_presence(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.update_presence not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_mii(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.update_mii not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_comment(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.update_comment not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_preference(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.update_preference not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_basic_info(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.get_basic_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_persistent_notification(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.delete_persistent_notification not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def check_setting_status(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.check_setting_status not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_request_block_settings(self, *args):\n\t\tlogger.warning(\"FriendsServerV2.get_request_block_settings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/health.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass HealthProtocol:\n\tMETHOD_PING_DAEMON = 1\n\tMETHOD_PING_DATABASE = 2\n\tMETHOD_RUN_SANITY_CHECK = 3\n\tMETHOD_FIX_SANITY_ERRORS = 4\n\t\n\tPROTOCOL_ID = 0x12\n\n\nclass HealthClient(HealthProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def ping_daemon(self):\n\t\tlogger.info(\"HealthClient.ping_daemon()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PING_DAEMON, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"HealthClient.ping_daemon -> done\")\n\t\treturn result\n\t\n\tasync def ping_database(self):\n\t\tlogger.info(\"HealthClient.ping_database()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PING_DATABASE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"HealthClient.ping_database -> done\")\n\t\treturn result\n\t\n\tasync def run_sanity_check(self):\n\t\tlogger.info(\"HealthClient.run_sanity_check()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RUN_SANITY_CHECK, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"HealthClient.run_sanity_check -> done\")\n\t\treturn result\n\t\n\tasync def fix_sanity_errors(self):\n\t\tlogger.info(\"HealthClient.fix_sanity_errors()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIX_SANITY_ERRORS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"HealthClient.fix_sanity_errors -> done\")\n\t\treturn result\n\n\nclass HealthServer(HealthProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PING_DAEMON: self.handle_ping_daemon,\n\t\t\tself.METHOD_PING_DATABASE: self.handle_ping_database,\n\t\t\tself.METHOD_RUN_SANITY_CHECK: self.handle_run_sanity_check,\n\t\t\tself.METHOD_FIX_SANITY_ERRORS: self.handle_fix_sanity_errors,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on HealthServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_ping_daemon(self, client, input, output):\n\t\tlogger.info(\"HealthServer.ping_daemon()\")\n\t\t#--- request ---\n\t\tresponse = await self.ping_daemon(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_ping_database(self, client, input, output):\n\t\tlogger.info(\"HealthServer.ping_database()\")\n\t\t#--- request ---\n\t\tresponse = await self.ping_database(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_run_sanity_check(self, client, input, output):\n\t\tlogger.info(\"HealthServer.run_sanity_check()\")\n\t\t#--- request ---\n\t\tresponse = await self.run_sanity_check(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_fix_sanity_errors(self, client, input, output):\n\t\tlogger.info(\"HealthServer.fix_sanity_errors()\")\n\t\t#--- request ---\n\t\tresponse = await self.fix_sanity_errors(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def ping_daemon(self, *args):\n\t\tlogger.warning(\"HealthServer.ping_daemon not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def ping_database(self, *args):\n\t\tlogger.warning(\"HealthServer.ping_database not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def run_sanity_check(self, *args):\n\t\tlogger.warning(\"HealthServer.run_sanity_check not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def fix_sanity_errors(self, *args):\n\t\tlogger.warning(\"HealthServer.fix_sanity_errors not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/hpp.py",
    "content": "\r\nfrom anynet import http, tls\r\nfrom nintendo import resources\r\nfrom nintendo.nex import common, kerberos, rmc, streams\r\nimport hashlib\r\nimport hmac\r\nimport secrets\r\n\r\n\r\nclass HppClient:\r\n\tdef __init__(self, settings, game_server_id, nex_version, pid, password):\r\n\t\tself.settings = settings\r\n\t\tself.game_server_id = game_server_id\r\n\t\tself.nex_version = nex_version\r\n\t\tself.pid = pid\r\n\t\tself.password = password\r\n\t\t\r\n\t\tself.environment = \"L1\"\r\n\t\t\r\n\t\tself.key_derivation = kerberos.KeyDerivationOld(65000, 1024)\r\n\t\t\r\n\t\tself.call_id = 1\r\n\t\t\r\n\t\tca = resources.certificate(\"Nintendo_Class_2_CA_G3.der\")\r\n\t\tself.context = tls.TLSContext()\r\n\t\tself.context.set_authority(ca)\r\n\r\n\tdef set_environment(self, env): self.environment = env\r\n\t\r\n\tdef host(self):\r\n\t\treturn \"hpp-%08x-%s.n.app.nintendo.net\" %(self.game_server_id, self.environment.lower())\r\n\r\n\tasync def request(self, protocol, method, body):\r\n\t\tcall_id = self.call_id\r\n\t\tself.call_id = (call_id + 1) & 0xFFFFFFFF\r\n\t\t\r\n\t\tmessage = rmc.RMCMessage.request(self.settings, protocol, method, call_id, body)\r\n\t\t\r\n\t\tdata = message.encode()\r\n\t\t\r\n\t\tkey1 = bytes.fromhex(self.settings[\"prudp.access_key\"]).ljust(8, b\"\\0\")\r\n\t\tkey2 = self.key_derivation.derive_key(self.password.encode(), self.pid)\r\n\t\t\r\n\t\tsignature1 = hmac.new(key1, data, hashlib.md5).hexdigest()\r\n\t\tsignature2 = hmac.new(key2, data, hashlib.md5).hexdigest()\r\n\t\t\r\n\t\trandom = secrets.token_hex(8).upper()\r\n\t\t\r\n\t\treq = http.HTTPRequest.post(\"https://%s/hpp/\" %self.host())\r\n\t\treq.headers[\"Host\"] = self.host()\r\n\t\treq.headers[\"pid\"] = str(self.pid)\r\n\t\treq.headers[\"version\"] = self.nex_version\r\n\t\treq.headers[\"token\"] = \"normaltoken\"\r\n\t\treq.headers[\"signature1\"] = signature1.upper()\r\n\t\treq.headers[\"signature2\"] = signature2.upper()\r\n\t\treq.headers[\"Content-Type\"] = \"multipart/form-data\"\r\n\t\treq.headers[\"Content-Length\"] = 0\r\n\t\treq.boundary = \"--------BOUNDARY--------\" + random\r\n\t\treq.files = {\"file\": data}\r\n\t\t\r\n\t\tresponse = await http.request(self.host(), req, self.context)\r\n\t\tif response.error():\r\n\t\t\traise ValueError(\"Hpp request failed with status %i\" %response.status_code)\r\n\t\t\r\n\t\tstream = streams.StreamIn(response.body, self.settings)\r\n\t\tif stream.u32() != stream.available():\r\n\t\t\traise ValueError(\"Hpp response has unexpected size\")\r\n\t\t\r\n\t\tsuccess = stream.bool()\r\n\t\tif not success:\r\n\t\t\terror = stream.u32()\r\n\t\t\tif call_id != stream.u32():\r\n\t\t\t\traise ValueError(\"Hpp error response has unexpected call id\")\r\n\t\t\tif not stream.eof():\r\n\t\t\t\traise ValueError(\"Hpp error response is bigger than expected\")\r\n\t\t\traise common.RMCError(error)\r\n\t\t\r\n\t\tif call_id != stream.u32():\r\n\t\t\traise ValueError(\"Hpp response has unexpected call id\")\r\n\t\tmethod_id = stream.u32()\r\n\t\tif method_id != method | 0x8000:\r\n\t\t\traise ValueError(\"Hpp response has unexpected method id\")\r\n\t\treturn stream.readall()\r\n"
  },
  {
    "path": "nintendo/nex/kerberos.py",
    "content": "\nfrom Crypto.Cipher import ARC4\nfrom nintendo.nex import streams\nimport struct\nimport secrets\nimport hashlib\nimport hmac\n\n\nclass KeyDerivationOld:\n\tdef __init__(self, base_count = 65000, pid_count = 1024):\n\t\tself.base_count = base_count\n\t\tself.pid_count = pid_count\n\t\t\n\tdef derive_key(self, password, pid):\n\t\tkey = password\n\t\tfor i in range(self.base_count + pid % self.pid_count):\n\t\t\tkey = hashlib.md5(key).digest()\n\t\treturn key\n\t\t\n\t\t\nclass KeyDerivationNew:\n\tdef __init__(self, base_count = 1, pid_count = 1):\n\t\tself.base_count = base_count\n\t\tself.pid_count = pid_count\n\t\t\n\tdef derive_key(self, password, pid):\n\t\tkey = password\n\t\tfor i in range(self.base_count):\n\t\t\tkey = hashlib.md5(key).digest()\n\t\t\t\n\t\tkey += struct.pack(\"<Q\", pid)\n\t\tfor i in range(self.pid_count):\n\t\t\tkey = hashlib.md5(key).digest()\n\t\t\t\n\t\treturn key\n\n\nclass KerberosEncryption:\n\tdef __init__(self, key):\n\t\tself.key = key\n\t\t\n\tdef check(self, buffer):\n\t\tdata = buffer[:-0x10]\n\t\tchecksum = buffer[-0x10:]\n\t\tmac = hmac.new(self.key, data, digestmod=hashlib.md5)\n\t\treturn checksum == mac.digest()\n\t\t\n\tdef decrypt(self, buffer):\n\t\tif not self.check(buffer):\n\t\t\traise ValueError(\"Invalid Kerberos checksum (incorrect password)\")\n\t\treturn ARC4.new(self.key).decrypt(buffer[:-0x10])\n\t\t\n\tdef encrypt(self, buffer):\n\t\tencrypted = ARC4.new(self.key).encrypt(buffer)\n\t\tmac = hmac.new(self.key, encrypted, digestmod=hashlib.md5)\n\t\treturn encrypted + mac.digest()\n\n\nclass ClientTicket:\n\tdef __init__(self):\n\t\tself.session_key = None\n\t\tself.target = None\n\t\tself.internal = b\"\"\n\t\n\t@classmethod\n\tdef decrypt(cls, data, key, settings):\n\t\tkerberos = KerberosEncryption(key)\n\t\tdecrypted = kerberos.decrypt(data)\n\t\tstream = streams.StreamIn(decrypted, settings)\n\t\t\n\t\tticket = cls()\n\t\tticket.session_key = stream.read(settings[\"kerberos.key_size\"])\n\t\tticket.target = stream.pid()\n\t\tticket.internal = stream.buffer()\n\t\treturn ticket\n\n\tdef encrypt(self, key, settings):\n\t\tstream = streams.StreamOut(settings)\n\t\tif settings[\"kerberos.key_size\"] != len(self.session_key):\n\t\t\traise ValueError(\"Incorrect session_key size\")\n\t\tstream.write(self.session_key)\n\t\tstream.pid(self.target)\n\t\tstream.buffer(self.internal)\n\n\t\tdata = stream.get()\n\t\tkerberos = KerberosEncryption(key)\n\t\treturn kerberos.encrypt(data)\n\t\t\n\t\t\nclass ServerTicket:\n\tdef __init__(self):\n\t\tself.timestamp = None\n\t\tself.source = None\n\t\tself.session_key = None\n\t\n\t@classmethod\n\tdef decrypt(cls, data, key, settings):\n\t\tif settings[\"kerberos.ticket_version\"] == 1:\n\t\t\tstream = streams.StreamIn(data, settings)\n\t\t\tticket_key = stream.buffer()\n\t\t\tdata = stream.buffer()\n\t\t\tkey = hashlib.md5(key + ticket_key).digest()\n\n\t\tkerberos = KerberosEncryption(key)\n\t\tdecrypted = kerberos.decrypt(data)\n\t\t\n\t\tstream = streams.StreamIn(decrypted, settings)\n\t\t\n\t\tticket = cls()\n\t\tticket.timestamp = stream.datetime()\n\t\tticket.source = stream.pid()\n\t\tticket.session_key = stream.read(settings[\"kerberos.key_size\"])\n\t\treturn ticket\n\n\tdef encrypt(self, key, settings):\n\t\tstream = streams.StreamOut(settings)\n\t\tstream.datetime(self.timestamp)\n\t\tstream.pid(self.source)\n\t\tif len(self.session_key) != settings[\"kerberos.key_size\"]:\n\t\t\traise ValueError(\"Incorrect session_key length\")\n\t\tstream.write(self.session_key)\n\n\t\tdata = stream.get()\n\t\tif settings[\"kerberos.ticket_version\"] == 1:\n\t\t\tticket_key = secrets.token_bytes(16)\n\t\t\tfinal_key = hashlib.md5(key + ticket_key).digest()\n\n\t\t\tkerberos = KerberosEncryption(final_key)\n\t\t\tencrypted = kerberos.encrypt(data)\n\t\t\t\n\t\t\tstream = streams.StreamOut(settings)\n\t\t\tstream.buffer(ticket_key)\n\t\t\tstream.buffer(encrypted)\n\t\t\treturn stream.get()\n\t\t\n\t\tkerberos = KerberosEncryption(key)\n\t\tencrypted = kerberos.encrypt(data)\n\t\treturn encrypted\n\n\nclass Credentials:\n\tdef __init__(self, ticket, pid, cid):\n\t\tself.ticket = ticket\n\t\tself.pid = pid\n\t\tself.cid = cid\n"
  },
  {
    "path": "nintendo/nex/matchmaking.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MatchmakeSystem:\n\tGLOBAL = 1\n\tFRIENDS = 2\n\n\nclass Gathering(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = 0\n\t\tself.owner = 0\n\t\tself.host = 0\n\t\tself.min_participants = 0\n\t\tself.max_participants = 0\n\t\tself.participation_policy = 1\n\t\tself.policy_argument = 0\n\t\tself.flags = 512\n\t\tself.state = 0\n\t\tself.description = \"\"\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.host = stream.pid()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.flags = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.description = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.pid(self.host)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.u32(self.flags)\n\t\tstream.u32(self.state)\n\t\tstream.string(self.description)\n\n\nclass GatheringURLs(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.urls = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'urls']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.urls = stream.list(stream.stationurl)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.urls, stream.stationurl)\n\n\nclass GatheringStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.flags = None\n\t\tself.values = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'flags', 'values']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.flags = stream.u32()\n\t\tself.values = stream.list(stream.float)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.flags)\n\t\tstream.list(self.values, stream.float)\n\n\nclass Invitation(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.guest = None\n\t\tself.message = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'guest', 'message']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.guest = stream.u32()\n\t\tself.message = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.guest)\n\t\tstream.string(self.message)\n\n\nclass ParticipantDetails(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.message = None\n\t\tself.participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'message', 'participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.message = stream.string()\n\t\tself.participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.string(self.message)\n\t\tstream.u16(self.participants)\n\n\nclass DeletionEntry(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.pid = None\n\t\tself.reason = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'pid', 'reason']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.reason = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.reason)\n\n\nclass MatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.param = {}\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.param = stream.map(stream.string, stream.variant)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.map(self.param, stream.string, stream.variant)\n\n\nclass MatchmakeSessionSearchCriteria(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.attribs = [\"\", \"\", \"\", \"\", \"\", \"\"]\n\t\tself.game_mode = \"\"\n\t\tself.min_participants = \"\"\n\t\tself.max_participants = \"\"\n\t\tself.matchmake_system = \"\"\n\t\tself.vacant_only = True\n\t\tself.exclude_locked = True\n\t\tself.exclude_non_host_pid = False\n\t\tself.selection_method = 0\n\t\tself.vacant_participants = 1\n\t\tself.param = MatchmakeParam()\n\t\tself.exclude_user_password = False\n\t\tself.exclude_system_password = False\n\t\tself.refer_gid = 0\n\t\tself.codeword = \"\"\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.attribs = stream.list(stream.string)\n\t\tself.game_mode = stream.string()\n\t\tself.min_participants = stream.string()\n\t\tself.max_participants = stream.string()\n\t\tself.matchmake_system = stream.string()\n\t\tself.vacant_only = stream.bool()\n\t\tself.exclude_locked = stream.bool()\n\t\tself.exclude_non_host_pid = stream.bool()\n\t\tself.selection_method = stream.u32()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.vacant_participants = stream.u16()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.exclude_user_password = stream.bool()\n\t\t\tself.exclude_system_password = stream.bool()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.codeword = stream.string()\n\t\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.attribs, stream.string)\n\t\tstream.string(self.game_mode)\n\t\tstream.string(self.min_participants)\n\t\tstream.string(self.max_participants)\n\t\tstream.string(self.matchmake_system)\n\t\tstream.bool(self.vacant_only)\n\t\tstream.bool(self.exclude_locked)\n\t\tstream.bool(self.exclude_non_host_pid)\n\t\tstream.u32(self.selection_method)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u16(self.vacant_participants)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.add(self.param)\n\t\t\tstream.bool(self.exclude_user_password)\n\t\t\tstream.bool(self.exclude_system_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.string(self.codeword)\n\t\t\tstream.add(self.range)\n\n\nclass MatchmakeSession(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.game_mode = 0\n\t\tself.attribs = [0, 0, 0, 0, 0, 0]\n\t\tself.open_participation = True\n\t\tself.matchmake_system = 0\n\t\tself.application_data = b\"\"\n\t\tself.num_participants = 0\n\t\tself.progress_score = 100\n\t\tself.session_key = b\"\"\n\t\tself.option = 0\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = common.DateTime(0)\n\t\tself.user_password = \"\"\n\t\tself.refer_gid = 0\n\t\tself.user_password_enabled = False\n\t\tself.system_password_enabled = False\n\t\tself.codeword = \"\"\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tversion = 1\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tversion = 2\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tversion = 3\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30000:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.game_mode = stream.u32()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\tself.num_participants = stream.u32()\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.progress_score = stream.u8()\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tself.session_key = stream.buffer()\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.option = stream.u32()\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\t\t\tself.started_time = stream.datetime()\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tself.user_password = stream.string()\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tself.refer_gid = stream.u32()\n\t\t\t\t\tself.user_password_enabled = stream.bool()\n\t\t\t\t\tself.system_password_enabled = stream.bool()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.progress_score = stream.u8()\n\t\t\tself.session_key = stream.buffer()\n\t\t\tself.option = stream.u32()\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.started_time = stream.datetime()\n\t\t\tself.user_password = stream.string()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.user_password_enabled = stream.bool()\n\t\t\tself.system_password_enabled = stream.bool()\n\t\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.game_mode)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.buffer(self.application_data)\n\t\tstream.u32(self.num_participants)\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u8(self.progress_score)\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tstream.buffer(self.session_key)\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u32(self.option)\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tstream.add(self.param)\n\t\t\t\t\tstream.datetime(self.started_time)\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tstream.string(self.user_password)\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tstream.u32(self.refer_gid)\n\t\t\t\t\tstream.bool(self.user_password_enabled)\n\t\t\t\t\tstream.bool(self.system_password_enabled)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.u8(self.progress_score)\n\t\t\tstream.buffer(self.session_key)\n\t\t\tstream.u32(self.option)\n\t\t\tstream.add(self.param)\n\t\t\tstream.datetime(self.started_time)\n\t\t\tstream.string(self.user_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.bool(self.user_password_enabled)\n\t\t\tstream.bool(self.system_password_enabled)\n\t\t\tstream.string(self.codeword)\ncommon.DataHolder.register(MatchmakeSession, \"MatchmakeSession\")\n\n\nclass MatchmakeBlockListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.options = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.options = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.options)\n\n\nclass CreateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.additional_participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['additional_participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.additional_participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.additional_participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\n\nclass JoinMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.behavior = None\n\t\tself.user_password = None\n\t\tself.system_password = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.extra_participants = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'participants', 'gid_for_participation_check', 'options', 'behavior', 'user_password', 'system_password', 'join_message', 'num_participants', 'extra_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.behavior = stream.u8()\n\t\tself.user_password = stream.string()\n\t\tself.system_password = stream.string()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.extra_participants = stream.u16()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.u8(self.behavior)\n\t\tstream.string(self.user_password)\n\t\tstream.string(self.system_password)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.u16(self.extra_participants)\n\t\tstream.add(self.block_list)\n\n\nclass UpdateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.modification_flags = None\n\t\tself.attributes = None\n\t\tself.open_participation = None\n\t\tself.application_buffer = None\n\t\tself.progress_score = None\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = None\n\t\tself.user_password = None\n\t\tself.game_mode = None\n\t\tself.description = None\n\t\tself.min_participants = None\n\t\tself.max_participants = None\n\t\tself.matchmake_system = None\n\t\tself.participation_policy = None\n\t\tself.policy_argument = None\n\t\tself.codeword = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'modification_flags', 'attributes', 'open_participation', 'application_buffer', 'progress_score', 'started_time', 'user_password', 'game_mode', 'description', 'min_participants', 'max_participants', 'matchmake_system', 'participation_policy', 'policy_argument', 'codeword']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.modification_flags = stream.u32()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.application_buffer = stream.buffer()\n\t\tself.progress_score = stream.u8()\n\t\tself.param = stream.extract(MatchmakeParam)\n\t\tself.started_time = stream.datetime()\n\t\tself.user_password = stream.string()\n\t\tself.game_mode = stream.u32()\n\t\tself.description = stream.string()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.modification_flags)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.u8(self.progress_score)\n\t\tstream.add(self.param)\n\t\tstream.datetime(self.started_time)\n\t\tstream.string(self.user_password)\n\t\tstream.u32(self.game_mode)\n\t\tstream.string(self.description)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.string(self.codeword)\n\n\nclass AutoMatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.search_criteria = None\n\t\tself.target_gids = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants', 'search_criteria', 'target_gids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.search_criteria = stream.list(MatchmakeSessionSearchCriteria)\n\t\tself.target_gids = stream.list(stream.u32)\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.list(self.search_criteria, stream.add)\n\t\tstream.list(self.target_gids, stream.u32)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pids = None\n\t\tself.options = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids', 'options']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.options = stream.u32()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u32(self.options)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.session = MatchmakeSession()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.session)\n\n\nclass PersistentGathering(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.password = None\n\t\tself.attribs = None\n\t\tself.application_buffer = None\n\t\tself.participation_start = None\n\t\tself.participation_end = None\n\t\tself.matchmake_session_count = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'password', 'attribs', 'application_buffer', 'participation_start', 'participation_end', 'matchmake_session_count', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.password = stream.string()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.application_buffer = stream.buffer()\n\t\tself.participation_start = stream.datetime()\n\t\tself.participation_end = stream.datetime()\n\t\tself.matchmake_session_count = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.string(self.password)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.datetime(self.participation_start)\n\t\tstream.datetime(self.participation_end)\n\t\tstream.u32(self.matchmake_session_count)\n\t\tstream.u32(self.num_participants)\ncommon.DataHolder.register(PersistentGathering, \"PersistentGathering\")\n\n\nclass SimpleCommunity(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.matchmake_session_count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'matchmake_session_count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.matchmake_session_count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.matchmake_session_count)\n\n\nclass PlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gathering = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gathering']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gathering = stream.anydata()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.anydata(self.gathering)\n\n\nclass SimplePlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gid = None\n\t\tself.game_mode = None\n\t\tself.attribute = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gid', 'game_mode', 'attribute']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gid = stream.u32()\n\t\tself.game_mode = stream.u32()\n\t\tself.attribute = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.game_mode)\n\t\tstream.u32(self.attribute)\n\n\nclass MatchmakeRefereeRound(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.gid = None\n\t\tself.state = None\n\t\tself.personal_data_category = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'gid', 'state', 'personal_data_category', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u64()\n\t\tself.gid = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.personal_data_category = stream.u32()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.id)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.state)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereeStartRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.personal_data_category = None\n\t\tself.gid = None\n\t\tself.pids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['personal_data_category', 'gid', 'pids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.personal_data_category = stream.u32()\n\t\tself.gid = stream.u32()\n\t\tself.pids = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.pids, stream.pid)\n\n\nclass MatchmakeRefereeEndRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.round_id = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['round_id', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.round_id = stream.u64()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.round_id)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereePersonalRoundResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.personal_round_result_flag = None\n\t\tself.round_win_loss = None\n\t\tself.rating_change = None\n\t\tself.buffer = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'personal_round_result_flag', 'round_win_loss', 'rating_change', 'buffer']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.personal_round_result_flag = stream.u32()\n\t\tself.round_win_loss = stream.u32()\n\t\tself.rating_change = stream.s32()\n\t\tself.buffer = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.personal_round_result_flag)\n\t\tstream.u32(self.round_win_loss)\n\t\tstream.s32(self.rating_change)\n\t\tstream.qbuffer(self.buffer)\n\n\nclass MatchmakeRefereeStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = None\n\t\tself.category = None\n\t\tself.pid = None\n\t\tself.recent_disconnection = None\n\t\tself.recent_violation = None\n\t\tself.recent_mismatch = None\n\t\tself.recent_win = None\n\t\tself.recent_loss = None\n\t\tself.recent_draw = None\n\t\tself.total_disconnect = None\n\t\tself.total_violation = None\n\t\tself.total_mismatch = None\n\t\tself.total_win = None\n\t\tself.total_loss = None\n\t\tself.total_draw = None\n\t\tself.rating_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unique_id', 'category', 'pid', 'recent_disconnection', 'recent_violation', 'recent_mismatch', 'recent_win', 'recent_loss', 'recent_draw', 'total_disconnect', 'total_violation', 'total_mismatch', 'total_win', 'total_loss', 'total_draw', 'rating_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.recent_disconnection = stream.u32()\n\t\tself.recent_violation = stream.u32()\n\t\tself.recent_mismatch = stream.u32()\n\t\tself.recent_win = stream.u32()\n\t\tself.recent_loss = stream.u32()\n\t\tself.recent_draw = stream.u32()\n\t\tself.total_disconnect = stream.u32()\n\t\tself.total_violation = stream.u32()\n\t\tself.total_mismatch = stream.u32()\n\t\tself.total_win = stream.u32()\n\t\tself.total_loss = stream.u32()\n\t\tself.total_draw = stream.u32()\n\t\tself.rating_value = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.category)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.recent_disconnection)\n\t\tstream.u32(self.recent_violation)\n\t\tstream.u32(self.recent_mismatch)\n\t\tstream.u32(self.recent_win)\n\t\tstream.u32(self.recent_loss)\n\t\tstream.u32(self.recent_draw)\n\t\tstream.u32(self.total_disconnect)\n\t\tstream.u32(self.total_violation)\n\t\tstream.u32(self.total_mismatch)\n\t\tstream.u32(self.total_win)\n\t\tstream.u32(self.total_loss)\n\t\tstream.u32(self.total_draw)\n\t\tstream.u32(self.rating_value)\n\n\nclass MatchmakeRefereeStatsTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.category = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\n\nclass MatchmakeRefereeStatsInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.initial_rating = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'initial_rating']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.initial_rating = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.initial_rating)\n\n\nclass MatchMakingProtocol:\n\tMETHOD_REGISTER_GATHERING = 1\n\tMETHOD_UNREGISTER_GATHERING = 2\n\tMETHOD_UNREGISTER_GATHERINGS = 3\n\tMETHOD_UPDATE_GATHERING = 4\n\tMETHOD_INVITE = 5\n\tMETHOD_ACCEPT_INVITATION = 6\n\tMETHOD_DECLINE_INVITATION = 7\n\tMETHOD_CANCEL_INVITATION = 8\n\tMETHOD_GET_INVITATIONS_SENT = 9\n\tMETHOD_GET_INVITATIONS_RECEIVED = 10\n\tMETHOD_PARTICIPATE = 11\n\tMETHOD_CANCEL_PARTICIPATION = 12\n\tMETHOD_GET_PARTICIPANTS = 13\n\tMETHOD_ADD_PARTICIPANTS = 14\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 15\n\tMETHOD_GET_PARTICIPANTS_URLS = 16\n\tMETHOD_FIND_BY_TYPE = 17\n\tMETHOD_FIND_BY_DESCRIPTION = 18\n\tMETHOD_FIND_BY_DESCRIPTION_REGEX = 19\n\tMETHOD_FIND_BY_ID = 20\n\tMETHOD_FIND_BY_SINGLE_ID = 21\n\tMETHOD_FIND_BY_OWNER = 22\n\tMETHOD_FIND_BY_PARTICIPANTS = 23\n\tMETHOD_FIND_INVITATIONS = 24\n\tMETHOD_FIND_BY_SQL_QUERY = 25\n\tMETHOD_LAUNCH_SESSION = 26\n\tMETHOD_UPDATE_SESSION_URL = 27\n\tMETHOD_GET_SESSION_URL = 28\n\tMETHOD_GET_STATE = 29\n\tMETHOD_SET_STATE = 30\n\tMETHOD_REPORT_STATS = 31\n\tMETHOD_GET_STATS = 32\n\tMETHOD_DELETE_GATHERING = 33\n\tMETHOD_GET_PENDING_DELETIONS = 34\n\tMETHOD_DELETE_FROM_DELETIONS = 35\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP_V1 = 36\n\tMETHOD_FIND_BY_DESCRIPTION_LIKE = 37\n\tMETHOD_REGISTER_LOCAL_URL = 38\n\tMETHOD_REGISTER_LOCAL_URLS = 39\n\tMETHOD_UPDATE_SESSION_HOST_V1 = 40\n\tMETHOD_GET_SESSION_URLS = 41\n\tMETHOD_UPDATE_SESSION_HOST = 42\n\tMETHOD_UPDATE_GATHERING_OWNERSHIP = 43\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP = 44\n\t\n\tPROTOCOL_ID = 0x15\n\n\nclass MatchMakingProtocolExt:\n\tMETHOD_END_PARTICIPATION = 1\n\tMETHOD_GET_PARTICIPANTS = 2\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 3\n\tMETHOD_GET_PARTICIPANTS_URLS = 4\n\tMETHOD_GET_GATHERING_RELATIONS = 5\n\tMETHOD_DELETE_FROM_DELETIONS = 6\n\t\n\tPROTOCOL_ID = 0x32\n\n\nclass MatchmakeExtensionProtocol:\n\tMETHOD_CLOSE_PARTICIPATION = 1\n\tMETHOD_OPEN_PARTICIPATION = 2\n\tMETHOD_AUTO_MATCHMAKE_POSTPONE = 3\n\tMETHOD_BROWSE_MATCHMAKE_SESSION = 4\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS = 5\n\tMETHOD_CREATE_MATCHMAKE_SESSION = 6\n\tMETHOD_JOIN_MATCHMAKE_SESSION = 7\n\tMETHOD_MODIFY_CURRENT_GAME_ATTRIBUTE = 8\n\tMETHOD_UPDATE_NOTIFICATION_DATA = 9\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA = 10\n\tMETHOD_UPDATE_APPLICATION_BUFFER = 11\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE = 12\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA_LIST = 13\n\tMETHOD_UPDATE_MATCHMAKE_SESSION = 14\n\tMETHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE = 15\n\tMETHOD_GET_PLAYING_SESSION = 16\n\tMETHOD_CREATE_COMMUNITY = 17\n\tMETHOD_UPDATE_COMMUNITY = 18\n\tMETHOD_JOIN_COMMUNITY = 19\n\tMETHOD_FIND_COMMUNITY_BY_GATHERING_ID = 20\n\tMETHOD_FIND_OFFICIAL_COMMUNITY = 21\n\tMETHOD_FIND_COMMUNITY_BY_PARTICIPANT = 22\n\tMETHOD_UPDATE_PRIVACY_SETTING = 23\n\tMETHOD_GET_MY_BLOCK_LIST = 24\n\tMETHOD_ADD_TO_BLOCK_LIST = 25\n\tMETHOD_REMOVE_FROM_BLOCK_LIST = 26\n\tMETHOD_CLEAR_MY_BLOCK_LIST = 27\n\tMETHOD_REPORT_VIOLATION = 28\n\tMETHOD_IS_VIOLATION_USER = 29\n\tMETHOD_JOIN_MATCHMAKE_SESSION_EX = 30\n\tMETHOD_GET_SIMPLE_PLAYING_SESSION = 31\n\tMETHOD_GET_SIMPLE_COMMUNITY = 32\n\tMETHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE = 33\n\tMETHOD_UPDATE_PROGRESS_SCORE = 34\n\tMETHOD_DEBUG_NOTIFY_EVENT = 35\n\tMETHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 36\n\tMETHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 37\n\tMETHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM = 38\n\tMETHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM = 39\n\tMETHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE = 40\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL = 41\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER = 42\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER = 43\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_PART = 44\n\tMETHOD_REQUEST_MATCHMAKING = 45\n\tMETHOD_WITHDRAW_MATCHMAKING = 46\n\tMETHOD_WITHDRAW_MATCHMAKING_ALL = 47\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID = 48\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID = 49\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_OWNER = 50\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT = 51\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE = 52\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE = 53\n\t\n\tPROTOCOL_ID = 0x6D\n\n\nclass MatchmakeRefereeProtocol:\n\tMETHOD_START_ROUND = 1\n\tMETHOD_GET_START_ROUND_PARAM = 2\n\tMETHOD_END_ROUND = 3\n\tMETHOD_END_ROUND_WITHOUT_REPORT = 4\n\tMETHOD_GET_ROUND_PARTICIPANTS = 5\n\tMETHOD_GET_NOT_SUMMARIZED_ROUND = 6\n\tMETHOD_GET_ROUND = 7\n\tMETHOD_GET_STATS_PRIMARY = 8\n\tMETHOD_GET_STATS_PRIMARIES = 9\n\tMETHOD_GET_STATS_ALL = 10\n\tMETHOD_CREATE_STATS = 11\n\tMETHOD_GET_OR_CREATE_STATS = 12\n\tMETHOD_RESET_STATS = 13\n\t\n\tPROTOCOL_ID = 0x78\n\n\nclass MatchMakingClient(MatchMakingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.register_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_gathering -> done\")\n\t\treturn gid\n\t\n\tasync def unregister_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering -> done\")\n\t\treturn result\n\t\n\tasync def unregister_gatherings(self, gids):\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings -> done\")\n\t\treturn result\n\t\n\tasync def update_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.update_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering -> done\")\n\t\treturn result\n\t\n\tasync def invite(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.invite()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_INVITE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.invite -> done\")\n\t\treturn result\n\t\n\tasync def accept_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.accept_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACCEPT_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.accept_invitation -> done\")\n\t\treturn result\n\t\n\tasync def decline_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.decline_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DECLINE_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.decline_invitation -> done\")\n\t\treturn result\n\t\n\tasync def cancel_invitation(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation -> done\")\n\t\treturn result\n\t\n\tasync def get_invitations_sent(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_SENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent -> done\")\n\t\treturn invitations\n\t\n\tasync def get_invitations_received(self):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_RECEIVED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received -> done\")\n\t\treturn invitations\n\t\n\tasync def participate(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.participate()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PARTICIPATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.participate -> done\")\n\t\treturn result\n\t\n\tasync def cancel_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def add_participants(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.add_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.add_participants -> done\")\n\t\treturn result\n\t\n\tasync def get_detailed_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def find_by_type(self, type, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_type()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(type)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_TYPE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_type -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description_regex(self, regex, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(regex)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_REGEX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_id(self, ids):\n\t\tlogger.info(\"MatchMakingClient.find_by_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_id -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_single_id(self, gid):\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SINGLE_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id -> done\")\n\t\treturn obj\n\t\n\tasync def find_by_owner(self, owner, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_owner -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_participants(self, pids):\n\t\tlogger.info(\"MatchMakingClient.find_by_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_participants -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_invitations(self, range):\n\t\tlogger.info(\"MatchMakingClient.find_invitations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_INVITATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_invitations -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_sql_query(self, query, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(query)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SQL_QUERY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query -> done\")\n\t\treturn gatherings\n\t\n\tasync def launch_session(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.launch_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LAUNCH_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.launch_session -> done\")\n\t\treturn result\n\t\n\tasync def update_session_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.update_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_url -> done\")\n\t\treturn result\n\t\n\tasync def get_session_url(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.url = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_url -> done\")\n\t\treturn obj\n\t\n\tasync def get_state(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.state = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_state -> done\")\n\t\treturn obj\n\t\n\tasync def set_state(self, gid, state):\n\t\tlogger.info(\"MatchMakingClient.set_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(state)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.set_state -> done\")\n\t\treturn result\n\t\n\tasync def report_stats(self, gid, stats):\n\t\tlogger.info(\"MatchMakingClient.report_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(stats, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.report_stats -> done\")\n\t\treturn result\n\t\n\tasync def get_stats(self, gid, pids, columns):\n\t\tlogger.info(\"MatchMakingClient.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.list(columns, stream.u8)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.stats = stream.list(GatheringStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_stats -> done\")\n\t\treturn obj\n\t\n\tasync def delete_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.delete_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_gathering -> done\")\n\t\treturn result\n\t\n\tasync def get_pending_deletions(self, reason, range):\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(reason)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PENDING_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.deletions = stream.list(DeletionEntry)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions -> done\")\n\t\treturn obj\n\t\n\tasync def delete_from_deletions(self, deletions):\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership_v1(self, gid, potential_owners):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1 -> done\")\n\t\treturn result\n\t\n\tasync def find_by_description_like(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_LIKE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like -> done\")\n\t\treturn gatherings\n\t\n\tasync def register_local_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.register_local_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.stationurl(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_url -> done\")\n\t\n\tasync def register_local_urls(self, gid, urls):\n\t\tlogger.info(\"MatchMakingClient.register_local_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_urls -> done\")\n\t\n\tasync def update_session_host_v1(self, gid):\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1 -> done\")\n\t\n\tasync def get_session_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_urls -> done\")\n\t\treturn urls\n\t\n\tasync def update_session_host(self, gid, is_migrate_owner):\n\t\tlogger.info(\"MatchMakingClient.update_session_host()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(is_migrate_owner)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host -> done\")\n\t\n\tasync def update_gathering_ownership(self, gid, participants_only):\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership(self, gid, potential_owners, participants_only):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership -> done\")\n\n\nclass MatchMakingClientExt(MatchMakingProtocolExt):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def end_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClientExt.end_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.end_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def get_detailed_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gids):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def get_gathering_relations(self, id, descr):\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.string(descr)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_GATHERING_RELATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations -> done\")\n\t\treturn result\n\t\n\tasync def delete_from_deletions(self, deletions, pid):\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions -> done\")\n\n\nclass MatchmakeExtensionClient(MatchmakeExtensionProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def close_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.close_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLOSE_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.close_participation -> done\")\n\t\n\tasync def open_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.open_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_OPEN_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.open_participation -> done\")\n\t\n\tasync def auto_matchmake_postpone(self, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def browse_matchmake_session(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session -> done\")\n\t\treturn gatherings\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gatherings = stream.list(stream.anydata)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls -> done\")\n\t\treturn obj\n\t\n\tasync def create_matchmake_session(self, gathering, description, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(description)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gid = stream.u32()\n\t\tobj.session_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session(self, gid, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session -> done\")\n\t\treturn session_key\n\t\n\tasync def modify_current_game_attribute(self, gid, attrib, value):\n\t\tlogger.info(\"MatchmakeExtensionClient.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(attrib)\n\t\tstream.u32(value)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.modify_current_game_attribute -> done\")\n\t\n\tasync def update_notification_data(self, type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(type)\n\t\tstream.pid(param1)\n\t\tstream.pid(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_notification_data -> done\")\n\t\n\tasync def get_friend_notification_data(self, type):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.s32(type)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data -> done\")\n\t\treturn notifications\n\t\n\tasync def update_application_buffer(self, gid, buffer):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_application_buffer()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.buffer(buffer)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_APPLICATION_BUFFER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_application_buffer -> done\")\n\t\n\tasync def update_matchmake_session_attribute(self, gid, attribs):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(attribs, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_attribute -> done\")\n\t\n\tasync def get_friend_notification_data_list(self, types):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(types, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data_list -> done\")\n\t\treturn notifications\n\t\n\tasync def update_matchmake_session(self, gathering):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session -> done\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, search_criteria, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(search_criteria, stream.add)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_search_criteria_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def get_playing_session(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(PlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_playing_session -> done\")\n\t\treturn sessions\n\t\n\tasync def create_community(self, community, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.create_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.create_community -> done\")\n\t\treturn gid\n\t\n\tasync def update_community(self, community):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_community -> done\")\n\t\n\tasync def join_community(self, gid, message, password):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tstream.string(password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_community -> done\")\n\t\n\tasync def find_community_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_gathering_id -> done\")\n\t\treturn communities\n\t\n\tasync def find_official_community(self, available_only, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_official_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(available_only)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_OFFICIAL_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_official_community -> done\")\n\t\treturn communities\n\t\n\tasync def find_community_by_participant(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_participant -> done\")\n\t\treturn communities\n\t\n\tasync def update_privacy_setting(self, online_status, community_participation):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(online_status)\n\t\tstream.bool(community_participation)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRIVACY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_privacy_setting -> done\")\n\t\n\tasync def get_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_my_block_list -> done\")\n\t\treturn pids\n\t\n\tasync def add_to_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClient.add_to_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_TO_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.add_to_block_list -> done\")\n\t\n\tasync def remove_from_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClient.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FROM_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.remove_from_block_list -> done\")\n\t\n\tasync def clear_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_my_block_list -> done\")\n\t\n\tasync def report_violation(self, pid, username, violation_code):\n\t\tlogger.info(\"MatchmakeExtensionClient.report_violation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.string(username)\n\t\tstream.u32(violation_code)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_VIOLATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.report_violation -> done\")\n\t\n\tasync def is_violation_user(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.is_violation_user()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_VIOLATION_USER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.flag = stream.bool()\n\t\tobj.score = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.is_violation_user -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session_ex(self, gid, gmessage, ignore_block_list, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(gmessage)\n\t\tstream.bool(ignore_block_list)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_ex -> done\")\n\t\treturn session_key\n\t\n\tasync def get_simple_playing_session(self, pids, include_login_user):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.bool(include_login_user)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.list(SimplePlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_playing_session -> done\")\n\t\treturn session\n\t\n\tasync def get_simple_community(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(SimpleCommunity)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_community -> done\")\n\t\treturn communities\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, gids, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tjoined_gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_gathering_id_postpone -> done\")\n\t\treturn joined_gathering\n\t\n\tasync def update_progress_score(self, gid, score):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_progress_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u8(score)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PROGRESS_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_progress_score -> done\")\n\t\n\tasync def debug_notify_event(self, pid, main_type, sub_type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClient.debug_notify_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.u32(main_type)\n\t\tstream.u32(sub_type)\n\t\tstream.u64(param1)\n\t\tstream.u64(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DEBUG_NOTIFY_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.debug_notify_event -> done\")\n\t\n\tasync def generate_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpassword = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.generate_matchmake_session_system_password -> done\")\n\t\treturn password\n\t\n\tasync def clear_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_matchmake_session_system_password -> done\")\n\t\n\tasync def create_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def join_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def auto_matchmake_with_param_postpone(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_param_postpone -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id_detail -> done\")\n\t\treturn session\n\t\n\tasync def browse_matchmake_session_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder -> done\")\n\t\treturn obj\n\t\n\tasync def update_matchmake_session_part(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_PART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_part -> done\")\n\t\n\tasync def request_matchmaking(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.request_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trequest_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.request_matchmaking -> done\")\n\t\treturn request_id\n\t\n\tasync def withdraw_matchmaking(self, request_id):\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(request_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking -> done\")\n\t\n\tasync def withdraw_matchmaking_all(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking_all -> done\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_single_gathering_id -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_owner(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_owner -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_participant(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.list(FindMatchmakeSessionByParticipantResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_participant -> done\")\n\t\treturn result\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder_no_result_range -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder_no_result_range -> done\")\n\t\treturn obj\n\n\nclass MatchmakeRefereeClient(MatchmakeRefereeProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def start_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_START_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round -> done\")\n\t\treturn round_id\n\t\n\tasync def get_start_round_param(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_START_ROUND_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparam = stream.extract(MatchmakeRefereeStartRoundParam)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param -> done\")\n\t\treturn param\n\t\n\tasync def end_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round -> done\")\n\t\n\tasync def end_round_without_report(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND_WITHOUT_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report -> done\")\n\t\n\tasync def get_round_participants(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants -> done\")\n\t\treturn pids\n\t\n\tasync def get_not_summarized_round(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOT_SUMMARIZED_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trounds = stream.list(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round -> done\")\n\t\treturn rounds\n\t\n\tasync def get_round(self, round):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround = stream.extract(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round -> done\")\n\t\treturn round\n\t\n\tasync def get_stats_primary(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary -> done\")\n\t\treturn stats\n\t\n\tasync def get_stats_primaries(self, targets):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARIES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.stats = stream.list(MatchmakeRefereeStats)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries -> done\")\n\t\treturn obj\n\t\n\tasync def get_stats_all(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.list(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all -> done\")\n\t\treturn stats\n\t\n\tasync def create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_or_create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OR_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def reset_stats(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats -> done\")\n\n\nclass MatchMakingServer(MatchMakingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER_GATHERING: self.handle_register_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERING: self.handle_unregister_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERINGS: self.handle_unregister_gatherings,\n\t\t\tself.METHOD_UPDATE_GATHERING: self.handle_update_gathering,\n\t\t\tself.METHOD_INVITE: self.handle_invite,\n\t\t\tself.METHOD_ACCEPT_INVITATION: self.handle_accept_invitation,\n\t\t\tself.METHOD_DECLINE_INVITATION: self.handle_decline_invitation,\n\t\t\tself.METHOD_CANCEL_INVITATION: self.handle_cancel_invitation,\n\t\t\tself.METHOD_GET_INVITATIONS_SENT: self.handle_get_invitations_sent,\n\t\t\tself.METHOD_GET_INVITATIONS_RECEIVED: self.handle_get_invitations_received,\n\t\t\tself.METHOD_PARTICIPATE: self.handle_participate,\n\t\t\tself.METHOD_CANCEL_PARTICIPATION: self.handle_cancel_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_ADD_PARTICIPANTS: self.handle_add_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_FIND_BY_TYPE: self.handle_find_by_type,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION: self.handle_find_by_description,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_REGEX: self.handle_find_by_description_regex,\n\t\t\tself.METHOD_FIND_BY_ID: self.handle_find_by_id,\n\t\t\tself.METHOD_FIND_BY_SINGLE_ID: self.handle_find_by_single_id,\n\t\t\tself.METHOD_FIND_BY_OWNER: self.handle_find_by_owner,\n\t\t\tself.METHOD_FIND_BY_PARTICIPANTS: self.handle_find_by_participants,\n\t\t\tself.METHOD_FIND_INVITATIONS: self.handle_find_invitations,\n\t\t\tself.METHOD_FIND_BY_SQL_QUERY: self.handle_find_by_sql_query,\n\t\t\tself.METHOD_LAUNCH_SESSION: self.handle_launch_session,\n\t\t\tself.METHOD_UPDATE_SESSION_URL: self.handle_update_session_url,\n\t\t\tself.METHOD_GET_SESSION_URL: self.handle_get_session_url,\n\t\t\tself.METHOD_GET_STATE: self.handle_get_state,\n\t\t\tself.METHOD_SET_STATE: self.handle_set_state,\n\t\t\tself.METHOD_REPORT_STATS: self.handle_report_stats,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_DELETE_GATHERING: self.handle_delete_gathering,\n\t\t\tself.METHOD_GET_PENDING_DELETIONS: self.handle_get_pending_deletions,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1: self.handle_migrate_gathering_ownership_v1,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_LIKE: self.handle_find_by_description_like,\n\t\t\tself.METHOD_REGISTER_LOCAL_URL: self.handle_register_local_url,\n\t\t\tself.METHOD_REGISTER_LOCAL_URLS: self.handle_register_local_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST_V1: self.handle_update_session_host_v1,\n\t\t\tself.METHOD_GET_SESSION_URLS: self.handle_get_session_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST: self.handle_update_session_host,\n\t\t\tself.METHOD_UPDATE_GATHERING_OWNERSHIP: self.handle_update_gathering_ownership,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP: self.handle_migrate_gathering_ownership,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.register_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_unregister_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.unregister_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_unregister_gatherings(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.unregister_gatherings(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.update_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_invite(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.invite()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.invite(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_accept_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.accept_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.accept_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_decline_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.decline_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.decline_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_invitation(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_invitations_sent(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_invitations_sent(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_invitations_received(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_received()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_invitations_received(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_participate(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.participate()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.participate(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.add_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.add_participants(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_detailed_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_find_by_type(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_type()\")\n\t\t#--- request ---\n\t\ttype = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_type(client, type, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description_regex(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tregex = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_regex(client, regex, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_id()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.find_by_id(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_single_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_single_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_by_single_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'gathering']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.gathering)\n\t\n\tasync def handle_find_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_owner()\")\n\t\t#--- request ---\n\t\towner = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_owner(client, owner, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_participants()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.find_by_participants(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_invitations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_invitations()\")\n\t\t#--- request ---\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_invitations(client, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_sql_query(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tquery = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_sql_query(client, query, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_launch_session(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.launch_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.launch_session(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.update_session_url(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_url(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'url']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.string(response.url)\n\t\n\tasync def handle_get_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_state(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'state']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.u32(response.state)\n\t\n\tasync def handle_set_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.set_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstate = input.u32()\n\t\tresponse = await self.set_state(client, gid, state)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_report_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.report_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstats = input.list(GatheringStats)\n\t\tresponse = await self.report_stats(client, gid, stats)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tcolumns = input.list(input.u8)\n\t\tresponse = await self.get_stats(client, gid, pids, columns)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'stats']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.stats, output.add)\n\t\n\tasync def handle_delete_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.delete_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_pending_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_pending_deletions()\")\n\t\t#--- request ---\n\t\treason = input.u32()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.get_pending_deletions(client, reason, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'deletions']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.deletions, output.add)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tresponse = await self.delete_from_deletions(client, deletions)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tresponse = await self.migrate_gathering_ownership_v1(client, gid, potential_owners)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_find_by_description_like(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_like()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_like(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_register_local_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.stationurl()\n\t\tawait self.register_local_url(client, gid, url)\n\t\n\tasync def handle_register_local_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turls = input.list(input.stationurl)\n\t\tawait self.register_local_urls(client, gid, urls)\n\t\n\tasync def handle_update_session_host_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.update_session_host_v1(client, gid)\n\t\n\tasync def handle_get_session_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_update_session_host(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tis_migrate_owner = input.bool()\n\t\tawait self.update_session_host(client, gid, is_migrate_owner)\n\t\n\tasync def handle_update_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tparticipants_only = input.bool()\n\t\tresponse = await self.update_gathering_ownership(client, gid, participants_only)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tparticipants_only = input.bool()\n\t\tawait self.migrate_gathering_ownership(client, gid, potential_owners, participants_only)\n\t\n\tasync def register_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gatherings(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gatherings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def invite(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.invite not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def accept_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.accept_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def decline_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.decline_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_sent(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_sent not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_received(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_received not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def participate(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.participate not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.add_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_type(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_type not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_regex(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_regex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_single_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_single_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_owner(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_invitations(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_invitations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_sql_query(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_sql_query not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def launch_session(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.launch_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def set_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.set_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.report_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pending_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_pending_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_like(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_like not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchMakingServerExt(MatchMakingProtocolExt):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_END_PARTICIPATION: self.handle_end_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_GET_GATHERING_RELATIONS: self.handle_get_gathering_relations,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServerExt: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_end_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.end_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.end_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_detailed_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_participants_urls(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_gathering_relations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tdescr = input.string()\n\t\tresponse = await self.get_gathering_relations(client, id, descr)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tpid = input.pid()\n\t\tawait self.delete_from_deletions(client, deletions, pid)\n\t\n\tasync def end_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.end_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_gathering_relations(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_gathering_relations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeExtensionServer(MatchmakeExtensionProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_CLOSE_PARTICIPATION: self.handle_close_participation,\n\t\t\tself.METHOD_OPEN_PARTICIPATION: self.handle_open_participation,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_POSTPONE: self.handle_auto_matchmake_postpone,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION: self.handle_browse_matchmake_session,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS: self.handle_browse_matchmake_session_with_host_urls,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION: self.handle_create_matchmake_session,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION: self.handle_join_matchmake_session,\n\t\t\tself.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE: self.handle_modify_current_game_attribute,\n\t\t\tself.METHOD_UPDATE_NOTIFICATION_DATA: self.handle_update_notification_data,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA: self.handle_get_friend_notification_data,\n\t\t\tself.METHOD_UPDATE_APPLICATION_BUFFER: self.handle_update_application_buffer,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE: self.handle_update_matchmake_session_attribute,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST: self.handle_get_friend_notification_data_list,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION: self.handle_update_matchmake_session,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE: self.handle_auto_matchmake_with_search_criteria_postpone,\n\t\t\tself.METHOD_GET_PLAYING_SESSION: self.handle_get_playing_session,\n\t\t\tself.METHOD_CREATE_COMMUNITY: self.handle_create_community,\n\t\t\tself.METHOD_UPDATE_COMMUNITY: self.handle_update_community,\n\t\t\tself.METHOD_JOIN_COMMUNITY: self.handle_join_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_GATHERING_ID: self.handle_find_community_by_gathering_id,\n\t\t\tself.METHOD_FIND_OFFICIAL_COMMUNITY: self.handle_find_official_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_PARTICIPANT: self.handle_find_community_by_participant,\n\t\t\tself.METHOD_UPDATE_PRIVACY_SETTING: self.handle_update_privacy_setting,\n\t\t\tself.METHOD_GET_MY_BLOCK_LIST: self.handle_get_my_block_list,\n\t\t\tself.METHOD_ADD_TO_BLOCK_LIST: self.handle_add_to_block_list,\n\t\t\tself.METHOD_REMOVE_FROM_BLOCK_LIST: self.handle_remove_from_block_list,\n\t\t\tself.METHOD_CLEAR_MY_BLOCK_LIST: self.handle_clear_my_block_list,\n\t\t\tself.METHOD_REPORT_VIOLATION: self.handle_report_violation,\n\t\t\tself.METHOD_IS_VIOLATION_USER: self.handle_is_violation_user,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_EX: self.handle_join_matchmake_session_ex,\n\t\t\tself.METHOD_GET_SIMPLE_PLAYING_SESSION: self.handle_get_simple_playing_session,\n\t\t\tself.METHOD_GET_SIMPLE_COMMUNITY: self.handle_get_simple_community,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE: self.handle_auto_matchmake_with_gathering_id_postpone,\n\t\t\tself.METHOD_UPDATE_PROGRESS_SCORE: self.handle_update_progress_score,\n\t\t\tself.METHOD_DEBUG_NOTIFY_EVENT: self.handle_debug_notify_event,\n\t\t\tself.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_generate_matchmake_session_system_password,\n\t\t\tself.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_clear_matchmake_session_system_password,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM: self.handle_create_matchmake_session_with_param,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM: self.handle_join_matchmake_session_with_param,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE: self.handle_auto_matchmake_with_param_postpone,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL: self.handle_find_matchmake_session_by_gathering_id_detail,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER: self.handle_browse_matchmake_session_no_holder,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER: self.handle_browse_matchmake_session_with_host_urls_no_holder,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_PART: self.handle_update_matchmake_session_part,\n\t\t\tself.METHOD_REQUEST_MATCHMAKING: self.handle_request_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING: self.handle_withdraw_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING_ALL: self.handle_withdraw_matchmaking_all,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID: self.handle_find_matchmake_session_by_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID: self.handle_find_matchmake_session_by_single_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER: self.handle_find_matchmake_session_by_owner,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT: self.handle_find_matchmake_session_by_participant,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_no_holder_no_result_range,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeExtensionServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_close_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.close_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.close_participation(client, gid)\n\t\n\tasync def handle_open_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.open_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.open_participation(client, gid)\n\t\n\tasync def handle_auto_matchmake_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_postpone(client, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_browse_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gatherings', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.gatherings, output.anydata)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_create_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tdescription = input.string()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.create_matchmake_session(client, gathering, description, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gid', 'session_key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.u32(response.gid)\n\t\toutput.buffer(response.session_key)\n\t\n\tasync def handle_join_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.join_matchmake_session(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_modify_current_game_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattrib = input.u32()\n\t\tvalue = input.u32()\n\t\tawait self.modify_current_game_attribute(client, gid, attrib, value)\n\t\n\tasync def handle_update_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.u32()\n\t\tparam1 = input.pid()\n\t\tparam2 = input.pid()\n\t\tparam3 = input.string()\n\t\tawait self.update_notification_data(client, type, param1, param2, param3)\n\t\n\tasync def handle_get_friend_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.s32()\n\t\tresponse = await self.get_friend_notification_data(client, type)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_application_buffer(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_application_buffer()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tbuffer = input.buffer()\n\t\tawait self.update_application_buffer(client, gid, buffer)\n\t\n\tasync def handle_update_matchmake_session_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattribs = input.list(input.u32)\n\t\tawait self.update_matchmake_session_attribute(client, gid, attribs)\n\t\n\tasync def handle_get_friend_notification_data_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\ttypes = input.list(input.u32)\n\t\tresponse = await self.get_friend_notification_data_list(client, types)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tawait self.update_matchmake_session(client, gathering)\n\t\n\tasync def handle_auto_matchmake_with_search_criteria_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.list(MatchmakeSessionSearchCriteria)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_search_criteria_postpone(client, search_criteria, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_get_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_playing_session(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.create_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tmessage = input.string()\n\t\tresponse = await self.create_community(client, community, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tawait self.update_community(client, community)\n\t\n\tasync def handle_join_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_community()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tpassword = input.string()\n\t\tawait self.join_community(client, gid, message, password)\n\t\n\tasync def handle_find_community_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_community_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_official_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_official_community()\")\n\t\t#--- request ---\n\t\tavailable_only = input.bool()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_official_community(client, available_only, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_community_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_community_by_participant(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_privacy_setting(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tonline_status = input.bool()\n\t\tcommunity_participation = input.bool()\n\t\tawait self.update_privacy_setting(client, online_status, community_participation)\n\t\n\tasync def handle_get_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_my_block_list()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_my_block_list(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_to_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.add_to_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.add_to_block_list(client, pids)\n\t\n\tasync def handle_remove_from_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.remove_from_block_list(client, pids)\n\t\n\tasync def handle_clear_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tawait self.clear_my_block_list(client)\n\t\n\tasync def handle_report_violation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.report_violation()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tusername = input.string()\n\t\tviolation_code = input.u32()\n\t\tawait self.report_violation(client, pid, username, violation_code)\n\t\n\tasync def handle_is_violation_user(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.is_violation_user()\")\n\t\t#--- request ---\n\t\tresponse = await self.is_violation_user(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['flag', 'score']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.flag)\n\t\toutput.u32(response.score)\n\t\n\tasync def handle_join_matchmake_session_ex(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tgmessage = input.string()\n\t\tignore_block_list = input.bool()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.join_matchmake_session_ex(client, gid, gmessage, ignore_block_list, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_get_simple_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tinclude_login_user = input.bool()\n\t\tresponse = await self.get_simple_playing_session(client, pids, include_login_user)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_simple_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_simple_community()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_simple_community(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_auto_matchmake_with_gathering_id_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_gathering_id_postpone(client, gids, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_update_progress_score(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_progress_score()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tscore = input.u8()\n\t\tawait self.update_progress_score(client, gid, score)\n\t\n\tasync def handle_debug_notify_event(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.debug_notify_event()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tmain_type = input.u32()\n\t\tsub_type = input.u32()\n\t\tparam1 = input.u64()\n\t\tparam2 = input.u64()\n\t\tparam3 = input.string()\n\t\tawait self.debug_notify_event(client, pid, main_type, sub_type, param1, param2, param3)\n\t\n\tasync def handle_generate_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.generate_matchmake_session_system_password(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_clear_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.clear_matchmake_session_system_password(client, gid)\n\t\n\tasync def handle_create_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CreateMatchmakeSessionParam)\n\t\tresponse = await self.create_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_join_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(JoinMatchmakeSessionParam)\n\t\tresponse = await self.join_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_auto_matchmake_with_param_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.auto_matchmake_with_param_postpone(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id_detail(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_gathering_id_detail(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_browse_matchmake_session_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_update_matchmake_session_part(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tparam = input.extract(UpdateMatchmakeSessionParam)\n\t\tawait self.update_matchmake_session_part(client, param)\n\t\n\tasync def handle_request_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.request_matchmaking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.request_matchmaking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_withdraw_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\trequest_id = input.u64()\n\t\tawait self.withdraw_matchmaking(client, request_id)\n\t\n\tasync def handle_withdraw_matchmaking_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tawait self.withdraw_matchmaking_all(client)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_matchmake_session_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_single_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_single_gathering_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_matchmake_session_by_owner(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tparam = input.extract(FindMatchmakeSessionByParticipantParam)\n\t\tresponse = await self.find_matchmake_session_by_participant(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def close_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.close_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def open_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.open_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.create_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def modify_current_game_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.modify_current_game_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_friend_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_application_buffer(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_application_buffer not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_matchmake_session_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_friend_notification_data_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_with_search_criteria_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.create_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_community_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_official_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_official_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_community_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_privacy_setting(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_privacy_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_to_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.add_to_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_from_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.remove_from_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.clear_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_violation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.report_violation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_violation_user(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.is_violation_user not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_ex(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_matchmake_session_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_simple_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_simple_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_with_gathering_id_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_progress_score(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_progress_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def debug_notify_event(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.debug_notify_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def generate_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.generate_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.clear_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.create_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_param_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_with_param_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id_detail not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_part(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_matchmake_session_part not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.request_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.withdraw_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking_all(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.withdraw_matchmaking_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_single_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_owner(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeRefereeServer(MatchmakeRefereeProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_START_ROUND: self.handle_start_round,\n\t\t\tself.METHOD_GET_START_ROUND_PARAM: self.handle_get_start_round_param,\n\t\t\tself.METHOD_END_ROUND: self.handle_end_round,\n\t\t\tself.METHOD_END_ROUND_WITHOUT_REPORT: self.handle_end_round_without_report,\n\t\t\tself.METHOD_GET_ROUND_PARTICIPANTS: self.handle_get_round_participants,\n\t\t\tself.METHOD_GET_NOT_SUMMARIZED_ROUND: self.handle_get_not_summarized_round,\n\t\t\tself.METHOD_GET_ROUND: self.handle_get_round,\n\t\t\tself.METHOD_GET_STATS_PRIMARY: self.handle_get_stats_primary,\n\t\t\tself.METHOD_GET_STATS_PRIMARIES: self.handle_get_stats_primaries,\n\t\t\tself.METHOD_GET_STATS_ALL: self.handle_get_stats_all,\n\t\t\tself.METHOD_CREATE_STATS: self.handle_create_stats,\n\t\t\tself.METHOD_GET_OR_CREATE_STATS: self.handle_get_or_create_stats,\n\t\t\tself.METHOD_RESET_STATS: self.handle_reset_stats,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeRefereeServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_start_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.start_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStartRoundParam)\n\t\tresponse = await self.start_round(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_get_start_round_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_start_round_param()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_start_round_param(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStartRoundParam):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStartRoundParam, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_end_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeEndRoundParam)\n\t\tawait self.end_round(client, param)\n\t\n\tasync def handle_end_round_without_report(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round_without_report()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tawait self.end_round_without_report(client, round_id)\n\t\n\tasync def handle_get_round_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round_participants()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_round_participants(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_not_summarized_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_not_summarized_round(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round()\")\n\t\t#--- request ---\n\t\tround = input.u64()\n\t\tresponse = await self.get_round(client, round)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeRound):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeRound, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primary(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primary()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primary(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primaries(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primaries()\")\n\t\t#--- request ---\n\t\ttargets = input.list(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primaries(client, targets)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['stats', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.stats, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_stats_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_all()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_all(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_or_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.get_or_create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_reset_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.reset_stats()\")\n\t\t#--- request ---\n\t\tawait self.reset_stats(client)\n\t\n\tasync def start_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.start_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_start_round_param(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_start_round_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round_without_report(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round_without_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_not_summarized_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_not_summarized_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primary(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primaries(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primaries not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_all(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_or_create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_or_create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.reset_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/matchmaking_eagle.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MatchmakeSystem:\n\tGLOBAL = 1\n\tFRIENDS = 2\n\n\nclass Gathering(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = 0\n\t\tself.owner = 0\n\t\tself.host = 0\n\t\tself.min_participants = 0\n\t\tself.max_participants = 0\n\t\tself.participation_policy = 1\n\t\tself.policy_argument = 0\n\t\tself.flags = 512\n\t\tself.state = 0\n\t\tself.description = \"\"\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.host = stream.pid()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.flags = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.description = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.pid(self.host)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.u32(self.flags)\n\t\tstream.u32(self.state)\n\t\tstream.string(self.description)\n\n\nclass GatheringURLs(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.urls = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'urls']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.urls = stream.list(stream.stationurl)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.urls, stream.stationurl)\n\n\nclass GatheringStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.flags = None\n\t\tself.values = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'flags', 'values']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.flags = stream.u32()\n\t\tself.values = stream.list(stream.float)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.flags)\n\t\tstream.list(self.values, stream.float)\n\n\nclass Invitation(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.guest = None\n\t\tself.message = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'guest', 'message']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.guest = stream.u32()\n\t\tself.message = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.guest)\n\t\tstream.string(self.message)\n\n\nclass ParticipantDetails(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.message = None\n\t\tself.participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'message', 'participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.message = stream.string()\n\t\tself.participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.string(self.message)\n\t\tstream.u16(self.participants)\n\n\nclass DeletionEntry(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.pid = None\n\t\tself.reason = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'pid', 'reason']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.reason = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.reason)\n\n\nclass MatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.param = {}\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.param = stream.map(stream.string, stream.variant)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.map(self.param, stream.string, stream.variant)\n\n\nclass MatchmakeSessionSearchCriteria(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.attribs = [\"\", \"\", \"\", \"\", \"\", \"\"]\n\t\tself.game_mode = \"\"\n\t\tself.min_participants = \"\"\n\t\tself.max_participants = \"\"\n\t\tself.matchmake_system = \"\"\n\t\tself.vacant_only = True\n\t\tself.exclude_locked = True\n\t\tself.exclude_non_host_pid = False\n\t\tself.selection_method = 0\n\t\tself.vacant_participants = 1\n\t\tself.param = MatchmakeParam()\n\t\tself.exclude_user_password = False\n\t\tself.exclude_system_password = False\n\t\tself.refer_gid = 0\n\t\tself.codeword = \"\"\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.attribs = stream.list(stream.string)\n\t\tself.game_mode = stream.string()\n\t\tself.min_participants = stream.string()\n\t\tself.max_participants = stream.string()\n\t\tself.matchmake_system = stream.string()\n\t\tself.vacant_only = stream.bool()\n\t\tself.exclude_locked = stream.bool()\n\t\tself.exclude_non_host_pid = stream.bool()\n\t\tself.selection_method = stream.u32()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.vacant_participants = stream.u16()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.exclude_user_password = stream.bool()\n\t\t\tself.exclude_system_password = stream.bool()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.codeword = stream.string()\n\t\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.attribs, stream.string)\n\t\tstream.string(self.game_mode)\n\t\tstream.string(self.min_participants)\n\t\tstream.string(self.max_participants)\n\t\tstream.string(self.matchmake_system)\n\t\tstream.bool(self.vacant_only)\n\t\tstream.bool(self.exclude_locked)\n\t\tstream.bool(self.exclude_non_host_pid)\n\t\tstream.u32(self.selection_method)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u16(self.vacant_participants)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.add(self.param)\n\t\t\tstream.bool(self.exclude_user_password)\n\t\t\tstream.bool(self.exclude_system_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.string(self.codeword)\n\t\t\tstream.add(self.range)\n\n\nclass MatchmakeSession(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.game_mode = 0\n\t\tself.attribs = [0, 0, 0, 0, 0, 0]\n\t\tself.open_participation = True\n\t\tself.matchmake_system = 0\n\t\tself.application_data = b\"\"\n\t\tself.num_participants = 0\n\t\tself.progress_score = 100\n\t\tself.session_key = b\"\"\n\t\tself.option = 0\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = common.DateTime(0)\n\t\tself.user_password = \"\"\n\t\tself.refer_gid = 0\n\t\tself.user_password_enabled = False\n\t\tself.system_password_enabled = False\n\t\tself.codeword = \"\"\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tversion = 1\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tversion = 2\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tversion = 3\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30000:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.game_mode = stream.u32()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\tself.num_participants = stream.u32()\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.progress_score = stream.u8()\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tself.session_key = stream.buffer()\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.option = stream.u32()\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\t\t\tself.started_time = stream.datetime()\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tself.user_password = stream.string()\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tself.refer_gid = stream.u32()\n\t\t\t\t\tself.user_password_enabled = stream.bool()\n\t\t\t\t\tself.system_password_enabled = stream.bool()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.progress_score = stream.u8()\n\t\t\tself.session_key = stream.buffer()\n\t\t\tself.option = stream.u32()\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.started_time = stream.datetime()\n\t\t\tself.user_password = stream.string()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.user_password_enabled = stream.bool()\n\t\t\tself.system_password_enabled = stream.bool()\n\t\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.game_mode)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.buffer(self.application_data)\n\t\tstream.u32(self.num_participants)\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u8(self.progress_score)\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tstream.buffer(self.session_key)\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u32(self.option)\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tstream.add(self.param)\n\t\t\t\t\tstream.datetime(self.started_time)\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tstream.string(self.user_password)\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tstream.u32(self.refer_gid)\n\t\t\t\t\tstream.bool(self.user_password_enabled)\n\t\t\t\t\tstream.bool(self.system_password_enabled)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.u8(self.progress_score)\n\t\t\tstream.buffer(self.session_key)\n\t\t\tstream.u32(self.option)\n\t\t\tstream.add(self.param)\n\t\t\tstream.datetime(self.started_time)\n\t\t\tstream.string(self.user_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.bool(self.user_password_enabled)\n\t\t\tstream.bool(self.system_password_enabled)\n\t\t\tstream.string(self.codeword)\ncommon.DataHolder.register(MatchmakeSession, \"MatchmakeSession\")\n\n\nclass MatchmakeBlockListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.options = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.options = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.options)\n\n\nclass CreateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.additional_participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['additional_participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.additional_participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.additional_participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\n\nclass JoinMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.behavior = None\n\t\tself.user_password = None\n\t\tself.system_password = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.extra_participants = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'participants', 'gid_for_participation_check', 'options', 'behavior', 'user_password', 'system_password', 'join_message', 'num_participants', 'extra_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.behavior = stream.u8()\n\t\tself.user_password = stream.string()\n\t\tself.system_password = stream.string()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.extra_participants = stream.u16()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.u8(self.behavior)\n\t\tstream.string(self.user_password)\n\t\tstream.string(self.system_password)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.u16(self.extra_participants)\n\t\tstream.add(self.block_list)\n\n\nclass UpdateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.modification_flags = None\n\t\tself.attributes = None\n\t\tself.open_participation = None\n\t\tself.application_buffer = None\n\t\tself.progress_score = None\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = None\n\t\tself.user_password = None\n\t\tself.game_mode = None\n\t\tself.description = None\n\t\tself.min_participants = None\n\t\tself.max_participants = None\n\t\tself.matchmake_system = None\n\t\tself.participation_policy = None\n\t\tself.policy_argument = None\n\t\tself.codeword = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'modification_flags', 'attributes', 'open_participation', 'application_buffer', 'progress_score', 'started_time', 'user_password', 'game_mode', 'description', 'min_participants', 'max_participants', 'matchmake_system', 'participation_policy', 'policy_argument', 'codeword']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.modification_flags = stream.u32()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.application_buffer = stream.buffer()\n\t\tself.progress_score = stream.u8()\n\t\tself.param = stream.extract(MatchmakeParam)\n\t\tself.started_time = stream.datetime()\n\t\tself.user_password = stream.string()\n\t\tself.game_mode = stream.u32()\n\t\tself.description = stream.string()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.modification_flags)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.u8(self.progress_score)\n\t\tstream.add(self.param)\n\t\tstream.datetime(self.started_time)\n\t\tstream.string(self.user_password)\n\t\tstream.u32(self.game_mode)\n\t\tstream.string(self.description)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.string(self.codeword)\n\n\nclass AutoMatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.search_criteria = None\n\t\tself.target_gids = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants', 'search_criteria', 'target_gids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.search_criteria = stream.list(MatchmakeSessionSearchCriteria)\n\t\tself.target_gids = stream.list(stream.u32)\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.list(self.search_criteria, stream.add)\n\t\tstream.list(self.target_gids, stream.u32)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pids = None\n\t\tself.options = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids', 'options']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.options = stream.u32()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u32(self.options)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.session = MatchmakeSession()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.session)\n\n\nclass PersistentGathering(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.password = None\n\t\tself.attribs = None\n\t\tself.application_buffer = None\n\t\tself.participation_start = None\n\t\tself.participation_end = None\n\t\tself.matchmake_session_count = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'password', 'attribs', 'application_buffer', 'participation_start', 'participation_end', 'matchmake_session_count', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.password = stream.string()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.application_buffer = stream.buffer()\n\t\tself.participation_start = stream.datetime()\n\t\tself.participation_end = stream.datetime()\n\t\tself.matchmake_session_count = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.string(self.password)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.datetime(self.participation_start)\n\t\tstream.datetime(self.participation_end)\n\t\tstream.u32(self.matchmake_session_count)\n\t\tstream.u32(self.num_participants)\ncommon.DataHolder.register(PersistentGathering, \"PersistentGathering\")\n\n\nclass SimpleCommunity(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.matchmake_session_count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'matchmake_session_count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.matchmake_session_count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.matchmake_session_count)\n\n\nclass PlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gathering = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gathering']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gathering = stream.anydata()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.anydata(self.gathering)\n\n\nclass SimplePlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gid = None\n\t\tself.game_mode = None\n\t\tself.attribute = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gid', 'game_mode', 'attribute']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gid = stream.u32()\n\t\tself.game_mode = stream.u32()\n\t\tself.attribute = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.game_mode)\n\t\tstream.u32(self.attribute)\n\n\nclass MatchmakeRefereeRound(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.gid = None\n\t\tself.state = None\n\t\tself.personal_data_category = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'gid', 'state', 'personal_data_category', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u64()\n\t\tself.gid = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.personal_data_category = stream.u32()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.id)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.state)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereeStartRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.personal_data_category = None\n\t\tself.gid = None\n\t\tself.pids = None\n\t\tself.report_summary_mode = None\n\t\tself.event_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['personal_data_category', 'gid', 'pids', 'report_summary_mode', 'event_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.personal_data_category = stream.u32()\n\t\tself.gid = stream.u32()\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.report_summary_mode = stream.u8()\n\t\tself.event_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u8(self.report_summary_mode)\n\t\tstream.u32(self.event_id)\n\n\nclass MatchmakeRefereeEndRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.round_id = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['round_id', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.round_id = stream.u64()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.round_id)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereePersonalRoundResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.personal_round_result_flag = None\n\t\tself.round_win_loss = None\n\t\tself.rating_value_change = None\n\t\tself.buffer = None\n\t\tself.report_summary_mode = None\n\t\tself.event_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'personal_round_result_flag', 'round_win_loss', 'rating_value_change', 'buffer', 'report_summary_mode', 'event_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.personal_round_result_flag = stream.u32()\n\t\tself.round_win_loss = stream.u32()\n\t\tself.rating_value_change = stream.s32()\n\t\tself.buffer = stream.qbuffer()\n\t\tself.report_summary_mode = stream.u8()\n\t\tself.event_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.personal_round_result_flag)\n\t\tstream.u32(self.round_win_loss)\n\t\tstream.s32(self.rating_value_change)\n\t\tstream.qbuffer(self.buffer)\n\t\tstream.u8(self.report_summary_mode)\n\t\tstream.u32(self.event_id)\n\n\nclass MatchmakeRefereeStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = None\n\t\tself.category = None\n\t\tself.pid = None\n\t\tself.recent_disconnection = None\n\t\tself.recent_violation = None\n\t\tself.recent_mismatch = None\n\t\tself.recent_win = None\n\t\tself.recent_loss = None\n\t\tself.recent_draw = None\n\t\tself.total_disconnect = None\n\t\tself.total_violation = None\n\t\tself.total_mismatch = None\n\t\tself.total_win = None\n\t\tself.total_loss = None\n\t\tself.total_draw = None\n\t\tself.rating_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unique_id', 'category', 'pid', 'recent_disconnection', 'recent_violation', 'recent_mismatch', 'recent_win', 'recent_loss', 'recent_draw', 'total_disconnect', 'total_violation', 'total_mismatch', 'total_win', 'total_loss', 'total_draw', 'rating_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.recent_disconnection = stream.u32()\n\t\tself.recent_violation = stream.u32()\n\t\tself.recent_mismatch = stream.u32()\n\t\tself.recent_win = stream.u32()\n\t\tself.recent_loss = stream.u32()\n\t\tself.recent_draw = stream.u32()\n\t\tself.total_disconnect = stream.u32()\n\t\tself.total_violation = stream.u32()\n\t\tself.total_mismatch = stream.u32()\n\t\tself.total_win = stream.u32()\n\t\tself.total_loss = stream.u32()\n\t\tself.total_draw = stream.u32()\n\t\tself.rating_value = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.category)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.recent_disconnection)\n\t\tstream.u32(self.recent_violation)\n\t\tstream.u32(self.recent_mismatch)\n\t\tstream.u32(self.recent_win)\n\t\tstream.u32(self.recent_loss)\n\t\tstream.u32(self.recent_draw)\n\t\tstream.u32(self.total_disconnect)\n\t\tstream.u32(self.total_violation)\n\t\tstream.u32(self.total_mismatch)\n\t\tstream.u32(self.total_win)\n\t\tstream.u32(self.total_loss)\n\t\tstream.u32(self.total_draw)\n\t\tstream.u32(self.rating_value)\n\n\nclass MatchmakeRefereeStatsTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.category = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\n\nclass MatchmakeRefereeStatsInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.initial_rating = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'initial_rating']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.initial_rating = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.initial_rating)\n\n\nclass MatchMakingProtocol:\n\tMETHOD_REGISTER_GATHERING = 1\n\tMETHOD_UNREGISTER_GATHERING = 2\n\tMETHOD_UNREGISTER_GATHERINGS = 3\n\tMETHOD_UPDATE_GATHERING = 4\n\tMETHOD_INVITE = 5\n\tMETHOD_ACCEPT_INVITATION = 6\n\tMETHOD_DECLINE_INVITATION = 7\n\tMETHOD_CANCEL_INVITATION = 8\n\tMETHOD_GET_INVITATIONS_SENT = 9\n\tMETHOD_GET_INVITATIONS_RECEIVED = 10\n\tMETHOD_PARTICIPATE = 11\n\tMETHOD_CANCEL_PARTICIPATION = 12\n\tMETHOD_GET_PARTICIPANTS = 13\n\tMETHOD_ADD_PARTICIPANTS = 14\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 15\n\tMETHOD_GET_PARTICIPANTS_URLS = 16\n\tMETHOD_FIND_BY_TYPE = 17\n\tMETHOD_FIND_BY_DESCRIPTION = 18\n\tMETHOD_FIND_BY_DESCRIPTION_REGEX = 19\n\tMETHOD_FIND_BY_ID = 20\n\tMETHOD_FIND_BY_SINGLE_ID = 21\n\tMETHOD_FIND_BY_OWNER = 22\n\tMETHOD_FIND_BY_PARTICIPANTS = 23\n\tMETHOD_FIND_INVITATIONS = 24\n\tMETHOD_FIND_BY_SQL_QUERY = 25\n\tMETHOD_LAUNCH_SESSION = 26\n\tMETHOD_UPDATE_SESSION_URL = 27\n\tMETHOD_GET_SESSION_URL = 28\n\tMETHOD_GET_STATE = 29\n\tMETHOD_SET_STATE = 30\n\tMETHOD_REPORT_STATS = 31\n\tMETHOD_GET_STATS = 32\n\tMETHOD_DELETE_GATHERING = 33\n\tMETHOD_GET_PENDING_DELETIONS = 34\n\tMETHOD_DELETE_FROM_DELETIONS = 35\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP_V1 = 36\n\tMETHOD_FIND_BY_DESCRIPTION_LIKE = 37\n\tMETHOD_REGISTER_LOCAL_URL = 38\n\tMETHOD_REGISTER_LOCAL_URLS = 39\n\tMETHOD_UPDATE_SESSION_HOST_V1 = 40\n\tMETHOD_GET_SESSION_URLS = 41\n\tMETHOD_UPDATE_SESSION_HOST = 42\n\tMETHOD_UPDATE_GATHERING_OWNERSHIP = 43\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP = 44\n\t\n\tPROTOCOL_ID = 0x15\n\n\nclass MatchMakingProtocolExt:\n\tMETHOD_END_PARTICIPATION = 1\n\tMETHOD_GET_PARTICIPANTS = 2\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 3\n\tMETHOD_GET_PARTICIPANTS_URLS = 4\n\tMETHOD_GET_GATHERING_RELATIONS = 5\n\tMETHOD_DELETE_FROM_DELETIONS = 6\n\t\n\tPROTOCOL_ID = 0x32\n\n\nclass MatchmakeExtensionProtocol:\n\tMETHOD_CLOSE_PARTICIPATION = 1\n\tMETHOD_OPEN_PARTICIPATION = 2\n\tMETHOD_AUTO_MATCHMAKE_POSTPONE = 3\n\tMETHOD_BROWSE_MATCHMAKE_SESSION = 4\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS = 5\n\tMETHOD_CREATE_MATCHMAKE_SESSION = 6\n\tMETHOD_JOIN_MATCHMAKE_SESSION = 7\n\tMETHOD_MODIFY_CURRENT_GAME_ATTRIBUTE = 8\n\tMETHOD_UPDATE_NOTIFICATION_DATA = 9\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA = 10\n\tMETHOD_UPDATE_APPLICATION_BUFFER = 11\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE = 12\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA_LIST = 13\n\tMETHOD_UPDATE_MATCHMAKE_SESSION = 14\n\tMETHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE = 15\n\tMETHOD_GET_PLAYING_SESSION = 16\n\tMETHOD_CREATE_COMMUNITY = 17\n\tMETHOD_UPDATE_COMMUNITY = 18\n\tMETHOD_JOIN_COMMUNITY = 19\n\tMETHOD_FIND_COMMUNITY_BY_GATHERING_ID = 20\n\tMETHOD_FIND_OFFICIAL_COMMUNITY = 21\n\tMETHOD_FIND_COMMUNITY_BY_PARTICIPANT = 22\n\tMETHOD_UPDATE_PRIVACY_SETTING = 23\n\tMETHOD_GET_MY_BLOCK_LIST = 24\n\tMETHOD_ADD_TO_BLOCK_LIST = 25\n\tMETHOD_REMOVE_FROM_BLOCK_LIST = 26\n\tMETHOD_CLEAR_MY_BLOCK_LIST = 27\n\tMETHOD_REPORT_VIOLATION = 28\n\tMETHOD_IS_VIOLATION_USER = 29\n\tMETHOD_JOIN_MATCHMAKE_SESSION_EX = 30\n\tMETHOD_GET_SIMPLE_PLAYING_SESSION = 31\n\tMETHOD_GET_SIMPLE_COMMUNITY = 32\n\tMETHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE = 33\n\tMETHOD_UPDATE_PROGRESS_SCORE = 34\n\tMETHOD_DEBUG_NOTIFY_EVENT = 35\n\tMETHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 36\n\tMETHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 37\n\tMETHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM = 38\n\tMETHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM = 39\n\tMETHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE = 40\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL = 41\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER = 42\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER = 43\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_PART = 44\n\tMETHOD_REQUEST_MATCHMAKING = 45\n\tMETHOD_WITHDRAW_MATCHMAKING = 46\n\tMETHOD_WITHDRAW_MATCHMAKING_ALL = 47\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID = 48\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID = 49\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_OWNER = 50\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT = 51\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE = 52\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE = 53\n\t\n\tPROTOCOL_ID = 0x6D\n\n\nclass MatchmakeRefereeProtocol:\n\tMETHOD_START_ROUND = 1\n\tMETHOD_GET_START_ROUND_PARAM = 2\n\tMETHOD_END_ROUND = 3\n\tMETHOD_END_ROUND_WITH_PARTIAL_REPORT = 4\n\tMETHOD_END_ROUND_WITHOUT_REPORT = 5\n\tMETHOD_GET_ROUND_PARTICIPANTS = 6\n\tMETHOD_GET_NOT_SUMMARIZED_ROUND = 7\n\tMETHOD_GET_ROUND = 8\n\tMETHOD_GET_STATS_PRIMARY = 9\n\tMETHOD_GET_STATS_PRIMARIES = 10\n\tMETHOD_GET_STATS_ALL = 11\n\tMETHOD_CREATE_STATS = 12\n\tMETHOD_GET_OR_CREATE_STATS = 13\n\tMETHOD_RESET_STATS = 14\n\tMETHOD_GET_EVENT_POINT = 15\n\tMETHOD_RESET_EVENT_POINT = 16\n\t\n\tPROTOCOL_ID = 0x78\n\n\nclass MatchMakingClient(MatchMakingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.register_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_gathering -> done\")\n\t\treturn gid\n\t\n\tasync def unregister_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering -> done\")\n\t\treturn result\n\t\n\tasync def unregister_gatherings(self, gids):\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings -> done\")\n\t\treturn result\n\t\n\tasync def update_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.update_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering -> done\")\n\t\treturn result\n\t\n\tasync def invite(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.invite()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_INVITE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.invite -> done\")\n\t\treturn result\n\t\n\tasync def accept_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.accept_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACCEPT_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.accept_invitation -> done\")\n\t\treturn result\n\t\n\tasync def decline_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.decline_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DECLINE_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.decline_invitation -> done\")\n\t\treturn result\n\t\n\tasync def cancel_invitation(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation -> done\")\n\t\treturn result\n\t\n\tasync def get_invitations_sent(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_SENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent -> done\")\n\t\treturn invitations\n\t\n\tasync def get_invitations_received(self):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_RECEIVED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received -> done\")\n\t\treturn invitations\n\t\n\tasync def participate(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.participate()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PARTICIPATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.participate -> done\")\n\t\treturn result\n\t\n\tasync def cancel_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def add_participants(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.add_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.add_participants -> done\")\n\t\treturn result\n\t\n\tasync def get_detailed_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def find_by_type(self, type, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_type()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(type)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_TYPE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_type -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description_regex(self, regex, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(regex)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_REGEX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_id(self, ids):\n\t\tlogger.info(\"MatchMakingClient.find_by_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_id -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_single_id(self, gid):\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SINGLE_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id -> done\")\n\t\treturn obj\n\t\n\tasync def find_by_owner(self, owner, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_owner -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_participants(self, pids):\n\t\tlogger.info(\"MatchMakingClient.find_by_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_participants -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_invitations(self, range):\n\t\tlogger.info(\"MatchMakingClient.find_invitations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_INVITATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_invitations -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_sql_query(self, query, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(query)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SQL_QUERY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query -> done\")\n\t\treturn gatherings\n\t\n\tasync def launch_session(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.launch_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LAUNCH_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.launch_session -> done\")\n\t\treturn result\n\t\n\tasync def update_session_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.update_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_url -> done\")\n\t\treturn result\n\t\n\tasync def get_session_url(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.url = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_url -> done\")\n\t\treturn obj\n\t\n\tasync def get_state(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.state = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_state -> done\")\n\t\treturn obj\n\t\n\tasync def set_state(self, gid, state):\n\t\tlogger.info(\"MatchMakingClient.set_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(state)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.set_state -> done\")\n\t\treturn result\n\t\n\tasync def report_stats(self, gid, stats):\n\t\tlogger.info(\"MatchMakingClient.report_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(stats, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.report_stats -> done\")\n\t\treturn result\n\t\n\tasync def get_stats(self, gid, pids, columns):\n\t\tlogger.info(\"MatchMakingClient.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.list(columns, stream.u8)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.stats = stream.list(GatheringStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_stats -> done\")\n\t\treturn obj\n\t\n\tasync def delete_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.delete_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_gathering -> done\")\n\t\treturn result\n\t\n\tasync def get_pending_deletions(self, reason, range):\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(reason)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PENDING_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.deletions = stream.list(DeletionEntry)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions -> done\")\n\t\treturn obj\n\t\n\tasync def delete_from_deletions(self, deletions):\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership_v1(self, gid, potential_owners):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1 -> done\")\n\t\treturn result\n\t\n\tasync def find_by_description_like(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_LIKE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like -> done\")\n\t\treturn gatherings\n\t\n\tasync def register_local_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.register_local_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.stationurl(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_url -> done\")\n\t\n\tasync def register_local_urls(self, gid, urls):\n\t\tlogger.info(\"MatchMakingClient.register_local_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_urls -> done\")\n\t\n\tasync def update_session_host_v1(self, gid):\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1 -> done\")\n\t\n\tasync def get_session_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_urls -> done\")\n\t\treturn urls\n\t\n\tasync def update_session_host(self, gid, is_migrate_owner):\n\t\tlogger.info(\"MatchMakingClient.update_session_host()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(is_migrate_owner)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host -> done\")\n\t\n\tasync def update_gathering_ownership(self, gid, participants_only):\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership(self, gid, potential_owners, participants_only):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership -> done\")\n\n\nclass MatchMakingClientExt(MatchMakingProtocolExt):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def end_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClientExt.end_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.end_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def get_detailed_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gids):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def get_gathering_relations(self, id, descr):\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.string(descr)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_GATHERING_RELATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations -> done\")\n\t\treturn result\n\t\n\tasync def delete_from_deletions(self, deletions, pid):\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions -> done\")\n\n\nclass MatchmakeExtensionClient(MatchmakeExtensionProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def close_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.close_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLOSE_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.close_participation -> done\")\n\t\n\tasync def open_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.open_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_OPEN_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.open_participation -> done\")\n\t\n\tasync def auto_matchmake_postpone(self, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def browse_matchmake_session(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session -> done\")\n\t\treturn gatherings\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gatherings = stream.list(stream.anydata)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls -> done\")\n\t\treturn obj\n\t\n\tasync def create_matchmake_session(self, gathering, description, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(description)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gid = stream.u32()\n\t\tobj.session_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session(self, gid, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session -> done\")\n\t\treturn session_key\n\t\n\tasync def modify_current_game_attribute(self, gid, attrib, value):\n\t\tlogger.info(\"MatchmakeExtensionClient.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(attrib)\n\t\tstream.u32(value)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.modify_current_game_attribute -> done\")\n\t\n\tasync def update_notification_data(self, type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(type)\n\t\tstream.pid(param1)\n\t\tstream.pid(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_notification_data -> done\")\n\t\n\tasync def get_friend_notification_data(self, type):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.s32(type)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data -> done\")\n\t\treturn notifications\n\t\n\tasync def update_application_buffer(self, gid, buffer):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_application_buffer()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.buffer(buffer)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_APPLICATION_BUFFER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_application_buffer -> done\")\n\t\n\tasync def update_matchmake_session_attribute(self, gid, attribs):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(attribs, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_attribute -> done\")\n\t\n\tasync def get_friend_notification_data_list(self, types):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(types, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_friend_notification_data_list -> done\")\n\t\treturn notifications\n\t\n\tasync def update_matchmake_session(self, gathering):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session -> done\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, search_criteria, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(search_criteria, stream.add)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_search_criteria_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def get_playing_session(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(PlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_playing_session -> done\")\n\t\treturn sessions\n\t\n\tasync def create_community(self, community, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.create_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.create_community -> done\")\n\t\treturn gid\n\t\n\tasync def update_community(self, community):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_community -> done\")\n\t\n\tasync def join_community(self, gid, message, password):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tstream.string(password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_community -> done\")\n\t\n\tasync def find_community_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_gathering_id -> done\")\n\t\treturn communities\n\t\n\tasync def find_official_community(self, available_only, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_official_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(available_only)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_OFFICIAL_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_official_community -> done\")\n\t\treturn communities\n\t\n\tasync def find_community_by_participant(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_community_by_participant -> done\")\n\t\treturn communities\n\t\n\tasync def update_privacy_setting(self, online_status, community_participation):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(online_status)\n\t\tstream.bool(community_participation)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRIVACY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_privacy_setting -> done\")\n\t\n\tasync def get_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_my_block_list -> done\")\n\t\treturn pids\n\t\n\tasync def add_to_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClient.add_to_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_TO_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.add_to_block_list -> done\")\n\t\n\tasync def remove_from_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClient.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FROM_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.remove_from_block_list -> done\")\n\t\n\tasync def clear_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_my_block_list -> done\")\n\t\n\tasync def report_violation(self, pid, username, violation_code):\n\t\tlogger.info(\"MatchmakeExtensionClient.report_violation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.string(username)\n\t\tstream.u32(violation_code)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_VIOLATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.report_violation -> done\")\n\t\n\tasync def is_violation_user(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.is_violation_user()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_VIOLATION_USER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.flag = stream.bool()\n\t\tobj.score = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.is_violation_user -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session_ex(self, gid, gmessage, ignore_block_list, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(gmessage)\n\t\tstream.bool(ignore_block_list)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_ex -> done\")\n\t\treturn session_key\n\t\n\tasync def get_simple_playing_session(self, pids, include_login_user):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.bool(include_login_user)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.list(SimplePlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_playing_session -> done\")\n\t\treturn session\n\t\n\tasync def get_simple_community(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(SimpleCommunity)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.get_simple_community -> done\")\n\t\treturn communities\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, gids, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tjoined_gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_gathering_id_postpone -> done\")\n\t\treturn joined_gathering\n\t\n\tasync def update_progress_score(self, gid, score):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_progress_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u8(score)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PROGRESS_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_progress_score -> done\")\n\t\n\tasync def debug_notify_event(self, pid, main_type, sub_type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClient.debug_notify_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.u32(main_type)\n\t\tstream.u32(sub_type)\n\t\tstream.u64(param1)\n\t\tstream.u64(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DEBUG_NOTIFY_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.debug_notify_event -> done\")\n\t\n\tasync def generate_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpassword = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.generate_matchmake_session_system_password -> done\")\n\t\treturn password\n\t\n\tasync def clear_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.clear_matchmake_session_system_password -> done\")\n\t\n\tasync def create_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.create_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def join_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.join_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def auto_matchmake_with_param_postpone(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.auto_matchmake_with_param_postpone -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id_detail -> done\")\n\t\treturn session\n\t\n\tasync def browse_matchmake_session_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder -> done\")\n\t\treturn obj\n\t\n\tasync def update_matchmake_session_part(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_PART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.update_matchmake_session_part -> done\")\n\t\n\tasync def request_matchmaking(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.request_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trequest_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.request_matchmaking -> done\")\n\t\treturn request_id\n\t\n\tasync def withdraw_matchmaking(self, request_id):\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(request_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking -> done\")\n\t\n\tasync def withdraw_matchmaking_all(self):\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.withdraw_matchmaking_all -> done\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_gathering_id -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_single_gathering_id -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_owner(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_owner -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_participant(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.list(FindMatchmakeSessionByParticipantResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.find_matchmake_session_by_participant -> done\")\n\t\treturn result\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_no_holder_no_result_range -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClient.browse_matchmake_session_with_host_urls_no_holder_no_result_range -> done\")\n\t\treturn obj\n\n\nclass MatchmakeRefereeClient(MatchmakeRefereeProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def start_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_START_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round -> done\")\n\t\treturn round_id\n\t\n\tasync def get_start_round_param(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_START_ROUND_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparam = stream.extract(MatchmakeRefereeStartRoundParam)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param -> done\")\n\t\treturn param\n\t\n\tasync def end_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round -> done\")\n\t\n\tasync def end_round_with_partial_report(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_with_partial_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND_WITH_PARTIAL_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_with_partial_report -> done\")\n\t\n\tasync def end_round_without_report(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND_WITHOUT_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report -> done\")\n\t\n\tasync def get_round_participants(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants -> done\")\n\t\treturn pids\n\t\n\tasync def get_not_summarized_round(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOT_SUMMARIZED_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trounds = stream.list(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round -> done\")\n\t\treturn rounds\n\t\n\tasync def get_round(self, round):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround = stream.extract(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round -> done\")\n\t\treturn round\n\t\n\tasync def get_stats_primary(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary -> done\")\n\t\treturn stats\n\t\n\tasync def get_stats_primaries(self, targets):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARIES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.stats = stream.list(MatchmakeRefereeStats)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries -> done\")\n\t\treturn obj\n\t\n\tasync def get_stats_all(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.list(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all -> done\")\n\t\treturn stats\n\t\n\tasync def create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_or_create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OR_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def reset_stats(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats -> done\")\n\n\nclass MatchMakingServer(MatchMakingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER_GATHERING: self.handle_register_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERING: self.handle_unregister_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERINGS: self.handle_unregister_gatherings,\n\t\t\tself.METHOD_UPDATE_GATHERING: self.handle_update_gathering,\n\t\t\tself.METHOD_INVITE: self.handle_invite,\n\t\t\tself.METHOD_ACCEPT_INVITATION: self.handle_accept_invitation,\n\t\t\tself.METHOD_DECLINE_INVITATION: self.handle_decline_invitation,\n\t\t\tself.METHOD_CANCEL_INVITATION: self.handle_cancel_invitation,\n\t\t\tself.METHOD_GET_INVITATIONS_SENT: self.handle_get_invitations_sent,\n\t\t\tself.METHOD_GET_INVITATIONS_RECEIVED: self.handle_get_invitations_received,\n\t\t\tself.METHOD_PARTICIPATE: self.handle_participate,\n\t\t\tself.METHOD_CANCEL_PARTICIPATION: self.handle_cancel_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_ADD_PARTICIPANTS: self.handle_add_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_FIND_BY_TYPE: self.handle_find_by_type,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION: self.handle_find_by_description,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_REGEX: self.handle_find_by_description_regex,\n\t\t\tself.METHOD_FIND_BY_ID: self.handle_find_by_id,\n\t\t\tself.METHOD_FIND_BY_SINGLE_ID: self.handle_find_by_single_id,\n\t\t\tself.METHOD_FIND_BY_OWNER: self.handle_find_by_owner,\n\t\t\tself.METHOD_FIND_BY_PARTICIPANTS: self.handle_find_by_participants,\n\t\t\tself.METHOD_FIND_INVITATIONS: self.handle_find_invitations,\n\t\t\tself.METHOD_FIND_BY_SQL_QUERY: self.handle_find_by_sql_query,\n\t\t\tself.METHOD_LAUNCH_SESSION: self.handle_launch_session,\n\t\t\tself.METHOD_UPDATE_SESSION_URL: self.handle_update_session_url,\n\t\t\tself.METHOD_GET_SESSION_URL: self.handle_get_session_url,\n\t\t\tself.METHOD_GET_STATE: self.handle_get_state,\n\t\t\tself.METHOD_SET_STATE: self.handle_set_state,\n\t\t\tself.METHOD_REPORT_STATS: self.handle_report_stats,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_DELETE_GATHERING: self.handle_delete_gathering,\n\t\t\tself.METHOD_GET_PENDING_DELETIONS: self.handle_get_pending_deletions,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1: self.handle_migrate_gathering_ownership_v1,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_LIKE: self.handle_find_by_description_like,\n\t\t\tself.METHOD_REGISTER_LOCAL_URL: self.handle_register_local_url,\n\t\t\tself.METHOD_REGISTER_LOCAL_URLS: self.handle_register_local_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST_V1: self.handle_update_session_host_v1,\n\t\t\tself.METHOD_GET_SESSION_URLS: self.handle_get_session_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST: self.handle_update_session_host,\n\t\t\tself.METHOD_UPDATE_GATHERING_OWNERSHIP: self.handle_update_gathering_ownership,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP: self.handle_migrate_gathering_ownership,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.register_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_unregister_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.unregister_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_unregister_gatherings(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.unregister_gatherings(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.update_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_invite(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.invite()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.invite(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_accept_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.accept_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.accept_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_decline_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.decline_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.decline_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_invitation(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_invitations_sent(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_invitations_sent(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_invitations_received(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_received()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_invitations_received(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_participate(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.participate()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.participate(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.add_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.add_participants(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_detailed_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_find_by_type(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_type()\")\n\t\t#--- request ---\n\t\ttype = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_type(client, type, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description_regex(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tregex = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_regex(client, regex, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_id()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.find_by_id(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_single_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_single_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_by_single_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'gathering']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.gathering)\n\t\n\tasync def handle_find_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_owner()\")\n\t\t#--- request ---\n\t\towner = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_owner(client, owner, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_participants()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.find_by_participants(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_invitations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_invitations()\")\n\t\t#--- request ---\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_invitations(client, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_sql_query(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tquery = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_sql_query(client, query, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_launch_session(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.launch_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.launch_session(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.update_session_url(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_url(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'url']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.string(response.url)\n\t\n\tasync def handle_get_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_state(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'state']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.u32(response.state)\n\t\n\tasync def handle_set_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.set_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstate = input.u32()\n\t\tresponse = await self.set_state(client, gid, state)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_report_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.report_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstats = input.list(GatheringStats)\n\t\tresponse = await self.report_stats(client, gid, stats)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tcolumns = input.list(input.u8)\n\t\tresponse = await self.get_stats(client, gid, pids, columns)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'stats']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.stats, output.add)\n\t\n\tasync def handle_delete_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.delete_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_pending_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_pending_deletions()\")\n\t\t#--- request ---\n\t\treason = input.u32()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.get_pending_deletions(client, reason, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'deletions']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.deletions, output.add)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tresponse = await self.delete_from_deletions(client, deletions)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tresponse = await self.migrate_gathering_ownership_v1(client, gid, potential_owners)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_find_by_description_like(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_like()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_like(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_register_local_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.stationurl()\n\t\tawait self.register_local_url(client, gid, url)\n\t\n\tasync def handle_register_local_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turls = input.list(input.stationurl)\n\t\tawait self.register_local_urls(client, gid, urls)\n\t\n\tasync def handle_update_session_host_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.update_session_host_v1(client, gid)\n\t\n\tasync def handle_get_session_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_update_session_host(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tis_migrate_owner = input.bool()\n\t\tawait self.update_session_host(client, gid, is_migrate_owner)\n\t\n\tasync def handle_update_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tparticipants_only = input.bool()\n\t\tresponse = await self.update_gathering_ownership(client, gid, participants_only)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tparticipants_only = input.bool()\n\t\tawait self.migrate_gathering_ownership(client, gid, potential_owners, participants_only)\n\t\n\tasync def register_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gatherings(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gatherings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def invite(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.invite not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def accept_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.accept_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def decline_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.decline_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_sent(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_sent not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_received(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_received not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def participate(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.participate not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.add_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_type(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_type not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_regex(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_regex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_single_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_single_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_owner(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_invitations(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_invitations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_sql_query(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_sql_query not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def launch_session(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.launch_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def set_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.set_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.report_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pending_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_pending_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_like(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_like not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchMakingServerExt(MatchMakingProtocolExt):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_END_PARTICIPATION: self.handle_end_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_GET_GATHERING_RELATIONS: self.handle_get_gathering_relations,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServerExt: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_end_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.end_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.end_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_detailed_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_participants_urls(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_gathering_relations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tdescr = input.string()\n\t\tresponse = await self.get_gathering_relations(client, id, descr)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tpid = input.pid()\n\t\tawait self.delete_from_deletions(client, deletions, pid)\n\t\n\tasync def end_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.end_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_gathering_relations(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_gathering_relations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeExtensionServer(MatchmakeExtensionProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_CLOSE_PARTICIPATION: self.handle_close_participation,\n\t\t\tself.METHOD_OPEN_PARTICIPATION: self.handle_open_participation,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_POSTPONE: self.handle_auto_matchmake_postpone,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION: self.handle_browse_matchmake_session,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS: self.handle_browse_matchmake_session_with_host_urls,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION: self.handle_create_matchmake_session,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION: self.handle_join_matchmake_session,\n\t\t\tself.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE: self.handle_modify_current_game_attribute,\n\t\t\tself.METHOD_UPDATE_NOTIFICATION_DATA: self.handle_update_notification_data,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA: self.handle_get_friend_notification_data,\n\t\t\tself.METHOD_UPDATE_APPLICATION_BUFFER: self.handle_update_application_buffer,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE: self.handle_update_matchmake_session_attribute,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST: self.handle_get_friend_notification_data_list,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION: self.handle_update_matchmake_session,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE: self.handle_auto_matchmake_with_search_criteria_postpone,\n\t\t\tself.METHOD_GET_PLAYING_SESSION: self.handle_get_playing_session,\n\t\t\tself.METHOD_CREATE_COMMUNITY: self.handle_create_community,\n\t\t\tself.METHOD_UPDATE_COMMUNITY: self.handle_update_community,\n\t\t\tself.METHOD_JOIN_COMMUNITY: self.handle_join_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_GATHERING_ID: self.handle_find_community_by_gathering_id,\n\t\t\tself.METHOD_FIND_OFFICIAL_COMMUNITY: self.handle_find_official_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_PARTICIPANT: self.handle_find_community_by_participant,\n\t\t\tself.METHOD_UPDATE_PRIVACY_SETTING: self.handle_update_privacy_setting,\n\t\t\tself.METHOD_GET_MY_BLOCK_LIST: self.handle_get_my_block_list,\n\t\t\tself.METHOD_ADD_TO_BLOCK_LIST: self.handle_add_to_block_list,\n\t\t\tself.METHOD_REMOVE_FROM_BLOCK_LIST: self.handle_remove_from_block_list,\n\t\t\tself.METHOD_CLEAR_MY_BLOCK_LIST: self.handle_clear_my_block_list,\n\t\t\tself.METHOD_REPORT_VIOLATION: self.handle_report_violation,\n\t\t\tself.METHOD_IS_VIOLATION_USER: self.handle_is_violation_user,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_EX: self.handle_join_matchmake_session_ex,\n\t\t\tself.METHOD_GET_SIMPLE_PLAYING_SESSION: self.handle_get_simple_playing_session,\n\t\t\tself.METHOD_GET_SIMPLE_COMMUNITY: self.handle_get_simple_community,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE: self.handle_auto_matchmake_with_gathering_id_postpone,\n\t\t\tself.METHOD_UPDATE_PROGRESS_SCORE: self.handle_update_progress_score,\n\t\t\tself.METHOD_DEBUG_NOTIFY_EVENT: self.handle_debug_notify_event,\n\t\t\tself.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_generate_matchmake_session_system_password,\n\t\t\tself.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_clear_matchmake_session_system_password,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM: self.handle_create_matchmake_session_with_param,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM: self.handle_join_matchmake_session_with_param,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE: self.handle_auto_matchmake_with_param_postpone,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL: self.handle_find_matchmake_session_by_gathering_id_detail,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER: self.handle_browse_matchmake_session_no_holder,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER: self.handle_browse_matchmake_session_with_host_urls_no_holder,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_PART: self.handle_update_matchmake_session_part,\n\t\t\tself.METHOD_REQUEST_MATCHMAKING: self.handle_request_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING: self.handle_withdraw_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING_ALL: self.handle_withdraw_matchmaking_all,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID: self.handle_find_matchmake_session_by_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID: self.handle_find_matchmake_session_by_single_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER: self.handle_find_matchmake_session_by_owner,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT: self.handle_find_matchmake_session_by_participant,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_no_holder_no_result_range,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeExtensionServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_close_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.close_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.close_participation(client, gid)\n\t\n\tasync def handle_open_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.open_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.open_participation(client, gid)\n\t\n\tasync def handle_auto_matchmake_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_postpone(client, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_browse_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gatherings', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.gatherings, output.anydata)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_create_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tdescription = input.string()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.create_matchmake_session(client, gathering, description, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gid', 'session_key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.u32(response.gid)\n\t\toutput.buffer(response.session_key)\n\t\n\tasync def handle_join_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.join_matchmake_session(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_modify_current_game_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattrib = input.u32()\n\t\tvalue = input.u32()\n\t\tawait self.modify_current_game_attribute(client, gid, attrib, value)\n\t\n\tasync def handle_update_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.u32()\n\t\tparam1 = input.pid()\n\t\tparam2 = input.pid()\n\t\tparam3 = input.string()\n\t\tawait self.update_notification_data(client, type, param1, param2, param3)\n\t\n\tasync def handle_get_friend_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.s32()\n\t\tresponse = await self.get_friend_notification_data(client, type)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_application_buffer(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_application_buffer()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tbuffer = input.buffer()\n\t\tawait self.update_application_buffer(client, gid, buffer)\n\t\n\tasync def handle_update_matchmake_session_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattribs = input.list(input.u32)\n\t\tawait self.update_matchmake_session_attribute(client, gid, attribs)\n\t\n\tasync def handle_get_friend_notification_data_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\ttypes = input.list(input.u32)\n\t\tresponse = await self.get_friend_notification_data_list(client, types)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tawait self.update_matchmake_session(client, gathering)\n\t\n\tasync def handle_auto_matchmake_with_search_criteria_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.list(MatchmakeSessionSearchCriteria)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_search_criteria_postpone(client, search_criteria, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_get_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_playing_session(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.create_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tmessage = input.string()\n\t\tresponse = await self.create_community(client, community, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tawait self.update_community(client, community)\n\t\n\tasync def handle_join_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_community()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tpassword = input.string()\n\t\tawait self.join_community(client, gid, message, password)\n\t\n\tasync def handle_find_community_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_community_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_official_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_official_community()\")\n\t\t#--- request ---\n\t\tavailable_only = input.bool()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_official_community(client, available_only, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_community_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_community_by_participant(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_privacy_setting(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tonline_status = input.bool()\n\t\tcommunity_participation = input.bool()\n\t\tawait self.update_privacy_setting(client, online_status, community_participation)\n\t\n\tasync def handle_get_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_my_block_list()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_my_block_list(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_to_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.add_to_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.add_to_block_list(client, pids)\n\t\n\tasync def handle_remove_from_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.remove_from_block_list(client, pids)\n\t\n\tasync def handle_clear_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tawait self.clear_my_block_list(client)\n\t\n\tasync def handle_report_violation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.report_violation()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tusername = input.string()\n\t\tviolation_code = input.u32()\n\t\tawait self.report_violation(client, pid, username, violation_code)\n\t\n\tasync def handle_is_violation_user(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.is_violation_user()\")\n\t\t#--- request ---\n\t\tresponse = await self.is_violation_user(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['flag', 'score']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.flag)\n\t\toutput.u32(response.score)\n\t\n\tasync def handle_join_matchmake_session_ex(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tgmessage = input.string()\n\t\tignore_block_list = input.bool()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.join_matchmake_session_ex(client, gid, gmessage, ignore_block_list, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_get_simple_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tinclude_login_user = input.bool()\n\t\tresponse = await self.get_simple_playing_session(client, pids, include_login_user)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_simple_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.get_simple_community()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_simple_community(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_auto_matchmake_with_gathering_id_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_gathering_id_postpone(client, gids, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_update_progress_score(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_progress_score()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tscore = input.u8()\n\t\tawait self.update_progress_score(client, gid, score)\n\t\n\tasync def handle_debug_notify_event(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.debug_notify_event()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tmain_type = input.u32()\n\t\tsub_type = input.u32()\n\t\tparam1 = input.u64()\n\t\tparam2 = input.u64()\n\t\tparam3 = input.string()\n\t\tawait self.debug_notify_event(client, pid, main_type, sub_type, param1, param2, param3)\n\t\n\tasync def handle_generate_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.generate_matchmake_session_system_password(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_clear_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.clear_matchmake_session_system_password(client, gid)\n\t\n\tasync def handle_create_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CreateMatchmakeSessionParam)\n\t\tresponse = await self.create_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_join_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(JoinMatchmakeSessionParam)\n\t\tresponse = await self.join_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_auto_matchmake_with_param_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.auto_matchmake_with_param_postpone(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id_detail(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_gathering_id_detail(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_browse_matchmake_session_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_update_matchmake_session_part(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tparam = input.extract(UpdateMatchmakeSessionParam)\n\t\tawait self.update_matchmake_session_part(client, param)\n\t\n\tasync def handle_request_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.request_matchmaking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.request_matchmaking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_withdraw_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\trequest_id = input.u64()\n\t\tawait self.withdraw_matchmaking(client, request_id)\n\t\n\tasync def handle_withdraw_matchmaking_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tawait self.withdraw_matchmaking_all(client)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_matchmake_session_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_single_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_single_gathering_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_matchmake_session_by_owner(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tparam = input.extract(FindMatchmakeSessionByParticipantParam)\n\t\tresponse = await self.find_matchmake_session_by_participant(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def close_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.close_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def open_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.open_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.create_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def modify_current_game_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.modify_current_game_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_friend_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_application_buffer(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_application_buffer not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_matchmake_session_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_friend_notification_data_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_with_search_criteria_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.create_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_community_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_official_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_official_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_community_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_privacy_setting(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_privacy_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_to_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.add_to_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_from_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.remove_from_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.clear_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_violation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.report_violation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_violation_user(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.is_violation_user not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_ex(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_matchmake_session_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_simple_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.get_simple_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_with_gathering_id_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_progress_score(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_progress_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def debug_notify_event(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.debug_notify_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def generate_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.generate_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.clear_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.create_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.join_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_param_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.auto_matchmake_with_param_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id_detail not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_part(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.update_matchmake_session_part not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.request_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.withdraw_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking_all(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.withdraw_matchmaking_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_single_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_owner(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.find_matchmake_session_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServer.browse_matchmake_session_with_host_urls_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeRefereeServer(MatchmakeRefereeProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_START_ROUND: self.handle_start_round,\n\t\t\tself.METHOD_GET_START_ROUND_PARAM: self.handle_get_start_round_param,\n\t\t\tself.METHOD_END_ROUND: self.handle_end_round,\n\t\t\tself.METHOD_END_ROUND_WITH_PARTIAL_REPORT: self.handle_end_round_with_partial_report,\n\t\t\tself.METHOD_END_ROUND_WITHOUT_REPORT: self.handle_end_round_without_report,\n\t\t\tself.METHOD_GET_ROUND_PARTICIPANTS: self.handle_get_round_participants,\n\t\t\tself.METHOD_GET_NOT_SUMMARIZED_ROUND: self.handle_get_not_summarized_round,\n\t\t\tself.METHOD_GET_ROUND: self.handle_get_round,\n\t\t\tself.METHOD_GET_STATS_PRIMARY: self.handle_get_stats_primary,\n\t\t\tself.METHOD_GET_STATS_PRIMARIES: self.handle_get_stats_primaries,\n\t\t\tself.METHOD_GET_STATS_ALL: self.handle_get_stats_all,\n\t\t\tself.METHOD_CREATE_STATS: self.handle_create_stats,\n\t\t\tself.METHOD_GET_OR_CREATE_STATS: self.handle_get_or_create_stats,\n\t\t\tself.METHOD_RESET_STATS: self.handle_reset_stats,\n\t\t\tself.METHOD_GET_EVENT_POINT: self.handle_get_event_point,\n\t\t\tself.METHOD_RESET_EVENT_POINT: self.handle_reset_event_point,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeRefereeServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_start_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.start_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStartRoundParam)\n\t\tresponse = await self.start_round(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_get_start_round_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_start_round_param()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_start_round_param(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStartRoundParam):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStartRoundParam, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_end_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeEndRoundParam)\n\t\tawait self.end_round(client, param)\n\t\n\tasync def handle_end_round_with_partial_report(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round_with_partial_report()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeEndRoundParam)\n\t\tawait self.end_round_with_partial_report(client, param)\n\t\n\tasync def handle_end_round_without_report(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round_without_report()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tawait self.end_round_without_report(client, round_id)\n\t\n\tasync def handle_get_round_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round_participants()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_round_participants(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_not_summarized_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_not_summarized_round(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round()\")\n\t\t#--- request ---\n\t\tround = input.u64()\n\t\tresponse = await self.get_round(client, round)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeRound):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeRound, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primary(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primary()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primary(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primaries(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primaries()\")\n\t\t#--- request ---\n\t\ttargets = input.list(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primaries(client, targets)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['stats', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.stats, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_stats_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_all()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_all(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_or_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.get_or_create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_reset_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.reset_stats()\")\n\t\t#--- request ---\n\t\tawait self.reset_stats(client)\n\t\n\tasync def handle_get_event_point(self, client, input, output):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_event_point is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_reset_event_point(self, client, input, output):\n\t\tlogger.warning(\"MatchmakeRefereeServer.reset_event_point is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def start_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.start_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_start_round_param(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_start_round_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round_with_partial_report(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round_with_partial_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round_without_report(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round_without_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_not_summarized_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_not_summarized_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primary(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primaries(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primaries not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_all(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_or_create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_or_create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.reset_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/matchmaking_mhxx.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MatchmakeSystem:\n\tGLOBAL = 1\n\tFRIENDS = 2\n\n\nclass Gathering(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = 0\n\t\tself.owner = 0\n\t\tself.host = 0\n\t\tself.min_participants = 0\n\t\tself.max_participants = 0\n\t\tself.participation_policy = 1\n\t\tself.policy_argument = 0\n\t\tself.flags = 512\n\t\tself.state = 0\n\t\tself.description = \"\"\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.host = stream.pid()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.flags = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.description = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.pid(self.host)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.u32(self.flags)\n\t\tstream.u32(self.state)\n\t\tstream.string(self.description)\n\n\nclass GatheringURLs(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.urls = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'urls']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.urls = stream.list(stream.stationurl)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.urls, stream.stationurl)\n\n\nclass GatheringStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.flags = None\n\t\tself.values = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'flags', 'values']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.flags = stream.u32()\n\t\tself.values = stream.list(stream.float)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.flags)\n\t\tstream.list(self.values, stream.float)\n\n\nclass Invitation(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.guest = None\n\t\tself.message = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'guest', 'message']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.guest = stream.u32()\n\t\tself.message = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.guest)\n\t\tstream.string(self.message)\n\n\nclass ParticipantDetails(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.message = None\n\t\tself.participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'message', 'participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.message = stream.string()\n\t\tself.participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.string(self.message)\n\t\tstream.u16(self.participants)\n\n\nclass DeletionEntry(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.pid = None\n\t\tself.reason = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'pid', 'reason']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.reason = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.reason)\n\n\nclass MatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.param = {}\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.param = stream.map(stream.string, stream.variant)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.map(self.param, stream.string, stream.variant)\n\n\nclass MatchmakeSessionSearchCriteria(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.attribs = [\"\", \"\", \"\", \"\", \"\", \"\"]\n\t\tself.game_mode = \"\"\n\t\tself.min_participants = \"\"\n\t\tself.max_participants = \"\"\n\t\tself.matchmake_system = \"\"\n\t\tself.vacant_only = True\n\t\tself.exclude_locked = True\n\t\tself.exclude_non_host_pid = False\n\t\tself.selection_method = 0\n\t\tself.vacant_participants = 1\n\t\tself.param = MatchmakeParam()\n\t\tself.exclude_user_password = False\n\t\tself.exclude_system_password = False\n\t\tself.refer_gid = 0\n\t\tself.codeword = \"\"\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.attribs = stream.list(stream.string)\n\t\tself.game_mode = stream.string()\n\t\tself.min_participants = stream.string()\n\t\tself.max_participants = stream.string()\n\t\tself.matchmake_system = stream.string()\n\t\tself.vacant_only = stream.bool()\n\t\tself.exclude_locked = stream.bool()\n\t\tself.exclude_non_host_pid = stream.bool()\n\t\tself.selection_method = stream.u32()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.vacant_participants = stream.u16()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.exclude_user_password = stream.bool()\n\t\t\tself.exclude_system_password = stream.bool()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.codeword = stream.string()\n\t\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.attribs, stream.string)\n\t\tstream.string(self.game_mode)\n\t\tstream.string(self.min_participants)\n\t\tstream.string(self.max_participants)\n\t\tstream.string(self.matchmake_system)\n\t\tstream.bool(self.vacant_only)\n\t\tstream.bool(self.exclude_locked)\n\t\tstream.bool(self.exclude_non_host_pid)\n\t\tstream.u32(self.selection_method)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u16(self.vacant_participants)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.add(self.param)\n\t\t\tstream.bool(self.exclude_user_password)\n\t\t\tstream.bool(self.exclude_system_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.string(self.codeword)\n\t\t\tstream.add(self.range)\n\n\nclass MatchmakeSession(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.game_mode = 0\n\t\tself.attribs = [0, 0, 0, 0, 0, 0]\n\t\tself.open_participation = True\n\t\tself.matchmake_system = 0\n\t\tself.application_data = b\"\"\n\t\tself.num_participants = 0\n\t\tself.progress_score = 100\n\t\tself.session_key = b\"\"\n\t\tself.option = 0\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = common.DateTime(0)\n\t\tself.user_password = \"\"\n\t\tself.refer_gid = 0\n\t\tself.user_password_enabled = False\n\t\tself.system_password_enabled = False\n\t\tself.codeword = \"\"\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tversion = 1\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tversion = 2\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tversion = 3\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30000:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.game_mode = stream.u32()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\tself.num_participants = stream.u32()\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.progress_score = stream.u8()\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tself.session_key = stream.buffer()\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.option = stream.u32()\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\t\t\tself.started_time = stream.datetime()\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tself.user_password = stream.string()\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tself.refer_gid = stream.u32()\n\t\t\t\t\tself.user_password_enabled = stream.bool()\n\t\t\t\t\tself.system_password_enabled = stream.bool()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.progress_score = stream.u8()\n\t\t\tself.session_key = stream.buffer()\n\t\t\tself.option = stream.u32()\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.started_time = stream.datetime()\n\t\t\tself.user_password = stream.string()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.user_password_enabled = stream.bool()\n\t\t\tself.system_password_enabled = stream.bool()\n\t\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.game_mode)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.buffer(self.application_data)\n\t\tstream.u32(self.num_participants)\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u8(self.progress_score)\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tstream.buffer(self.session_key)\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u32(self.option)\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tstream.add(self.param)\n\t\t\t\t\tstream.datetime(self.started_time)\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tstream.string(self.user_password)\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tstream.u32(self.refer_gid)\n\t\t\t\t\tstream.bool(self.user_password_enabled)\n\t\t\t\t\tstream.bool(self.system_password_enabled)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.u8(self.progress_score)\n\t\t\tstream.buffer(self.session_key)\n\t\t\tstream.u32(self.option)\n\t\t\tstream.add(self.param)\n\t\t\tstream.datetime(self.started_time)\n\t\t\tstream.string(self.user_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.bool(self.user_password_enabled)\n\t\t\tstream.bool(self.system_password_enabled)\n\t\t\tstream.string(self.codeword)\ncommon.DataHolder.register(MatchmakeSession, \"MatchmakeSession\")\n\n\nclass MatchmakeBlockListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.options = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.options = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.options)\n\n\nclass CreateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.additional_participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['additional_participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.additional_participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.additional_participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\n\nclass JoinMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.behavior = None\n\t\tself.user_password = None\n\t\tself.system_password = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.extra_participants = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'participants', 'gid_for_participation_check', 'options', 'behavior', 'user_password', 'system_password', 'join_message', 'num_participants', 'extra_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.behavior = stream.u8()\n\t\tself.user_password = stream.string()\n\t\tself.system_password = stream.string()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.extra_participants = stream.u16()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.u8(self.behavior)\n\t\tstream.string(self.user_password)\n\t\tstream.string(self.system_password)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.u16(self.extra_participants)\n\t\tstream.add(self.block_list)\n\n\nclass UpdateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.modification_flags = None\n\t\tself.attributes = None\n\t\tself.open_participation = None\n\t\tself.application_buffer = None\n\t\tself.progress_score = None\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = None\n\t\tself.user_password = None\n\t\tself.game_mode = None\n\t\tself.description = None\n\t\tself.min_participants = None\n\t\tself.max_participants = None\n\t\tself.matchmake_system = None\n\t\tself.participation_policy = None\n\t\tself.policy_argument = None\n\t\tself.codeword = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'modification_flags', 'attributes', 'open_participation', 'application_buffer', 'progress_score', 'started_time', 'user_password', 'game_mode', 'description', 'min_participants', 'max_participants', 'matchmake_system', 'participation_policy', 'policy_argument', 'codeword']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.modification_flags = stream.u32()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.application_buffer = stream.buffer()\n\t\tself.progress_score = stream.u8()\n\t\tself.param = stream.extract(MatchmakeParam)\n\t\tself.started_time = stream.datetime()\n\t\tself.user_password = stream.string()\n\t\tself.game_mode = stream.u32()\n\t\tself.description = stream.string()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.modification_flags)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.u8(self.progress_score)\n\t\tstream.add(self.param)\n\t\tstream.datetime(self.started_time)\n\t\tstream.string(self.user_password)\n\t\tstream.u32(self.game_mode)\n\t\tstream.string(self.description)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.string(self.codeword)\n\n\nclass AutoMatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.search_criteria = None\n\t\tself.target_gids = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants', 'search_criteria', 'target_gids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.search_criteria = stream.list(MatchmakeSessionSearchCriteria)\n\t\tself.target_gids = stream.list(stream.u32)\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.list(self.search_criteria, stream.add)\n\t\tstream.list(self.target_gids, stream.u32)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pids = None\n\t\tself.options = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids', 'options']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.options = stream.u32()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u32(self.options)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.session = MatchmakeSession()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.session)\n\n\nclass PersistentGathering(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.password = None\n\t\tself.attribs = None\n\t\tself.application_buffer = None\n\t\tself.participation_start = None\n\t\tself.participation_end = None\n\t\tself.matchmake_session_count = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'password', 'attribs', 'application_buffer', 'participation_start', 'participation_end', 'matchmake_session_count', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.password = stream.string()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.application_buffer = stream.buffer()\n\t\tself.participation_start = stream.datetime()\n\t\tself.participation_end = stream.datetime()\n\t\tself.matchmake_session_count = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.string(self.password)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.datetime(self.participation_start)\n\t\tstream.datetime(self.participation_end)\n\t\tstream.u32(self.matchmake_session_count)\n\t\tstream.u32(self.num_participants)\ncommon.DataHolder.register(PersistentGathering, \"PersistentGathering\")\n\n\nclass SimpleCommunity(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.matchmake_session_count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'matchmake_session_count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.matchmake_session_count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.matchmake_session_count)\n\n\nclass PlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gathering = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gathering']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gathering = stream.anydata()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.anydata(self.gathering)\n\n\nclass SimplePlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gid = None\n\t\tself.game_mode = None\n\t\tself.attribute = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gid', 'game_mode', 'attribute']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gid = stream.u32()\n\t\tself.game_mode = stream.u32()\n\t\tself.attribute = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.game_mode)\n\t\tstream.u32(self.attribute)\n\n\nclass MatchmakeRefereeRound(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.gid = None\n\t\tself.state = None\n\t\tself.personal_data_category = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'gid', 'state', 'personal_data_category', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u64()\n\t\tself.gid = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.personal_data_category = stream.u32()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.id)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.state)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereeStartRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.personal_data_category = None\n\t\tself.gid = None\n\t\tself.pids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['personal_data_category', 'gid', 'pids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.personal_data_category = stream.u32()\n\t\tself.gid = stream.u32()\n\t\tself.pids = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.pids, stream.pid)\n\n\nclass MatchmakeRefereeEndRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.round_id = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['round_id', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.round_id = stream.u64()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.round_id)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereePersonalRoundResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.personal_round_result_flag = None\n\t\tself.round_win_loss = None\n\t\tself.rating_change = None\n\t\tself.buffer = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'personal_round_result_flag', 'round_win_loss', 'rating_change', 'buffer']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.personal_round_result_flag = stream.u32()\n\t\tself.round_win_loss = stream.u32()\n\t\tself.rating_change = stream.s32()\n\t\tself.buffer = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.personal_round_result_flag)\n\t\tstream.u32(self.round_win_loss)\n\t\tstream.s32(self.rating_change)\n\t\tstream.qbuffer(self.buffer)\n\n\nclass MatchmakeRefereeStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = None\n\t\tself.category = None\n\t\tself.pid = None\n\t\tself.recent_disconnection = None\n\t\tself.recent_violation = None\n\t\tself.recent_mismatch = None\n\t\tself.recent_win = None\n\t\tself.recent_loss = None\n\t\tself.recent_draw = None\n\t\tself.total_disconnect = None\n\t\tself.total_violation = None\n\t\tself.total_mismatch = None\n\t\tself.total_win = None\n\t\tself.total_loss = None\n\t\tself.total_draw = None\n\t\tself.rating_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unique_id', 'category', 'pid', 'recent_disconnection', 'recent_violation', 'recent_mismatch', 'recent_win', 'recent_loss', 'recent_draw', 'total_disconnect', 'total_violation', 'total_mismatch', 'total_win', 'total_loss', 'total_draw', 'rating_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.recent_disconnection = stream.u32()\n\t\tself.recent_violation = stream.u32()\n\t\tself.recent_mismatch = stream.u32()\n\t\tself.recent_win = stream.u32()\n\t\tself.recent_loss = stream.u32()\n\t\tself.recent_draw = stream.u32()\n\t\tself.total_disconnect = stream.u32()\n\t\tself.total_violation = stream.u32()\n\t\tself.total_mismatch = stream.u32()\n\t\tself.total_win = stream.u32()\n\t\tself.total_loss = stream.u32()\n\t\tself.total_draw = stream.u32()\n\t\tself.rating_value = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.category)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.recent_disconnection)\n\t\tstream.u32(self.recent_violation)\n\t\tstream.u32(self.recent_mismatch)\n\t\tstream.u32(self.recent_win)\n\t\tstream.u32(self.recent_loss)\n\t\tstream.u32(self.recent_draw)\n\t\tstream.u32(self.total_disconnect)\n\t\tstream.u32(self.total_violation)\n\t\tstream.u32(self.total_mismatch)\n\t\tstream.u32(self.total_win)\n\t\tstream.u32(self.total_loss)\n\t\tstream.u32(self.total_draw)\n\t\tstream.u32(self.rating_value)\n\n\nclass MatchmakeRefereeStatsTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.category = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\n\nclass MatchmakeRefereeStatsInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.initial_rating = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'initial_rating']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.initial_rating = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.initial_rating)\n\n\nclass FriendUserParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.name = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['name']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.name = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.name)\n\n\nclass FriendUserInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.presence = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'presence']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.u64()\n\t\tself.name = stream.string()\n\t\tself.presence = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.u32(self.presence)\n\n\nclass MatchMakingProtocol:\n\tMETHOD_REGISTER_GATHERING = 1\n\tMETHOD_UNREGISTER_GATHERING = 2\n\tMETHOD_UNREGISTER_GATHERINGS = 3\n\tMETHOD_UPDATE_GATHERING = 4\n\tMETHOD_INVITE = 5\n\tMETHOD_ACCEPT_INVITATION = 6\n\tMETHOD_DECLINE_INVITATION = 7\n\tMETHOD_CANCEL_INVITATION = 8\n\tMETHOD_GET_INVITATIONS_SENT = 9\n\tMETHOD_GET_INVITATIONS_RECEIVED = 10\n\tMETHOD_PARTICIPATE = 11\n\tMETHOD_CANCEL_PARTICIPATION = 12\n\tMETHOD_GET_PARTICIPANTS = 13\n\tMETHOD_ADD_PARTICIPANTS = 14\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 15\n\tMETHOD_GET_PARTICIPANTS_URLS = 16\n\tMETHOD_FIND_BY_TYPE = 17\n\tMETHOD_FIND_BY_DESCRIPTION = 18\n\tMETHOD_FIND_BY_DESCRIPTION_REGEX = 19\n\tMETHOD_FIND_BY_ID = 20\n\tMETHOD_FIND_BY_SINGLE_ID = 21\n\tMETHOD_FIND_BY_OWNER = 22\n\tMETHOD_FIND_BY_PARTICIPANTS = 23\n\tMETHOD_FIND_INVITATIONS = 24\n\tMETHOD_FIND_BY_SQL_QUERY = 25\n\tMETHOD_LAUNCH_SESSION = 26\n\tMETHOD_UPDATE_SESSION_URL = 27\n\tMETHOD_GET_SESSION_URL = 28\n\tMETHOD_GET_STATE = 29\n\tMETHOD_SET_STATE = 30\n\tMETHOD_REPORT_STATS = 31\n\tMETHOD_GET_STATS = 32\n\tMETHOD_DELETE_GATHERING = 33\n\tMETHOD_GET_PENDING_DELETIONS = 34\n\tMETHOD_DELETE_FROM_DELETIONS = 35\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP_V1 = 36\n\tMETHOD_FIND_BY_DESCRIPTION_LIKE = 37\n\tMETHOD_REGISTER_LOCAL_URL = 38\n\tMETHOD_REGISTER_LOCAL_URLS = 39\n\tMETHOD_UPDATE_SESSION_HOST_V1 = 40\n\tMETHOD_GET_SESSION_URLS = 41\n\tMETHOD_UPDATE_SESSION_HOST = 42\n\tMETHOD_UPDATE_GATHERING_OWNERSHIP = 43\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP = 44\n\t\n\tPROTOCOL_ID = 0x15\n\n\nclass MatchMakingProtocolExt:\n\tMETHOD_END_PARTICIPATION = 1\n\tMETHOD_GET_PARTICIPANTS = 2\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 3\n\tMETHOD_GET_PARTICIPANTS_URLS = 4\n\tMETHOD_GET_GATHERING_RELATIONS = 5\n\tMETHOD_DELETE_FROM_DELETIONS = 6\n\t\n\tPROTOCOL_ID = 0x32\n\n\nclass MatchmakeRefereeProtocol:\n\tMETHOD_START_ROUND = 1\n\tMETHOD_GET_START_ROUND_PARAM = 2\n\tMETHOD_END_ROUND = 3\n\tMETHOD_END_ROUND_WITHOUT_REPORT = 4\n\tMETHOD_GET_ROUND_PARTICIPANTS = 5\n\tMETHOD_GET_NOT_SUMMARIZED_ROUND = 6\n\tMETHOD_GET_ROUND = 7\n\tMETHOD_GET_STATS_PRIMARY = 8\n\tMETHOD_GET_STATS_PRIMARIES = 9\n\tMETHOD_GET_STATS_ALL = 10\n\tMETHOD_CREATE_STATS = 11\n\tMETHOD_GET_OR_CREATE_STATS = 12\n\tMETHOD_RESET_STATS = 13\n\t\n\tPROTOCOL_ID = 0x78\n\n\nclass MatchmakeExtensionProtocolMHXX:\n\tMETHOD_CLOSE_PARTICIPATION = 1\n\tMETHOD_OPEN_PARTICIPATION = 2\n\tMETHOD_AUTO_MATCHMAKE_POSTPONE = 3\n\tMETHOD_BROWSE_MATCHMAKE_SESSION = 4\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS = 5\n\tMETHOD_CREATE_MATCHMAKE_SESSION = 6\n\tMETHOD_JOIN_MATCHMAKE_SESSION = 7\n\tMETHOD_MODIFY_CURRENT_GAME_ATTRIBUTE = 8\n\tMETHOD_UPDATE_NOTIFICATION_DATA = 9\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA = 10\n\tMETHOD_UPDATE_APPLICATION_BUFFER = 11\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE = 12\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA_LIST = 13\n\tMETHOD_UPDATE_MATCHMAKE_SESSION = 14\n\tMETHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE = 15\n\tMETHOD_GET_PLAYING_SESSION = 16\n\tMETHOD_CREATE_COMMUNITY = 17\n\tMETHOD_UPDATE_COMMUNITY = 18\n\tMETHOD_JOIN_COMMUNITY = 19\n\tMETHOD_FIND_COMMUNITY_BY_GATHERING_ID = 20\n\tMETHOD_FIND_OFFICIAL_COMMUNITY = 21\n\tMETHOD_FIND_COMMUNITY_BY_PARTICIPANT = 22\n\tMETHOD_UPDATE_PRIVACY_SETTING = 23\n\tMETHOD_GET_MY_BLOCK_LIST = 24\n\tMETHOD_ADD_TO_BLOCK_LIST = 25\n\tMETHOD_REMOVE_FROM_BLOCK_LIST = 26\n\tMETHOD_CLEAR_MY_BLOCK_LIST = 27\n\tMETHOD_REPORT_VIOLATION = 28\n\tMETHOD_IS_VIOLATION_USER = 29\n\tMETHOD_JOIN_MATCHMAKE_SESSION_EX = 30\n\tMETHOD_GET_SIMPLE_PLAYING_SESSION = 31\n\tMETHOD_GET_SIMPLE_COMMUNITY = 32\n\tMETHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE = 33\n\tMETHOD_UPDATE_PROGRESS_SCORE = 34\n\tMETHOD_DEBUG_NOTIFY_EVENT = 35\n\tMETHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 36\n\tMETHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 37\n\tMETHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM = 38\n\tMETHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM = 39\n\tMETHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE = 40\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL = 41\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER = 42\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER = 43\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_PART = 44\n\tMETHOD_REQUEST_MATCHMAKING = 45\n\tMETHOD_WITHDRAW_MATCHMAKING = 46\n\tMETHOD_WITHDRAW_MATCHMAKING_ALL = 47\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID = 48\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID = 49\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_OWNER = 50\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT = 51\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE = 52\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE = 53\n\tMETHOD_UPDATE_FRIEND_USER_PROFILE = 54\n\tMETHOD_GET_FRIEND_USER_PROFILES = 55\n\tMETHOD_GET_FRIENDS = 56\n\tMETHOD_ADD_FRIENDS = 57\n\tMETHOD_REMOVE_FRIEND = 58\n\tMETHOD_FIND_COMMUNITY_BY_OWNER = 59\n\t\n\tPROTOCOL_ID = 0x6D\n\n\nclass MatchMakingClient(MatchMakingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.register_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_gathering -> done\")\n\t\treturn gid\n\t\n\tasync def unregister_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering -> done\")\n\t\treturn result\n\t\n\tasync def unregister_gatherings(self, gids):\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings -> done\")\n\t\treturn result\n\t\n\tasync def update_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.update_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering -> done\")\n\t\treturn result\n\t\n\tasync def invite(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.invite()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_INVITE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.invite -> done\")\n\t\treturn result\n\t\n\tasync def accept_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.accept_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACCEPT_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.accept_invitation -> done\")\n\t\treturn result\n\t\n\tasync def decline_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.decline_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DECLINE_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.decline_invitation -> done\")\n\t\treturn result\n\t\n\tasync def cancel_invitation(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation -> done\")\n\t\treturn result\n\t\n\tasync def get_invitations_sent(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_SENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent -> done\")\n\t\treturn invitations\n\t\n\tasync def get_invitations_received(self):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_RECEIVED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received -> done\")\n\t\treturn invitations\n\t\n\tasync def participate(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.participate()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PARTICIPATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.participate -> done\")\n\t\treturn result\n\t\n\tasync def cancel_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def add_participants(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.add_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.add_participants -> done\")\n\t\treturn result\n\t\n\tasync def get_detailed_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def find_by_type(self, type, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_type()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(type)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_TYPE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_type -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description_regex(self, regex, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(regex)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_REGEX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_id(self, ids):\n\t\tlogger.info(\"MatchMakingClient.find_by_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_id -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_single_id(self, gid):\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SINGLE_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id -> done\")\n\t\treturn obj\n\t\n\tasync def find_by_owner(self, owner, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_owner -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_participants(self, pids):\n\t\tlogger.info(\"MatchMakingClient.find_by_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_participants -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_invitations(self, range):\n\t\tlogger.info(\"MatchMakingClient.find_invitations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_INVITATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_invitations -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_sql_query(self, query, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(query)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SQL_QUERY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query -> done\")\n\t\treturn gatherings\n\t\n\tasync def launch_session(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.launch_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LAUNCH_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.launch_session -> done\")\n\t\treturn result\n\t\n\tasync def update_session_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.update_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_url -> done\")\n\t\treturn result\n\t\n\tasync def get_session_url(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.url = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_url -> done\")\n\t\treturn obj\n\t\n\tasync def get_state(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.state = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_state -> done\")\n\t\treturn obj\n\t\n\tasync def set_state(self, gid, state):\n\t\tlogger.info(\"MatchMakingClient.set_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(state)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.set_state -> done\")\n\t\treturn result\n\t\n\tasync def report_stats(self, gid, stats):\n\t\tlogger.info(\"MatchMakingClient.report_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(stats, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.report_stats -> done\")\n\t\treturn result\n\t\n\tasync def get_stats(self, gid, pids, columns):\n\t\tlogger.info(\"MatchMakingClient.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.list(columns, stream.u8)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.stats = stream.list(GatheringStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_stats -> done\")\n\t\treturn obj\n\t\n\tasync def delete_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.delete_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_gathering -> done\")\n\t\treturn result\n\t\n\tasync def get_pending_deletions(self, reason, range):\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(reason)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PENDING_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.deletions = stream.list(DeletionEntry)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions -> done\")\n\t\treturn obj\n\t\n\tasync def delete_from_deletions(self, deletions):\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership_v1(self, gid, potential_owners):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1 -> done\")\n\t\treturn result\n\t\n\tasync def find_by_description_like(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_LIKE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like -> done\")\n\t\treturn gatherings\n\t\n\tasync def register_local_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.register_local_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.stationurl(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_url -> done\")\n\t\n\tasync def register_local_urls(self, gid, urls):\n\t\tlogger.info(\"MatchMakingClient.register_local_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_urls -> done\")\n\t\n\tasync def update_session_host_v1(self, gid):\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1 -> done\")\n\t\n\tasync def get_session_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_urls -> done\")\n\t\treturn urls\n\t\n\tasync def update_session_host(self, gid, is_migrate_owner):\n\t\tlogger.info(\"MatchMakingClient.update_session_host()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(is_migrate_owner)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host -> done\")\n\t\n\tasync def update_gathering_ownership(self, gid, participants_only):\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership(self, gid, potential_owners, participants_only):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership -> done\")\n\n\nclass MatchMakingClientExt(MatchMakingProtocolExt):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def end_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClientExt.end_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.end_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def get_detailed_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gids):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def get_gathering_relations(self, id, descr):\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.string(descr)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_GATHERING_RELATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations -> done\")\n\t\treturn result\n\t\n\tasync def delete_from_deletions(self, deletions, pid):\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions -> done\")\n\n\nclass MatchmakeRefereeClient(MatchmakeRefereeProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def start_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_START_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round -> done\")\n\t\treturn round_id\n\t\n\tasync def get_start_round_param(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_START_ROUND_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparam = stream.extract(MatchmakeRefereeStartRoundParam)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param -> done\")\n\t\treturn param\n\t\n\tasync def end_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round -> done\")\n\t\n\tasync def end_round_without_report(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND_WITHOUT_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report -> done\")\n\t\n\tasync def get_round_participants(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants -> done\")\n\t\treturn pids\n\t\n\tasync def get_not_summarized_round(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOT_SUMMARIZED_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trounds = stream.list(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round -> done\")\n\t\treturn rounds\n\t\n\tasync def get_round(self, round):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround = stream.extract(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round -> done\")\n\t\treturn round\n\t\n\tasync def get_stats_primary(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary -> done\")\n\t\treturn stats\n\t\n\tasync def get_stats_primaries(self, targets):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARIES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.stats = stream.list(MatchmakeRefereeStats)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries -> done\")\n\t\treturn obj\n\t\n\tasync def get_stats_all(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.list(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all -> done\")\n\t\treturn stats\n\t\n\tasync def create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_or_create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OR_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def reset_stats(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats -> done\")\n\n\nclass MatchmakeExtensionClientMHXX(MatchmakeExtensionProtocolMHXX):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def close_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.close_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLOSE_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.close_participation -> done\")\n\t\n\tasync def open_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.open_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_OPEN_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.open_participation -> done\")\n\t\n\tasync def auto_matchmake_postpone(self, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def browse_matchmake_session(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session -> done\")\n\t\treturn gatherings\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gatherings = stream.list(stream.anydata)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_with_host_urls -> done\")\n\t\treturn obj\n\t\n\tasync def create_matchmake_session(self, gathering, description, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(description)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gid = stream.u32()\n\t\tobj.session_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.create_matchmake_session -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session(self, gid, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_matchmake_session -> done\")\n\t\treturn session_key\n\t\n\tasync def modify_current_game_attribute(self, gid, attrib, value):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(attrib)\n\t\tstream.u32(value)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.modify_current_game_attribute -> done\")\n\t\n\tasync def update_notification_data(self, type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(type)\n\t\tstream.pid(param1)\n\t\tstream.pid(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_notification_data -> done\")\n\t\n\tasync def get_friend_notification_data(self, type):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.s32(type)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friend_notification_data -> done\")\n\t\treturn notifications\n\t\n\tasync def update_application_buffer(self, gid, buffer):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_application_buffer()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.buffer(buffer)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_APPLICATION_BUFFER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_application_buffer -> done\")\n\t\n\tasync def update_matchmake_session_attribute(self, gid, attribs):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(attribs, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_matchmake_session_attribute -> done\")\n\t\n\tasync def get_friend_notification_data_list(self, types):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(types, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friend_notification_data_list -> done\")\n\t\treturn notifications\n\t\n\tasync def update_matchmake_session(self, gathering):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_matchmake_session -> done\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, search_criteria, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(search_criteria, stream.add)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_with_search_criteria_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def get_playing_session(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(PlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_playing_session -> done\")\n\t\treturn sessions\n\t\n\tasync def create_community(self, community, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.create_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.create_community -> done\")\n\t\treturn gid\n\t\n\tasync def update_community(self, community):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_community -> done\")\n\t\n\tasync def join_community(self, gid, message, password):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tstream.string(password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_community -> done\")\n\t\n\tasync def find_community_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_community_by_gathering_id -> done\")\n\t\treturn communities\n\t\n\tasync def find_official_community(self, available_only, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_official_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(available_only)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_OFFICIAL_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_official_community -> done\")\n\t\treturn communities\n\t\n\tasync def find_community_by_participant(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_community_by_participant -> done\")\n\t\treturn communities\n\t\n\tasync def update_privacy_setting(self, online_status, community_participation):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(online_status)\n\t\tstream.bool(community_participation)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRIVACY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_privacy_setting -> done\")\n\t\n\tasync def get_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_my_block_list -> done\")\n\t\treturn pids\n\t\n\tasync def add_to_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.add_to_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_TO_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.add_to_block_list -> done\")\n\t\n\tasync def remove_from_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FROM_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.remove_from_block_list -> done\")\n\t\n\tasync def clear_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.clear_my_block_list -> done\")\n\t\n\tasync def report_violation(self, pid, username, violation_code):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.report_violation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.string(username)\n\t\tstream.u32(violation_code)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_VIOLATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.report_violation -> done\")\n\t\n\tasync def is_violation_user(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.is_violation_user()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_VIOLATION_USER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.flag = stream.bool()\n\t\tobj.score = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.is_violation_user -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session_ex(self, gid, gmessage, ignore_block_list, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(gmessage)\n\t\tstream.bool(ignore_block_list)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_matchmake_session_ex -> done\")\n\t\treturn session_key\n\t\n\tasync def get_simple_playing_session(self, pids, include_login_user):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.bool(include_login_user)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.list(SimplePlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_simple_playing_session -> done\")\n\t\treturn session\n\t\n\tasync def get_simple_community(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_simple_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(SimpleCommunity)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_simple_community -> done\")\n\t\treturn communities\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, gids, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tjoined_gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_with_gathering_id_postpone -> done\")\n\t\treturn joined_gathering\n\t\n\tasync def update_progress_score(self, gid, score):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_progress_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u8(score)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PROGRESS_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_progress_score -> done\")\n\t\n\tasync def debug_notify_event(self, pid, main_type, sub_type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.debug_notify_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.u32(main_type)\n\t\tstream.u32(sub_type)\n\t\tstream.u64(param1)\n\t\tstream.u64(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DEBUG_NOTIFY_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.debug_notify_event -> done\")\n\t\n\tasync def generate_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpassword = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.generate_matchmake_session_system_password -> done\")\n\t\treturn password\n\t\n\tasync def clear_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.clear_matchmake_session_system_password -> done\")\n\t\n\tasync def create_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.create_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def join_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.join_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def auto_matchmake_with_param_postpone(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.auto_matchmake_with_param_postpone -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_gathering_id_detail -> done\")\n\t\treturn session\n\t\n\tasync def browse_matchmake_session_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_no_holder -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_with_host_urls_no_holder -> done\")\n\t\treturn obj\n\t\n\tasync def update_matchmake_session_part(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_PART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_matchmake_session_part -> done\")\n\t\n\tasync def request_matchmaking(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.request_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trequest_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.request_matchmaking -> done\")\n\t\treturn request_id\n\t\n\tasync def withdraw_matchmaking(self, request_id):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(request_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.withdraw_matchmaking -> done\")\n\t\n\tasync def withdraw_matchmaking_all(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.withdraw_matchmaking_all -> done\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_gathering_id -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_single_gathering_id -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_owner(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_owner -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_participant(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.list(FindMatchmakeSessionByParticipantResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_matchmake_session_by_participant -> done\")\n\t\treturn result\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_no_holder_no_result_range -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.browse_matchmake_session_with_host_urls_no_holder_no_result_range -> done\")\n\t\treturn obj\n\t\n\tasync def update_friend_user_profile(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_friend_user_profile()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_FRIEND_USER_PROFILE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.update_friend_user_profile -> done\")\n\t\n\tasync def get_friend_user_profiles(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friend_user_profiles()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_USER_PROFILES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(FriendUserInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friend_user_profiles -> done\")\n\t\treturn infos\n\t\n\tasync def get_friends(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friends()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIENDS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(FriendUserInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.get_friends -> done\")\n\t\treturn infos\n\t\n\tasync def add_friends(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.add_friends()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.u64)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_FRIENDS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.add_friends -> done\")\n\t\n\tasync def remove_friend(self, pid):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.remove_friend()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FRIEND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.remove_friend -> done\")\n\t\n\tasync def find_community_by_owner(self, id, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_community_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(id)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tlst_community = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMHXX.find_community_by_owner -> done\")\n\t\treturn lst_community\n\n\nclass MatchMakingServer(MatchMakingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER_GATHERING: self.handle_register_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERING: self.handle_unregister_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERINGS: self.handle_unregister_gatherings,\n\t\t\tself.METHOD_UPDATE_GATHERING: self.handle_update_gathering,\n\t\t\tself.METHOD_INVITE: self.handle_invite,\n\t\t\tself.METHOD_ACCEPT_INVITATION: self.handle_accept_invitation,\n\t\t\tself.METHOD_DECLINE_INVITATION: self.handle_decline_invitation,\n\t\t\tself.METHOD_CANCEL_INVITATION: self.handle_cancel_invitation,\n\t\t\tself.METHOD_GET_INVITATIONS_SENT: self.handle_get_invitations_sent,\n\t\t\tself.METHOD_GET_INVITATIONS_RECEIVED: self.handle_get_invitations_received,\n\t\t\tself.METHOD_PARTICIPATE: self.handle_participate,\n\t\t\tself.METHOD_CANCEL_PARTICIPATION: self.handle_cancel_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_ADD_PARTICIPANTS: self.handle_add_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_FIND_BY_TYPE: self.handle_find_by_type,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION: self.handle_find_by_description,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_REGEX: self.handle_find_by_description_regex,\n\t\t\tself.METHOD_FIND_BY_ID: self.handle_find_by_id,\n\t\t\tself.METHOD_FIND_BY_SINGLE_ID: self.handle_find_by_single_id,\n\t\t\tself.METHOD_FIND_BY_OWNER: self.handle_find_by_owner,\n\t\t\tself.METHOD_FIND_BY_PARTICIPANTS: self.handle_find_by_participants,\n\t\t\tself.METHOD_FIND_INVITATIONS: self.handle_find_invitations,\n\t\t\tself.METHOD_FIND_BY_SQL_QUERY: self.handle_find_by_sql_query,\n\t\t\tself.METHOD_LAUNCH_SESSION: self.handle_launch_session,\n\t\t\tself.METHOD_UPDATE_SESSION_URL: self.handle_update_session_url,\n\t\t\tself.METHOD_GET_SESSION_URL: self.handle_get_session_url,\n\t\t\tself.METHOD_GET_STATE: self.handle_get_state,\n\t\t\tself.METHOD_SET_STATE: self.handle_set_state,\n\t\t\tself.METHOD_REPORT_STATS: self.handle_report_stats,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_DELETE_GATHERING: self.handle_delete_gathering,\n\t\t\tself.METHOD_GET_PENDING_DELETIONS: self.handle_get_pending_deletions,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1: self.handle_migrate_gathering_ownership_v1,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_LIKE: self.handle_find_by_description_like,\n\t\t\tself.METHOD_REGISTER_LOCAL_URL: self.handle_register_local_url,\n\t\t\tself.METHOD_REGISTER_LOCAL_URLS: self.handle_register_local_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST_V1: self.handle_update_session_host_v1,\n\t\t\tself.METHOD_GET_SESSION_URLS: self.handle_get_session_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST: self.handle_update_session_host,\n\t\t\tself.METHOD_UPDATE_GATHERING_OWNERSHIP: self.handle_update_gathering_ownership,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP: self.handle_migrate_gathering_ownership,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.register_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_unregister_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.unregister_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_unregister_gatherings(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.unregister_gatherings(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.update_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_invite(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.invite()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.invite(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_accept_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.accept_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.accept_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_decline_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.decline_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.decline_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_invitation(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_invitations_sent(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_invitations_sent(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_invitations_received(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_received()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_invitations_received(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_participate(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.participate()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.participate(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.add_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.add_participants(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_detailed_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_find_by_type(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_type()\")\n\t\t#--- request ---\n\t\ttype = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_type(client, type, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description_regex(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tregex = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_regex(client, regex, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_id()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.find_by_id(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_single_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_single_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_by_single_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'gathering']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.gathering)\n\t\n\tasync def handle_find_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_owner()\")\n\t\t#--- request ---\n\t\towner = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_owner(client, owner, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_participants()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.find_by_participants(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_invitations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_invitations()\")\n\t\t#--- request ---\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_invitations(client, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_sql_query(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tquery = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_sql_query(client, query, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_launch_session(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.launch_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.launch_session(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.update_session_url(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_url(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'url']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.string(response.url)\n\t\n\tasync def handle_get_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_state(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'state']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.u32(response.state)\n\t\n\tasync def handle_set_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.set_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstate = input.u32()\n\t\tresponse = await self.set_state(client, gid, state)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_report_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.report_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstats = input.list(GatheringStats)\n\t\tresponse = await self.report_stats(client, gid, stats)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tcolumns = input.list(input.u8)\n\t\tresponse = await self.get_stats(client, gid, pids, columns)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'stats']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.stats, output.add)\n\t\n\tasync def handle_delete_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.delete_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_pending_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_pending_deletions()\")\n\t\t#--- request ---\n\t\treason = input.u32()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.get_pending_deletions(client, reason, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'deletions']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.deletions, output.add)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tresponse = await self.delete_from_deletions(client, deletions)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tresponse = await self.migrate_gathering_ownership_v1(client, gid, potential_owners)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_find_by_description_like(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_like()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_like(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_register_local_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.stationurl()\n\t\tawait self.register_local_url(client, gid, url)\n\t\n\tasync def handle_register_local_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turls = input.list(input.stationurl)\n\t\tawait self.register_local_urls(client, gid, urls)\n\t\n\tasync def handle_update_session_host_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.update_session_host_v1(client, gid)\n\t\n\tasync def handle_get_session_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_update_session_host(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tis_migrate_owner = input.bool()\n\t\tawait self.update_session_host(client, gid, is_migrate_owner)\n\t\n\tasync def handle_update_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tparticipants_only = input.bool()\n\t\tresponse = await self.update_gathering_ownership(client, gid, participants_only)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tparticipants_only = input.bool()\n\t\tawait self.migrate_gathering_ownership(client, gid, potential_owners, participants_only)\n\t\n\tasync def register_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gatherings(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gatherings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def invite(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.invite not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def accept_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.accept_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def decline_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.decline_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_sent(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_sent not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_received(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_received not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def participate(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.participate not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.add_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_type(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_type not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_regex(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_regex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_single_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_single_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_owner(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_invitations(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_invitations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_sql_query(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_sql_query not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def launch_session(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.launch_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def set_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.set_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.report_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pending_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_pending_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_like(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_like not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchMakingServerExt(MatchMakingProtocolExt):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_END_PARTICIPATION: self.handle_end_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_GET_GATHERING_RELATIONS: self.handle_get_gathering_relations,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServerExt: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_end_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.end_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.end_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_detailed_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_participants_urls(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_gathering_relations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tdescr = input.string()\n\t\tresponse = await self.get_gathering_relations(client, id, descr)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tpid = input.pid()\n\t\tawait self.delete_from_deletions(client, deletions, pid)\n\t\n\tasync def end_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.end_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_gathering_relations(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_gathering_relations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeRefereeServer(MatchmakeRefereeProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_START_ROUND: self.handle_start_round,\n\t\t\tself.METHOD_GET_START_ROUND_PARAM: self.handle_get_start_round_param,\n\t\t\tself.METHOD_END_ROUND: self.handle_end_round,\n\t\t\tself.METHOD_END_ROUND_WITHOUT_REPORT: self.handle_end_round_without_report,\n\t\t\tself.METHOD_GET_ROUND_PARTICIPANTS: self.handle_get_round_participants,\n\t\t\tself.METHOD_GET_NOT_SUMMARIZED_ROUND: self.handle_get_not_summarized_round,\n\t\t\tself.METHOD_GET_ROUND: self.handle_get_round,\n\t\t\tself.METHOD_GET_STATS_PRIMARY: self.handle_get_stats_primary,\n\t\t\tself.METHOD_GET_STATS_PRIMARIES: self.handle_get_stats_primaries,\n\t\t\tself.METHOD_GET_STATS_ALL: self.handle_get_stats_all,\n\t\t\tself.METHOD_CREATE_STATS: self.handle_create_stats,\n\t\t\tself.METHOD_GET_OR_CREATE_STATS: self.handle_get_or_create_stats,\n\t\t\tself.METHOD_RESET_STATS: self.handle_reset_stats,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeRefereeServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_start_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.start_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStartRoundParam)\n\t\tresponse = await self.start_round(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_get_start_round_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_start_round_param()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_start_round_param(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStartRoundParam):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStartRoundParam, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_end_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeEndRoundParam)\n\t\tawait self.end_round(client, param)\n\t\n\tasync def handle_end_round_without_report(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round_without_report()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tawait self.end_round_without_report(client, round_id)\n\t\n\tasync def handle_get_round_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round_participants()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_round_participants(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_not_summarized_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_not_summarized_round(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round()\")\n\t\t#--- request ---\n\t\tround = input.u64()\n\t\tresponse = await self.get_round(client, round)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeRound):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeRound, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primary(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primary()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primary(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primaries(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primaries()\")\n\t\t#--- request ---\n\t\ttargets = input.list(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primaries(client, targets)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['stats', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.stats, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_stats_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_all()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_all(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_or_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.get_or_create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_reset_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.reset_stats()\")\n\t\t#--- request ---\n\t\tawait self.reset_stats(client)\n\t\n\tasync def start_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.start_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_start_round_param(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_start_round_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round_without_report(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round_without_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_not_summarized_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_not_summarized_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primary(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primaries(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primaries not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_all(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_or_create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_or_create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.reset_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeExtensionServerMHXX(MatchmakeExtensionProtocolMHXX):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_CLOSE_PARTICIPATION: self.handle_close_participation,\n\t\t\tself.METHOD_OPEN_PARTICIPATION: self.handle_open_participation,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_POSTPONE: self.handle_auto_matchmake_postpone,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION: self.handle_browse_matchmake_session,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS: self.handle_browse_matchmake_session_with_host_urls,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION: self.handle_create_matchmake_session,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION: self.handle_join_matchmake_session,\n\t\t\tself.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE: self.handle_modify_current_game_attribute,\n\t\t\tself.METHOD_UPDATE_NOTIFICATION_DATA: self.handle_update_notification_data,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA: self.handle_get_friend_notification_data,\n\t\t\tself.METHOD_UPDATE_APPLICATION_BUFFER: self.handle_update_application_buffer,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE: self.handle_update_matchmake_session_attribute,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST: self.handle_get_friend_notification_data_list,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION: self.handle_update_matchmake_session,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE: self.handle_auto_matchmake_with_search_criteria_postpone,\n\t\t\tself.METHOD_GET_PLAYING_SESSION: self.handle_get_playing_session,\n\t\t\tself.METHOD_CREATE_COMMUNITY: self.handle_create_community,\n\t\t\tself.METHOD_UPDATE_COMMUNITY: self.handle_update_community,\n\t\t\tself.METHOD_JOIN_COMMUNITY: self.handle_join_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_GATHERING_ID: self.handle_find_community_by_gathering_id,\n\t\t\tself.METHOD_FIND_OFFICIAL_COMMUNITY: self.handle_find_official_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_PARTICIPANT: self.handle_find_community_by_participant,\n\t\t\tself.METHOD_UPDATE_PRIVACY_SETTING: self.handle_update_privacy_setting,\n\t\t\tself.METHOD_GET_MY_BLOCK_LIST: self.handle_get_my_block_list,\n\t\t\tself.METHOD_ADD_TO_BLOCK_LIST: self.handle_add_to_block_list,\n\t\t\tself.METHOD_REMOVE_FROM_BLOCK_LIST: self.handle_remove_from_block_list,\n\t\t\tself.METHOD_CLEAR_MY_BLOCK_LIST: self.handle_clear_my_block_list,\n\t\t\tself.METHOD_REPORT_VIOLATION: self.handle_report_violation,\n\t\t\tself.METHOD_IS_VIOLATION_USER: self.handle_is_violation_user,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_EX: self.handle_join_matchmake_session_ex,\n\t\t\tself.METHOD_GET_SIMPLE_PLAYING_SESSION: self.handle_get_simple_playing_session,\n\t\t\tself.METHOD_GET_SIMPLE_COMMUNITY: self.handle_get_simple_community,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE: self.handle_auto_matchmake_with_gathering_id_postpone,\n\t\t\tself.METHOD_UPDATE_PROGRESS_SCORE: self.handle_update_progress_score,\n\t\t\tself.METHOD_DEBUG_NOTIFY_EVENT: self.handle_debug_notify_event,\n\t\t\tself.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_generate_matchmake_session_system_password,\n\t\t\tself.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_clear_matchmake_session_system_password,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM: self.handle_create_matchmake_session_with_param,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM: self.handle_join_matchmake_session_with_param,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE: self.handle_auto_matchmake_with_param_postpone,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL: self.handle_find_matchmake_session_by_gathering_id_detail,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER: self.handle_browse_matchmake_session_no_holder,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER: self.handle_browse_matchmake_session_with_host_urls_no_holder,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_PART: self.handle_update_matchmake_session_part,\n\t\t\tself.METHOD_REQUEST_MATCHMAKING: self.handle_request_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING: self.handle_withdraw_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING_ALL: self.handle_withdraw_matchmaking_all,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID: self.handle_find_matchmake_session_by_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID: self.handle_find_matchmake_session_by_single_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER: self.handle_find_matchmake_session_by_owner,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT: self.handle_find_matchmake_session_by_participant,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_no_holder_no_result_range,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range,\n\t\t\tself.METHOD_UPDATE_FRIEND_USER_PROFILE: self.handle_update_friend_user_profile,\n\t\t\tself.METHOD_GET_FRIEND_USER_PROFILES: self.handle_get_friend_user_profiles,\n\t\t\tself.METHOD_GET_FRIENDS: self.handle_get_friends,\n\t\t\tself.METHOD_ADD_FRIENDS: self.handle_add_friends,\n\t\t\tself.METHOD_REMOVE_FRIEND: self.handle_remove_friend,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_OWNER: self.handle_find_community_by_owner,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeExtensionServerMHXX: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_close_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.close_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.close_participation(client, gid)\n\t\n\tasync def handle_open_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.open_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.open_participation(client, gid)\n\t\n\tasync def handle_auto_matchmake_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_postpone(client, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_browse_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gatherings', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.gatherings, output.anydata)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_create_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tdescription = input.string()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.create_matchmake_session(client, gathering, description, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gid', 'session_key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.u32(response.gid)\n\t\toutput.buffer(response.session_key)\n\t\n\tasync def handle_join_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.join_matchmake_session(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_modify_current_game_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattrib = input.u32()\n\t\tvalue = input.u32()\n\t\tawait self.modify_current_game_attribute(client, gid, attrib, value)\n\t\n\tasync def handle_update_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.u32()\n\t\tparam1 = input.pid()\n\t\tparam2 = input.pid()\n\t\tparam3 = input.string()\n\t\tawait self.update_notification_data(client, type, param1, param2, param3)\n\t\n\tasync def handle_get_friend_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.s32()\n\t\tresponse = await self.get_friend_notification_data(client, type)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_application_buffer(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_application_buffer()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tbuffer = input.buffer()\n\t\tawait self.update_application_buffer(client, gid, buffer)\n\t\n\tasync def handle_update_matchmake_session_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattribs = input.list(input.u32)\n\t\tawait self.update_matchmake_session_attribute(client, gid, attribs)\n\t\n\tasync def handle_get_friend_notification_data_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\ttypes = input.list(input.u32)\n\t\tresponse = await self.get_friend_notification_data_list(client, types)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tawait self.update_matchmake_session(client, gathering)\n\t\n\tasync def handle_auto_matchmake_with_search_criteria_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.list(MatchmakeSessionSearchCriteria)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_search_criteria_postpone(client, search_criteria, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_get_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_playing_session(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.create_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tmessage = input.string()\n\t\tresponse = await self.create_community(client, community, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tawait self.update_community(client, community)\n\t\n\tasync def handle_join_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.join_community()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tpassword = input.string()\n\t\tawait self.join_community(client, gid, message, password)\n\t\n\tasync def handle_find_community_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_community_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_official_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_official_community()\")\n\t\t#--- request ---\n\t\tavailable_only = input.bool()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_official_community(client, available_only, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_community_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_community_by_participant(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_privacy_setting(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tonline_status = input.bool()\n\t\tcommunity_participation = input.bool()\n\t\tawait self.update_privacy_setting(client, online_status, community_participation)\n\t\n\tasync def handle_get_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_my_block_list()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_my_block_list(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_to_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.add_to_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.add_to_block_list(client, pids)\n\t\n\tasync def handle_remove_from_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.remove_from_block_list(client, pids)\n\t\n\tasync def handle_clear_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tawait self.clear_my_block_list(client)\n\t\n\tasync def handle_report_violation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.report_violation()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tusername = input.string()\n\t\tviolation_code = input.u32()\n\t\tawait self.report_violation(client, pid, username, violation_code)\n\t\n\tasync def handle_is_violation_user(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.is_violation_user()\")\n\t\t#--- request ---\n\t\tresponse = await self.is_violation_user(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['flag', 'score']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.flag)\n\t\toutput.u32(response.score)\n\t\n\tasync def handle_join_matchmake_session_ex(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tgmessage = input.string()\n\t\tignore_block_list = input.bool()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.join_matchmake_session_ex(client, gid, gmessage, ignore_block_list, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_get_simple_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tinclude_login_user = input.bool()\n\t\tresponse = await self.get_simple_playing_session(client, pids, include_login_user)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_simple_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_simple_community()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_simple_community(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_auto_matchmake_with_gathering_id_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_gathering_id_postpone(client, gids, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_update_progress_score(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_progress_score()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tscore = input.u8()\n\t\tawait self.update_progress_score(client, gid, score)\n\t\n\tasync def handle_debug_notify_event(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.debug_notify_event()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tmain_type = input.u32()\n\t\tsub_type = input.u32()\n\t\tparam1 = input.u64()\n\t\tparam2 = input.u64()\n\t\tparam3 = input.string()\n\t\tawait self.debug_notify_event(client, pid, main_type, sub_type, param1, param2, param3)\n\t\n\tasync def handle_generate_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.generate_matchmake_session_system_password(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_clear_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.clear_matchmake_session_system_password(client, gid)\n\t\n\tasync def handle_create_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CreateMatchmakeSessionParam)\n\t\tresponse = await self.create_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_join_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(JoinMatchmakeSessionParam)\n\t\tresponse = await self.join_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_auto_matchmake_with_param_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.auto_matchmake_with_param_postpone(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id_detail(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_gathering_id_detail(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_browse_matchmake_session_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_update_matchmake_session_part(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tparam = input.extract(UpdateMatchmakeSessionParam)\n\t\tawait self.update_matchmake_session_part(client, param)\n\t\n\tasync def handle_request_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.request_matchmaking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.request_matchmaking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_withdraw_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\trequest_id = input.u64()\n\t\tawait self.withdraw_matchmaking(client, request_id)\n\t\n\tasync def handle_withdraw_matchmaking_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tawait self.withdraw_matchmaking_all(client)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_matchmake_session_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_single_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_single_gathering_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_matchmake_session_by_owner(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tparam = input.extract(FindMatchmakeSessionByParticipantParam)\n\t\tresponse = await self.find_matchmake_session_by_participant(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_update_friend_user_profile(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.update_friend_user_profile()\")\n\t\t#--- request ---\n\t\tparam = input.extract(FriendUserParam)\n\t\tawait self.update_friend_user_profile(client, param)\n\t\n\tasync def handle_get_friend_user_profiles(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_friend_user_profiles()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.u64)\n\t\tresponse = await self.get_friend_user_profiles(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_friends(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.get_friends()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_friends(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_add_friends(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.add_friends()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.u64)\n\t\tawait self.add_friends(client, pids)\n\t\n\tasync def handle_remove_friend(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.remove_friend()\")\n\t\t#--- request ---\n\t\tpid = input.u64()\n\t\tawait self.remove_friend(client, pid)\n\t\n\tasync def handle_find_community_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMHXX.find_community_by_owner()\")\n\t\t#--- request ---\n\t\tid = input.u64()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_community_by_owner(client, id, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def close_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.close_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def open_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.open_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.auto_matchmake_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.browse_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_with_host_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.create_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.join_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def modify_current_game_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.modify_current_game_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_friend_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_application_buffer(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_application_buffer not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_matchmake_session_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_friend_notification_data_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.auto_matchmake_with_search_criteria_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.create_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.join_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_community_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_official_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_official_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_community_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_privacy_setting(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_privacy_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_to_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.add_to_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_from_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.remove_from_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.clear_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_violation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.report_violation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_violation_user(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.is_violation_user not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_ex(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.join_matchmake_session_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_simple_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_simple_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.auto_matchmake_with_gathering_id_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_progress_score(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_progress_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def debug_notify_event(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.debug_notify_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def generate_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.generate_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.clear_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.create_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.join_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_param_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.auto_matchmake_with_param_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_gathering_id_detail not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_with_host_urls_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_part(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_matchmake_session_part not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.request_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.withdraw_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking_all(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.withdraw_matchmaking_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_single_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_owner(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_matchmake_session_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.browse_matchmake_session_with_host_urls_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_friend_user_profile(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.update_friend_user_profile not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_user_profiles(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_friend_user_profiles not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friends(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.get_friends not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_friends(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.add_friends not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_friend(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.remove_friend not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_owner(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMHXX.find_community_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/matchmaking_mk8.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MatchmakeSystem:\n\tGLOBAL = 1\n\tFRIENDS = 2\n\n\nclass Gathering(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = 0\n\t\tself.owner = 0\n\t\tself.host = 0\n\t\tself.min_participants = 0\n\t\tself.max_participants = 0\n\t\tself.participation_policy = 1\n\t\tself.policy_argument = 0\n\t\tself.flags = 512\n\t\tself.state = 0\n\t\tself.description = \"\"\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.host = stream.pid()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.flags = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.description = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.pid(self.host)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.u32(self.flags)\n\t\tstream.u32(self.state)\n\t\tstream.string(self.description)\n\n\nclass GatheringURLs(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.urls = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'urls']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.urls = stream.list(stream.stationurl)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.urls, stream.stationurl)\n\n\nclass GatheringStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.flags = None\n\t\tself.values = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'flags', 'values']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.flags = stream.u32()\n\t\tself.values = stream.list(stream.float)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.flags)\n\t\tstream.list(self.values, stream.float)\n\n\nclass Invitation(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.guest = None\n\t\tself.message = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'guest', 'message']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.guest = stream.u32()\n\t\tself.message = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.guest)\n\t\tstream.string(self.message)\n\n\nclass ParticipantDetails(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.message = None\n\t\tself.participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'message', 'participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.message = stream.string()\n\t\tself.participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.string(self.message)\n\t\tstream.u16(self.participants)\n\n\nclass DeletionEntry(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.pid = None\n\t\tself.reason = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'pid', 'reason']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.reason = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.reason)\n\n\nclass MatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.param = {}\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.param = stream.map(stream.string, stream.variant)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.map(self.param, stream.string, stream.variant)\n\n\nclass MatchmakeSessionSearchCriteria(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.attribs = [\"\", \"\", \"\", \"\", \"\", \"\"]\n\t\tself.game_mode = \"\"\n\t\tself.min_participants = \"\"\n\t\tself.max_participants = \"\"\n\t\tself.matchmake_system = \"\"\n\t\tself.vacant_only = True\n\t\tself.exclude_locked = True\n\t\tself.exclude_non_host_pid = False\n\t\tself.selection_method = 0\n\t\tself.vacant_participants = 1\n\t\tself.param = MatchmakeParam()\n\t\tself.exclude_user_password = False\n\t\tself.exclude_system_password = False\n\t\tself.refer_gid = 0\n\t\tself.codeword = \"\"\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.attribs = stream.list(stream.string)\n\t\tself.game_mode = stream.string()\n\t\tself.min_participants = stream.string()\n\t\tself.max_participants = stream.string()\n\t\tself.matchmake_system = stream.string()\n\t\tself.vacant_only = stream.bool()\n\t\tself.exclude_locked = stream.bool()\n\t\tself.exclude_non_host_pid = stream.bool()\n\t\tself.selection_method = stream.u32()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.vacant_participants = stream.u16()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.exclude_user_password = stream.bool()\n\t\t\tself.exclude_system_password = stream.bool()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.codeword = stream.string()\n\t\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.attribs, stream.string)\n\t\tstream.string(self.game_mode)\n\t\tstream.string(self.min_participants)\n\t\tstream.string(self.max_participants)\n\t\tstream.string(self.matchmake_system)\n\t\tstream.bool(self.vacant_only)\n\t\tstream.bool(self.exclude_locked)\n\t\tstream.bool(self.exclude_non_host_pid)\n\t\tstream.u32(self.selection_method)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u16(self.vacant_participants)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.add(self.param)\n\t\t\tstream.bool(self.exclude_user_password)\n\t\t\tstream.bool(self.exclude_system_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.string(self.codeword)\n\t\t\tstream.add(self.range)\n\n\nclass MatchmakeSession(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.game_mode = 0\n\t\tself.attribs = [0, 0, 0, 0, 0, 0]\n\t\tself.open_participation = True\n\t\tself.matchmake_system = 0\n\t\tself.application_data = b\"\"\n\t\tself.num_participants = 0\n\t\tself.progress_score = 100\n\t\tself.session_key = b\"\"\n\t\tself.option = 0\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = common.DateTime(0)\n\t\tself.user_password = \"\"\n\t\tself.refer_gid = 0\n\t\tself.user_password_enabled = False\n\t\tself.system_password_enabled = False\n\t\tself.codeword = \"\"\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tversion = 1\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tversion = 2\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tversion = 3\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30000:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.game_mode = stream.u32()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\tself.num_participants = stream.u32()\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.progress_score = stream.u8()\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tself.session_key = stream.buffer()\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.option = stream.u32()\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\t\t\tself.started_time = stream.datetime()\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tself.user_password = stream.string()\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tself.refer_gid = stream.u32()\n\t\t\t\t\tself.user_password_enabled = stream.bool()\n\t\t\t\t\tself.system_password_enabled = stream.bool()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.progress_score = stream.u8()\n\t\t\tself.session_key = stream.buffer()\n\t\t\tself.option = stream.u32()\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.started_time = stream.datetime()\n\t\t\tself.user_password = stream.string()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.user_password_enabled = stream.bool()\n\t\t\tself.system_password_enabled = stream.bool()\n\t\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.game_mode)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.buffer(self.application_data)\n\t\tstream.u32(self.num_participants)\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u8(self.progress_score)\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tstream.buffer(self.session_key)\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u32(self.option)\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tstream.add(self.param)\n\t\t\t\t\tstream.datetime(self.started_time)\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tstream.string(self.user_password)\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tstream.u32(self.refer_gid)\n\t\t\t\t\tstream.bool(self.user_password_enabled)\n\t\t\t\t\tstream.bool(self.system_password_enabled)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.u8(self.progress_score)\n\t\t\tstream.buffer(self.session_key)\n\t\t\tstream.u32(self.option)\n\t\t\tstream.add(self.param)\n\t\t\tstream.datetime(self.started_time)\n\t\t\tstream.string(self.user_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.bool(self.user_password_enabled)\n\t\t\tstream.bool(self.system_password_enabled)\n\t\t\tstream.string(self.codeword)\ncommon.DataHolder.register(MatchmakeSession, \"MatchmakeSession\")\n\n\nclass MatchmakeBlockListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.options = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.options = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.options)\n\n\nclass CreateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.additional_participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['additional_participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.additional_participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.additional_participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\n\nclass JoinMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.behavior = None\n\t\tself.user_password = None\n\t\tself.system_password = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.extra_participants = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'participants', 'gid_for_participation_check', 'options', 'behavior', 'user_password', 'system_password', 'join_message', 'num_participants', 'extra_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.behavior = stream.u8()\n\t\tself.user_password = stream.string()\n\t\tself.system_password = stream.string()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.extra_participants = stream.u16()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.u8(self.behavior)\n\t\tstream.string(self.user_password)\n\t\tstream.string(self.system_password)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.u16(self.extra_participants)\n\t\tstream.add(self.block_list)\n\n\nclass UpdateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.modification_flags = None\n\t\tself.attributes = None\n\t\tself.open_participation = None\n\t\tself.application_buffer = None\n\t\tself.progress_score = None\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = None\n\t\tself.user_password = None\n\t\tself.game_mode = None\n\t\tself.description = None\n\t\tself.min_participants = None\n\t\tself.max_participants = None\n\t\tself.matchmake_system = None\n\t\tself.participation_policy = None\n\t\tself.policy_argument = None\n\t\tself.codeword = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'modification_flags', 'attributes', 'open_participation', 'application_buffer', 'progress_score', 'started_time', 'user_password', 'game_mode', 'description', 'min_participants', 'max_participants', 'matchmake_system', 'participation_policy', 'policy_argument', 'codeword']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.modification_flags = stream.u32()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.application_buffer = stream.buffer()\n\t\tself.progress_score = stream.u8()\n\t\tself.param = stream.extract(MatchmakeParam)\n\t\tself.started_time = stream.datetime()\n\t\tself.user_password = stream.string()\n\t\tself.game_mode = stream.u32()\n\t\tself.description = stream.string()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.modification_flags)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.u8(self.progress_score)\n\t\tstream.add(self.param)\n\t\tstream.datetime(self.started_time)\n\t\tstream.string(self.user_password)\n\t\tstream.u32(self.game_mode)\n\t\tstream.string(self.description)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.string(self.codeword)\n\n\nclass AutoMatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.search_criteria = None\n\t\tself.target_gids = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants', 'search_criteria', 'target_gids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.search_criteria = stream.list(MatchmakeSessionSearchCriteria)\n\t\tself.target_gids = stream.list(stream.u32)\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.list(self.search_criteria, stream.add)\n\t\tstream.list(self.target_gids, stream.u32)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pids = None\n\t\tself.options = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids', 'options']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.options = stream.u32()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u32(self.options)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.session = MatchmakeSession()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.session)\n\n\nclass PersistentGathering(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.password = None\n\t\tself.attribs = None\n\t\tself.application_buffer = None\n\t\tself.participation_start = None\n\t\tself.participation_end = None\n\t\tself.matchmake_session_count = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'password', 'attribs', 'application_buffer', 'participation_start', 'participation_end', 'matchmake_session_count', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.password = stream.string()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.application_buffer = stream.buffer()\n\t\tself.participation_start = stream.datetime()\n\t\tself.participation_end = stream.datetime()\n\t\tself.matchmake_session_count = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.string(self.password)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.datetime(self.participation_start)\n\t\tstream.datetime(self.participation_end)\n\t\tstream.u32(self.matchmake_session_count)\n\t\tstream.u32(self.num_participants)\ncommon.DataHolder.register(PersistentGathering, \"PersistentGathering\")\n\n\nclass SimpleCommunity(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.matchmake_session_count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'matchmake_session_count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.matchmake_session_count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.matchmake_session_count)\n\n\nclass PlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gathering = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gathering']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gathering = stream.anydata()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.anydata(self.gathering)\n\n\nclass SimplePlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gid = None\n\t\tself.game_mode = None\n\t\tself.attribute = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gid', 'game_mode', 'attribute']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gid = stream.u32()\n\t\tself.game_mode = stream.u32()\n\t\tself.attribute = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.game_mode)\n\t\tstream.u32(self.attribute)\n\n\nclass MatchmakeRefereeRound(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.gid = None\n\t\tself.state = None\n\t\tself.personal_data_category = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'gid', 'state', 'personal_data_category', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u64()\n\t\tself.gid = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.personal_data_category = stream.u32()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.id)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.state)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereeStartRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.personal_data_category = None\n\t\tself.gid = None\n\t\tself.pids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['personal_data_category', 'gid', 'pids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.personal_data_category = stream.u32()\n\t\tself.gid = stream.u32()\n\t\tself.pids = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.pids, stream.pid)\n\n\nclass MatchmakeRefereeEndRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.round_id = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['round_id', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.round_id = stream.u64()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.round_id)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereePersonalRoundResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.personal_round_result_flag = None\n\t\tself.round_win_loss = None\n\t\tself.rating_change = None\n\t\tself.buffer = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'personal_round_result_flag', 'round_win_loss', 'rating_change', 'buffer']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.personal_round_result_flag = stream.u32()\n\t\tself.round_win_loss = stream.u32()\n\t\tself.rating_change = stream.s32()\n\t\tself.buffer = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.personal_round_result_flag)\n\t\tstream.u32(self.round_win_loss)\n\t\tstream.s32(self.rating_change)\n\t\tstream.qbuffer(self.buffer)\n\n\nclass MatchmakeRefereeStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = None\n\t\tself.category = None\n\t\tself.pid = None\n\t\tself.recent_disconnection = None\n\t\tself.recent_violation = None\n\t\tself.recent_mismatch = None\n\t\tself.recent_win = None\n\t\tself.recent_loss = None\n\t\tself.recent_draw = None\n\t\tself.total_disconnect = None\n\t\tself.total_violation = None\n\t\tself.total_mismatch = None\n\t\tself.total_win = None\n\t\tself.total_loss = None\n\t\tself.total_draw = None\n\t\tself.rating_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unique_id', 'category', 'pid', 'recent_disconnection', 'recent_violation', 'recent_mismatch', 'recent_win', 'recent_loss', 'recent_draw', 'total_disconnect', 'total_violation', 'total_mismatch', 'total_win', 'total_loss', 'total_draw', 'rating_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.recent_disconnection = stream.u32()\n\t\tself.recent_violation = stream.u32()\n\t\tself.recent_mismatch = stream.u32()\n\t\tself.recent_win = stream.u32()\n\t\tself.recent_loss = stream.u32()\n\t\tself.recent_draw = stream.u32()\n\t\tself.total_disconnect = stream.u32()\n\t\tself.total_violation = stream.u32()\n\t\tself.total_mismatch = stream.u32()\n\t\tself.total_win = stream.u32()\n\t\tself.total_loss = stream.u32()\n\t\tself.total_draw = stream.u32()\n\t\tself.rating_value = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.category)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.recent_disconnection)\n\t\tstream.u32(self.recent_violation)\n\t\tstream.u32(self.recent_mismatch)\n\t\tstream.u32(self.recent_win)\n\t\tstream.u32(self.recent_loss)\n\t\tstream.u32(self.recent_draw)\n\t\tstream.u32(self.total_disconnect)\n\t\tstream.u32(self.total_violation)\n\t\tstream.u32(self.total_mismatch)\n\t\tstream.u32(self.total_win)\n\t\tstream.u32(self.total_loss)\n\t\tstream.u32(self.total_draw)\n\t\tstream.u32(self.rating_value)\n\n\nclass MatchmakeRefereeStatsTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.category = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\n\nclass MatchmakeRefereeStatsInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.initial_rating = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'initial_rating']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.initial_rating = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.initial_rating)\n\n\nclass SimpleSearchObject(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.owner = None\n\t\tself.attributes = None\n\t\tself.metadata = None\n\t\tself.community_id = None\n\t\tself.community_code = None\n\t\tself.datetime = SimpleSearchDateTimeAttribute()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'owner', 'attributes', 'metadata', 'community_id', 'community_code']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.metadata = stream.qbuffer()\n\t\tself.community_id = stream.u32()\n\t\tself.community_code = stream.string()\n\t\tself.datetime = stream.extract(SimpleSearchDateTimeAttribute)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.qbuffer(self.metadata)\n\t\tstream.u32(self.community_id)\n\t\tstream.string(self.community_code)\n\t\tstream.add(self.datetime)\n\n\nclass SimpleSearchDateTimeAttribute(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.unk3 = None\n\t\tself.unk4 = None\n\t\tself.start_time = None\n\t\tself.end_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'unk3', 'unk4', 'start_time', 'end_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u32()\n\t\tself.unk2 = stream.u32()\n\t\tself.unk3 = stream.u32()\n\t\tself.unk4 = stream.u32()\n\t\tself.start_time = stream.datetime()\n\t\tself.end_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.unk1)\n\t\tstream.u32(self.unk2)\n\t\tstream.u32(self.unk3)\n\t\tstream.u32(self.unk4)\n\t\tstream.datetime(self.start_time)\n\t\tstream.datetime(self.end_time)\n\n\nclass SimpleSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unk1 = None\n\t\tself.unk2 = None\n\t\tself.conditions = None\n\t\tself.unk3 = None\n\t\tself.range = common.ResultRange()\n\t\tself.unk4 = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unk1', 'unk2', 'conditions', 'unk3', 'unk4']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unk1 = stream.u32()\n\t\tself.unk2 = stream.pid()\n\t\tself.conditions = stream.list(SimpleSearchCondition)\n\t\tself.unk3 = stream.string()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\tself.unk4 = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.unk1)\n\t\tstream.pid(self.unk2)\n\t\tstream.list(self.conditions, stream.add)\n\t\tstream.string(self.unk3)\n\t\tstream.add(self.range)\n\t\tstream.datetime(self.unk4)\n\n\nclass SimpleSearchCondition(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.value = None\n\t\tself.operator = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['value', 'operator']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.value = stream.u32()\n\t\tself.operator = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.value)\n\t\tstream.u32(self.operator)\n\n\nclass MatchMakingProtocol:\n\tMETHOD_REGISTER_GATHERING = 1\n\tMETHOD_UNREGISTER_GATHERING = 2\n\tMETHOD_UNREGISTER_GATHERINGS = 3\n\tMETHOD_UPDATE_GATHERING = 4\n\tMETHOD_INVITE = 5\n\tMETHOD_ACCEPT_INVITATION = 6\n\tMETHOD_DECLINE_INVITATION = 7\n\tMETHOD_CANCEL_INVITATION = 8\n\tMETHOD_GET_INVITATIONS_SENT = 9\n\tMETHOD_GET_INVITATIONS_RECEIVED = 10\n\tMETHOD_PARTICIPATE = 11\n\tMETHOD_CANCEL_PARTICIPATION = 12\n\tMETHOD_GET_PARTICIPANTS = 13\n\tMETHOD_ADD_PARTICIPANTS = 14\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 15\n\tMETHOD_GET_PARTICIPANTS_URLS = 16\n\tMETHOD_FIND_BY_TYPE = 17\n\tMETHOD_FIND_BY_DESCRIPTION = 18\n\tMETHOD_FIND_BY_DESCRIPTION_REGEX = 19\n\tMETHOD_FIND_BY_ID = 20\n\tMETHOD_FIND_BY_SINGLE_ID = 21\n\tMETHOD_FIND_BY_OWNER = 22\n\tMETHOD_FIND_BY_PARTICIPANTS = 23\n\tMETHOD_FIND_INVITATIONS = 24\n\tMETHOD_FIND_BY_SQL_QUERY = 25\n\tMETHOD_LAUNCH_SESSION = 26\n\tMETHOD_UPDATE_SESSION_URL = 27\n\tMETHOD_GET_SESSION_URL = 28\n\tMETHOD_GET_STATE = 29\n\tMETHOD_SET_STATE = 30\n\tMETHOD_REPORT_STATS = 31\n\tMETHOD_GET_STATS = 32\n\tMETHOD_DELETE_GATHERING = 33\n\tMETHOD_GET_PENDING_DELETIONS = 34\n\tMETHOD_DELETE_FROM_DELETIONS = 35\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP_V1 = 36\n\tMETHOD_FIND_BY_DESCRIPTION_LIKE = 37\n\tMETHOD_REGISTER_LOCAL_URL = 38\n\tMETHOD_REGISTER_LOCAL_URLS = 39\n\tMETHOD_UPDATE_SESSION_HOST_V1 = 40\n\tMETHOD_GET_SESSION_URLS = 41\n\tMETHOD_UPDATE_SESSION_HOST = 42\n\tMETHOD_UPDATE_GATHERING_OWNERSHIP = 43\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP = 44\n\t\n\tPROTOCOL_ID = 0x15\n\n\nclass MatchMakingProtocolExt:\n\tMETHOD_END_PARTICIPATION = 1\n\tMETHOD_GET_PARTICIPANTS = 2\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 3\n\tMETHOD_GET_PARTICIPANTS_URLS = 4\n\tMETHOD_GET_GATHERING_RELATIONS = 5\n\tMETHOD_DELETE_FROM_DELETIONS = 6\n\t\n\tPROTOCOL_ID = 0x32\n\n\nclass MatchmakeRefereeProtocol:\n\tMETHOD_START_ROUND = 1\n\tMETHOD_GET_START_ROUND_PARAM = 2\n\tMETHOD_END_ROUND = 3\n\tMETHOD_END_ROUND_WITHOUT_REPORT = 4\n\tMETHOD_GET_ROUND_PARTICIPANTS = 5\n\tMETHOD_GET_NOT_SUMMARIZED_ROUND = 6\n\tMETHOD_GET_ROUND = 7\n\tMETHOD_GET_STATS_PRIMARY = 8\n\tMETHOD_GET_STATS_PRIMARIES = 9\n\tMETHOD_GET_STATS_ALL = 10\n\tMETHOD_CREATE_STATS = 11\n\tMETHOD_GET_OR_CREATE_STATS = 12\n\tMETHOD_RESET_STATS = 13\n\t\n\tPROTOCOL_ID = 0x78\n\n\nclass MatchmakeExtensionProtocolMK8:\n\tMETHOD_CLOSE_PARTICIPATION = 1\n\tMETHOD_OPEN_PARTICIPATION = 2\n\tMETHOD_AUTO_MATCHMAKE_POSTPONE = 3\n\tMETHOD_BROWSE_MATCHMAKE_SESSION = 4\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS = 5\n\tMETHOD_CREATE_MATCHMAKE_SESSION = 6\n\tMETHOD_JOIN_MATCHMAKE_SESSION = 7\n\tMETHOD_MODIFY_CURRENT_GAME_ATTRIBUTE = 8\n\tMETHOD_UPDATE_NOTIFICATION_DATA = 9\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA = 10\n\tMETHOD_UPDATE_APPLICATION_BUFFER = 11\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE = 12\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA_LIST = 13\n\tMETHOD_UPDATE_MATCHMAKE_SESSION = 14\n\tMETHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE = 15\n\tMETHOD_GET_PLAYING_SESSION = 16\n\tMETHOD_CREATE_COMMUNITY = 17\n\tMETHOD_UPDATE_COMMUNITY = 18\n\tMETHOD_JOIN_COMMUNITY = 19\n\tMETHOD_FIND_COMMUNITY_BY_GATHERING_ID = 20\n\tMETHOD_FIND_OFFICIAL_COMMUNITY = 21\n\tMETHOD_FIND_COMMUNITY_BY_PARTICIPANT = 22\n\tMETHOD_UPDATE_PRIVACY_SETTING = 23\n\tMETHOD_GET_MY_BLOCK_LIST = 24\n\tMETHOD_ADD_TO_BLOCK_LIST = 25\n\tMETHOD_REMOVE_FROM_BLOCK_LIST = 26\n\tMETHOD_CLEAR_MY_BLOCK_LIST = 27\n\tMETHOD_REPORT_VIOLATION = 28\n\tMETHOD_IS_VIOLATION_USER = 29\n\tMETHOD_JOIN_MATCHMAKE_SESSION_EX = 30\n\tMETHOD_GET_SIMPLE_PLAYING_SESSION = 31\n\tMETHOD_GET_SIMPLE_COMMUNITY = 32\n\tMETHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE = 33\n\tMETHOD_UPDATE_PROGRESS_SCORE = 34\n\tMETHOD_DEBUG_NOTIFY_EVENT = 35\n\tMETHOD_CREATE_SIMPLE_SEARCH_OBJECT = 36\n\tMETHOD_UPDATE_SIMPLE_SEARCH_OBJECT = 37\n\tMETHOD_DELETE_SIMPLE_SEARCH_OBJECT = 38\n\tMETHOD_SEARCH_SIMPLE_SEARCH_OBJECT = 39\n\tMETHOD_JOIN_MATCHMAKE_SESSION_WITH_EXTRA_PARTICIPANTS = 40\n\tMETHOD_SEARCH_SIMPLE_SEARCH_OBJECT_BY_OBJECT_IDS = 41\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER = 42\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER = 43\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_PART = 44\n\tMETHOD_REQUEST_MATCHMAKING = 45\n\tMETHOD_WITHDRAW_MATCHMAKING = 46\n\tMETHOD_WITHDRAW_MATCHMAKING_ALL = 47\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID = 48\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID = 49\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_OWNER = 50\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT = 51\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE = 52\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE = 53\n\t\n\tPROTOCOL_ID = 0x6D\n\n\nclass MatchMakingClient(MatchMakingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.register_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_gathering -> done\")\n\t\treturn gid\n\t\n\tasync def unregister_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering -> done\")\n\t\treturn result\n\t\n\tasync def unregister_gatherings(self, gids):\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings -> done\")\n\t\treturn result\n\t\n\tasync def update_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.update_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering -> done\")\n\t\treturn result\n\t\n\tasync def invite(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.invite()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_INVITE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.invite -> done\")\n\t\treturn result\n\t\n\tasync def accept_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.accept_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACCEPT_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.accept_invitation -> done\")\n\t\treturn result\n\t\n\tasync def decline_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.decline_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DECLINE_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.decline_invitation -> done\")\n\t\treturn result\n\t\n\tasync def cancel_invitation(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation -> done\")\n\t\treturn result\n\t\n\tasync def get_invitations_sent(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_SENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent -> done\")\n\t\treturn invitations\n\t\n\tasync def get_invitations_received(self):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_RECEIVED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received -> done\")\n\t\treturn invitations\n\t\n\tasync def participate(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.participate()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PARTICIPATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.participate -> done\")\n\t\treturn result\n\t\n\tasync def cancel_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def add_participants(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.add_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.add_participants -> done\")\n\t\treturn result\n\t\n\tasync def get_detailed_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def find_by_type(self, type, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_type()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(type)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_TYPE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_type -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description_regex(self, regex, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(regex)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_REGEX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_id(self, ids):\n\t\tlogger.info(\"MatchMakingClient.find_by_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_id -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_single_id(self, gid):\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SINGLE_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id -> done\")\n\t\treturn obj\n\t\n\tasync def find_by_owner(self, owner, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_owner -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_participants(self, pids):\n\t\tlogger.info(\"MatchMakingClient.find_by_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_participants -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_invitations(self, range):\n\t\tlogger.info(\"MatchMakingClient.find_invitations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_INVITATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_invitations -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_sql_query(self, query, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(query)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SQL_QUERY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query -> done\")\n\t\treturn gatherings\n\t\n\tasync def launch_session(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.launch_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LAUNCH_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.launch_session -> done\")\n\t\treturn result\n\t\n\tasync def update_session_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.update_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_url -> done\")\n\t\treturn result\n\t\n\tasync def get_session_url(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.url = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_url -> done\")\n\t\treturn obj\n\t\n\tasync def get_state(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.state = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_state -> done\")\n\t\treturn obj\n\t\n\tasync def set_state(self, gid, state):\n\t\tlogger.info(\"MatchMakingClient.set_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(state)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.set_state -> done\")\n\t\treturn result\n\t\n\tasync def report_stats(self, gid, stats):\n\t\tlogger.info(\"MatchMakingClient.report_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(stats, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.report_stats -> done\")\n\t\treturn result\n\t\n\tasync def get_stats(self, gid, pids, columns):\n\t\tlogger.info(\"MatchMakingClient.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.list(columns, stream.u8)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.stats = stream.list(GatheringStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_stats -> done\")\n\t\treturn obj\n\t\n\tasync def delete_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.delete_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_gathering -> done\")\n\t\treturn result\n\t\n\tasync def get_pending_deletions(self, reason, range):\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(reason)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PENDING_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.deletions = stream.list(DeletionEntry)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions -> done\")\n\t\treturn obj\n\t\n\tasync def delete_from_deletions(self, deletions):\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership_v1(self, gid, potential_owners):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1 -> done\")\n\t\treturn result\n\t\n\tasync def find_by_description_like(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_LIKE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like -> done\")\n\t\treturn gatherings\n\t\n\tasync def register_local_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.register_local_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.stationurl(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_url -> done\")\n\t\n\tasync def register_local_urls(self, gid, urls):\n\t\tlogger.info(\"MatchMakingClient.register_local_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_urls -> done\")\n\t\n\tasync def update_session_host_v1(self, gid):\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1 -> done\")\n\t\n\tasync def get_session_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_urls -> done\")\n\t\treturn urls\n\t\n\tasync def update_session_host(self, gid, is_migrate_owner):\n\t\tlogger.info(\"MatchMakingClient.update_session_host()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(is_migrate_owner)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host -> done\")\n\t\n\tasync def update_gathering_ownership(self, gid, participants_only):\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership(self, gid, potential_owners, participants_only):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership -> done\")\n\n\nclass MatchMakingClientExt(MatchMakingProtocolExt):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def end_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClientExt.end_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.end_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def get_detailed_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gids):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def get_gathering_relations(self, id, descr):\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.string(descr)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_GATHERING_RELATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations -> done\")\n\t\treturn result\n\t\n\tasync def delete_from_deletions(self, deletions, pid):\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions -> done\")\n\n\nclass MatchmakeRefereeClient(MatchmakeRefereeProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def start_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_START_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round -> done\")\n\t\treturn round_id\n\t\n\tasync def get_start_round_param(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_START_ROUND_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparam = stream.extract(MatchmakeRefereeStartRoundParam)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param -> done\")\n\t\treturn param\n\t\n\tasync def end_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round -> done\")\n\t\n\tasync def end_round_without_report(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND_WITHOUT_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report -> done\")\n\t\n\tasync def get_round_participants(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants -> done\")\n\t\treturn pids\n\t\n\tasync def get_not_summarized_round(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOT_SUMMARIZED_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trounds = stream.list(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round -> done\")\n\t\treturn rounds\n\t\n\tasync def get_round(self, round):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround = stream.extract(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round -> done\")\n\t\treturn round\n\t\n\tasync def get_stats_primary(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary -> done\")\n\t\treturn stats\n\t\n\tasync def get_stats_primaries(self, targets):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARIES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.stats = stream.list(MatchmakeRefereeStats)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries -> done\")\n\t\treturn obj\n\t\n\tasync def get_stats_all(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.list(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all -> done\")\n\t\treturn stats\n\t\n\tasync def create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_or_create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OR_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def reset_stats(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats -> done\")\n\n\nclass MatchmakeExtensionClientMK8(MatchmakeExtensionProtocolMK8):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def close_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.close_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLOSE_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.close_participation -> done\")\n\t\n\tasync def open_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.open_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_OPEN_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.open_participation -> done\")\n\t\n\tasync def auto_matchmake_postpone(self, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.auto_matchmake_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def browse_matchmake_session(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session -> done\")\n\t\treturn gatherings\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gatherings = stream.list(stream.anydata)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_with_host_urls -> done\")\n\t\treturn obj\n\t\n\tasync def create_matchmake_session(self, gathering, description, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(description)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gid = stream.u32()\n\t\tobj.session_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.create_matchmake_session -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session(self, gid, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_matchmake_session -> done\")\n\t\treturn session_key\n\t\n\tasync def modify_current_game_attribute(self, gid, attrib, value):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(attrib)\n\t\tstream.u32(value)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.modify_current_game_attribute -> done\")\n\t\n\tasync def update_notification_data(self, type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(type)\n\t\tstream.pid(param1)\n\t\tstream.pid(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_notification_data -> done\")\n\t\n\tasync def get_friend_notification_data(self, type):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.s32(type)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_friend_notification_data -> done\")\n\t\treturn notifications\n\t\n\tasync def update_application_buffer(self, gid, buffer):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_application_buffer()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.buffer(buffer)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_APPLICATION_BUFFER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_application_buffer -> done\")\n\t\n\tasync def update_matchmake_session_attribute(self, gid, attribs):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(attribs, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_matchmake_session_attribute -> done\")\n\t\n\tasync def get_friend_notification_data_list(self, types):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(types, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_friend_notification_data_list -> done\")\n\t\treturn notifications\n\t\n\tasync def update_matchmake_session(self, gathering):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_matchmake_session -> done\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, search_criteria, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(search_criteria, stream.add)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.auto_matchmake_with_search_criteria_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def get_playing_session(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(PlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_playing_session -> done\")\n\t\treturn sessions\n\t\n\tasync def create_community(self, community, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.create_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.create_community -> done\")\n\t\treturn gid\n\t\n\tasync def update_community(self, community):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_community -> done\")\n\t\n\tasync def join_community(self, gid, message, password):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tstream.string(password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_community -> done\")\n\t\n\tasync def find_community_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_community_by_gathering_id -> done\")\n\t\treturn communities\n\t\n\tasync def find_official_community(self, available_only, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_official_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(available_only)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_OFFICIAL_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_official_community -> done\")\n\t\treturn communities\n\t\n\tasync def find_community_by_participant(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_community_by_participant -> done\")\n\t\treturn communities\n\t\n\tasync def update_privacy_setting(self, online_status, community_participation):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(online_status)\n\t\tstream.bool(community_participation)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRIVACY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_privacy_setting -> done\")\n\t\n\tasync def get_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_my_block_list -> done\")\n\t\treturn pids\n\t\n\tasync def add_to_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.add_to_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_TO_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.add_to_block_list -> done\")\n\t\n\tasync def remove_from_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FROM_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.remove_from_block_list -> done\")\n\t\n\tasync def clear_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.clear_my_block_list -> done\")\n\t\n\tasync def report_violation(self, pid, username, violation_code):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.report_violation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.string(username)\n\t\tstream.u32(violation_code)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_VIOLATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.report_violation -> done\")\n\t\n\tasync def is_violation_user(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.is_violation_user()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_VIOLATION_USER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.flag = stream.bool()\n\t\tobj.score = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.is_violation_user -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session_ex(self, gid, gmessage, ignore_block_list, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(gmessage)\n\t\tstream.bool(ignore_block_list)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_matchmake_session_ex -> done\")\n\t\treturn session_key\n\t\n\tasync def get_simple_playing_session(self, pids, include_login_user):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.bool(include_login_user)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.list(SimplePlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_simple_playing_session -> done\")\n\t\treturn session\n\t\n\tasync def get_simple_community(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_simple_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(SimpleCommunity)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.get_simple_community -> done\")\n\t\treturn communities\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, gids, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tjoined_gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.auto_matchmake_with_gathering_id_postpone -> done\")\n\t\treturn joined_gathering\n\t\n\tasync def update_progress_score(self, gid, score):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_progress_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u8(score)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PROGRESS_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_progress_score -> done\")\n\t\n\tasync def debug_notify_event(self, pid, main_type, sub_type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.debug_notify_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.u32(main_type)\n\t\tstream.u32(sub_type)\n\t\tstream.u64(param1)\n\t\tstream.u64(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DEBUG_NOTIFY_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.debug_notify_event -> done\")\n\t\n\tasync def create_simple_search_object(self, object):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.create_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.create_simple_search_object -> done\")\n\t\treturn id\n\t\n\tasync def update_simple_search_object(self, id, object):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.add(object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_simple_search_object -> done\")\n\t\n\tasync def delete_simple_search_object(self, id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.delete_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.delete_simple_search_object -> done\")\n\t\n\tasync def search_simple_search_object(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.search_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobjects = stream.list(SimpleSearchObject)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.search_simple_search_object -> done\")\n\t\treturn objects\n\t\n\tasync def join_matchmake_session_with_extra_participants(self, gid, join_message, ignore_blacklist, participation_count, extra_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_matchmake_session_with_extra_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(join_message)\n\t\tstream.bool(ignore_blacklist)\n\t\tstream.u16(participation_count)\n\t\tstream.u32(extra_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_WITH_EXTRA_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.join_matchmake_session_with_extra_participants -> done\")\n\t\treturn session_key\n\t\n\tasync def search_simple_search_object_by_object_ids(self, ids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.search_simple_search_object_by_object_ids()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT_BY_OBJECT_IDS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobjects = stream.list(SimpleSearchObject)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.search_simple_search_object_by_object_ids -> done\")\n\t\treturn objects\n\t\n\tasync def browse_matchmake_session_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_no_holder -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_with_host_urls_no_holder -> done\")\n\t\treturn obj\n\t\n\tasync def update_matchmake_session_part(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_PART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.update_matchmake_session_part -> done\")\n\t\n\tasync def request_matchmaking(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.request_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trequest_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.request_matchmaking -> done\")\n\t\treturn request_id\n\t\n\tasync def withdraw_matchmaking(self, request_id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(request_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.withdraw_matchmaking -> done\")\n\t\n\tasync def withdraw_matchmaking_all(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.withdraw_matchmaking_all -> done\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_gathering_id -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_single_gathering_id -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_owner(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_owner -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_participant(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.list(FindMatchmakeSessionByParticipantResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.find_matchmake_session_by_participant -> done\")\n\t\treturn result\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_no_holder_no_result_range -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8.browse_matchmake_session_with_host_urls_no_holder_no_result_range -> done\")\n\t\treturn obj\n\n\nclass MatchMakingServer(MatchMakingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER_GATHERING: self.handle_register_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERING: self.handle_unregister_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERINGS: self.handle_unregister_gatherings,\n\t\t\tself.METHOD_UPDATE_GATHERING: self.handle_update_gathering,\n\t\t\tself.METHOD_INVITE: self.handle_invite,\n\t\t\tself.METHOD_ACCEPT_INVITATION: self.handle_accept_invitation,\n\t\t\tself.METHOD_DECLINE_INVITATION: self.handle_decline_invitation,\n\t\t\tself.METHOD_CANCEL_INVITATION: self.handle_cancel_invitation,\n\t\t\tself.METHOD_GET_INVITATIONS_SENT: self.handle_get_invitations_sent,\n\t\t\tself.METHOD_GET_INVITATIONS_RECEIVED: self.handle_get_invitations_received,\n\t\t\tself.METHOD_PARTICIPATE: self.handle_participate,\n\t\t\tself.METHOD_CANCEL_PARTICIPATION: self.handle_cancel_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_ADD_PARTICIPANTS: self.handle_add_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_FIND_BY_TYPE: self.handle_find_by_type,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION: self.handle_find_by_description,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_REGEX: self.handle_find_by_description_regex,\n\t\t\tself.METHOD_FIND_BY_ID: self.handle_find_by_id,\n\t\t\tself.METHOD_FIND_BY_SINGLE_ID: self.handle_find_by_single_id,\n\t\t\tself.METHOD_FIND_BY_OWNER: self.handle_find_by_owner,\n\t\t\tself.METHOD_FIND_BY_PARTICIPANTS: self.handle_find_by_participants,\n\t\t\tself.METHOD_FIND_INVITATIONS: self.handle_find_invitations,\n\t\t\tself.METHOD_FIND_BY_SQL_QUERY: self.handle_find_by_sql_query,\n\t\t\tself.METHOD_LAUNCH_SESSION: self.handle_launch_session,\n\t\t\tself.METHOD_UPDATE_SESSION_URL: self.handle_update_session_url,\n\t\t\tself.METHOD_GET_SESSION_URL: self.handle_get_session_url,\n\t\t\tself.METHOD_GET_STATE: self.handle_get_state,\n\t\t\tself.METHOD_SET_STATE: self.handle_set_state,\n\t\t\tself.METHOD_REPORT_STATS: self.handle_report_stats,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_DELETE_GATHERING: self.handle_delete_gathering,\n\t\t\tself.METHOD_GET_PENDING_DELETIONS: self.handle_get_pending_deletions,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1: self.handle_migrate_gathering_ownership_v1,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_LIKE: self.handle_find_by_description_like,\n\t\t\tself.METHOD_REGISTER_LOCAL_URL: self.handle_register_local_url,\n\t\t\tself.METHOD_REGISTER_LOCAL_URLS: self.handle_register_local_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST_V1: self.handle_update_session_host_v1,\n\t\t\tself.METHOD_GET_SESSION_URLS: self.handle_get_session_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST: self.handle_update_session_host,\n\t\t\tself.METHOD_UPDATE_GATHERING_OWNERSHIP: self.handle_update_gathering_ownership,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP: self.handle_migrate_gathering_ownership,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.register_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_unregister_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.unregister_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_unregister_gatherings(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.unregister_gatherings(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.update_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_invite(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.invite()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.invite(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_accept_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.accept_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.accept_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_decline_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.decline_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.decline_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_invitation(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_invitations_sent(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_invitations_sent(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_invitations_received(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_received()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_invitations_received(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_participate(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.participate()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.participate(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.add_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.add_participants(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_detailed_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_find_by_type(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_type()\")\n\t\t#--- request ---\n\t\ttype = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_type(client, type, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description_regex(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tregex = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_regex(client, regex, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_id()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.find_by_id(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_single_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_single_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_by_single_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'gathering']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.gathering)\n\t\n\tasync def handle_find_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_owner()\")\n\t\t#--- request ---\n\t\towner = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_owner(client, owner, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_participants()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.find_by_participants(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_invitations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_invitations()\")\n\t\t#--- request ---\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_invitations(client, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_sql_query(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tquery = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_sql_query(client, query, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_launch_session(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.launch_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.launch_session(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.update_session_url(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_url(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'url']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.string(response.url)\n\t\n\tasync def handle_get_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_state(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'state']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.u32(response.state)\n\t\n\tasync def handle_set_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.set_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstate = input.u32()\n\t\tresponse = await self.set_state(client, gid, state)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_report_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.report_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstats = input.list(GatheringStats)\n\t\tresponse = await self.report_stats(client, gid, stats)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tcolumns = input.list(input.u8)\n\t\tresponse = await self.get_stats(client, gid, pids, columns)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'stats']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.stats, output.add)\n\t\n\tasync def handle_delete_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.delete_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_pending_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_pending_deletions()\")\n\t\t#--- request ---\n\t\treason = input.u32()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.get_pending_deletions(client, reason, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'deletions']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.deletions, output.add)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tresponse = await self.delete_from_deletions(client, deletions)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tresponse = await self.migrate_gathering_ownership_v1(client, gid, potential_owners)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_find_by_description_like(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_like()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_like(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_register_local_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.stationurl()\n\t\tawait self.register_local_url(client, gid, url)\n\t\n\tasync def handle_register_local_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turls = input.list(input.stationurl)\n\t\tawait self.register_local_urls(client, gid, urls)\n\t\n\tasync def handle_update_session_host_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.update_session_host_v1(client, gid)\n\t\n\tasync def handle_get_session_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_update_session_host(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tis_migrate_owner = input.bool()\n\t\tawait self.update_session_host(client, gid, is_migrate_owner)\n\t\n\tasync def handle_update_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tparticipants_only = input.bool()\n\t\tresponse = await self.update_gathering_ownership(client, gid, participants_only)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tparticipants_only = input.bool()\n\t\tawait self.migrate_gathering_ownership(client, gid, potential_owners, participants_only)\n\t\n\tasync def register_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gatherings(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gatherings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def invite(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.invite not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def accept_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.accept_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def decline_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.decline_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_sent(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_sent not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_received(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_received not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def participate(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.participate not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.add_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_type(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_type not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_regex(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_regex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_single_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_single_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_owner(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_invitations(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_invitations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_sql_query(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_sql_query not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def launch_session(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.launch_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def set_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.set_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.report_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pending_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_pending_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_like(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_like not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchMakingServerExt(MatchMakingProtocolExt):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_END_PARTICIPATION: self.handle_end_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_GET_GATHERING_RELATIONS: self.handle_get_gathering_relations,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServerExt: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_end_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.end_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.end_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_detailed_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_participants_urls(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_gathering_relations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tdescr = input.string()\n\t\tresponse = await self.get_gathering_relations(client, id, descr)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tpid = input.pid()\n\t\tawait self.delete_from_deletions(client, deletions, pid)\n\t\n\tasync def end_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.end_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_gathering_relations(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_gathering_relations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeRefereeServer(MatchmakeRefereeProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_START_ROUND: self.handle_start_round,\n\t\t\tself.METHOD_GET_START_ROUND_PARAM: self.handle_get_start_round_param,\n\t\t\tself.METHOD_END_ROUND: self.handle_end_round,\n\t\t\tself.METHOD_END_ROUND_WITHOUT_REPORT: self.handle_end_round_without_report,\n\t\t\tself.METHOD_GET_ROUND_PARTICIPANTS: self.handle_get_round_participants,\n\t\t\tself.METHOD_GET_NOT_SUMMARIZED_ROUND: self.handle_get_not_summarized_round,\n\t\t\tself.METHOD_GET_ROUND: self.handle_get_round,\n\t\t\tself.METHOD_GET_STATS_PRIMARY: self.handle_get_stats_primary,\n\t\t\tself.METHOD_GET_STATS_PRIMARIES: self.handle_get_stats_primaries,\n\t\t\tself.METHOD_GET_STATS_ALL: self.handle_get_stats_all,\n\t\t\tself.METHOD_CREATE_STATS: self.handle_create_stats,\n\t\t\tself.METHOD_GET_OR_CREATE_STATS: self.handle_get_or_create_stats,\n\t\t\tself.METHOD_RESET_STATS: self.handle_reset_stats,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeRefereeServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_start_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.start_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStartRoundParam)\n\t\tresponse = await self.start_round(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_get_start_round_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_start_round_param()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_start_round_param(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStartRoundParam):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStartRoundParam, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_end_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeEndRoundParam)\n\t\tawait self.end_round(client, param)\n\t\n\tasync def handle_end_round_without_report(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round_without_report()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tawait self.end_round_without_report(client, round_id)\n\t\n\tasync def handle_get_round_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round_participants()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_round_participants(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_not_summarized_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_not_summarized_round(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round()\")\n\t\t#--- request ---\n\t\tround = input.u64()\n\t\tresponse = await self.get_round(client, round)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeRound):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeRound, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primary(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primary()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primary(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primaries(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primaries()\")\n\t\t#--- request ---\n\t\ttargets = input.list(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primaries(client, targets)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['stats', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.stats, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_stats_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_all()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_all(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_or_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.get_or_create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_reset_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.reset_stats()\")\n\t\t#--- request ---\n\t\tawait self.reset_stats(client)\n\t\n\tasync def start_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.start_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_start_round_param(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_start_round_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round_without_report(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round_without_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_not_summarized_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_not_summarized_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primary(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primaries(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primaries not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_all(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_or_create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_or_create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.reset_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeExtensionServerMK8(MatchmakeExtensionProtocolMK8):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_CLOSE_PARTICIPATION: self.handle_close_participation,\n\t\t\tself.METHOD_OPEN_PARTICIPATION: self.handle_open_participation,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_POSTPONE: self.handle_auto_matchmake_postpone,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION: self.handle_browse_matchmake_session,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS: self.handle_browse_matchmake_session_with_host_urls,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION: self.handle_create_matchmake_session,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION: self.handle_join_matchmake_session,\n\t\t\tself.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE: self.handle_modify_current_game_attribute,\n\t\t\tself.METHOD_UPDATE_NOTIFICATION_DATA: self.handle_update_notification_data,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA: self.handle_get_friend_notification_data,\n\t\t\tself.METHOD_UPDATE_APPLICATION_BUFFER: self.handle_update_application_buffer,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE: self.handle_update_matchmake_session_attribute,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST: self.handle_get_friend_notification_data_list,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION: self.handle_update_matchmake_session,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE: self.handle_auto_matchmake_with_search_criteria_postpone,\n\t\t\tself.METHOD_GET_PLAYING_SESSION: self.handle_get_playing_session,\n\t\t\tself.METHOD_CREATE_COMMUNITY: self.handle_create_community,\n\t\t\tself.METHOD_UPDATE_COMMUNITY: self.handle_update_community,\n\t\t\tself.METHOD_JOIN_COMMUNITY: self.handle_join_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_GATHERING_ID: self.handle_find_community_by_gathering_id,\n\t\t\tself.METHOD_FIND_OFFICIAL_COMMUNITY: self.handle_find_official_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_PARTICIPANT: self.handle_find_community_by_participant,\n\t\t\tself.METHOD_UPDATE_PRIVACY_SETTING: self.handle_update_privacy_setting,\n\t\t\tself.METHOD_GET_MY_BLOCK_LIST: self.handle_get_my_block_list,\n\t\t\tself.METHOD_ADD_TO_BLOCK_LIST: self.handle_add_to_block_list,\n\t\t\tself.METHOD_REMOVE_FROM_BLOCK_LIST: self.handle_remove_from_block_list,\n\t\t\tself.METHOD_CLEAR_MY_BLOCK_LIST: self.handle_clear_my_block_list,\n\t\t\tself.METHOD_REPORT_VIOLATION: self.handle_report_violation,\n\t\t\tself.METHOD_IS_VIOLATION_USER: self.handle_is_violation_user,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_EX: self.handle_join_matchmake_session_ex,\n\t\t\tself.METHOD_GET_SIMPLE_PLAYING_SESSION: self.handle_get_simple_playing_session,\n\t\t\tself.METHOD_GET_SIMPLE_COMMUNITY: self.handle_get_simple_community,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE: self.handle_auto_matchmake_with_gathering_id_postpone,\n\t\t\tself.METHOD_UPDATE_PROGRESS_SCORE: self.handle_update_progress_score,\n\t\t\tself.METHOD_DEBUG_NOTIFY_EVENT: self.handle_debug_notify_event,\n\t\t\tself.METHOD_CREATE_SIMPLE_SEARCH_OBJECT: self.handle_create_simple_search_object,\n\t\t\tself.METHOD_UPDATE_SIMPLE_SEARCH_OBJECT: self.handle_update_simple_search_object,\n\t\t\tself.METHOD_DELETE_SIMPLE_SEARCH_OBJECT: self.handle_delete_simple_search_object,\n\t\t\tself.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT: self.handle_search_simple_search_object,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_WITH_EXTRA_PARTICIPANTS: self.handle_join_matchmake_session_with_extra_participants,\n\t\t\tself.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT_BY_OBJECT_IDS: self.handle_search_simple_search_object_by_object_ids,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER: self.handle_browse_matchmake_session_no_holder,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER: self.handle_browse_matchmake_session_with_host_urls_no_holder,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_PART: self.handle_update_matchmake_session_part,\n\t\t\tself.METHOD_REQUEST_MATCHMAKING: self.handle_request_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING: self.handle_withdraw_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING_ALL: self.handle_withdraw_matchmaking_all,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID: self.handle_find_matchmake_session_by_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID: self.handle_find_matchmake_session_by_single_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER: self.handle_find_matchmake_session_by_owner,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT: self.handle_find_matchmake_session_by_participant,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_no_holder_no_result_range,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeExtensionServerMK8: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_close_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.close_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.close_participation(client, gid)\n\t\n\tasync def handle_open_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.open_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.open_participation(client, gid)\n\t\n\tasync def handle_auto_matchmake_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_postpone(client, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_browse_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gatherings', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.gatherings, output.anydata)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_create_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tdescription = input.string()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.create_matchmake_session(client, gathering, description, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gid', 'session_key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.u32(response.gid)\n\t\toutput.buffer(response.session_key)\n\t\n\tasync def handle_join_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.join_matchmake_session(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_modify_current_game_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattrib = input.u32()\n\t\tvalue = input.u32()\n\t\tawait self.modify_current_game_attribute(client, gid, attrib, value)\n\t\n\tasync def handle_update_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.u32()\n\t\tparam1 = input.pid()\n\t\tparam2 = input.pid()\n\t\tparam3 = input.string()\n\t\tawait self.update_notification_data(client, type, param1, param2, param3)\n\t\n\tasync def handle_get_friend_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.s32()\n\t\tresponse = await self.get_friend_notification_data(client, type)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_application_buffer(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_application_buffer()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tbuffer = input.buffer()\n\t\tawait self.update_application_buffer(client, gid, buffer)\n\t\n\tasync def handle_update_matchmake_session_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattribs = input.list(input.u32)\n\t\tawait self.update_matchmake_session_attribute(client, gid, attribs)\n\t\n\tasync def handle_get_friend_notification_data_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\ttypes = input.list(input.u32)\n\t\tresponse = await self.get_friend_notification_data_list(client, types)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tawait self.update_matchmake_session(client, gathering)\n\t\n\tasync def handle_auto_matchmake_with_search_criteria_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.list(MatchmakeSessionSearchCriteria)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_search_criteria_postpone(client, search_criteria, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_get_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.get_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_playing_session(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.create_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tmessage = input.string()\n\t\tresponse = await self.create_community(client, community, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tawait self.update_community(client, community)\n\t\n\tasync def handle_join_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.join_community()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tpassword = input.string()\n\t\tawait self.join_community(client, gid, message, password)\n\t\n\tasync def handle_find_community_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_community_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_official_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_official_community()\")\n\t\t#--- request ---\n\t\tavailable_only = input.bool()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_official_community(client, available_only, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_community_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_community_by_participant(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_privacy_setting(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tonline_status = input.bool()\n\t\tcommunity_participation = input.bool()\n\t\tawait self.update_privacy_setting(client, online_status, community_participation)\n\t\n\tasync def handle_get_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.get_my_block_list()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_my_block_list(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_to_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.add_to_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.add_to_block_list(client, pids)\n\t\n\tasync def handle_remove_from_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.remove_from_block_list(client, pids)\n\t\n\tasync def handle_clear_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tawait self.clear_my_block_list(client)\n\t\n\tasync def handle_report_violation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.report_violation()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tusername = input.string()\n\t\tviolation_code = input.u32()\n\t\tawait self.report_violation(client, pid, username, violation_code)\n\t\n\tasync def handle_is_violation_user(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.is_violation_user()\")\n\t\t#--- request ---\n\t\tresponse = await self.is_violation_user(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['flag', 'score']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.flag)\n\t\toutput.u32(response.score)\n\t\n\tasync def handle_join_matchmake_session_ex(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tgmessage = input.string()\n\t\tignore_block_list = input.bool()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.join_matchmake_session_ex(client, gid, gmessage, ignore_block_list, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_get_simple_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tinclude_login_user = input.bool()\n\t\tresponse = await self.get_simple_playing_session(client, pids, include_login_user)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_simple_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.get_simple_community()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_simple_community(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_auto_matchmake_with_gathering_id_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_gathering_id_postpone(client, gids, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_update_progress_score(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_progress_score()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tscore = input.u8()\n\t\tawait self.update_progress_score(client, gid, score)\n\t\n\tasync def handle_debug_notify_event(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.debug_notify_event()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tmain_type = input.u32()\n\t\tsub_type = input.u32()\n\t\tparam1 = input.u64()\n\t\tparam2 = input.u64()\n\t\tparam3 = input.string()\n\t\tawait self.debug_notify_event(client, pid, main_type, sub_type, param1, param2, param3)\n\t\n\tasync def handle_create_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.create_simple_search_object()\")\n\t\t#--- request ---\n\t\tobject = input.extract(SimpleSearchObject)\n\t\tresponse = await self.create_simple_search_object(client, object)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_simple_search_object()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tobject = input.extract(SimpleSearchObject)\n\t\tawait self.update_simple_search_object(client, id, object)\n\t\n\tasync def handle_delete_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.delete_simple_search_object()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tawait self.delete_simple_search_object(client, id)\n\t\n\tasync def handle_search_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.search_simple_search_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SimpleSearchParam)\n\t\tresponse = await self.search_simple_search_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_join_matchmake_session_with_extra_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.join_matchmake_session_with_extra_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tjoin_message = input.string()\n\t\tignore_blacklist = input.bool()\n\t\tparticipation_count = input.u16()\n\t\textra_participants = input.u32()\n\t\tresponse = await self.join_matchmake_session_with_extra_participants(client, gid, join_message, ignore_blacklist, participation_count, extra_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_search_simple_search_object_by_object_ids(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.search_simple_search_object_by_object_ids()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.search_simple_search_object_by_object_ids(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_update_matchmake_session_part(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tparam = input.extract(UpdateMatchmakeSessionParam)\n\t\tawait self.update_matchmake_session_part(client, param)\n\t\n\tasync def handle_request_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.request_matchmaking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.request_matchmaking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_withdraw_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\trequest_id = input.u64()\n\t\tawait self.withdraw_matchmaking(client, request_id)\n\t\n\tasync def handle_withdraw_matchmaking_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tawait self.withdraw_matchmaking_all(client)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_matchmake_session_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_single_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_single_gathering_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_matchmake_session_by_owner(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tparam = input.extract(FindMatchmakeSessionByParticipantParam)\n\t\tresponse = await self.find_matchmake_session_by_participant(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def close_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.close_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def open_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.open_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.auto_matchmake_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.browse_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.browse_matchmake_session_with_host_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.create_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.join_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def modify_current_game_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.modify_current_game_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.get_friend_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_application_buffer(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_application_buffer not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_matchmake_session_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.get_friend_notification_data_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.auto_matchmake_with_search_criteria_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.get_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.create_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.join_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_community_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_official_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_official_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_community_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_privacy_setting(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_privacy_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.get_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_to_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.add_to_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_from_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.remove_from_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.clear_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_violation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.report_violation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_violation_user(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.is_violation_user not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_ex(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.join_matchmake_session_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.get_simple_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.get_simple_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.auto_matchmake_with_gathering_id_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_progress_score(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_progress_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def debug_notify_event(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.debug_notify_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.create_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.delete_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.search_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_with_extra_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.join_matchmake_session_with_extra_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_simple_search_object_by_object_ids(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.search_simple_search_object_by_object_ids not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.browse_matchmake_session_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.browse_matchmake_session_with_host_urls_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_part(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.update_matchmake_session_part not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.request_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.withdraw_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking_all(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.withdraw_matchmaking_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_single_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_owner(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.find_matchmake_session_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.browse_matchmake_session_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8.browse_matchmake_session_with_host_urls_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/matchmaking_mk8d.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MatchmakeSystem:\n\tGLOBAL = 1\n\tFRIENDS = 2\n\n\nclass SimpleSearchConditionOperator:\n\tANY = 0\n\tEQUAL = 1\n\tGREATER_THAN = 2\n\tLESS_THAN = 3\n\tGREATER_THAN_OR_EQUAL = 4\n\tLESS_THAN_OR_EQUAL = 5\n\n\nclass Gathering(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = 0\n\t\tself.owner = 0\n\t\tself.host = 0\n\t\tself.min_participants = 0\n\t\tself.max_participants = 0\n\t\tself.participation_policy = 1\n\t\tself.policy_argument = 0\n\t\tself.flags = 512\n\t\tself.state = 0\n\t\tself.description = \"\"\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.host = stream.pid()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.flags = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.description = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.pid(self.host)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.u32(self.flags)\n\t\tstream.u32(self.state)\n\t\tstream.string(self.description)\n\n\nclass GatheringURLs(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.urls = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'urls']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.urls = stream.list(stream.stationurl)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.urls, stream.stationurl)\n\n\nclass GatheringStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.flags = None\n\t\tself.values = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'flags', 'values']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.flags = stream.u32()\n\t\tself.values = stream.list(stream.float)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.flags)\n\t\tstream.list(self.values, stream.float)\n\n\nclass Invitation(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.guest = None\n\t\tself.message = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'guest', 'message']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.guest = stream.u32()\n\t\tself.message = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.guest)\n\t\tstream.string(self.message)\n\n\nclass ParticipantDetails(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.name = None\n\t\tself.message = None\n\t\tself.participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'name', 'message', 'participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.name = stream.string()\n\t\tself.message = stream.string()\n\t\tself.participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.string(self.name)\n\t\tstream.string(self.message)\n\t\tstream.u16(self.participants)\n\n\nclass DeletionEntry(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.pid = None\n\t\tself.reason = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'pid', 'reason']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.reason = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.reason)\n\n\nclass MatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.param = {}\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.param = stream.map(stream.string, stream.variant)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.map(self.param, stream.string, stream.variant)\n\n\nclass MatchmakeSessionSearchCriteria(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.attribs = [\"\", \"\", \"\", \"\", \"\", \"\"]\n\t\tself.game_mode = \"\"\n\t\tself.min_participants = \"\"\n\t\tself.max_participants = \"\"\n\t\tself.matchmake_system = \"\"\n\t\tself.vacant_only = True\n\t\tself.exclude_locked = True\n\t\tself.exclude_non_host_pid = False\n\t\tself.selection_method = 0\n\t\tself.vacant_participants = 1\n\t\tself.param = MatchmakeParam()\n\t\tself.exclude_user_password = False\n\t\tself.exclude_system_password = False\n\t\tself.refer_gid = 0\n\t\tself.codeword = \"\"\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.attribs = stream.list(stream.string)\n\t\tself.game_mode = stream.string()\n\t\tself.min_participants = stream.string()\n\t\tself.max_participants = stream.string()\n\t\tself.matchmake_system = stream.string()\n\t\tself.vacant_only = stream.bool()\n\t\tself.exclude_locked = stream.bool()\n\t\tself.exclude_non_host_pid = stream.bool()\n\t\tself.selection_method = stream.u32()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.vacant_participants = stream.u16()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.exclude_user_password = stream.bool()\n\t\t\tself.exclude_system_password = stream.bool()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.codeword = stream.string()\n\t\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.attribs, stream.string)\n\t\tstream.string(self.game_mode)\n\t\tstream.string(self.min_participants)\n\t\tstream.string(self.max_participants)\n\t\tstream.string(self.matchmake_system)\n\t\tstream.bool(self.vacant_only)\n\t\tstream.bool(self.exclude_locked)\n\t\tstream.bool(self.exclude_non_host_pid)\n\t\tstream.u32(self.selection_method)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.u16(self.vacant_participants)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.add(self.param)\n\t\t\tstream.bool(self.exclude_user_password)\n\t\t\tstream.bool(self.exclude_system_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.string(self.codeword)\n\t\t\tstream.add(self.range)\n\n\nclass MatchmakeSession(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.game_mode = 0\n\t\tself.attribs = [0, 0, 0, 0, 0, 0]\n\t\tself.open_participation = True\n\t\tself.matchmake_system = 0\n\t\tself.application_data = b\"\"\n\t\tself.num_participants = 0\n\t\tself.progress_score = 100\n\t\tself.session_key = b\"\"\n\t\tself.option = 0\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = common.DateTime(0)\n\t\tself.user_password = \"\"\n\t\tself.refer_gid = 0\n\t\tself.user_password_enabled = False\n\t\tself.system_password_enabled = False\n\t\tself.codeword = \"\"\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tversion = 1\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tversion = 2\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tversion = 3\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tif 30000 <= settings[\"nex.version\"] < 40000:\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30000:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tpass\n\t\t\tif settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.game_mode = stream.u32()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.application_data = stream.buffer()\n\t\tself.num_participants = stream.u32()\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.progress_score = stream.u8()\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tself.session_key = stream.buffer()\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tself.option = stream.u32()\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\t\t\tself.started_time = stream.datetime()\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tself.user_password = stream.string()\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tself.refer_gid = stream.u32()\n\t\t\t\t\tself.user_password_enabled = stream.bool()\n\t\t\t\t\tself.system_password_enabled = stream.bool()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.progress_score = stream.u8()\n\t\t\tself.session_key = stream.buffer()\n\t\t\tself.option = stream.u32()\n\t\t\tself.param = stream.extract(MatchmakeParam)\n\t\t\tself.started_time = stream.datetime()\n\t\t\tself.user_password = stream.string()\n\t\t\tself.refer_gid = stream.u32()\n\t\t\tself.user_password_enabled = stream.bool()\n\t\t\tself.system_password_enabled = stream.bool()\n\t\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.game_mode)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.buffer(self.application_data)\n\t\tstream.u32(self.num_participants)\n\t\tif 30000 <= stream.settings[\"nex.version\"] < 40000:\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u8(self.progress_score)\n\t\t\tif stream.settings[\"nex.version\"] >= 30000:\n\t\t\t\tstream.buffer(self.session_key)\n\t\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\t\tstream.u32(self.option)\n\t\t\tif stream.settings[\"nex.version\"] >= 30600:\n\t\t\t\tif version >= 1:\n\t\t\t\t\tstream.add(self.param)\n\t\t\t\t\tstream.datetime(self.started_time)\n\t\t\tif stream.settings[\"nex.version\"] >= 30700:\n\t\t\t\tif version >= 2:\n\t\t\t\t\tstream.string(self.user_password)\n\t\t\tif stream.settings[\"nex.version\"] >= 30800:\n\t\t\t\tif version >= 3:\n\t\t\t\t\tstream.u32(self.refer_gid)\n\t\t\t\t\tstream.bool(self.user_password_enabled)\n\t\t\t\t\tstream.bool(self.system_password_enabled)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.u8(self.progress_score)\n\t\t\tstream.buffer(self.session_key)\n\t\t\tstream.u32(self.option)\n\t\t\tstream.add(self.param)\n\t\t\tstream.datetime(self.started_time)\n\t\t\tstream.string(self.user_password)\n\t\t\tstream.u32(self.refer_gid)\n\t\t\tstream.bool(self.user_password_enabled)\n\t\t\tstream.bool(self.system_password_enabled)\n\t\t\tstream.string(self.codeword)\ncommon.DataHolder.register(MatchmakeSession, \"MatchmakeSession\")\n\n\nclass MatchmakeBlockListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.options = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.options = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.options)\n\n\nclass CreateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.additional_participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['additional_participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.additional_participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.additional_participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\n\nclass JoinMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.behavior = None\n\t\tself.user_password = None\n\t\tself.system_password = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.extra_participants = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'participants', 'gid_for_participation_check', 'options', 'behavior', 'user_password', 'system_password', 'join_message', 'num_participants', 'extra_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.behavior = stream.u8()\n\t\tself.user_password = stream.string()\n\t\tself.system_password = stream.string()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.extra_participants = stream.u16()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.u8(self.behavior)\n\t\tstream.string(self.user_password)\n\t\tstream.string(self.system_password)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.u16(self.extra_participants)\n\t\tstream.add(self.block_list)\n\n\nclass UpdateMatchmakeSessionParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.modification_flags = None\n\t\tself.attributes = None\n\t\tself.open_participation = None\n\t\tself.application_buffer = None\n\t\tself.progress_score = None\n\t\tself.param = MatchmakeParam()\n\t\tself.started_time = None\n\t\tself.user_password = None\n\t\tself.game_mode = None\n\t\tself.description = None\n\t\tself.min_participants = None\n\t\tself.max_participants = None\n\t\tself.matchmake_system = None\n\t\tself.participation_policy = None\n\t\tself.policy_argument = None\n\t\tself.codeword = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'modification_flags', 'attributes', 'open_participation', 'application_buffer', 'progress_score', 'started_time', 'user_password', 'game_mode', 'description', 'min_participants', 'max_participants', 'matchmake_system', 'participation_policy', 'policy_argument', 'codeword']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.modification_flags = stream.u32()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.open_participation = stream.bool()\n\t\tself.application_buffer = stream.buffer()\n\t\tself.progress_score = stream.u8()\n\t\tself.param = stream.extract(MatchmakeParam)\n\t\tself.started_time = stream.datetime()\n\t\tself.user_password = stream.string()\n\t\tself.game_mode = stream.u32()\n\t\tself.description = stream.string()\n\t\tself.min_participants = stream.u16()\n\t\tself.max_participants = stream.u16()\n\t\tself.matchmake_system = stream.u32()\n\t\tself.participation_policy = stream.u32()\n\t\tself.policy_argument = stream.u32()\n\t\tself.codeword = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.modification_flags)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.bool(self.open_participation)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.u8(self.progress_score)\n\t\tstream.add(self.param)\n\t\tstream.datetime(self.started_time)\n\t\tstream.string(self.user_password)\n\t\tstream.u32(self.game_mode)\n\t\tstream.string(self.description)\n\t\tstream.u16(self.min_participants)\n\t\tstream.u16(self.max_participants)\n\t\tstream.u32(self.matchmake_system)\n\t\tstream.u32(self.participation_policy)\n\t\tstream.u32(self.policy_argument)\n\t\tstream.string(self.codeword)\n\n\nclass AutoMatchmakeParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.session = MatchmakeSession()\n\t\tself.participants = None\n\t\tself.gid_for_participation_check = None\n\t\tself.options = None\n\t\tself.join_message = None\n\t\tself.num_participants = None\n\t\tself.search_criteria = None\n\t\tself.target_gids = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['participants', 'gid_for_participation_check', 'options', 'join_message', 'num_participants', 'search_criteria', 'target_gids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\tself.participants = stream.list(stream.pid)\n\t\tself.gid_for_participation_check = stream.u32()\n\t\tself.options = stream.u32()\n\t\tself.join_message = stream.string()\n\t\tself.num_participants = stream.u16()\n\t\tself.search_criteria = stream.list(MatchmakeSessionSearchCriteria)\n\t\tself.target_gids = stream.list(stream.u32)\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.add(self.session)\n\t\tstream.list(self.participants, stream.pid)\n\t\tstream.u32(self.gid_for_participation_check)\n\t\tstream.u32(self.options)\n\t\tstream.string(self.join_message)\n\t\tstream.u16(self.num_participants)\n\t\tstream.list(self.search_criteria, stream.add)\n\t\tstream.list(self.target_gids, stream.u32)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pids = None\n\t\tself.options = None\n\t\tself.block_list = MatchmakeBlockListParam()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pids', 'options']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pids = stream.list(stream.pid)\n\t\tself.options = stream.u32()\n\t\tself.block_list = stream.extract(MatchmakeBlockListParam)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.pids, stream.pid)\n\t\tstream.u32(self.options)\n\t\tstream.add(self.block_list)\n\n\nclass FindMatchmakeSessionByParticipantResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.session = MatchmakeSession()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.session = stream.extract(MatchmakeSession)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.add(self.session)\n\n\nclass PersistentGathering(Gathering):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.password = None\n\t\tself.attribs = None\n\t\tself.application_buffer = None\n\t\tself.participation_start = None\n\t\tself.participation_end = None\n\t\tself.matchmake_session_count = None\n\t\tself.num_participants = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'password', 'attribs', 'application_buffer', 'participation_start', 'participation_end', 'matchmake_session_count', 'num_participants']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.password = stream.string()\n\t\tself.attribs = stream.list(stream.u32)\n\t\tself.application_buffer = stream.buffer()\n\t\tself.participation_start = stream.datetime()\n\t\tself.participation_end = stream.datetime()\n\t\tself.matchmake_session_count = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.string(self.password)\n\t\tstream.list(self.attribs, stream.u32)\n\t\tstream.buffer(self.application_buffer)\n\t\tstream.datetime(self.participation_start)\n\t\tstream.datetime(self.participation_end)\n\t\tstream.u32(self.matchmake_session_count)\n\t\tstream.u32(self.num_participants)\ncommon.DataHolder.register(PersistentGathering, \"PersistentGathering\")\n\n\nclass SimpleCommunity(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.gid = None\n\t\tself.matchmake_session_count = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['gid', 'matchmake_session_count']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.gid = stream.u32()\n\t\tself.matchmake_session_count = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.matchmake_session_count)\n\n\nclass PlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gathering = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gathering']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gathering = stream.anydata()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.anydata(self.gathering)\n\n\nclass SimplePlayingSession(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.gid = None\n\t\tself.game_mode = None\n\t\tself.attribute = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'gid', 'game_mode', 'attribute']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.gid = stream.u32()\n\t\tself.game_mode = stream.u32()\n\t\tself.attribute = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.game_mode)\n\t\tstream.u32(self.attribute)\n\n\nclass MatchmakeRefereeRound(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.gid = None\n\t\tself.state = None\n\t\tself.personal_data_category = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'gid', 'state', 'personal_data_category', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u64()\n\t\tself.gid = stream.u32()\n\t\tself.state = stream.u32()\n\t\tself.personal_data_category = stream.u32()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.id)\n\t\tstream.u32(self.gid)\n\t\tstream.u32(self.state)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereeStartRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.personal_data_category = None\n\t\tself.gid = None\n\t\tself.pids = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['personal_data_category', 'gid', 'pids']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.personal_data_category = stream.u32()\n\t\tself.gid = stream.u32()\n\t\tself.pids = stream.list(stream.pid)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.personal_data_category)\n\t\tstream.u32(self.gid)\n\t\tstream.list(self.pids, stream.pid)\n\n\nclass MatchmakeRefereeEndRoundParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.round_id = None\n\t\tself.results = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['round_id', 'results']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.round_id = stream.u64()\n\t\tself.results = stream.list(MatchmakeRefereePersonalRoundResult)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.round_id)\n\t\tstream.list(self.results, stream.add)\n\n\nclass MatchmakeRefereePersonalRoundResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.personal_round_result_flag = None\n\t\tself.round_win_loss = None\n\t\tself.rating_change = None\n\t\tself.buffer = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'personal_round_result_flag', 'round_win_loss', 'rating_change', 'buffer']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.personal_round_result_flag = stream.u32()\n\t\tself.round_win_loss = stream.u32()\n\t\tself.rating_change = stream.s32()\n\t\tself.buffer = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.personal_round_result_flag)\n\t\tstream.u32(self.round_win_loss)\n\t\tstream.s32(self.rating_change)\n\t\tstream.qbuffer(self.buffer)\n\n\nclass MatchmakeRefereeStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = None\n\t\tself.category = None\n\t\tself.pid = None\n\t\tself.recent_disconnection = None\n\t\tself.recent_violation = None\n\t\tself.recent_mismatch = None\n\t\tself.recent_win = None\n\t\tself.recent_loss = None\n\t\tself.recent_draw = None\n\t\tself.total_disconnect = None\n\t\tself.total_violation = None\n\t\tself.total_mismatch = None\n\t\tself.total_win = None\n\t\tself.total_loss = None\n\t\tself.total_draw = None\n\t\tself.rating_value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['unique_id', 'category', 'pid', 'recent_disconnection', 'recent_violation', 'recent_mismatch', 'recent_win', 'recent_loss', 'recent_draw', 'total_disconnect', 'total_violation', 'total_mismatch', 'total_win', 'total_loss', 'total_draw', 'rating_value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.recent_disconnection = stream.u32()\n\t\tself.recent_violation = stream.u32()\n\t\tself.recent_mismatch = stream.u32()\n\t\tself.recent_win = stream.u32()\n\t\tself.recent_loss = stream.u32()\n\t\tself.recent_draw = stream.u32()\n\t\tself.total_disconnect = stream.u32()\n\t\tself.total_violation = stream.u32()\n\t\tself.total_mismatch = stream.u32()\n\t\tself.total_win = stream.u32()\n\t\tself.total_loss = stream.u32()\n\t\tself.total_draw = stream.u32()\n\t\tself.rating_value = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.category)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.recent_disconnection)\n\t\tstream.u32(self.recent_violation)\n\t\tstream.u32(self.recent_mismatch)\n\t\tstream.u32(self.recent_win)\n\t\tstream.u32(self.recent_loss)\n\t\tstream.u32(self.recent_draw)\n\t\tstream.u32(self.total_disconnect)\n\t\tstream.u32(self.total_violation)\n\t\tstream.u32(self.total_mismatch)\n\t\tstream.u32(self.total_win)\n\t\tstream.u32(self.total_loss)\n\t\tstream.u32(self.total_draw)\n\t\tstream.u32(self.rating_value)\n\n\nclass MatchmakeRefereeStatsTarget(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.category = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\n\nclass MatchmakeRefereeStatsInitParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.initial_rating = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'initial_rating']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.initial_rating = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.initial_rating)\n\n\nclass SimpleSearchObject(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.owner = None\n\t\tself.attributes = None\n\t\tself.metadata = None\n\t\tself.community_id = None\n\t\tself.community_code = None\n\t\tself.datetime = SimpleSearchDateTimeAttribute()\n\t\tself.liveliness_rate = None\n\t\tself.liveliness_update_time = None\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tversion = 1\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'owner', 'attributes', 'metadata', 'community_id', 'community_code']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tif version >= 1:\n\t\t\t\tfor field in ['liveliness_rate', 'liveliness_update_time']:\n\t\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.attributes = stream.list(stream.u32)\n\t\tself.metadata = stream.qbuffer()\n\t\tself.community_id = stream.u32()\n\t\tself.community_code = stream.string()\n\t\tself.datetime = stream.extract(SimpleSearchDateTimeAttribute)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tif version >= 1:\n\t\t\t\tself.liveliness_rate = stream.u32()\n\t\t\t\tself.liveliness_update_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.list(self.attributes, stream.u32)\n\t\tstream.qbuffer(self.metadata)\n\t\tstream.u32(self.community_id)\n\t\tstream.string(self.community_code)\n\t\tstream.add(self.datetime)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tif version >= 1:\n\t\t\t\tstream.u32(self.liveliness_rate)\n\t\t\t\tstream.datetime(self.liveliness_update_time)\n\n\nclass SimpleSearchDateTimeAttribute(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.start_daytime = None\n\t\tself.end_daytime = None\n\t\tself.start_time = None\n\t\tself.end_time = None\n\t\tself.start_datetime = None\n\t\tself.end_datetime = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['start_daytime', 'end_daytime', 'start_time', 'end_time', 'start_datetime', 'end_datetime']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.start_daytime = stream.u32()\n\t\tself.end_daytime = stream.u32()\n\t\tself.start_time = stream.u32()\n\t\tself.end_time = stream.u32()\n\t\tself.start_datetime = stream.datetime()\n\t\tself.end_datetime = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.start_daytime)\n\t\tstream.u32(self.end_daytime)\n\t\tstream.u32(self.start_time)\n\t\tstream.u32(self.end_time)\n\t\tstream.datetime(self.start_datetime)\n\t\tstream.datetime(self.end_datetime)\n\n\nclass SimpleSearchParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = 0\n\t\tself.owner = 0\n\t\tself.conditions = []\n\t\tself.community_code = \"\"\n\t\tself.range = common.ResultRange()\n\t\tself.datetime = common.DateTime(0)\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.owner = stream.pid()\n\t\tself.conditions = stream.list(SimpleSearchCondition)\n\t\tself.community_code = stream.string()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\tself.datetime = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.pid(self.owner)\n\t\tstream.list(self.conditions, stream.add)\n\t\tstream.string(self.community_code)\n\t\tstream.add(self.range)\n\t\tstream.datetime(self.datetime)\n\n\nclass SimpleSearchCondition(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.value = None\n\t\tself.operator = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['value', 'operator']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.value = stream.u32()\n\t\tself.operator = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.value)\n\t\tstream.u32(self.operator)\n\n\nclass MatchMakingProtocol:\n\tMETHOD_REGISTER_GATHERING = 1\n\tMETHOD_UNREGISTER_GATHERING = 2\n\tMETHOD_UNREGISTER_GATHERINGS = 3\n\tMETHOD_UPDATE_GATHERING = 4\n\tMETHOD_INVITE = 5\n\tMETHOD_ACCEPT_INVITATION = 6\n\tMETHOD_DECLINE_INVITATION = 7\n\tMETHOD_CANCEL_INVITATION = 8\n\tMETHOD_GET_INVITATIONS_SENT = 9\n\tMETHOD_GET_INVITATIONS_RECEIVED = 10\n\tMETHOD_PARTICIPATE = 11\n\tMETHOD_CANCEL_PARTICIPATION = 12\n\tMETHOD_GET_PARTICIPANTS = 13\n\tMETHOD_ADD_PARTICIPANTS = 14\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 15\n\tMETHOD_GET_PARTICIPANTS_URLS = 16\n\tMETHOD_FIND_BY_TYPE = 17\n\tMETHOD_FIND_BY_DESCRIPTION = 18\n\tMETHOD_FIND_BY_DESCRIPTION_REGEX = 19\n\tMETHOD_FIND_BY_ID = 20\n\tMETHOD_FIND_BY_SINGLE_ID = 21\n\tMETHOD_FIND_BY_OWNER = 22\n\tMETHOD_FIND_BY_PARTICIPANTS = 23\n\tMETHOD_FIND_INVITATIONS = 24\n\tMETHOD_FIND_BY_SQL_QUERY = 25\n\tMETHOD_LAUNCH_SESSION = 26\n\tMETHOD_UPDATE_SESSION_URL = 27\n\tMETHOD_GET_SESSION_URL = 28\n\tMETHOD_GET_STATE = 29\n\tMETHOD_SET_STATE = 30\n\tMETHOD_REPORT_STATS = 31\n\tMETHOD_GET_STATS = 32\n\tMETHOD_DELETE_GATHERING = 33\n\tMETHOD_GET_PENDING_DELETIONS = 34\n\tMETHOD_DELETE_FROM_DELETIONS = 35\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP_V1 = 36\n\tMETHOD_FIND_BY_DESCRIPTION_LIKE = 37\n\tMETHOD_REGISTER_LOCAL_URL = 38\n\tMETHOD_REGISTER_LOCAL_URLS = 39\n\tMETHOD_UPDATE_SESSION_HOST_V1 = 40\n\tMETHOD_GET_SESSION_URLS = 41\n\tMETHOD_UPDATE_SESSION_HOST = 42\n\tMETHOD_UPDATE_GATHERING_OWNERSHIP = 43\n\tMETHOD_MIGRATE_GATHERING_OWNERSHIP = 44\n\t\n\tPROTOCOL_ID = 0x15\n\n\nclass MatchMakingProtocolExt:\n\tMETHOD_END_PARTICIPATION = 1\n\tMETHOD_GET_PARTICIPANTS = 2\n\tMETHOD_GET_DETAILED_PARTICIPANTS = 3\n\tMETHOD_GET_PARTICIPANTS_URLS = 4\n\tMETHOD_GET_GATHERING_RELATIONS = 5\n\tMETHOD_DELETE_FROM_DELETIONS = 6\n\t\n\tPROTOCOL_ID = 0x32\n\n\nclass MatchmakeRefereeProtocol:\n\tMETHOD_START_ROUND = 1\n\tMETHOD_GET_START_ROUND_PARAM = 2\n\tMETHOD_END_ROUND = 3\n\tMETHOD_END_ROUND_WITHOUT_REPORT = 4\n\tMETHOD_GET_ROUND_PARTICIPANTS = 5\n\tMETHOD_GET_NOT_SUMMARIZED_ROUND = 6\n\tMETHOD_GET_ROUND = 7\n\tMETHOD_GET_STATS_PRIMARY = 8\n\tMETHOD_GET_STATS_PRIMARIES = 9\n\tMETHOD_GET_STATS_ALL = 10\n\tMETHOD_CREATE_STATS = 11\n\tMETHOD_GET_OR_CREATE_STATS = 12\n\tMETHOD_RESET_STATS = 13\n\t\n\tPROTOCOL_ID = 0x78\n\n\nclass MatchmakeExtensionProtocolMK8D:\n\tMETHOD_CLOSE_PARTICIPATION = 1\n\tMETHOD_OPEN_PARTICIPATION = 2\n\tMETHOD_AUTO_MATCHMAKE_POSTPONE = 3\n\tMETHOD_BROWSE_MATCHMAKE_SESSION = 4\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS = 5\n\tMETHOD_CREATE_MATCHMAKE_SESSION = 6\n\tMETHOD_JOIN_MATCHMAKE_SESSION = 7\n\tMETHOD_MODIFY_CURRENT_GAME_ATTRIBUTE = 8\n\tMETHOD_UPDATE_NOTIFICATION_DATA = 9\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA = 10\n\tMETHOD_UPDATE_APPLICATION_BUFFER = 11\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE = 12\n\tMETHOD_GET_FRIEND_NOTIFICATION_DATA_LIST = 13\n\tMETHOD_UPDATE_MATCHMAKE_SESSION = 14\n\tMETHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE = 15\n\tMETHOD_GET_PLAYING_SESSION = 16\n\tMETHOD_CREATE_COMMUNITY = 17\n\tMETHOD_UPDATE_COMMUNITY = 18\n\tMETHOD_JOIN_COMMUNITY = 19\n\tMETHOD_FIND_COMMUNITY_BY_GATHERING_ID = 20\n\tMETHOD_FIND_OFFICIAL_COMMUNITY = 21\n\tMETHOD_FIND_COMMUNITY_BY_PARTICIPANT = 22\n\tMETHOD_UPDATE_PRIVACY_SETTING = 23\n\tMETHOD_GET_MY_BLOCK_LIST = 24\n\tMETHOD_ADD_TO_BLOCK_LIST = 25\n\tMETHOD_REMOVE_FROM_BLOCK_LIST = 26\n\tMETHOD_CLEAR_MY_BLOCK_LIST = 27\n\tMETHOD_REPORT_VIOLATION = 28\n\tMETHOD_IS_VIOLATION_USER = 29\n\tMETHOD_JOIN_MATCHMAKE_SESSION_EX = 30\n\tMETHOD_GET_SIMPLE_PLAYING_SESSION = 31\n\tMETHOD_GET_SIMPLE_COMMUNITY = 32\n\tMETHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE = 33\n\tMETHOD_UPDATE_PROGRESS_SCORE = 34\n\tMETHOD_DEBUG_NOTIFY_EVENT = 35\n\tMETHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 36\n\tMETHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD = 37\n\tMETHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM = 38\n\tMETHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM = 39\n\tMETHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE = 40\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL = 41\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER = 42\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER = 43\n\tMETHOD_UPDATE_MATCHMAKE_SESSION_PART = 44\n\tMETHOD_REQUEST_MATCHMAKING = 45\n\tMETHOD_WITHDRAW_MATCHMAKING = 46\n\tMETHOD_WITHDRAW_MATCHMAKING_ALL = 47\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID = 48\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID = 49\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_OWNER = 50\n\tMETHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT = 51\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE = 52\n\tMETHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE = 53\n\tMETHOD_CREATE_SIMPLE_SEARCH_OBJECT = 54\n\tMETHOD_UPDATE_SIMPLE_SEARCH_OBJECT = 55\n\tMETHOD_DELETE_SIMPLE_SEARCH_OBJECT = 56\n\tMETHOD_SEARCH_SIMPLE_SEARCH_OBJECT = 57\n\tMETHOD_SEARCH_SIMPLE_SEARCH_OBJECT_BY_OBJECT_IDS = 58\n\tMETHOD_JOIN_MATCHMAKE_SESSION_WITH_EXTRA_PARTICIPANTS = 59\n\tMETHOD_CUSTOM_GET_SIMPLE_PLAYING_SESSION = 60\n\tMETHOD_CREATE_COMPETITION = 61\n\tMETHOD_DELETE_COMPETITION = 62\n\tMETHOD_REGISTER_FAVORITE_COMPETITION = 63\n\tMETHOD_UNREGISTER_FAVORITE_COMPETITION = 64\n\tMETHOD_GET_FAVORITE_COMPETITION = 65\n\tMETHOD_GET_TEAM_PARTICIPANTS = 66\n\tMETHOD_FIND_COMMUNITY_BY_OWNER = 67\n\t\n\tPROTOCOL_ID = 0x6D\n\n\nclass MatchMakingClient(MatchMakingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.register_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_gathering -> done\")\n\t\treturn gid\n\t\n\tasync def unregister_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gathering -> done\")\n\t\treturn result\n\t\n\tasync def unregister_gatherings(self, gids):\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_GATHERINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.unregister_gatherings -> done\")\n\t\treturn result\n\t\n\tasync def update_gathering(self, gathering):\n\t\tlogger.info(\"MatchMakingClient.update_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering -> done\")\n\t\treturn result\n\t\n\tasync def invite(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.invite()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_INVITE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.invite -> done\")\n\t\treturn result\n\t\n\tasync def accept_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.accept_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACCEPT_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.accept_invitation -> done\")\n\t\treturn result\n\t\n\tasync def decline_invitation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.decline_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DECLINE_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.decline_invitation -> done\")\n\t\treturn result\n\t\n\tasync def cancel_invitation(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_INVITATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_invitation -> done\")\n\t\treturn result\n\t\n\tasync def get_invitations_sent(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_SENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_sent -> done\")\n\t\treturn invitations\n\t\n\tasync def get_invitations_received(self):\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INVITATIONS_RECEIVED, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinvitations = stream.list(Invitation)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_invitations_received -> done\")\n\t\treturn invitations\n\t\n\tasync def participate(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.participate()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PARTICIPATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.participate -> done\")\n\t\treturn result\n\t\n\tasync def cancel_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClient.cancel_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CANCEL_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.cancel_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def add_participants(self, gid, pids, message):\n\t\tlogger.info(\"MatchMakingClient.add_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.add_participants -> done\")\n\t\treturn result\n\t\n\tasync def get_detailed_participants(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def find_by_type(self, type, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_type()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(type)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_TYPE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_type -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_description_regex(self, regex, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(regex)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_REGEX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_regex -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_id(self, ids):\n\t\tlogger.info(\"MatchMakingClient.find_by_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_id -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_single_id(self, gid):\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SINGLE_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_single_id -> done\")\n\t\treturn obj\n\t\n\tasync def find_by_owner(self, owner, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(owner)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_owner -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_participants(self, pids):\n\t\tlogger.info(\"MatchMakingClient.find_by_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_participants -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_invitations(self, range):\n\t\tlogger.info(\"MatchMakingClient.find_invitations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_INVITATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_invitations -> done\")\n\t\treturn gatherings\n\t\n\tasync def find_by_sql_query(self, query, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(query)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_SQL_QUERY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_sql_query -> done\")\n\t\treturn gatherings\n\t\n\tasync def launch_session(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.launch_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LAUNCH_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.launch_session -> done\")\n\t\treturn result\n\t\n\tasync def update_session_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.update_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_url -> done\")\n\t\treturn result\n\t\n\tasync def get_session_url(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.url = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_url -> done\")\n\t\treturn obj\n\t\n\tasync def get_state(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.state = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_state -> done\")\n\t\treturn obj\n\t\n\tasync def set_state(self, gid, state):\n\t\tlogger.info(\"MatchMakingClient.set_state()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(state)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SET_STATE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.set_state -> done\")\n\t\treturn result\n\t\n\tasync def report_stats(self, gid, stats):\n\t\tlogger.info(\"MatchMakingClient.report_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(stats, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.report_stats -> done\")\n\t\treturn result\n\t\n\tasync def get_stats(self, gid, pids, columns):\n\t\tlogger.info(\"MatchMakingClient.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.list(columns, stream.u8)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.stats = stream.list(GatheringStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_stats -> done\")\n\t\treturn obj\n\t\n\tasync def delete_gathering(self, gid):\n\t\tlogger.info(\"MatchMakingClient.delete_gathering()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_GATHERING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_gathering -> done\")\n\t\treturn result\n\t\n\tasync def get_pending_deletions(self, reason, range):\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(reason)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PENDING_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.deletions = stream.list(DeletionEntry)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_pending_deletions -> done\")\n\t\treturn obj\n\t\n\tasync def delete_from_deletions(self, deletions):\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.delete_from_deletions -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership_v1(self, gid, potential_owners):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership_v1 -> done\")\n\t\treturn result\n\t\n\tasync def find_by_description_like(self, description, range):\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(description)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_BY_DESCRIPTION_LIKE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.find_by_description_like -> done\")\n\t\treturn gatherings\n\t\n\tasync def register_local_url(self, gid, url):\n\t\tlogger.info(\"MatchMakingClient.register_local_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.stationurl(url)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_url -> done\")\n\t\n\tasync def register_local_urls(self, gid, urls):\n\t\tlogger.info(\"MatchMakingClient.register_local_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_LOCAL_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.register_local_urls -> done\")\n\t\n\tasync def update_session_host_v1(self, gid):\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST_V1, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host_v1 -> done\")\n\t\n\tasync def get_session_urls(self, gid):\n\t\tlogger.info(\"MatchMakingClient.get_session_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SESSION_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.get_session_urls -> done\")\n\t\treturn urls\n\t\n\tasync def update_session_host(self, gid, is_migrate_owner):\n\t\tlogger.info(\"MatchMakingClient.update_session_host()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(is_migrate_owner)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SESSION_HOST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_session_host -> done\")\n\t\n\tasync def update_gathering_ownership(self, gid, participants_only):\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.update_gathering_ownership -> done\")\n\t\treturn result\n\t\n\tasync def migrate_gathering_ownership(self, gid, potential_owners, participants_only):\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(potential_owners, stream.pid)\n\t\tstream.bool(participants_only)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MIGRATE_GATHERING_OWNERSHIP, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClient.migrate_gathering_ownership -> done\")\n\n\nclass MatchMakingClientExt(MatchMakingProtocolExt):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def end_participation(self, gid, message):\n\t\tlogger.info(\"MatchMakingClientExt.end_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.end_participation -> done\")\n\t\treturn result\n\t\n\tasync def get_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparticipants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants -> done\")\n\t\treturn participants\n\t\n\tasync def get_detailed_participants(self, gid, only_active):\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.bool(only_active)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_DETAILED_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdetails = stream.list(ParticipantDetails)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_detailed_participants -> done\")\n\t\treturn details\n\t\n\tasync def get_participants_urls(self, gids):\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PARTICIPANTS_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\turls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_participants_urls -> done\")\n\t\treturn urls\n\t\n\tasync def get_gathering_relations(self, id, descr):\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.string(descr)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_GATHERING_RELATIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.get_gathering_relations -> done\")\n\t\treturn result\n\t\n\tasync def delete_from_deletions(self, deletions, pid):\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(deletions, stream.u32)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_FROM_DELETIONS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchMakingClientExt.delete_from_deletions -> done\")\n\n\nclass MatchmakeRefereeClient(MatchmakeRefereeProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def start_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_START_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.start_round -> done\")\n\t\treturn round_id\n\t\n\tasync def get_start_round_param(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_START_ROUND_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tparam = stream.extract(MatchmakeRefereeStartRoundParam)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_start_round_param -> done\")\n\t\treturn param\n\t\n\tasync def end_round(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round -> done\")\n\t\n\tasync def end_round_without_report(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_END_ROUND_WITHOUT_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.end_round_without_report -> done\")\n\t\n\tasync def get_round_participants(self, round_id):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round_participants -> done\")\n\t\treturn pids\n\t\n\tasync def get_not_summarized_round(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NOT_SUMMARIZED_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trounds = stream.list(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_not_summarized_round -> done\")\n\t\treturn rounds\n\t\n\tasync def get_round(self, round):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(round)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ROUND, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tround = stream.extract(MatchmakeRefereeRound)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_round -> done\")\n\t\treturn round\n\t\n\tasync def get_stats_primary(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primary -> done\")\n\t\treturn stats\n\t\n\tasync def get_stats_primaries(self, targets):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(targets, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_PRIMARIES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.stats = stream.list(MatchmakeRefereeStats)\n\t\tobj.results = stream.list(stream.result)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_primaries -> done\")\n\t\treturn obj\n\t\n\tasync def get_stats_all(self, target):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(target)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.list(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_stats_all -> done\")\n\t\treturn stats\n\t\n\tasync def create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_or_create_stats(self, param):\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_OR_CREATE_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(MatchmakeRefereeStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.get_or_create_stats -> done\")\n\t\treturn stats\n\t\n\tasync def reset_stats(self):\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RESET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeRefereeClient.reset_stats -> done\")\n\n\nclass MatchmakeExtensionClientMK8D(MatchmakeExtensionProtocolMK8D):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def close_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.close_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLOSE_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.close_participation -> done\")\n\t\n\tasync def open_participation(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.open_participation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_OPEN_PARTICIPATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.open_participation -> done\")\n\t\n\tasync def auto_matchmake_postpone(self, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def browse_matchmake_session(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgatherings = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session -> done\")\n\t\treturn gatherings\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gatherings = stream.list(stream.anydata)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_with_host_urls -> done\")\n\t\treturn obj\n\t\n\tasync def create_matchmake_session(self, gathering, description, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tstream.string(description)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.gid = stream.u32()\n\t\tobj.session_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_matchmake_session -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session(self, gid, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session -> done\")\n\t\treturn session_key\n\t\n\tasync def modify_current_game_attribute(self, gid, attrib, value):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u32(attrib)\n\t\tstream.u32(value)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.modify_current_game_attribute -> done\")\n\t\n\tasync def update_notification_data(self, type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(type)\n\t\tstream.pid(param1)\n\t\tstream.pid(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_notification_data -> done\")\n\t\n\tasync def get_friend_notification_data(self, type):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.s32(type)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_friend_notification_data -> done\")\n\t\treturn notifications\n\t\n\tasync def update_application_buffer(self, gid, buffer):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_application_buffer()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.buffer(buffer)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_APPLICATION_BUFFER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_application_buffer -> done\")\n\t\n\tasync def update_matchmake_session_attribute(self, gid, attribs):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.list(attribs, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_matchmake_session_attribute -> done\")\n\t\n\tasync def get_friend_notification_data_list(self, types):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(types, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnotifications = stream.list(notification.NotificationEvent)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_friend_notification_data_list -> done\")\n\t\treturn notifications\n\t\n\tasync def update_matchmake_session(self, gathering):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(gathering)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_matchmake_session -> done\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, search_criteria, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(search_criteria, stream.add)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_with_search_criteria_postpone -> done\")\n\t\treturn gathering\n\t\n\tasync def get_playing_session(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(PlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_playing_session -> done\")\n\t\treturn sessions\n\t\n\tasync def create_community(self, community, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tgid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_community -> done\")\n\t\treturn gid\n\t\n\tasync def update_community(self, community):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(community)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_community -> done\")\n\t\n\tasync def join_community(self, gid, message, password):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(message)\n\t\tstream.string(password)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_community -> done\")\n\t\n\tasync def find_community_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_community_by_gathering_id -> done\")\n\t\treturn communities\n\t\n\tasync def find_official_community(self, available_only, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_official_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(available_only)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_OFFICIAL_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_official_community -> done\")\n\t\treturn communities\n\t\n\tasync def find_community_by_participant(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_COMMUNITY_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(PersistentGathering)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_community_by_participant -> done\")\n\t\treturn communities\n\t\n\tasync def update_privacy_setting(self, online_status, community_participation):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.bool(online_status)\n\t\tstream.bool(community_participation)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PRIVACY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_privacy_setting -> done\")\n\t\n\tasync def get_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpids = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_my_block_list -> done\")\n\t\treturn pids\n\t\n\tasync def add_to_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.add_to_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ADD_TO_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.add_to_block_list -> done\")\n\t\n\tasync def remove_from_block_list(self, pids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REMOVE_FROM_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.remove_from_block_list -> done\")\n\t\n\tasync def clear_my_block_list(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MY_BLOCK_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.clear_my_block_list -> done\")\n\t\n\tasync def report_violation(self, pid, username, violation_code):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.report_violation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.string(username)\n\t\tstream.u32(violation_code)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_VIOLATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.report_violation -> done\")\n\t\n\tasync def is_violation_user(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.is_violation_user()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_IS_VIOLATION_USER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.flag = stream.bool()\n\t\tobj.score = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.is_violation_user -> done\")\n\t\treturn obj\n\t\n\tasync def join_matchmake_session_ex(self, gid, gmessage, ignore_block_list, num_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(gmessage)\n\t\tstream.bool(ignore_block_list)\n\t\tstream.u16(num_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session_ex -> done\")\n\t\treturn session_key\n\t\n\tasync def get_simple_playing_session(self, pids, include_login_user):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.bool(include_login_user)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_PLAYING_SESSION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.list(SimplePlayingSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_simple_playing_session -> done\")\n\t\treturn session\n\t\n\tasync def get_simple_community(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_simple_community()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SIMPLE_COMMUNITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommunities = stream.list(SimpleCommunity)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_simple_community -> done\")\n\t\treturn communities\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, gids, gathering, message):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tstream.anydata(gathering)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tjoined_gathering = stream.anydata()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_with_gathering_id_postpone -> done\")\n\t\treturn joined_gathering\n\t\n\tasync def update_progress_score(self, gid, score):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_progress_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.u8(score)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_PROGRESS_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_progress_score -> done\")\n\t\n\tasync def debug_notify_event(self, pid, main_type, sub_type, param1, param2, param3):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.debug_notify_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.u32(main_type)\n\t\tstream.u32(sub_type)\n\t\tstream.u64(param1)\n\t\tstream.u64(param2)\n\t\tstream.string(param3)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DEBUG_NOTIFY_EVENT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.debug_notify_event -> done\")\n\t\n\tasync def generate_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tpassword = stream.string()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.generate_matchmake_session_system_password -> done\")\n\t\treturn password\n\t\n\tasync def clear_matchmake_session_system_password(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.clear_matchmake_session_system_password -> done\")\n\t\n\tasync def create_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def join_matchmake_session_with_param(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session_with_param -> done\")\n\t\treturn session\n\t\n\tasync def auto_matchmake_with_param_postpone(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.auto_matchmake_with_param_postpone -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_gathering_id_detail -> done\")\n\t\treturn session\n\t\n\tasync def browse_matchmake_session_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_no_holder -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, search_criteria, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_with_host_urls_no_holder -> done\")\n\t\treturn obj\n\t\n\tasync def update_matchmake_session_part(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_MATCHMAKE_SESSION_PART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_matchmake_session_part -> done\")\n\t\n\tasync def request_matchmaking(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.request_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\trequest_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.request_matchmaking -> done\")\n\t\treturn request_id\n\t\n\tasync def withdraw_matchmaking(self, request_id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(request_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.withdraw_matchmaking -> done\")\n\t\n\tasync def withdraw_matchmaking_all(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_WITHDRAW_MATCHMAKING_ALL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.withdraw_matchmaking_all -> done\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, gids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(gids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_gathering_id -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, gid):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession = stream.extract(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_single_gathering_id -> done\")\n\t\treturn session\n\t\n\tasync def find_matchmake_session_by_owner(self, pid, range):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.pid(pid)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_owner -> done\")\n\t\treturn sessions\n\t\n\tasync def find_matchmake_session_by_participant(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.list(FindMatchmakeSessionByParticipantResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.find_matchmake_session_by_participant -> done\")\n\t\treturn result\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsessions = stream.list(MatchmakeSession)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_no_holder_no_result_range -> done\")\n\t\treturn sessions\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, search_criteria):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(search_criteria)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.sessions = stream.list(MatchmakeSession)\n\t\tobj.urls = stream.list(GatheringURLs)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.browse_matchmake_session_with_host_urls_no_holder_no_result_range -> done\")\n\t\treturn obj\n\t\n\tasync def create_simple_search_object(self, object):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tid = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_simple_search_object -> done\")\n\t\treturn id\n\t\n\tasync def update_simple_search_object(self, id, object):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tstream.add(object)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.update_simple_search_object -> done\")\n\t\n\tasync def delete_simple_search_object(self, id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.delete_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.delete_simple_search_object -> done\")\n\t\n\tasync def search_simple_search_object(self, param):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.search_simple_search_object()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobjects = stream.list(SimpleSearchObject)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.search_simple_search_object -> done\")\n\t\treturn objects\n\t\n\tasync def search_simple_search_object_by_object_ids(self, ids):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.search_simple_search_object_by_object_ids()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT_BY_OBJECT_IDS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobjects = stream.list(SimpleSearchObject)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.search_simple_search_object_by_object_ids -> done\")\n\t\treturn objects\n\t\n\tasync def join_matchmake_session_with_extra_participants(self, gid, join_message, ignore_blacklist, participation_count, extra_participants):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session_with_extra_participants()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(gid)\n\t\tstream.string(join_message)\n\t\tstream.bool(ignore_blacklist)\n\t\tstream.u16(participation_count)\n\t\tstream.u32(extra_participants)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_JOIN_MATCHMAKE_SESSION_WITH_EXTRA_PARTICIPANTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsession_key = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.join_matchmake_session_with_extra_participants -> done\")\n\t\treturn session_key\n\t\n\tasync def create_competition(self, competition):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_competition()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(competition)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CREATE_COMPETITION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcompetition = stream.extract(SimpleSearchObject)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.create_competition -> done\")\n\t\treturn competition\n\t\n\tasync def delete_competition(self, id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.delete_competition()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_COMPETITION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.delete_competition -> done\")\n\t\n\tasync def register_favorite_competition(self, id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.register_favorite_competition()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_FAVORITE_COMPETITION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.register_favorite_competition -> done\")\n\t\n\tasync def unregister_favorite_competition(self, id):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.unregister_favorite_competition()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UNREGISTER_FAVORITE_COMPETITION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.unregister_favorite_competition -> done\")\n\t\n\tasync def get_favorite_competition(self):\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_favorite_competition()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_FAVORITE_COMPETITION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcompetitions = stream.list(SimpleSearchObject)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MatchmakeExtensionClientMK8D.get_favorite_competition -> done\")\n\t\treturn competitions\n\n\nclass MatchMakingServer(MatchMakingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER_GATHERING: self.handle_register_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERING: self.handle_unregister_gathering,\n\t\t\tself.METHOD_UNREGISTER_GATHERINGS: self.handle_unregister_gatherings,\n\t\t\tself.METHOD_UPDATE_GATHERING: self.handle_update_gathering,\n\t\t\tself.METHOD_INVITE: self.handle_invite,\n\t\t\tself.METHOD_ACCEPT_INVITATION: self.handle_accept_invitation,\n\t\t\tself.METHOD_DECLINE_INVITATION: self.handle_decline_invitation,\n\t\t\tself.METHOD_CANCEL_INVITATION: self.handle_cancel_invitation,\n\t\t\tself.METHOD_GET_INVITATIONS_SENT: self.handle_get_invitations_sent,\n\t\t\tself.METHOD_GET_INVITATIONS_RECEIVED: self.handle_get_invitations_received,\n\t\t\tself.METHOD_PARTICIPATE: self.handle_participate,\n\t\t\tself.METHOD_CANCEL_PARTICIPATION: self.handle_cancel_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_ADD_PARTICIPANTS: self.handle_add_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_FIND_BY_TYPE: self.handle_find_by_type,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION: self.handle_find_by_description,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_REGEX: self.handle_find_by_description_regex,\n\t\t\tself.METHOD_FIND_BY_ID: self.handle_find_by_id,\n\t\t\tself.METHOD_FIND_BY_SINGLE_ID: self.handle_find_by_single_id,\n\t\t\tself.METHOD_FIND_BY_OWNER: self.handle_find_by_owner,\n\t\t\tself.METHOD_FIND_BY_PARTICIPANTS: self.handle_find_by_participants,\n\t\t\tself.METHOD_FIND_INVITATIONS: self.handle_find_invitations,\n\t\t\tself.METHOD_FIND_BY_SQL_QUERY: self.handle_find_by_sql_query,\n\t\t\tself.METHOD_LAUNCH_SESSION: self.handle_launch_session,\n\t\t\tself.METHOD_UPDATE_SESSION_URL: self.handle_update_session_url,\n\t\t\tself.METHOD_GET_SESSION_URL: self.handle_get_session_url,\n\t\t\tself.METHOD_GET_STATE: self.handle_get_state,\n\t\t\tself.METHOD_SET_STATE: self.handle_set_state,\n\t\t\tself.METHOD_REPORT_STATS: self.handle_report_stats,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_DELETE_GATHERING: self.handle_delete_gathering,\n\t\t\tself.METHOD_GET_PENDING_DELETIONS: self.handle_get_pending_deletions,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP_V1: self.handle_migrate_gathering_ownership_v1,\n\t\t\tself.METHOD_FIND_BY_DESCRIPTION_LIKE: self.handle_find_by_description_like,\n\t\t\tself.METHOD_REGISTER_LOCAL_URL: self.handle_register_local_url,\n\t\t\tself.METHOD_REGISTER_LOCAL_URLS: self.handle_register_local_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST_V1: self.handle_update_session_host_v1,\n\t\t\tself.METHOD_GET_SESSION_URLS: self.handle_get_session_urls,\n\t\t\tself.METHOD_UPDATE_SESSION_HOST: self.handle_update_session_host,\n\t\t\tself.METHOD_UPDATE_GATHERING_OWNERSHIP: self.handle_update_gathering_ownership,\n\t\t\tself.METHOD_MIGRATE_GATHERING_OWNERSHIP: self.handle_migrate_gathering_ownership,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.register_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_unregister_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.unregister_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_unregister_gatherings(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.unregister_gatherings()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.unregister_gatherings(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tresponse = await self.update_gathering(client, gathering)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_invite(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.invite()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.invite(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_accept_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.accept_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.accept_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_decline_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.decline_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.decline_invitation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_invitation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_invitation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_invitation(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_invitations_sent(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_sent()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_invitations_sent(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_invitations_received(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_invitations_received()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_invitations_received(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_participate(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.participate()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.participate(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_cancel_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.cancel_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.cancel_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.add_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tmessage = input.string()\n\t\tresponse = await self.add_participants(client, gid, pids, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_detailed_participants(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_participants_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_find_by_type(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_type()\")\n\t\t#--- request ---\n\t\ttype = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_type(client, type, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_description_regex(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_regex()\")\n\t\t#--- request ---\n\t\tregex = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_regex(client, regex, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_id()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.find_by_id(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_single_id(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_single_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_by_single_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'gathering']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.anydata(response.gathering)\n\t\n\tasync def handle_find_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_owner()\")\n\t\t#--- request ---\n\t\towner = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_owner(client, owner, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_participants()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.find_by_participants(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_invitations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_invitations()\")\n\t\t#--- request ---\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_invitations(client, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_find_by_sql_query(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_sql_query()\")\n\t\t#--- request ---\n\t\tquery = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_sql_query(client, query, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_launch_session(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.launch_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.launch_session(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_update_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.string()\n\t\tresponse = await self.update_session_url(client, gid, url)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_session_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_url(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'url']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.string(response.url)\n\t\n\tasync def handle_get_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_state(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'state']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.u32(response.state)\n\t\n\tasync def handle_set_state(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.set_state()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstate = input.u32()\n\t\tresponse = await self.set_state(client, gid, state)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_report_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.report_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tstats = input.list(GatheringStats)\n\t\tresponse = await self.report_stats(client, gid, stats)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_stats()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpids = input.list(input.pid)\n\t\tcolumns = input.list(input.u8)\n\t\tresponse = await self.get_stats(client, gid, pids, columns)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'stats']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.stats, output.add)\n\t\n\tasync def handle_delete_gathering(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_gathering()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.delete_gathering(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_pending_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_pending_deletions()\")\n\t\t#--- request ---\n\t\treason = input.u32()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.get_pending_deletions(client, reason, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'deletions']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.deletions, output.add)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tresponse = await self.delete_from_deletions(client, deletions)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tresponse = await self.migrate_gathering_ownership_v1(client, gid, potential_owners)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_find_by_description_like(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.find_by_description_like()\")\n\t\t#--- request ---\n\t\tdescription = input.string()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_by_description_like(client, description, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_register_local_url(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_url()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turl = input.stationurl()\n\t\tawait self.register_local_url(client, gid, url)\n\t\n\tasync def handle_register_local_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.register_local_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\turls = input.list(input.stationurl)\n\t\tawait self.register_local_urls(client, gid, urls)\n\t\n\tasync def handle_update_session_host_v1(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host_v1()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.update_session_host_v1(client, gid)\n\t\n\tasync def handle_get_session_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.get_session_urls()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.get_session_urls(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.stationurl)\n\t\n\tasync def handle_update_session_host(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_session_host()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tis_migrate_owner = input.bool()\n\t\tawait self.update_session_host(client, gid, is_migrate_owner)\n\t\n\tasync def handle_update_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.update_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tparticipants_only = input.bool()\n\t\tresponse = await self.update_gathering_ownership(client, gid, participants_only)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_migrate_gathering_ownership(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServer.migrate_gathering_ownership()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tpotential_owners = input.list(input.pid)\n\t\tparticipants_only = input.bool()\n\t\tawait self.migrate_gathering_ownership(client, gid, potential_owners, participants_only)\n\t\n\tasync def register_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_gatherings(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.unregister_gatherings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def invite(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.invite not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def accept_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.accept_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def decline_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.decline_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_invitation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_invitation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_sent(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_sent not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_invitations_received(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_invitations_received not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def participate(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.participate not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def cancel_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.cancel_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.add_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_type(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_type not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_regex(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_regex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_single_id(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_single_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_owner(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_invitations(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_invitations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_sql_query(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_sql_query not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def launch_session(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.launch_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def set_state(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.set_state not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.report_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_gathering(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_gathering not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_pending_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_pending_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_by_description_like(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.find_by_description_like not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_url(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_local_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.register_local_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host_v1(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host_v1 not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_session_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.get_session_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_session_host(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_session_host not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.update_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def migrate_gathering_ownership(self, *args):\n\t\tlogger.warning(\"MatchMakingServer.migrate_gathering_ownership not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchMakingServerExt(MatchMakingProtocolExt):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_END_PARTICIPATION: self.handle_end_participation,\n\t\t\tself.METHOD_GET_PARTICIPANTS: self.handle_get_participants,\n\t\t\tself.METHOD_GET_DETAILED_PARTICIPANTS: self.handle_get_detailed_participants,\n\t\t\tself.METHOD_GET_PARTICIPANTS_URLS: self.handle_get_participants_urls,\n\t\t\tself.METHOD_GET_GATHERING_RELATIONS: self.handle_get_gathering_relations,\n\t\t\tself.METHOD_DELETE_FROM_DELETIONS: self.handle_delete_from_deletions,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchMakingServerExt: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_end_participation(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.end_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.end_participation(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_detailed_participants(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_detailed_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tonly_active = input.bool()\n\t\tresponse = await self.get_detailed_participants(client, gid, only_active)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_participants_urls(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_participants_urls()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_participants_urls(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_gathering_relations(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.get_gathering_relations()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tdescr = input.string()\n\t\tresponse = await self.get_gathering_relations(client, id, descr)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_delete_from_deletions(self, client, input, output):\n\t\tlogger.info(\"MatchMakingServerExt.delete_from_deletions()\")\n\t\t#--- request ---\n\t\tdeletions = input.list(input.u32)\n\t\tpid = input.pid()\n\t\tawait self.delete_from_deletions(client, deletions, pid)\n\t\n\tasync def end_participation(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.end_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_detailed_participants(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_detailed_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_participants_urls(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_participants_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_gathering_relations(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.get_gathering_relations not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_from_deletions(self, *args):\n\t\tlogger.warning(\"MatchMakingServerExt.delete_from_deletions not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeRefereeServer(MatchmakeRefereeProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_START_ROUND: self.handle_start_round,\n\t\t\tself.METHOD_GET_START_ROUND_PARAM: self.handle_get_start_round_param,\n\t\t\tself.METHOD_END_ROUND: self.handle_end_round,\n\t\t\tself.METHOD_END_ROUND_WITHOUT_REPORT: self.handle_end_round_without_report,\n\t\t\tself.METHOD_GET_ROUND_PARTICIPANTS: self.handle_get_round_participants,\n\t\t\tself.METHOD_GET_NOT_SUMMARIZED_ROUND: self.handle_get_not_summarized_round,\n\t\t\tself.METHOD_GET_ROUND: self.handle_get_round,\n\t\t\tself.METHOD_GET_STATS_PRIMARY: self.handle_get_stats_primary,\n\t\t\tself.METHOD_GET_STATS_PRIMARIES: self.handle_get_stats_primaries,\n\t\t\tself.METHOD_GET_STATS_ALL: self.handle_get_stats_all,\n\t\t\tself.METHOD_CREATE_STATS: self.handle_create_stats,\n\t\t\tself.METHOD_GET_OR_CREATE_STATS: self.handle_get_or_create_stats,\n\t\t\tself.METHOD_RESET_STATS: self.handle_reset_stats,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeRefereeServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_start_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.start_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStartRoundParam)\n\t\tresponse = await self.start_round(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_get_start_round_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_start_round_param()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_start_round_param(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStartRoundParam):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStartRoundParam, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_end_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeEndRoundParam)\n\t\tawait self.end_round(client, param)\n\t\n\tasync def handle_end_round_without_report(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.end_round_without_report()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tawait self.end_round_without_report(client, round_id)\n\t\n\tasync def handle_get_round_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round_participants()\")\n\t\t#--- request ---\n\t\tround_id = input.u64()\n\t\tresponse = await self.get_round_participants(client, round_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_get_not_summarized_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_not_summarized_round()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_not_summarized_round(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_round(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_round()\")\n\t\t#--- request ---\n\t\tround = input.u64()\n\t\tresponse = await self.get_round(client, round)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeRound):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeRound, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primary(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primary()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primary(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_stats_primaries(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_primaries()\")\n\t\t#--- request ---\n\t\ttargets = input.list(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_primaries(client, targets)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['stats', 'results']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.stats, output.add)\n\t\toutput.list(response.results, output.result)\n\t\n\tasync def handle_get_stats_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_stats_all()\")\n\t\t#--- request ---\n\t\ttarget = input.extract(MatchmakeRefereeStatsTarget)\n\t\tresponse = await self.get_stats_all(client, target)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_or_create_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.get_or_create_stats()\")\n\t\t#--- request ---\n\t\tparam = input.extract(MatchmakeRefereeStatsInitParam)\n\t\tresponse = await self.get_or_create_stats(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeRefereeStats):\n\t\t\traise RuntimeError(\"Expected MatchmakeRefereeStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_reset_stats(self, client, input, output):\n\t\tlogger.info(\"MatchmakeRefereeServer.reset_stats()\")\n\t\t#--- request ---\n\t\tawait self.reset_stats(client)\n\t\n\tasync def start_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.start_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_start_round_param(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_start_round_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def end_round_without_report(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.end_round_without_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_not_summarized_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_not_summarized_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_round(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_round not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primary(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primary not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_primaries(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_primaries not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats_all(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_stats_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_or_create_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.get_or_create_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def reset_stats(self, *args):\n\t\tlogger.warning(\"MatchmakeRefereeServer.reset_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MatchmakeExtensionServerMK8D(MatchmakeExtensionProtocolMK8D):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_CLOSE_PARTICIPATION: self.handle_close_participation,\n\t\t\tself.METHOD_OPEN_PARTICIPATION: self.handle_open_participation,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_POSTPONE: self.handle_auto_matchmake_postpone,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION: self.handle_browse_matchmake_session,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS: self.handle_browse_matchmake_session_with_host_urls,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION: self.handle_create_matchmake_session,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION: self.handle_join_matchmake_session,\n\t\t\tself.METHOD_MODIFY_CURRENT_GAME_ATTRIBUTE: self.handle_modify_current_game_attribute,\n\t\t\tself.METHOD_UPDATE_NOTIFICATION_DATA: self.handle_update_notification_data,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA: self.handle_get_friend_notification_data,\n\t\t\tself.METHOD_UPDATE_APPLICATION_BUFFER: self.handle_update_application_buffer,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_ATTRIBUTE: self.handle_update_matchmake_session_attribute,\n\t\t\tself.METHOD_GET_FRIEND_NOTIFICATION_DATA_LIST: self.handle_get_friend_notification_data_list,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION: self.handle_update_matchmake_session,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_SEARCH_CRITERIA_POSTPONE: self.handle_auto_matchmake_with_search_criteria_postpone,\n\t\t\tself.METHOD_GET_PLAYING_SESSION: self.handle_get_playing_session,\n\t\t\tself.METHOD_CREATE_COMMUNITY: self.handle_create_community,\n\t\t\tself.METHOD_UPDATE_COMMUNITY: self.handle_update_community,\n\t\t\tself.METHOD_JOIN_COMMUNITY: self.handle_join_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_GATHERING_ID: self.handle_find_community_by_gathering_id,\n\t\t\tself.METHOD_FIND_OFFICIAL_COMMUNITY: self.handle_find_official_community,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_PARTICIPANT: self.handle_find_community_by_participant,\n\t\t\tself.METHOD_UPDATE_PRIVACY_SETTING: self.handle_update_privacy_setting,\n\t\t\tself.METHOD_GET_MY_BLOCK_LIST: self.handle_get_my_block_list,\n\t\t\tself.METHOD_ADD_TO_BLOCK_LIST: self.handle_add_to_block_list,\n\t\t\tself.METHOD_REMOVE_FROM_BLOCK_LIST: self.handle_remove_from_block_list,\n\t\t\tself.METHOD_CLEAR_MY_BLOCK_LIST: self.handle_clear_my_block_list,\n\t\t\tself.METHOD_REPORT_VIOLATION: self.handle_report_violation,\n\t\t\tself.METHOD_IS_VIOLATION_USER: self.handle_is_violation_user,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_EX: self.handle_join_matchmake_session_ex,\n\t\t\tself.METHOD_GET_SIMPLE_PLAYING_SESSION: self.handle_get_simple_playing_session,\n\t\t\tself.METHOD_GET_SIMPLE_COMMUNITY: self.handle_get_simple_community,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_GATHERING_ID_POSTPONE: self.handle_auto_matchmake_with_gathering_id_postpone,\n\t\t\tself.METHOD_UPDATE_PROGRESS_SCORE: self.handle_update_progress_score,\n\t\t\tself.METHOD_DEBUG_NOTIFY_EVENT: self.handle_debug_notify_event,\n\t\t\tself.METHOD_GENERATE_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_generate_matchmake_session_system_password,\n\t\t\tself.METHOD_CLEAR_MATCHMAKE_SESSION_SYSTEM_PASSWORD: self.handle_clear_matchmake_session_system_password,\n\t\t\tself.METHOD_CREATE_MATCHMAKE_SESSION_WITH_PARAM: self.handle_create_matchmake_session_with_param,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_WITH_PARAM: self.handle_join_matchmake_session_with_param,\n\t\t\tself.METHOD_AUTO_MATCHMAKE_WITH_PARAM_POSTPONE: self.handle_auto_matchmake_with_param_postpone,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID_DETAIL: self.handle_find_matchmake_session_by_gathering_id_detail,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER: self.handle_browse_matchmake_session_no_holder,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER: self.handle_browse_matchmake_session_with_host_urls_no_holder,\n\t\t\tself.METHOD_UPDATE_MATCHMAKE_SESSION_PART: self.handle_update_matchmake_session_part,\n\t\t\tself.METHOD_REQUEST_MATCHMAKING: self.handle_request_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING: self.handle_withdraw_matchmaking,\n\t\t\tself.METHOD_WITHDRAW_MATCHMAKING_ALL: self.handle_withdraw_matchmaking_all,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_GATHERING_ID: self.handle_find_matchmake_session_by_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_SINGLE_GATHERING_ID: self.handle_find_matchmake_session_by_single_gathering_id,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_OWNER: self.handle_find_matchmake_session_by_owner,\n\t\t\tself.METHOD_FIND_MATCHMAKE_SESSION_BY_PARTICIPANT: self.handle_find_matchmake_session_by_participant,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_no_holder_no_result_range,\n\t\t\tself.METHOD_BROWSE_MATCHMAKE_SESSION_WITH_HOST_URLS_NO_HOLDER_NO_RESULT_RANGE: self.handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range,\n\t\t\tself.METHOD_CREATE_SIMPLE_SEARCH_OBJECT: self.handle_create_simple_search_object,\n\t\t\tself.METHOD_UPDATE_SIMPLE_SEARCH_OBJECT: self.handle_update_simple_search_object,\n\t\t\tself.METHOD_DELETE_SIMPLE_SEARCH_OBJECT: self.handle_delete_simple_search_object,\n\t\t\tself.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT: self.handle_search_simple_search_object,\n\t\t\tself.METHOD_SEARCH_SIMPLE_SEARCH_OBJECT_BY_OBJECT_IDS: self.handle_search_simple_search_object_by_object_ids,\n\t\t\tself.METHOD_JOIN_MATCHMAKE_SESSION_WITH_EXTRA_PARTICIPANTS: self.handle_join_matchmake_session_with_extra_participants,\n\t\t\tself.METHOD_CUSTOM_GET_SIMPLE_PLAYING_SESSION: self.handle_custom_get_simple_playing_session,\n\t\t\tself.METHOD_CREATE_COMPETITION: self.handle_create_competition,\n\t\t\tself.METHOD_DELETE_COMPETITION: self.handle_delete_competition,\n\t\t\tself.METHOD_REGISTER_FAVORITE_COMPETITION: self.handle_register_favorite_competition,\n\t\t\tself.METHOD_UNREGISTER_FAVORITE_COMPETITION: self.handle_unregister_favorite_competition,\n\t\t\tself.METHOD_GET_FAVORITE_COMPETITION: self.handle_get_favorite_competition,\n\t\t\tself.METHOD_GET_TEAM_PARTICIPANTS: self.handle_get_team_participants,\n\t\t\tself.METHOD_FIND_COMMUNITY_BY_OWNER: self.handle_find_community_by_owner,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MatchmakeExtensionServerMK8D: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_close_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.close_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.close_participation(client, gid)\n\t\n\tasync def handle_open_participation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.open_participation()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.open_participation(client, gid)\n\t\n\tasync def handle_auto_matchmake_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.auto_matchmake_postpone()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_postpone(client, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_browse_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.browse_matchmake_session()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_with_host_urls()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gatherings', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.gatherings, output.anydata)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_create_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.create_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tdescription = input.string()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.create_matchmake_session(client, gathering, description, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['gid', 'session_key']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.u32(response.gid)\n\t\toutput.buffer(response.session_key)\n\t\n\tasync def handle_join_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.join_matchmake_session()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tresponse = await self.join_matchmake_session(client, gid, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_modify_current_game_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.modify_current_game_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattrib = input.u32()\n\t\tvalue = input.u32()\n\t\tawait self.modify_current_game_attribute(client, gid, attrib, value)\n\t\n\tasync def handle_update_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.u32()\n\t\tparam1 = input.pid()\n\t\tparam2 = input.pid()\n\t\tparam3 = input.string()\n\t\tawait self.update_notification_data(client, type, param1, param2, param3)\n\t\n\tasync def handle_get_friend_notification_data(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_friend_notification_data()\")\n\t\t#--- request ---\n\t\ttype = input.s32()\n\t\tresponse = await self.get_friend_notification_data(client, type)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_application_buffer(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_application_buffer()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tbuffer = input.buffer()\n\t\tawait self.update_application_buffer(client, gid, buffer)\n\t\n\tasync def handle_update_matchmake_session_attribute(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_matchmake_session_attribute()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tattribs = input.list(input.u32)\n\t\tawait self.update_matchmake_session_attribute(client, gid, attribs)\n\t\n\tasync def handle_get_friend_notification_data_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_friend_notification_data_list()\")\n\t\t#--- request ---\n\t\ttypes = input.list(input.u32)\n\t\tresponse = await self.get_friend_notification_data_list(client, types)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_matchmake_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_matchmake_session()\")\n\t\t#--- request ---\n\t\tgathering = input.anydata()\n\t\tawait self.update_matchmake_session(client, gathering)\n\t\n\tasync def handle_auto_matchmake_with_search_criteria_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.auto_matchmake_with_search_criteria_postpone()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.list(MatchmakeSessionSearchCriteria)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_search_criteria_postpone(client, search_criteria, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_get_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_playing_session(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_create_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.create_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tmessage = input.string()\n\t\tresponse = await self.create_community(client, community, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_community()\")\n\t\t#--- request ---\n\t\tcommunity = input.extract(PersistentGathering)\n\t\tawait self.update_community(client, community)\n\t\n\tasync def handle_join_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.join_community()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tmessage = input.string()\n\t\tpassword = input.string()\n\t\tawait self.join_community(client, gid, message, password)\n\t\n\tasync def handle_find_community_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_community_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_community_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_official_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_official_community()\")\n\t\t#--- request ---\n\t\tavailable_only = input.bool()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_official_community(client, available_only, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_community_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_community_by_participant()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_community_by_participant(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_update_privacy_setting(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_privacy_setting()\")\n\t\t#--- request ---\n\t\tonline_status = input.bool()\n\t\tcommunity_participation = input.bool()\n\t\tawait self.update_privacy_setting(client, online_status, community_participation)\n\t\n\tasync def handle_get_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_my_block_list()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_my_block_list(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.pid)\n\t\n\tasync def handle_add_to_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.add_to_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.add_to_block_list(client, pids)\n\t\n\tasync def handle_remove_from_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.remove_from_block_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tawait self.remove_from_block_list(client, pids)\n\t\n\tasync def handle_clear_my_block_list(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.clear_my_block_list()\")\n\t\t#--- request ---\n\t\tawait self.clear_my_block_list(client)\n\t\n\tasync def handle_report_violation(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.report_violation()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tusername = input.string()\n\t\tviolation_code = input.u32()\n\t\tawait self.report_violation(client, pid, username, violation_code)\n\t\n\tasync def handle_is_violation_user(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.is_violation_user()\")\n\t\t#--- request ---\n\t\tresponse = await self.is_violation_user(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['flag', 'score']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.flag)\n\t\toutput.u32(response.score)\n\t\n\tasync def handle_join_matchmake_session_ex(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.join_matchmake_session_ex()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tgmessage = input.string()\n\t\tignore_block_list = input.bool()\n\t\tnum_participants = input.u16()\n\t\tresponse = await self.join_matchmake_session_ex(client, gid, gmessage, ignore_block_list, num_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_get_simple_playing_session(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_simple_playing_session()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tinclude_login_user = input.bool()\n\t\tresponse = await self.get_simple_playing_session(client, pids, include_login_user)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_simple_community(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_simple_community()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.get_simple_community(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_auto_matchmake_with_gathering_id_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.auto_matchmake_with_gathering_id_postpone()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tgathering = input.anydata()\n\t\tmessage = input.string()\n\t\tresponse = await self.auto_matchmake_with_gathering_id_postpone(client, gids, gathering, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Gathering):\n\t\t\traise RuntimeError(\"Expected Gathering, got %s\" %response.__class__.__name__)\n\t\toutput.anydata(response)\n\t\n\tasync def handle_update_progress_score(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_progress_score()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tscore = input.u8()\n\t\tawait self.update_progress_score(client, gid, score)\n\t\n\tasync def handle_debug_notify_event(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.debug_notify_event()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\tmain_type = input.u32()\n\t\tsub_type = input.u32()\n\t\tparam1 = input.u64()\n\t\tparam2 = input.u64()\n\t\tparam3 = input.string()\n\t\tawait self.debug_notify_event(client, pid, main_type, sub_type, param1, param2, param3)\n\t\n\tasync def handle_generate_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.generate_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.generate_matchmake_session_system_password(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, str):\n\t\t\traise RuntimeError(\"Expected str, got %s\" %response.__class__.__name__)\n\t\toutput.string(response)\n\t\n\tasync def handle_clear_matchmake_session_system_password(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.clear_matchmake_session_system_password()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tawait self.clear_matchmake_session_system_password(client, gid)\n\t\n\tasync def handle_create_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.create_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CreateMatchmakeSessionParam)\n\t\tresponse = await self.create_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_join_matchmake_session_with_param(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.join_matchmake_session_with_param()\")\n\t\t#--- request ---\n\t\tparam = input.extract(JoinMatchmakeSessionParam)\n\t\tresponse = await self.join_matchmake_session_with_param(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_auto_matchmake_with_param_postpone(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.auto_matchmake_with_param_postpone()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.auto_matchmake_with_param_postpone(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id_detail(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_gathering_id_detail()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_gathering_id_detail(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_browse_matchmake_session_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_with_host_urls_no_holder()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder(client, search_criteria, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_update_matchmake_session_part(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_matchmake_session_part()\")\n\t\t#--- request ---\n\t\tparam = input.extract(UpdateMatchmakeSessionParam)\n\t\tawait self.update_matchmake_session_part(client, param)\n\t\n\tasync def handle_request_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.request_matchmaking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(AutoMatchmakeParam)\n\t\tresponse = await self.request_matchmaking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_withdraw_matchmaking(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.withdraw_matchmaking()\")\n\t\t#--- request ---\n\t\trequest_id = input.u64()\n\t\tawait self.withdraw_matchmaking(client, request_id)\n\t\n\tasync def handle_withdraw_matchmaking_all(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.withdraw_matchmaking_all()\")\n\t\t#--- request ---\n\t\tawait self.withdraw_matchmaking_all(client)\n\t\n\tasync def handle_find_matchmake_session_by_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_gathering_id()\")\n\t\t#--- request ---\n\t\tgids = input.list(input.u32)\n\t\tresponse = await self.find_matchmake_session_by_gathering_id(client, gids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_single_gathering_id(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_single_gathering_id()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tresponse = await self.find_matchmake_session_by_single_gathering_id(client, gid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, MatchmakeSession):\n\t\t\traise RuntimeError(\"Expected MatchmakeSession, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_find_matchmake_session_by_owner(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_owner()\")\n\t\t#--- request ---\n\t\tpid = input.pid()\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.find_matchmake_session_by_owner(client, pid, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_find_matchmake_session_by_participant(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_participant()\")\n\t\t#--- request ---\n\t\tparam = input.extract(FindMatchmakeSessionByParticipantParam)\n\t\tresponse = await self.find_matchmake_session_by_participant(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_with_host_urls_no_holder_no_result_range()\")\n\t\t#--- request ---\n\t\tsearch_criteria = input.extract(MatchmakeSessionSearchCriteria)\n\t\tresponse = await self.browse_matchmake_session_with_host_urls_no_holder_no_result_range(client, search_criteria)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['sessions', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.list(response.sessions, output.add)\n\t\toutput.list(response.urls, output.add)\n\t\n\tasync def handle_create_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.create_simple_search_object()\")\n\t\t#--- request ---\n\t\tobject = input.extract(SimpleSearchObject)\n\t\tresponse = await self.create_simple_search_object(client, object)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_update_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.update_simple_search_object()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tobject = input.extract(SimpleSearchObject)\n\t\tawait self.update_simple_search_object(client, id, object)\n\t\n\tasync def handle_delete_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.delete_simple_search_object()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tawait self.delete_simple_search_object(client, id)\n\t\n\tasync def handle_search_simple_search_object(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.search_simple_search_object()\")\n\t\t#--- request ---\n\t\tparam = input.extract(SimpleSearchParam)\n\t\tresponse = await self.search_simple_search_object(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_search_simple_search_object_by_object_ids(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.search_simple_search_object_by_object_ids()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u32)\n\t\tresponse = await self.search_simple_search_object_by_object_ids(client, ids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_join_matchmake_session_with_extra_participants(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.join_matchmake_session_with_extra_participants()\")\n\t\t#--- request ---\n\t\tgid = input.u32()\n\t\tjoin_message = input.string()\n\t\tignore_blacklist = input.bool()\n\t\tparticipation_count = input.u16()\n\t\textra_participants = input.u32()\n\t\tresponse = await self.join_matchmake_session_with_extra_participants(client, gid, join_message, ignore_blacklist, participation_count, extra_participants)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_custom_get_simple_playing_session(self, client, input, output):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.custom_get_simple_playing_session is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_create_competition(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.create_competition()\")\n\t\t#--- request ---\n\t\tcompetition = input.extract(SimpleSearchObject)\n\t\tresponse = await self.create_competition(client, competition)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, SimpleSearchObject):\n\t\t\traise RuntimeError(\"Expected SimpleSearchObject, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_delete_competition(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.delete_competition()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tawait self.delete_competition(client, id)\n\t\n\tasync def handle_register_favorite_competition(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.register_favorite_competition()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tawait self.register_favorite_competition(client, id)\n\t\n\tasync def handle_unregister_favorite_competition(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.unregister_favorite_competition()\")\n\t\t#--- request ---\n\t\tid = input.u32()\n\t\tawait self.unregister_favorite_competition(client, id)\n\t\n\tasync def handle_get_favorite_competition(self, client, input, output):\n\t\tlogger.info(\"MatchmakeExtensionServerMK8D.get_favorite_competition()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_favorite_competition(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_team_participants(self, client, input, output):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_team_participants is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_find_community_by_owner(self, client, input, output):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_community_by_owner is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def close_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.close_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def open_participation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.open_participation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.auto_matchmake_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.browse_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_with_host_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.create_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.join_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def modify_current_game_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.modify_current_game_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_friend_notification_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_application_buffer(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_application_buffer not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_attribute(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_matchmake_session_attribute not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_friend_notification_data_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_friend_notification_data_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_matchmake_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_search_criteria_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.auto_matchmake_with_search_criteria_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.create_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.join_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_community_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_official_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_official_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_community_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_community_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_privacy_setting(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_privacy_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def add_to_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.add_to_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def remove_from_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.remove_from_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_my_block_list(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.clear_my_block_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_violation(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.report_violation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def is_violation_user(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.is_violation_user not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_ex(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.join_matchmake_session_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_playing_session(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_simple_playing_session not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_simple_community(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_simple_community not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_gathering_id_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.auto_matchmake_with_gathering_id_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_progress_score(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_progress_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def debug_notify_event(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.debug_notify_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def generate_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.generate_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def clear_matchmake_session_system_password(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.clear_matchmake_session_system_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.create_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_with_param(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.join_matchmake_session_with_param not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def auto_matchmake_with_param_postpone(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.auto_matchmake_with_param_postpone not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id_detail(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_gathering_id_detail not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_with_host_urls_no_holder not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_matchmake_session_part(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_matchmake_session_part not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.request_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.withdraw_matchmaking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def withdraw_matchmaking_all(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.withdraw_matchmaking_all not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_single_gathering_id(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_single_gathering_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_owner(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_owner not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def find_matchmake_session_by_participant(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.find_matchmake_session_by_participant not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def browse_matchmake_session_with_host_urls_no_holder_no_result_range(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.browse_matchmake_session_with_host_urls_no_holder_no_result_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.create_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.update_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.delete_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_simple_search_object(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.search_simple_search_object not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def search_simple_search_object_by_object_ids(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.search_simple_search_object_by_object_ids not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def join_matchmake_session_with_extra_participants(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.join_matchmake_session_with_extra_participants not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def create_competition(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.create_competition not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_competition(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.delete_competition not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_favorite_competition(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.register_favorite_competition not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def unregister_favorite_competition(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.unregister_favorite_competition not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_favorite_competition(self, *args):\n\t\tlogger.warning(\"MatchmakeExtensionServerMK8D.get_favorite_competition not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/messaging.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RecipientType:\n\tPRINCIPAL = 1\n\tGATHERING = 2\n\n\nclass MessageRecipient(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.pid = None\n\t\tself.gid = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'pid', 'gid']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.gid = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.gid)\n\n\nclass UserMessage(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.parent_id = None\n\t\tself.sender = None\n\t\tself.reception_time = None\n\t\tself.life_time = None\n\t\tself.flags = None\n\t\tself.subject = None\n\t\tself.sender_name = None\n\t\tself.recipient = MessageRecipient()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'parent_id', 'sender', 'reception_time', 'life_time', 'flags', 'subject', 'sender_name']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.parent_id = stream.u32()\n\t\tself.sender = stream.pid()\n\t\tself.reception_time = stream.datetime()\n\t\tself.life_time = stream.u32()\n\t\tself.flags = stream.u32()\n\t\tself.subject = stream.string()\n\t\tself.sender_name = stream.string()\n\t\tself.recipient = stream.extract(MessageRecipient)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.u32(self.parent_id)\n\t\tstream.pid(self.sender)\n\t\tstream.datetime(self.reception_time)\n\t\tstream.u32(self.life_time)\n\t\tstream.u32(self.flags)\n\t\tstream.string(self.subject)\n\t\tstream.string(self.sender_name)\n\t\tstream.add(self.recipient)\ncommon.DataHolder.register(UserMessage, \"UserMessage\")\n\n\nclass TextMessage(UserMessage):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.body = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['body']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.body = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.body)\ncommon.DataHolder.register(TextMessage, \"TextMessage\")\n\n\nclass BinaryMessage(UserMessage):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.body = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['body']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.body = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.qbuffer(self.body)\ncommon.DataHolder.register(BinaryMessage, \"BinaryMessage\")\n\n\nclass MessagingProtocol:\n\tMETHOD_DELIVER_MESSAGE = 1\n\tMETHOD_GET_NUMBER_OF_MESSAGES = 2\n\tMETHOD_GET_MESSAGE_HEADERS = 3\n\tMETHOD_RETRIEVE_ALL_MESSAGES_WITHIN_RANGE = 4\n\tMETHOD_RETRIEVE_MESSAGES = 5\n\tMETHOD_DELETE_MESSAGES = 6\n\tMETHOD_DELETE_ALL_MESSAGES = 7\n\t\n\tPROTOCOL_ID = 0x17\n\n\nclass MessageDeliveryProtocol:\n\tNORESPONSE = True\n\t\n\tMETHOD_DELIVER_MESSAGE = 1\n\t\n\tPROTOCOL_ID = 0x1B\n\n\nclass MessagingClient(MessagingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def deliver_message(self, message):\n\t\tlogger.info(\"MessagingClient.deliver_message()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELIVER_MESSAGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.modified_message = stream.anydata()\n\t\tobj.sandbox_node_ids = stream.list(stream.u32)\n\t\tobj.participants = stream.list(stream.pid)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.deliver_message -> done\")\n\t\treturn obj\n\t\n\tasync def get_number_of_messages(self, recipient):\n\t\tlogger.info(\"MessagingClient.get_number_of_messages()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(recipient)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_NUMBER_OF_MESSAGES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnumber = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.get_number_of_messages -> done\")\n\t\treturn number\n\t\n\tasync def get_message_headers(self, recipient, range):\n\t\tlogger.info(\"MessagingClient.get_message_headers()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(recipient)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_MESSAGE_HEADERS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\theaders = stream.list(UserMessage)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.get_message_headers -> done\")\n\t\treturn headers\n\t\n\tasync def retrieve_all_messages_within_range(self, recipient, range):\n\t\tlogger.info(\"MessagingClient.retrieve_all_messages_within_range()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(recipient)\n\t\tstream.add(range)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RETRIEVE_ALL_MESSAGES_WITHIN_RANGE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tmessages = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.retrieve_all_messages_within_range -> done\")\n\t\treturn messages\n\t\n\tasync def retrieve_messages(self, recipient, message_ids, leave_on_server):\n\t\tlogger.info(\"MessagingClient.retrieve_messages()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(recipient)\n\t\tstream.list(message_ids, stream.u32)\n\t\tstream.bool(leave_on_server)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_RETRIEVE_MESSAGES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tmessages = stream.list(stream.anydata)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.retrieve_messages -> done\")\n\t\treturn messages\n\t\n\tasync def delete_messages(self, recipient, message_ids):\n\t\tlogger.info(\"MessagingClient.delete_messages()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(recipient)\n\t\tstream.list(message_ids, stream.u32)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_MESSAGES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.delete_messages -> done\")\n\t\n\tasync def delete_all_messages(self, recipient):\n\t\tlogger.info(\"MessagingClient.delete_all_messages()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(recipient)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_ALL_MESSAGES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tnumber_deleted = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MessagingClient.delete_all_messages -> done\")\n\t\treturn number_deleted\n\n\nclass MessageDeliveryClient(MessageDeliveryProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def deliver_message(self, message):\n\t\tlogger.info(\"MessageDeliveryClient.deliver_message()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.anydata(message)\n\t\tawait self.client.request(self.PROTOCOL_ID, self.METHOD_DELIVER_MESSAGE, stream.get(), True)\n\n\nclass MessagingServer(MessagingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_DELIVER_MESSAGE: self.handle_deliver_message,\n\t\t\tself.METHOD_GET_NUMBER_OF_MESSAGES: self.handle_get_number_of_messages,\n\t\t\tself.METHOD_GET_MESSAGE_HEADERS: self.handle_get_message_headers,\n\t\t\tself.METHOD_RETRIEVE_ALL_MESSAGES_WITHIN_RANGE: self.handle_retrieve_all_messages_within_range,\n\t\t\tself.METHOD_RETRIEVE_MESSAGES: self.handle_retrieve_messages,\n\t\t\tself.METHOD_DELETE_MESSAGES: self.handle_delete_messages,\n\t\t\tself.METHOD_DELETE_ALL_MESSAGES: self.handle_delete_all_messages,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MessagingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_deliver_message(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.deliver_message()\")\n\t\t#--- request ---\n\t\tmessage = input.anydata()\n\t\tresponse = await self.deliver_message(client, message)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['modified_message', 'sandbox_node_ids', 'participants']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.anydata(response.modified_message)\n\t\toutput.list(response.sandbox_node_ids, output.u32)\n\t\toutput.list(response.participants, output.pid)\n\t\n\tasync def handle_get_number_of_messages(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.get_number_of_messages()\")\n\t\t#--- request ---\n\t\trecipient = input.extract(MessageRecipient)\n\t\tresponse = await self.get_number_of_messages(client, recipient)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_get_message_headers(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.get_message_headers()\")\n\t\t#--- request ---\n\t\trecipient = input.extract(MessageRecipient)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.get_message_headers(client, recipient, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_retrieve_all_messages_within_range(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.retrieve_all_messages_within_range()\")\n\t\t#--- request ---\n\t\trecipient = input.extract(MessageRecipient)\n\t\trange = input.extract(common.ResultRange)\n\t\tresponse = await self.retrieve_all_messages_within_range(client, recipient, range)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_retrieve_messages(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.retrieve_messages()\")\n\t\t#--- request ---\n\t\trecipient = input.extract(MessageRecipient)\n\t\tmessage_ids = input.list(input.u32)\n\t\tleave_on_server = input.bool()\n\t\tresponse = await self.retrieve_messages(client, recipient, message_ids, leave_on_server)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.anydata)\n\t\n\tasync def handle_delete_messages(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.delete_messages()\")\n\t\t#--- request ---\n\t\trecipient = input.extract(MessageRecipient)\n\t\tmessage_ids = input.list(input.u32)\n\t\tawait self.delete_messages(client, recipient, message_ids)\n\t\n\tasync def handle_delete_all_messages(self, client, input, output):\n\t\tlogger.info(\"MessagingServer.delete_all_messages()\")\n\t\t#--- request ---\n\t\trecipient = input.extract(MessageRecipient)\n\t\tresponse = await self.delete_all_messages(client, recipient)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def deliver_message(self, *args):\n\t\tlogger.warning(\"MessagingServer.deliver_message not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_number_of_messages(self, *args):\n\t\tlogger.warning(\"MessagingServer.get_number_of_messages not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_message_headers(self, *args):\n\t\tlogger.warning(\"MessagingServer.get_message_headers not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def retrieve_all_messages_within_range(self, *args):\n\t\tlogger.warning(\"MessagingServer.retrieve_all_messages_within_range not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def retrieve_messages(self, *args):\n\t\tlogger.warning(\"MessagingServer.retrieve_messages not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_messages(self, *args):\n\t\tlogger.warning(\"MessagingServer.delete_messages not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_all_messages(self, *args):\n\t\tlogger.warning(\"MessagingServer.delete_all_messages not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n\nclass MessageDeliveryServer(MessageDeliveryProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_DELIVER_MESSAGE: self.handle_deliver_message,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MessageDeliveryServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_deliver_message(self, client, input, output):\n\t\tlogger.info(\"MessageDeliveryServer.deliver_message()\")\n\t\t#--- request ---\n\t\tmessage = input.anydata()\n\t\tawait self.deliver_message(client, message)\n\t\n\tasync def deliver_message(self, *args):\n\t\tlogger.warning(\"MessageDeliveryServer.deliver_message not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/monitoring.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass MonitoringProtocol:\n\tMETHOD_PING_DAEMON = 1\n\tMETHOD_GET_CLUSTER_MEMBERS = 2\n\t\n\tPROTOCOL_ID = 0x13\n\n\nclass MonitoringClient(MonitoringProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def ping_daemon(self):\n\t\tlogger.info(\"MonitoringClient.ping_daemon()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PING_DAEMON, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MonitoringClient.ping_daemon -> done\")\n\t\treturn result\n\t\n\tasync def get_cluster_members(self):\n\t\tlogger.info(\"MonitoringClient.get_cluster_members()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CLUSTER_MEMBERS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tmembers = stream.list(stream.string)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"MonitoringClient.get_cluster_members -> done\")\n\t\treturn members\n\n\nclass MonitoringServer(MonitoringProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PING_DAEMON: self.handle_ping_daemon,\n\t\t\tself.METHOD_GET_CLUSTER_MEMBERS: self.handle_get_cluster_members,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on MonitoringServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_ping_daemon(self, client, input, output):\n\t\tlogger.info(\"MonitoringServer.ping_daemon()\")\n\t\t#--- request ---\n\t\tresponse = await self.ping_daemon(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_cluster_members(self, client, input, output):\n\t\tlogger.info(\"MonitoringServer.get_cluster_members()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_cluster_members(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.string)\n\t\n\tasync def ping_daemon(self, *args):\n\t\tlogger.warning(\"MonitoringServer.ping_daemon not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_cluster_members(self, *args):\n\t\tlogger.warning(\"MonitoringServer.get_cluster_members not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/natcheck.py",
    "content": "\r\nfrom anynet import util\r\nimport struct\r\n\r\n\r\nPRIMARY_ADDRESS = \"nncs1-lp1.n.n.srv.nintendo.net\"\r\nPRIMARY_PORT = 10025\r\n\r\n\r\nasync def detect_external_address(socket):\r\n\tmessage = struct.pack(\">IIII\", 1, 0, 0, 0)\r\n\tawait socket.send(message, (PRIMARY_ADDRESS, PRIMARY_PORT))\r\n\t\r\n\twhile True:\r\n\t\tresponse = (await socket.recv())[0]\r\n\t\tif len(response) == 16:\r\n\t\t\ttype, port, host, extra = struct.unpack(\">IIII\", response)\r\n\t\t\tif type == 1:\r\n\t\t\t\treturn util.ip_from_hex(host), port\r\n"
  },
  {
    "path": "nintendo/nex/nattraversal.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass NATTraversalProtocol:\n\tMETHOD_REQUEST_PROBE_INITIATION = 1\n\tMETHOD_INITIATE_PROBE = 2\n\tMETHOD_REQUEST_PROBE_INITIATION_EXT = 3\n\tMETHOD_REPORT_NAT_TRAVERSAL_RESULT = 4\n\tMETHOD_REPORT_NAT_PROPERTIES = 5\n\tMETHOD_GET_RELAY_SIGNATURE_KEY = 6\n\tMETHOD_REPORT_NAT_TRAVERSAL_RESULT_DETAIL = 7\n\t\n\tPROTOCOL_ID = 0x3\n\n\nclass NATTraversalClient(NATTraversalProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def request_probe_initiation(self, target_urls):\n\t\tlogger.info(\"NATTraversalClient.request_probe_initiation()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(target_urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_PROBE_INITIATION, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.request_probe_initiation -> done\")\n\t\n\tasync def initiate_probe(self, station_to_probe):\n\t\tlogger.info(\"NATTraversalClient.initiate_probe()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.stationurl(station_to_probe)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_INITIATE_PROBE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.initiate_probe -> done\")\n\t\n\tasync def request_probe_initiation_ext(self, target_urls, station_to_probe):\n\t\tlogger.info(\"NATTraversalClient.request_probe_initiation_ext()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(target_urls, stream.stationurl)\n\t\tstream.stationurl(station_to_probe)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_PROBE_INITIATION_EXT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.request_probe_initiation_ext -> done\")\n\t\n\tasync def report_nat_traversal_result(self, cid, result):\n\t\tlogger.info(\"NATTraversalClient.report_nat_traversal_result()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(cid)\n\t\tstream.bool(result)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_NAT_TRAVERSAL_RESULT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.report_nat_traversal_result -> done\")\n\t\n\tasync def report_nat_properties(self, natm, natf, rtt):\n\t\tlogger.info(\"NATTraversalClient.report_nat_properties()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(natm)\n\t\tstream.u32(natf)\n\t\tstream.u32(rtt)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_NAT_PROPERTIES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.report_nat_properties -> done\")\n\t\n\tasync def get_relay_signature_key(self):\n\t\tlogger.info(\"NATTraversalClient.get_relay_signature_key()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RELAY_SIGNATURE_KEY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.mode = stream.s32()\n\t\tobj.time = stream.datetime()\n\t\tobj.address = stream.string()\n\t\tobj.port = stream.u16()\n\t\tobj.address_type = stream.s32()\n\t\tobj.game_server_id = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.get_relay_signature_key -> done\")\n\t\treturn obj\n\t\n\tasync def report_nat_traversal_result_detail(self, cid, result, detail, rtt):\n\t\tlogger.info(\"NATTraversalClient.report_nat_traversal_result_detail()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(cid)\n\t\tstream.bool(result)\n\t\tstream.s32(detail)\n\t\tstream.u32(rtt)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPORT_NAT_TRAVERSAL_RESULT_DETAIL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"NATTraversalClient.report_nat_traversal_result_detail -> done\")\n\n\nclass NATTraversalServer(NATTraversalProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REQUEST_PROBE_INITIATION: self.handle_request_probe_initiation,\n\t\t\tself.METHOD_INITIATE_PROBE: self.handle_initiate_probe,\n\t\t\tself.METHOD_REQUEST_PROBE_INITIATION_EXT: self.handle_request_probe_initiation_ext,\n\t\t\tself.METHOD_REPORT_NAT_TRAVERSAL_RESULT: self.handle_report_nat_traversal_result,\n\t\t\tself.METHOD_REPORT_NAT_PROPERTIES: self.handle_report_nat_properties,\n\t\t\tself.METHOD_GET_RELAY_SIGNATURE_KEY: self.handle_get_relay_signature_key,\n\t\t\tself.METHOD_REPORT_NAT_TRAVERSAL_RESULT_DETAIL: self.handle_report_nat_traversal_result_detail,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on NATTraversalServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_request_probe_initiation(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.request_probe_initiation()\")\n\t\t#--- request ---\n\t\ttarget_urls = input.list(input.stationurl)\n\t\tawait self.request_probe_initiation(client, target_urls)\n\t\n\tasync def handle_initiate_probe(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.initiate_probe()\")\n\t\t#--- request ---\n\t\tstation_to_probe = input.stationurl()\n\t\tawait self.initiate_probe(client, station_to_probe)\n\t\n\tasync def handle_request_probe_initiation_ext(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.request_probe_initiation_ext()\")\n\t\t#--- request ---\n\t\ttarget_urls = input.list(input.stationurl)\n\t\tstation_to_probe = input.stationurl()\n\t\tawait self.request_probe_initiation_ext(client, target_urls, station_to_probe)\n\t\n\tasync def handle_report_nat_traversal_result(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.report_nat_traversal_result()\")\n\t\t#--- request ---\n\t\tcid = input.u32()\n\t\tresult = input.bool()\n\t\tawait self.report_nat_traversal_result(client, cid, result)\n\t\n\tasync def handle_report_nat_properties(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.report_nat_properties()\")\n\t\t#--- request ---\n\t\tnatm = input.u32()\n\t\tnatf = input.u32()\n\t\trtt = input.u32()\n\t\tawait self.report_nat_properties(client, natm, natf, rtt)\n\t\n\tasync def handle_get_relay_signature_key(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.get_relay_signature_key()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_relay_signature_key(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['mode', 'time', 'address', 'port', 'address_type', 'game_server_id']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.s32(response.mode)\n\t\toutput.datetime(response.time)\n\t\toutput.string(response.address)\n\t\toutput.u16(response.port)\n\t\toutput.s32(response.address_type)\n\t\toutput.u32(response.game_server_id)\n\t\n\tasync def handle_report_nat_traversal_result_detail(self, client, input, output):\n\t\tlogger.info(\"NATTraversalServer.report_nat_traversal_result_detail()\")\n\t\t#--- request ---\n\t\tcid = input.u32()\n\t\tresult = input.bool()\n\t\tdetail = input.s32()\n\t\trtt = input.u32()\n\t\tawait self.report_nat_traversal_result_detail(client, cid, result, detail, rtt)\n\t\n\tasync def request_probe_initiation(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.request_probe_initiation not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def initiate_probe(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.initiate_probe not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_probe_initiation_ext(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.request_probe_initiation_ext not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_nat_traversal_result(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.report_nat_traversal_result not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_nat_properties(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.report_nat_properties not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_relay_signature_key(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.get_relay_signature_key not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def report_nat_traversal_result_detail(self, *args):\n\t\tlogger.warning(\"NATTraversalServer.report_nat_traversal_result_detail not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/nintendonotification.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass NintendoNotificationType:\n\tLOGOUT = 10\n\tPRESENCE_CHANGE = 24\n\tUNFRIENDED = 26\n\tFRIENDED = 30\n\tSTATUS_CHANGE = 33\n\n\nclass u8KeyValue(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.u8()\n\t\tself.value = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.key)\n\t\tstream.u8(self.value)\ncommon.DataHolder.register(u8KeyValue, \"u8KeyValue\")\n\n\nclass u32KeyValue(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.u8()\n\t\tself.value = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.key)\n\t\tstream.u32(self.value)\ncommon.DataHolder.register(u32KeyValue, \"u32KeyValue\")\n\n\nclass u64KeyValue(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.u8()\n\t\tself.value = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.key)\n\t\tstream.u64(self.value)\ncommon.DataHolder.register(u64KeyValue, \"u64KeyValue\")\n\n\nclass StringKeyValue(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.key = None\n\t\tself.value = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['key', 'value']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.key = stream.u8()\n\t\tself.value = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.key)\n\t\tstream.string(self.value)\ncommon.DataHolder.register(StringKeyValue, \"StringKeyValue\")\n\n\nclass NintendoNotificationEvent(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.type = None\n\t\tself.pid = None\n\t\tself.data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['type', 'pid', 'data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.type = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.data = stream.anydata()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.type)\n\t\tstream.pid(self.pid)\n\t\tstream.anydata(self.data)\n\n\nclass NintendoNotificationEventGeneral(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.param1 = None\n\t\tself.param2 = None\n\t\tself.param3 = None\n\t\tself.text = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['param1', 'param2', 'param3', 'text']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.param1 = stream.u32()\n\t\tself.param2 = stream.u64()\n\t\tself.param3 = stream.u64()\n\t\tself.text = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.param1)\n\t\tstream.u64(self.param2)\n\t\tstream.u64(self.param3)\n\t\tstream.string(self.text)\ncommon.DataHolder.register(NintendoNotificationEventGeneral, \"NintendoNotificationEventGeneral\")\n\n\nclass NintendoNotificationEventKeyValue(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.u8 = None\n\t\tself.u32 = None\n\t\tself.u64 = None\n\t\tself.string = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['u8', 'u32', 'u64', 'string']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.u8 = stream.list(u8KeyValue)\n\t\tself.u32 = stream.list(u32KeyValue)\n\t\tself.u64 = stream.list(u64KeyValue)\n\t\tself.string = stream.list(StringKeyValue)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.u8, stream.add)\n\t\tstream.list(self.u32, stream.add)\n\t\tstream.list(self.u64, stream.add)\n\t\tstream.list(self.string, stream.add)\ncommon.DataHolder.register(NintendoNotificationEventKeyValue, \"NintendoNotificationEventKeyValue\")\n\n\nclass NintendoNotificationEventProfile(common.Data):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.region = None\n\t\tself.country = None\n\t\tself.area = None\n\t\tself.language = None\n\t\tself.platform = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['region', 'country', 'area', 'language', 'platform']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.region = stream.u8()\n\t\tself.country = stream.u8()\n\t\tself.area = stream.u8()\n\t\tself.language = stream.u8()\n\t\tself.platform = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.region)\n\t\tstream.u8(self.country)\n\t\tstream.u8(self.area)\n\t\tstream.u8(self.language)\n\t\tstream.u8(self.platform)\ncommon.DataHolder.register(NintendoNotificationEventProfile, \"NintendoNotificationEventProfile\")\n\n\nclass NintendoNotificationProtocol:\n\tNORESPONSE = True\n\t\n\tMETHOD_PROCESS_NINTENDO_NOTIFICATION_EVENT = 1\n\tMETHOD_PROCESS_NINTENDO_NOTIFICATION_EVENT_ALT = 2\n\t\n\tPROTOCOL_ID = 0x64\n\n\nclass NintendoNotificationClient(NintendoNotificationProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def process_nintendo_notification_event(self, event):\n\t\tlogger.info(\"NintendoNotificationClient.process_nintendo_notification_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(event)\n\t\tawait self.client.request(self.PROTOCOL_ID, self.METHOD_PROCESS_NINTENDO_NOTIFICATION_EVENT, stream.get(), True)\n\t\n\tasync def process_nintendo_notification_event_alt(self, event):\n\t\tlogger.info(\"NintendoNotificationClient.process_nintendo_notification_event_alt()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(event)\n\t\tawait self.client.request(self.PROTOCOL_ID, self.METHOD_PROCESS_NINTENDO_NOTIFICATION_EVENT_ALT, stream.get(), True)\n\n\nclass NintendoNotificationServer(NintendoNotificationProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PROCESS_NINTENDO_NOTIFICATION_EVENT: self.handle_process_nintendo_notification_event,\n\t\t\tself.METHOD_PROCESS_NINTENDO_NOTIFICATION_EVENT_ALT: self.handle_process_nintendo_notification_event_alt,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on NintendoNotificationServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_process_nintendo_notification_event(self, client, input, output):\n\t\tlogger.info(\"NintendoNotificationServer.process_nintendo_notification_event()\")\n\t\t#--- request ---\n\t\tevent = input.extract(NintendoNotificationEvent)\n\t\tawait self.process_nintendo_notification_event(client, event)\n\t\n\tasync def handle_process_nintendo_notification_event_alt(self, client, input, output):\n\t\tlogger.info(\"NintendoNotificationServer.process_nintendo_notification_event_alt()\")\n\t\t#--- request ---\n\t\tevent = input.extract(NintendoNotificationEvent)\n\t\tawait self.process_nintendo_notification_event_alt(client, event)\n\t\n\tasync def process_nintendo_notification_event(self, *args):\n\t\tlogger.warning(\"NintendoNotificationServer.process_nintendo_notification_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def process_nintendo_notification_event_alt(self, *args):\n\t\tlogger.warning(\"NintendoNotificationServer.process_nintendo_notification_event_alt not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/notification.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass NotificationEvent(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.type = None\n\t\tself.param1 = 0\n\t\tself.param2 = 0\n\t\tself.text = \"\"\n\t\tself.param3 = 0\n\t\tself.map = {}\n\t\n\tdef max_version(self, settings):\n\t\tversion = 0\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tversion = 1\n\t\treturn version\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'type']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 30500:\n\t\t\tpass\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tif version >= 1:\n\t\t\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.type = stream.u32()\n\t\tself.param1 = stream.pid()\n\t\tself.param2 = stream.pid()\n\t\tself.text = stream.string()\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tself.param3 = stream.pid()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tif version >= 1:\n\t\t\t\tself.map = stream.map(stream.string, stream.variant)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.type)\n\t\tstream.pid(self.param1)\n\t\tstream.pid(self.param2)\n\t\tstream.string(self.text)\n\t\tif stream.settings[\"nex.version\"] >= 30500:\n\t\t\tstream.pid(self.param3)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tif version >= 1:\n\t\t\t\tstream.map(self.map, stream.string, stream.variant)\n\n\nclass NotificationProtocol:\n\tNORESPONSE = True\n\t\n\tMETHOD_PROCESS_NOTIFICATION_EVENT = 1\n\t\n\tPROTOCOL_ID = 0xE\n\n\nclass NotificationClient(NotificationProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def process_notification_event(self, event):\n\t\tlogger.info(\"NotificationClient.process_notification_event()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(event)\n\t\tawait self.client.request(self.PROTOCOL_ID, self.METHOD_PROCESS_NOTIFICATION_EVENT, stream.get(), True)\n\n\nclass NotificationServer(NotificationProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PROCESS_NOTIFICATION_EVENT: self.handle_process_notification_event,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on NotificationServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_process_notification_event(self, client, input, output):\n\t\tlogger.info(\"NotificationServer.process_notification_event()\")\n\t\t#--- request ---\n\t\tevent = input.extract(NotificationEvent)\n\t\tawait self.process_notification_event(client, event)\n\t\n\tasync def process_notification_event(self, *args):\n\t\tlogger.warning(\"NotificationServer.process_notification_event not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/prudp.py",
    "content": "\nfrom Crypto.Cipher import ARC4\nfrom anynet import udp, tls, websocket, util, \\\n\tscheduler, streams, queue\nfrom nintendo.nex import kerberos, streams as streams_nex\nimport contextlib\nimport hashlib\nimport struct\nimport random\nimport socket\nimport anyio\nimport zlib\nimport hmac\nimport time\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nTYPE_SYN = 0\nTYPE_CONNECT = 1\nTYPE_DATA = 2\nTYPE_DISCONNECT = 3\nTYPE_PING = 4\nTYPE_USER = 5\nTYPE_ROUTE = 6\nTYPE_RAW = 7\n\nFLAG_ACK = 1\nFLAG_RELIABLE = 2\nFLAG_NEED_ACK = 4\nFLAG_HAS_SIZE = 8\nFLAG_MULTI_ACK = 0x200\n\nTYPE_NAMES = [\"TYPE_SYN\", \"TYPE_CONNECT\", \"TYPE_DATA\", \"TYPE_DISCONNECT\", \"TYPE_PING\", \"TYPE_USER\", \"TYPE_ROUTE\", \"TYPE_RAW\"]\n\nFLAG_NAMES = {\n\tFLAG_ACK: \"ACK\",\n\tFLAG_NEED_ACK: \"NEED_ACK\",\n\tFLAG_MULTI_ACK: \"MULTI_ACK\",\n\tFLAG_RELIABLE: \"RELIABLE\",\n\tFLAG_HAS_SIZE: \"HAS_SIZE\"\n}\n\nFLAG_LIST = [FLAG_ACK, FLAG_NEED_ACK, FLAG_MULTI_ACK, FLAG_RELIABLE, FLAG_HAS_SIZE]\n\nOPTION_SUPPORT = 0\nOPTION_CONNECTION_SIG = 1\nOPTION_FRAGMENT_ID = 2\nOPTION_UNRELIABLE_SEQ_ID = 3\nOPTION_MAX_SUBSTREAM_ID = 4\nOPTION_CONNECTION_SIG_LITE = 128\n\nOPTIONS = {\n\tOPTION_SUPPORT: (4, \"OPTION_SUPPORT\", \"I\"),\n\tOPTION_CONNECTION_SIG: (16, \"OPTION_CONNECTION_SIG\", \"16s\"),\n\tOPTION_FRAGMENT_ID: (1, \"OPTION_FRAGMENT_ID\", \"B\"),\n\tOPTION_UNRELIABLE_SEQ_ID: (2, \"OPTION_UNRELIABLE_SEQ_ID\", \"H\"),\n\tOPTION_MAX_SUBSTREAM_ID: (1, \"OPTION_MAX_SUBSTREAM_ID\", \"B\"),\n\tOPTION_CONNECTION_SIG_LITE: (16, \"OPTION_CONNECTION_SIG_LITE\", \"16s\")\n}\n\nSTATE_CONNECTING = 0\nSTATE_CONNECTED = 1\nSTATE_DISCONNECTING = 2\nSTATE_DISCONNECTED = 3\n\n\ndef encode_options(options):\n\tdata = b\"\"\n\tfor k, v in options.items():\n\t\tsize, name, type = OPTIONS[k]\n\t\tdata += struct.pack(\"<BB%s\" %type, k, size, v)\n\treturn data\n\ndef decode_options(data):\n\toptions = {}\n\tstream = streams.StreamIn(data, \"<\")\n\twhile not stream.eof():\n\t\ttype = stream.u8()\n\t\tlength = stream.u8()\n\t\t\n\t\tif type not in OPTIONS:\n\t\t\traise ValueError(\"(Opt) Unrecognized option type: %i\" %type)\n\t\t\n\t\texpected_length, name, format = OPTIONS[type]\n\t\tif length != expected_length:\n\t\t\traise ValueError(\"(Opt) Invalid option length in %s\" %name)\n\t\t\n\t\tif type in options:\n\t\t\traise ValueError(\"(Opt) %s is present more than once\" %name)\n\t\t\n\t\tvalue = struct.unpack(\"<\" + format, stream.read(length))[0]\n\t\toptions[type] = value\n\treturn options\n\t\n\nclass PRUDPPacket:\n\tdef __init__(self, type=None, flags=None):\n\t\tself.type = type\n\t\tself.flags = flags\n\t\t\n\t\tself.version = None\n\t\tself.source_type = None\n\t\tself.source_port = None\n\t\tself.dest_type = None\n\t\tself.dest_port = None\n\t\tself.session_id = 0\n\t\tself.packet_id = 0\n\t\tself.fragment_id = 0\n\t\tself.substream_id = 0\n\t\tself.connection_signature = None\n\t\tself.initial_unreliable_id = 0\n\t\tself.max_substream_id = 0\n\t\tself.supported_functions = 0\n\t\tself.minor_version = 0\n\t\tself.signature = None\n\t\t\n\t\tself.payload = b\"\"\n\t\t\n\tdef __repr__(self):\n\t\tflags = []\n\t\tfor flag in FLAG_LIST:\n\t\t\tif self.flags & flag:\n\t\t\t\tflags.append(FLAG_NAMES[flag])\n\t\tflags = \",\".join(flags)\n\t\t\n\t\treturn \"<PRUDPPacket type=%s flags=%s seq=%i frag=%i>\" %(\n\t\t\tTYPE_NAMES[self.type], flags, self.packet_id, self.fragment_id\n\t\t)\n\n\t\t\nclass PRUDPMessageV0:\n\tdef __init__(self, settings):\n\t\tself.signature_version = settings[\"prudp_v0.signature_version\"]\n\t\tself.checksum_version = settings[\"prudp_v0.checksum_version\"]\n\t\tself.flags_version = settings[\"prudp_v0.flags_version\"]\n\t\t\n\t\tself.access_key = settings[\"prudp.access_key\"].encode()\n\t\n\tdef signature_size(self): return 4\n\t\n\tdef calc_checksum(self, data):\n\t\tchecksum = sum(self.access_key)\n\t\tif self.checksum_version == 0:\n\t\t\tdata = data.ljust((len(data) + 3) & ~3, b\"\\0\")\n\t\t\twords = struct.unpack(\"<%iI\" %(len(data) // 4), data)\n\t\t\treturn ((checksum & 0xFF) + sum(words)) & 0xFFFFFFFF\n\n\t\telse:\n\t\t\twords = struct.unpack_from(\"<%iI\" %(len(data) // 4), data)\n\t\t\ttemp = sum(words) & 0xFFFFFFFF\n\t\t\t\n\t\t\tchecksum += sum(data[len(data) & ~3:])\n\t\t\tchecksum += sum(struct.pack(\"<I\", temp))\n\t\t\treturn checksum & 0xFF\n\t\n\tdef calc_data_signature(self, packet, session_key):\n\t\tdata = packet.payload\n\t\tif self.signature_version == 0:\n\t\t\theader = struct.pack(\"<HB\", packet.packet_id, packet.fragment_id)\n\t\t\tdata = session_key + header + data\n\n\t\tif data:\n\t\t\tkey = hashlib.md5(self.access_key).digest()\n\t\t\tdigest = hmac.digest(key, data, hashlib.md5)\n\t\t\treturn digest[:4]\n\t\treturn struct.pack(\"<I\", 0x12345678)\n\t\t\n\tdef calc_packet_signature(self, packet, session_key, connection_signature):\n\t\tif packet.type == TYPE_DATA:\n\t\t\treturn self.calc_data_signature(packet, session_key)\n\t\tif packet.type == TYPE_DISCONNECT and self.signature_version == 0:\n\t\t\treturn self.calc_data_signature(packet, session_key)\n\t\tif connection_signature:\n\t\t\treturn connection_signature\n\t\treturn bytes(4)\n\t\n\tdef calc_connection_signature(self, addr):\n\t\tdata = socket.inet_aton(addr[0]) + struct.pack(\">H\", addr[1])\n\t\treturn hashlib.md5(data).digest()[3::-1]\n\t\t\n\tdef encode(self, packet):\n\t\tstream = streams.StreamOut(\"<\")\n\t\tstream.u8(packet.source_port | (packet.source_type << 4))\n\t\tstream.u8(packet.dest_port | (packet.dest_type << 4))\n\t\tif self.flags_version == 0:\n\t\t\tstream.u8(packet.type | (packet.flags << 3))\n\t\telse:\n\t\t\tstream.u16(packet.type | (packet.flags << 4))\n\t\tstream.u8(packet.session_id)\n\t\tstream.write(packet.signature)\n\t\tstream.u16(packet.packet_id)\n\t\tself.encode_options(packet, stream)\n\t\tstream.write(packet.payload)\n\t\t\n\t\tdata = stream.get()\n\t\tif self.checksum_version == 0:\n\t\t\tdata += struct.pack(\"<I\", self.calc_checksum(data))\n\t\telse:\n\t\t\tdata += struct.pack(\"<B\", self.calc_checksum(data))\n\t\treturn data\n\t\n\tdef encode_options(self, packet, stream):\n\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\tstream.write(packet.connection_signature)\n\t\tif packet.type == TYPE_DATA:\n\t\t\tstream.u8(packet.fragment_id)\n\t\tif packet.flags & FLAG_HAS_SIZE:\n\t\t\tstream.u16(len(packet.payload))\n\t\n\tdef decode(self, data):\n\t\tpackets = []\n\t\t\n\t\tstream = streams.StreamIn(data, \"<\")\n\t\twhile not stream.eof():\n\t\t\tstart = stream.tell()\n\t\t\n\t\t\tsource = stream.u8()\n\t\t\tdest = stream.u8()\n\t\t\t\n\t\t\tpacket = PRUDPPacket()\n\t\t\tpacket.version = 0\n\t\t\tpacket.source_type = source >> 4\n\t\t\tpacket.source_port = source & 0xF\n\t\t\tpacket.dest_type = dest >> 4\n\t\t\tpacket.dest_port = dest & 0xF\n\t\t\t\n\t\t\tif self.flags_version == 0:\n\t\t\t\ttype_flags = stream.u8()\n\t\t\t\tpacket.flags = type_flags >> 3\n\t\t\t\tpacket.type = type_flags & 7\n\t\t\telse:\n\t\t\t\ttype_flags = stream.u16()\n\t\t\t\tpacket.flags = type_flags >> 4\n\t\t\t\tpacket.type = type_flags & 0xF\n\t\t\t\t\n\t\t\tpacket.session_id = stream.u8()\n\t\t\tpacket.signature = stream.read(4)\n\t\t\tpacket.packet_id = stream.u16()\n\t\t\t\n\t\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\t\tpacket.connection_signature = stream.read(4)\n\t\t\tif packet.type == TYPE_DATA:\n\t\t\t\tpacket.fragment_id = stream.u8()\n\t\t\t\n\t\t\tif packet.flags & FLAG_HAS_SIZE:\n\t\t\t\tpayload_size = stream.u16()\n\t\t\telse:\n\t\t\t\tif self.checksum_version == 0:\n\t\t\t\t\tpayload_size = stream.available() - 4\n\t\t\t\telse:\n\t\t\t\t\tpayload_size = stream.available() - 1\n\t\t\tpacket.payload = stream.read(payload_size)\n\t\t\t\n\t\t\t# Check packet checksum\n\t\t\tend = stream.tell()\n\t\t\tchecksum_data = stream.get()[start : end]\n\t\t\texpected_checksum = self.calc_checksum(checksum_data)\n\t\t\t\n\t\t\tif self.checksum_version == 0:\n\t\t\t\tchecksum = stream.u32()\n\t\t\telse:\n\t\t\t\tchecksum = stream.u8()\n\t\t\t\t\n\t\t\tif checksum != expected_checksum:\n\t\t\t\traise ValueError(\"(V0) Invalid checksum (expected %i, got %i)\" %(expected_checksum, checksum))\n\t\t\t\n\t\t\t# Checksum is good!\n\t\t\tpackets.append(packet)\n\t\treturn packets\n\n\nclass PRUDPMessageV1:\n\tdef __init__(self, settings):\n\t\tself.access_key = settings[\"prudp.access_key\"].encode()\n\t\n\tdef signature_size(self): return 16\n\t\n\tdef calc_packet_signature(self, packet, session_key, connection_signature):\n\t\toptions = self.encode_options(packet)\n\t\theader = self.encode_header(packet, len(options))\n\t\t\n\t\tkey = hashlib.md5(self.access_key).digest()\n\t\tmac = hmac.new(key, digestmod=hashlib.md5)\n\t\tmac.update(header[4:])\n\t\tmac.update(session_key)\n\t\tmac.update(struct.pack(\"<I\", sum(self.access_key)))\n\t\tmac.update(connection_signature)\n\t\tmac.update(options)\n\t\tmac.update(packet.payload)\n\t\treturn mac.digest()\n\t\t\n\tdef calc_connection_signature(self, addr):\n\t\tkey = bytes.fromhex(\"26c31f381e46d6eb38e1af6ab70d11\")\n\t\tdata = socket.inet_aton(addr[0]) + struct.pack(\">H\", addr[1])\n\t\treturn hmac.digest(key, data, hashlib.md5)\n\t\n\tdef encode(self, packet):\n\t\toptions = self.encode_options(packet)\n\t\theader = self.encode_header(packet, len(options))\n\t\treturn b\"\\xEA\\xD0\" + header + packet.signature + options + packet.payload\n\t\n\tdef encode_header(self, packet, option_size):\n\t\tstream = streams.StreamOut(\"<\")\n\t\tstream.u8(1) # PRUDP version\n\t\tstream.u8(option_size)\n\t\tstream.u16(len(packet.payload))\n\t\tstream.u8(packet.source_port | (packet.source_type << 4))\n\t\tstream.u8(packet.dest_port | (packet.dest_type << 4))\n\t\tstream.u16(packet.type | (packet.flags << 4))\n\t\tstream.u8(packet.session_id)\n\t\tstream.u8(packet.substream_id)\n\t\tstream.u16(packet.packet_id)\n\t\treturn stream.get()\n\t\n\tdef encode_options(self, packet):\n\t\toptions = {}\n\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\toptions[OPTION_SUPPORT] = packet.minor_version | (packet.supported_functions << 8)\n\t\t\toptions[OPTION_CONNECTION_SIG] = packet.connection_signature\n\t\t\tif packet.type == TYPE_CONNECT:\n\t\t\t\toptions[OPTION_UNRELIABLE_SEQ_ID] = packet.initial_unreliable_id\n\t\t\toptions[OPTION_MAX_SUBSTREAM_ID] = packet.max_substream_id\n\t\telif packet.type == TYPE_DATA:\n\t\t\toptions[OPTION_FRAGMENT_ID] = packet.fragment_id\n\t\treturn encode_options(options)\n\t\t\n\tdef verify_options(self, packet, options):\n\t\tkeys = set(options)\n\t\tif packet.type == TYPE_SYN:\n\t\t\treturn keys == {OPTION_SUPPORT, OPTION_CONNECTION_SIG, OPTION_MAX_SUBSTREAM_ID}\n\t\tif packet.type == TYPE_CONNECT:\n\t\t\treturn keys == {OPTION_SUPPORT, OPTION_CONNECTION_SIG, OPTION_UNRELIABLE_SEQ_ID, OPTION_MAX_SUBSTREAM_ID}\n\t\tif packet.type == TYPE_DATA:\n\t\t\treturn keys == {OPTION_FRAGMENT_ID}\n\t\treturn keys == set()\n\t\t\n\tdef decode(self, data):\n\t\tpackets = []\n\t\t\n\t\tstream = streams.StreamIn(data, \"<\")\n\t\twhile not stream.eof():\n\t\t\tif stream.read(2) != b\"\\xEA\\xD0\":\n\t\t\t\traise ValueError(\"(V1) Invalid magic number\")\n\t\t\t\t\n\t\t\theader = stream.peek(12)\n\t\t\t\n\t\t\tif stream.u8() != 1:\n\t\t\t\traise ValueError(\"(V1) Version check failed\")\n\t\t\t\n\t\t\toption_size = stream.u8()\n\t\t\tpayload_size = stream.u16()\n\t\t\tsource = stream.u8()\n\t\t\tdest = stream.u8()\n\t\t\ttype_flags = stream.u16()\n\t\t\t\n\t\t\tpacket = PRUDPPacket()\n\t\t\tpacket.version = 1\n\t\t\tpacket.source_type = source >> 4\n\t\t\tpacket.source_port = source & 0xF\n\t\t\tpacket.dest_type = dest >> 4\n\t\t\tpacket.dest_port = dest & 0xF\n\t\t\tpacket.flags = type_flags >> 4\n\t\t\tpacket.type = type_flags & 0xF\n\t\t\tpacket.session_id = stream.u8()\n\t\t\tpacket.substream_id = stream.u8()\n\t\t\tpacket.packet_id = stream.u16()\n\t\t\t\n\t\t\tpacket.signature = stream.read(16)\n\t\t\t\n\t\t\toption_data = stream.read(option_size)\n\t\t\toptions = decode_options(option_data)\n\t\t\t\n\t\t\tif not self.verify_options(packet, options):\n\t\t\t\traise ValueError(\"(V1) Received unexpected set of options\")\n\t\t\t\n\t\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\t\tpacket.minor_version = options[OPTION_SUPPORT] & 0xFF\n\t\t\t\tpacket.supported_functions = options[OPTION_SUPPORT] >> 8\n\t\t\t\tpacket.connection_signature = options[OPTION_CONNECTION_SIG]\n\t\t\t\tpacket.max_substream_id = options[OPTION_MAX_SUBSTREAM_ID]\n\t\t\tif packet.type == TYPE_CONNECT:\n\t\t\t\tpacket.initial_unreliable_id = options[OPTION_UNRELIABLE_SEQ_ID]\n\t\t\tif packet.type == TYPE_DATA:\n\t\t\t\tpacket.fragment_id = options[OPTION_FRAGMENT_ID]\n\t\t\t\n\t\t\tpacket.payload = stream.read(payload_size)\n\t\t\t\n\t\t\tpackets.append(packet)\n\t\treturn packets\n\t\t\n\nclass PRUDPLiteMessage:\n\tdef __init__(self, settings):\n\t\tself.access_key = settings[\"prudp.access_key\"].encode()\n\t\t\n\t\tself.buffer = b\"\"\n\t\t\n\tdef signature_size(self): return 16\n\n\tdef calc_packet_signature(self, packet, session_key, connection_signature):\n\t\tif packet.type == TYPE_CONNECT and packet.flags & FLAG_NEED_ACK:\n\t\t\tkey = hashlib.md5(self.access_key).digest()\n\t\t\treturn hmac.digest(key, key + connection_signature, hashlib.md5)\n\t\treturn None\n\t\n\tdef calc_connection_signature(self, addr):\n\t\tkey = bytes.fromhex(\"26c31f381e46d6eb38e1af6ab70d11\")\n\t\tdata = socket.inet_aton(addr[0]) + struct.pack(\">H\", addr[1])\n\t\treturn hmac.digest(key, data, hashlib.md5)\n\t\n\tdef encode(self, packet):\n\t\toptions = self.encode_options(packet)\n\t\theader = self.encode_header(packet, len(options))\n\t\treturn header + options + packet.payload\n\t\n\tdef encode_header(self, packet, option_size):\n\t\tstream = streams.StreamOut(\"<\")\n\t\tstream.u8(0x80)\n\t\tstream.u8(option_size)\n\t\tstream.u16(len(packet.payload))\n\t\tstream.u8((packet.source_type << 4) | packet.dest_type)\n\t\tstream.u8(packet.source_port)\n\t\tstream.u8(packet.dest_port)\n\t\tstream.u8(packet.fragment_id)\n\t\tstream.u16(packet.type | (packet.flags << 4))\n\t\tstream.u16(packet.packet_id)\n\t\treturn stream.get()\n\t\n\tdef encode_options(self, packet):\n\t\toptions = {}\n\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\toptions[OPTION_SUPPORT] = packet.minor_version | (packet.supported_functions << 8)\n\t\tif packet.type == TYPE_SYN and packet.flags & FLAG_ACK:\n\t\t\toptions[OPTION_CONNECTION_SIG] = packet.connection_signature\n\t\tif packet.type == TYPE_CONNECT and not packet.flags & FLAG_ACK:\n\t\t\toptions[OPTION_CONNECTION_SIG_LITE] = packet.signature\n\t\treturn encode_options(options)\n\t\n\tdef verify_options(self, packet, options):\n\t\tkeys = set(options)\n\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\tif packet.type == TYPE_SYN and packet.flags & FLAG_ACK:\n\t\t\t\treturn keys == {OPTION_SUPPORT, OPTION_CONNECTION_SIG}\n\t\t\tif packet.type == TYPE_CONNECT and not packet.flags & FLAG_ACK:\n\t\t\t\treturn keys == {OPTION_SUPPORT, OPTION_CONNECTION_SIG_LITE}\n\t\t\treturn keys == {OPTION_SUPPORT}\n\t\treturn keys == set()\n\t\n\tdef decode(self, data):\n\t\tself.buffer += data\n\t\t\n\t\tpackets = []\n\t\twhile self.buffer:\n\t\t\tif len(self.buffer) < 12: return packets\n\t\t\t\n\t\t\tstream = streams.StreamIn(self.buffer, \"<\")\n\t\t\tif stream.u8() != 0x80:\n\t\t\t\traise ValueError(\"(Lite) Invalid magic number\")\n\t\t\t\n\t\t\toption_size = stream.u8()\n\t\t\tpayload_size = stream.u16()\n\t\t\tif len(self.buffer) < 12 + option_size + payload_size:\n\t\t\t\treturn packets\n\t\t\t\n\t\t\tself.buffer = self.buffer[12 + option_size + payload_size:]\n\t\t\t\n\t\t\tpacket = PRUDPPacket()\n\t\t\t\n\t\t\tstream_types = stream.u8()\n\t\t\tpacket.source_type = stream_types >> 4\n\t\t\tpacket.dest_type = stream_types & 0xF\n\t\t\t\n\t\t\tpacket.source_port = stream.u8()\n\t\t\tpacket.dest_port = stream.u8()\n\t\t\tpacket.fragment_id = stream.u8()\n\t\t\t\n\t\t\ttype_flags = stream.u16()\n\t\t\tpacket.flags = type_flags >> 4\n\t\t\tpacket.type = type_flags & 0xF\n\t\t\t\n\t\t\tpacket.packet_id = stream.u16()\n\t\t\tpacket.session_id = 0\n\t\t\t\n\t\t\toption_data = stream.read(option_size)\n\t\t\toptions = decode_options(option_data)\n\t\t\t\n\t\t\tif not self.verify_options(packet, options):\n\t\t\t\traise ValueError(\"(Lite) Received unexpected set of options\")\n\t\t\t\n\t\t\tpacket.connection_signature = b\"\"\n\t\t\tif packet.type in [TYPE_SYN, TYPE_CONNECT]:\n\t\t\t\tpacket.minor_version = options[OPTION_SUPPORT] & 0xFF\n\t\t\t\tpacket.supported_functions = options[OPTION_SUPPORT] >> 8\n\t\t\tif packet.type == TYPE_SYN and packet.flags & FLAG_ACK:\n\t\t\t\tpacket.connection_signature = options[OPTION_CONNECTION_SIG]\n\t\t\tif packet.type == TYPE_CONNECT and not packet.flags & FLAG_ACK:\n\t\t\t\tpacket.signature = options[OPTION_CONNECTION_SIG_LITE]\n\t\t\t\n\t\t\tpacket.payload = stream.read(payload_size)\n\t\t\tpackets.append(packet)\n\t\treturn packets\n\t\t\n\t\t\nclass PRUDPMessageSelector:\n\tdef __init__(self, settings):\n\t\tself.settings = settings\n\t\tself.v0 = PRUDPMessageV0(settings)\n\t\tself.v1 = PRUDPMessageV1(settings)\n\t\tself.lite = PRUDPLiteMessage(settings)\n\t\t\n\tdef select(self, version):\n\t\tif self.settings[\"prudp.transport\"] == self.settings.TRANSPORT_UDP:\n\t\t\tif version == 0:\n\t\t\t\treturn self.v0\n\t\t\treturn self.v1\n\t\treturn self.lite\n\t\n\tdef analyze(self, data):\n\t\tif self.settings[\"prudp.transport\"] == self.settings.TRANSPORT_UDP:\n\t\t\tif self.settings[\"prudp.version\"] == 2:\n\t\t\t\tif data[:3] == b\"\\xEA\\xD0\\x01\":\n\t\t\t\t\treturn self.v1\n\t\t\t\treturn self.v0\n\t\treturn self.select(self.settings[\"prudp.version\"])\n\t\n\tdef signature_size(self, version=None):\n\t\treturn self.select(version).signature_size()\n\tdef calc_packet_signature(self, packet, session_key, connection_signature):\n\t\treturn self.select(packet.version).calc_packet_signature(packet, session_key, connection_signature)\n\tdef calc_connection_signature(self, addr, version=None):\n\t\treturn self.select(version).calc_connection_signature(addr)\n\tdef encode(self, packet):\n\t\treturn self.select(packet.version).encode(packet)\n\tdef decode(self, data):\n\t\treturn self.analyze(data).decode(data)\n\t\n\t\nclass RC4Encryption:\n\tdef __init__(self, key):\n\t\tself.rc4enc = ARC4.new(key)\n\t\tself.rc4dec = ARC4.new(key)\n\t\n\tdef set_key(self, key):\n\t\tself.rc4enc = ARC4.new(key)\n\t\tself.rc4dec = ARC4.new(key)\n\t\t\n\tdef encrypt(self, data): return self.rc4enc.encrypt(data)\n\tdef decrypt(self, data): return self.rc4dec.decrypt(data)\n\t\n\t\nclass DummyEncryption:\n\tdef set_key(self, key): pass\n\tdef encrypt(self, data): return data\n\tdef decrypt(self, data): return data\n\t\n\t\nclass ZlibCompression:\n\tdef compress(self, data):\n\t\tcompressed = zlib.compress(data)\n\t\tratio = int(len(data) / len(compressed) + 1)\n\t\treturn bytes([ratio]) + compressed\n\t\t\n\tdef decompress(self, data):\n\t\tif data[0] == 0:\n\t\t\treturn data[1:]\n\t\t\n\t\tdecompressed = zlib.decompress(data[1:])\n\t\tratio = int(len(decompressed) / (len(data) - 1) + 1)\n\t\tif ratio != data[0]:\n\t\t\traise ValueError(\"Unexpected compression ratio (expected %i, got %i)\" %ratio, data[0])\n\t\treturn decompressed\n\t\t\n\t\t\nclass DummyCompression:\n\tdef compress(self, data): return data\n\tdef decompress(self, data): return data\n\n\nclass PayloadEncoder:\n\n\tDEFAULT_KEY = b\"CD&ML\"\n\n\tdef __init__(self, settings):\n\t\tsubstreams = settings[\"prudp.max_substream_id\"] + 1\n\t\t\n\t\tself.reliable_encryption = [self.create_encryption(settings) for i in range(substreams)]\n\t\tself.unreliable_encryption = self.create_encryption(settings)\n\t\t\n\t\tself.unreliable_key = bytes(0x20)\n\t\t\n\t\tif settings[\"prudp.compression\"] == settings.COMPRESSION_NONE:\n\t\t\tself.compression = DummyCompression()\n\t\telse:\n\t\t\tself.compression = ZlibCompression()\n\t\t\t\n\tdef create_encryption(self, settings):\n\t\tif settings[\"prudp.transport\"] == settings.TRANSPORT_UDP:\n\t\t\treturn RC4Encryption(self.DEFAULT_KEY)\n\t\treturn DummyEncryption()\n\t\t\n\tdef encode(self, packet):\n\t\tdata = packet.payload\n\t\tif packet.type == TYPE_DATA and data:\n\t\t\tdata = self.compression.compress(data)\n\t\t\tif packet.flags & FLAG_RELIABLE:\n\t\t\t\tdata = self.reliable_encryption[packet.substream_id].encrypt(data)\n\t\t\telse:\n\t\t\t\tkey = self.make_unreliable_key(packet)\n\t\t\t\tself.unreliable_encryption.set_key(key)\n\t\t\t\t\n\t\t\t\tdata = self.unreliable_encryption.encrypt(data)\n\t\treturn data\n\t\n\tdef decode(self, packet):\n\t\tdata = packet.payload\n\t\tif packet.type == TYPE_DATA and data:\n\t\t\tif packet.flags & FLAG_RELIABLE:\n\t\t\t\tdata = self.reliable_encryption[packet.substream_id].decrypt(data)\n\t\t\telse:\n\t\t\t\tkey = self.make_unreliable_key(packet)\n\t\t\t\tself.unreliable_encryption.set_key(key)\n\t\t\t\t\n\t\t\t\tdata = self.unreliable_encryption.decrypt(data)\n\t\t\tdata = self.compression.decompress(data)\n\t\treturn data\n\t\n\tdef make_unreliable_key(self, packet):\n\t\tkey = list(self.unreliable_key)\n\t\tkey[0] = (key[0] + packet.packet_id) & 0xFF\n\t\tkey[1] = (key[1] + (packet.packet_id >> 8)) & 0xFF\n\t\tkey[31] = (key[31] + packet.session_id) & 0xFF\n\t\treturn bytes(key)\n\t\t\n\tdef modify_key(self, key):\n\t\tchars = list(key)\n\t\t\n\t\tadd = len(chars) // 2 + 1\n\t\tfor i in range(len(chars) // 2):\n\t\t\tchars[i] = (chars[i] + add - i) & 0xFF\n\t\t\n\t\treturn bytes(chars)\n\t\t\n\tdef combine_keys(self, key1, key2):\n\t\treturn hashlib.md5(key1 + key2).digest()\n\t\t\n\tdef init_unreliable_key(self, key):\n\t\tpart1 = self.combine_keys(key, bytes.fromhex(\"18d8233437e4e3fe\"))\n\t\tpart2 = self.combine_keys(key, bytes.fromhex(\"233e600123cdab80\"))\n\t\treturn part1 + part2\n\t\n\tdef set_session_key(self, key):\n\t\tself.reliable_encryption[0].set_key(key)\n\t\t\n\t\ttemp_key = key\n\t\tfor encryption in self.reliable_encryption[1:]:\n\t\t\ttemp_key = self.modify_key(temp_key)\n\t\t\tencryption.set_key(temp_key)\n\t\t\n\t\tself.unreliable_key = self.init_unreliable_key(key)\n\n\nclass SequenceCounter:\n\tdef __init__(self, initial = 1):\n\t\tself.next_id = initial\n\t\n\tdef next(self):\n\t\tcurrent = self.next_id\n\t\tself.next_id = (self.next_id + 1) & 0xFFFF\n\t\treturn current\n\t\t\n\t\t\nclass SequenceMgr:\n\tdef __init__(self, settings):\t\n\t\tsubstreams = settings[\"prudp.max_substream_id\"] + 1\n\t\t\n\t\tself.initial_unreliable_id = 1\n\t\tif settings[\"prudp.transport\"] == settings.TRANSPORT_UDP:\n\t\t\tif settings[\"prudp.version\"] != 0:\n\t\t\t\tself.initial_unreliable_id = random.randint(0, 0xFFFF)\n\t\t\n\t\tself.counters = [SequenceCounter() for i in range(substreams)]\n\t\tself.unreliable_counter = SequenceCounter(self.initial_unreliable_id)\n\t\tself.ping_counter = SequenceCounter()\n\t\t\n\tdef assign(self, packet):\n\t\tif packet.flags & FLAG_RELIABLE:\n\t\t\treturn self.counters[packet.substream_id].next()\n\t\tif packet.type == TYPE_DATA:\n\t\t\treturn self.unreliable_counter.next()\n\t\tif packet.type == TYPE_PING:\n\t\t\treturn self.ping_counter.next()\n\t\treturn 0\n\n\nclass SlidingWindow:\n\tdef __init__(self):\n\t\tself.next = 1\n\t\tself.packets = {}\n\t\n\tdef skip(self):\n\t\tself.next = (self.next + 1) & 0xFFFF\n\t\n\tdef update(self, packet):\n\t\tpackets = []\n\t\tif packet.packet_id < self.next or packet.packet_id in self.packets:\n\t\t\tlogger.debug(\"Received duplicate packet: %s\", packet)\n\t\telse:\n\t\t\tself.packets[packet.packet_id] = packet\n\t\t\twhile self.next in self.packets:\n\t\t\t\tpacket = self.packets.pop(self.next)\n\t\t\t\tpackets.append(packet)\n\t\t\t\tself.skip()\n\t\treturn packets\n\n\nclass PRUDPClient:\n\tdef __init__(self, settings, transport, version):\n\t\tself.fragment_size = settings[\"prudp.fragment_size\"]\n\t\tself.resend_timeout = settings[\"prudp.resend_timeout\"]\n\t\tself.resend_limit = settings[\"prudp.resend_limit\"]\n\t\tself.ping_timeout = settings[\"prudp.ping_timeout\"]\n\t\tself.max_substream_id = settings[\"prudp.max_substream_id\"]\n\t\tself.supported_functions = settings[\"prudp.supported_functions\"]\n\t\tself.minor_ver = settings[\"prudp.minor_version\"]\n\t\t\n\t\tself.settings = settings\n\t\tself.transport = transport\n\t\tself.version = version\n\t\t\n\t\tself.packet_encoder = PRUDPMessageSelector(settings).select(version)\n\t\tself.payload_encoder = PayloadEncoder(settings)\n\t\tself.sequence_mgr = SequenceMgr(settings)\n\t\t\n\t\tsubstreams = self.max_substream_id + 1\n\t\tself.sliding_windows = [SlidingWindow() for i in range(substreams)]\n\t\tself.fragment_buffers = [b\"\"] * substreams\n\t\t\n\t\tself.packets = [queue.create() for i in range(substreams)]\n\t\tself.unreliable_packets = queue.create()\n\t\t\n\t\tself.group = None\n\t\tself.scheduler = None\n\t\tself.ping_event = None\n\t\tself.ack_events = {}\n\t\t\n\t\tself.connection_check = random.randint(0, 0xFFFFFFFF)\n\t\t\n\t\tself.local_session_id = random.randint(0, 0xFF)\n\t\tself.remote_session_id = None\n\t\tself.remote_signature = None\n\t\t\n\t\tself.local_addr = None\n\t\tself.local_port = None\n\t\tself.local_type = None\n\t\t\n\t\tself.remote_addr = None\n\t\tself.remote_port = None\n\t\tself.remote_type = None\n\t\t\n\t\tself.user_pid = None\n\t\tself.user_cid = None\n\t\tself.session_key = b\"\"\n\t\t\n\t\tself.credentials = None\n\t\t\n\t\tself.handshake_event = anyio.Event()\n\t\tself.close_event = anyio.Event()\n\t\t\n\t\tself.state = STATE_CONNECTING\n\t\n\tasync def __aenter__(self): return self\n\tasync def __aexit__(self, typ, val, tb):\n\t\tawait self.cleanup()\n\t\t\n\tdef bind(self, addr, port, type):\n\t\tself.local_addr = addr\n\t\tself.local_port = port\n\t\tself.local_type = type\n\t\n\tdef connect(self, addr, port, type):\n\t\tself.remote_addr = addr\n\t\tself.remote_port = port\n\t\tself.remote_type = type\n\t\n\tdef login(self, pid, cid, session_key):\n\t\tself.user_pid = pid\n\t\tself.user_cid = cid\n\t\tself.session_key = session_key\n\t\t\n\t\tself.payload_encoder.set_session_key(session_key)\n\t\n\tdef configure(self, max_substream_id, supported_functions, minor_version):\n\t\tself.max_substream_id = max_substream_id\n\t\tself.supported_functions = supported_functions\n\t\tself.minor_ver = minor_version\n\t\n\tdef remote(self, connection_signature, session_id):\n\t\tself.remote_signature = connection_signature\n\t\tself.remote_session_id = session_id\n\t\t\n\tasync def handshake(self, credentials, group):\n\t\tself.group = group\n\t\t\n\t\tself.scheduler = scheduler.Scheduler(group)\n\t\tself.scheduler.start()\n\t\t\n\t\tself.credentials = credentials\n\t\tif self.credentials:\n\t\t\tself.login(credentials.pid, credentials.cid, credentials.ticket.session_key)\n\t\t\n\t\tawait self.send_syn()\n\t\tawait self.handshake_event.wait()\n\t\t\n\t\tif self.state != STATE_CONNECTED:\n\t\t\traise RuntimeError(\"PRUDP connection failed\")\n\t\t\n\t\tself.ping_event = self.scheduler.repeat(self.send_ping, self.ping_timeout)\n\t\n\tasync def serve(self, group):\n\t\tself.group = group\n\t\t\n\t\tself.state = STATE_CONNECTED\n\t\t\n\t\tself.sliding_windows[0].skip()\n\t\t\n\t\tself.scheduler = scheduler.Scheduler(group)\n\t\tself.scheduler.start()\n\t\t\n\t\tself.ping_event = self.scheduler.repeat(self.send_ping, self.ping_timeout)\n\t\n\tasync def send(self, data, substream=0):\n\t\tif self.state != STATE_CONNECTED:\n\t\t\traise anyio.ClosedResourceError(\"PRUDP connection is closed\")\n\t\t\n\t\tif not 0 <= substream <= self.max_substream_id:\n\t\t\traise ValueError(\"Substream id is invalid\")\n\t\t\n\t\tfragment_id = 1\n\t\twhile data:\n\t\t\tif len(data) <= self.fragment_size:\n\t\t\t\tfragment_id = 0\n\t\t\tawait self.send_fragment(data[:self.fragment_size], fragment_id, substream)\n\t\t\tdata = data[self.fragment_size:]\n\t\t\tfragment_id += 1\n\t\n\tasync def send_fragment(self, data, fragment_id, substream):\n\t\tpacket = PRUDPPacket(TYPE_DATA, FLAG_RELIABLE | FLAG_NEED_ACK | FLAG_HAS_SIZE)\n\t\tpacket.fragment_id = fragment_id\n\t\tpacket.substream_id = substream\n\t\tpacket.payload = data\n\t\tawait self.send_packet(packet)\n\t\n\tasync def send_unreliable(self, data):\n\t\tif self.state != STATE_CONNECTED:\n\t\t\traise anyio.ClosedResourceError(\"PRUDP connection is closed\")\n\t\t\n\t\tpacket = PRUDPPacket(TYPE_DATA, FLAG_NEED_ACK | FLAG_HAS_SIZE)\n\t\tpacket.payload = data\n\t\tawait self.send_packet(packet)\n\t\n\tasync def send_ping(self):\n\t\tpacket = PRUDPPacket(TYPE_PING, FLAG_RELIABLE | FLAG_NEED_ACK)\n\t\tawait self.send_packet(packet)\n\t\n\tasync def send_syn(self):\n\t\tpacket = PRUDPPacket(TYPE_SYN, FLAG_NEED_ACK)\n\t\tpacket.connection_signature = bytes(self.packet_encoder.signature_size())\n\t\tpacket.max_substream_id = self.max_substream_id\n\t\tpacket.supported_functions = self.supported_functions\n\t\tpacket.minor_version = self.minor_ver\n\t\tawait self.send_packet(packet)\n\t\n\tasync def send_connect(self):\n\t\tconnection_signature = self.packet_encoder.calc_connection_signature(self.remote_addr)\n\t\tpacket = PRUDPPacket(TYPE_CONNECT, FLAG_RELIABLE | FLAG_NEED_ACK | FLAG_HAS_SIZE)\n\t\tpacket.connection_signature = connection_signature\n\t\tpacket.initial_unreliable_id = self.sequence_mgr.initial_unreliable_id\n\t\tpacket.max_substream_id = self.max_substream_id\n\t\tpacket.minor_version = self.minor_ver\n\t\tpacket.supported_functions = self.supported_functions\n\t\tpacket.payload = self.build_connection_request()\n\t\tawait self.send_packet(packet)\n\t\n\tasync def send_ack(self, packet):\n\t\tack = PRUDPPacket(packet.type, FLAG_ACK)\n\t\tack.packet_id = packet.packet_id\n\t\tack.fragment_id = packet.fragment_id\n\t\tack.substream_id = packet.substream_id\n\t\t\n\t\tawait self.send_packet(ack)\n\t\tif packet.type == TYPE_DISCONNECT:\n\t\t\tawait self.send_packet(ack)\n\t\t\tawait self.send_packet(ack)\n\t\n\tasync def send_packet(self, packet):\n\t\tpacket.version = self.version\n\t\tpacket.source_port = self.local_port\n\t\tpacket.source_type = self.local_type\n\t\tpacket.dest_port = self.remote_port\n\t\tpacket.dest_type = self.remote_type\n\t\tif not packet.flags & (FLAG_ACK | FLAG_MULTI_ACK):\n\t\t\tpacket.packet_id = self.sequence_mgr.assign(packet)\n\t\tif packet.type != TYPE_SYN:\n\t\t\tpacket.session_id = self.local_session_id\n\t\t\n\t\tif packet.type == TYPE_DATA and not packet.flags & (FLAG_ACK | FLAG_MULTI_ACK):\n\t\t\tpacket.payload = self.payload_encoder.encode(packet)\n\t\t\n\t\tif packet.type == TYPE_SYN:\n\t\t\tpacket.signature = self.packet_encoder.calc_packet_signature(packet, b\"\", b\"\")\n\t\telif packet.type == TYPE_CONNECT:\n\t\t\tpacket.signature = self.packet_encoder.calc_packet_signature(packet, b\"\", self.remote_signature)\n\t\telse:\n\t\t\tpacket.signature = self.packet_encoder.calc_packet_signature(packet, self.session_key, self.remote_signature)\n\t\t\n\t\ttry:\n\t\t\tawait self.transport.send(packet, self.remote_addr)\n\t\texcept util.StreamError:\n\t\t\tawait self.cleanup()\n\t\t\treturn\n\t\t\n\t\tif (packet.flags & FLAG_RELIABLE or packet.type == TYPE_SYN) and packet.flags & FLAG_NEED_ACK:\n\t\t\tself.schedule_timeout(packet)\n\t\t\t\n\tasync def resend_packet(self, packet, counter):\n\t\tkey = (packet.type, packet.substream_id, packet.packet_id)\n\t\tif counter < self.resend_limit:\n\t\t\tlogger.debug(\"[%i] Resending packet: %s\", self.local_session_id, packet)\n\t\t\t\n\t\t\ttry:\n\t\t\t\tawait self.transport.send(packet, self.remote_addr)\n\t\t\texcept util.StreamError:\n\t\t\t\tawait self.cleanup()\n\t\t\t\treturn\n\t\t\t\n\t\t\thandle = self.scheduler.schedule(self.resend_packet, self.resend_timeout, packet, counter + 1)\n\t\t\tself.ack_events[key] = handle\n\t\telse:\n\t\t\tlogger.error(\"Packet timed out: %s\" %packet)\n\t\t\tawait self.cleanup()\n\t\n\tdef schedule_timeout(self, packet):\n\t\tkey = (packet.type, packet.substream_id, packet.packet_id)\n\t\thandle = self.scheduler.schedule(self.resend_packet, self.resend_timeout, packet, 0)\n\t\tself.ack_events[key] = handle\n\t\t\n\tdef build_connection_request(self):\n\t\tif self.credentials is None:\n\t\t\treturn b\"\"\n\t\t\n\t\tstream = streams_nex.StreamOut(self.settings)\n\t\tstream.buffer(self.credentials.ticket.internal)\n\t\t\n\t\tsubstream = streams_nex.StreamOut(self.settings)\n\t\tsubstream.pid(self.credentials.pid)\n\t\tsubstream.u32(self.credentials.cid)\n\t\tsubstream.u32(self.connection_check)\n\t\t\n\t\tkerb = kerberos.KerberosEncryption(self.credentials.ticket.session_key)\n\t\tstream.buffer(kerb.encrypt(substream.get()))\n\t\treturn stream.get()\n\t\n\tdef check_connection_response(self, data):\n\t\tif self.credentials is not None:\n\t\t\tif len(data) != 8:\n\t\t\t\traise ValueError(\"Connection response has wrong size\")\n\t\t\t\n\t\t\tlength, check_value = struct.unpack(\"<II\", data)\n\t\t\tif length != 4:\n\t\t\t\traise ValueError(\"Invalid connection response size\")\n\t\t\tif check_value != (self.connection_check + 1) & 0xFFFFFFFF:\n\t\t\t\traise ValueError(\"Connection response check failed\")\n\t\telif data:\n\t\t\traise ValueError(\"Expected empty connection response\")\n\t\t\n\tasync def handle(self, packet):\n\t\tif self.state == STATE_DISCONNECTED: return\n\t\t\n\t\tif self.state == STATE_CONNECTING and packet.type != TYPE_SYN:\n\t\t\traise ValueError(\"Expected SYN packet\")\n\t\t\n\t\tif packet.type == TYPE_SYN:\n\t\t\tawait self.process_syn(packet)\n\t\telif packet.type == TYPE_CONNECT:\n\t\t\tawait self.process_connect(packet)\n\t\telse:\n\t\t\tawait self.process_other(packet)\n\t\t\n\t\tif packet.flags & FLAG_ACK:\n\t\t\tkey = (packet.type, packet.substream_id, packet.packet_id)\n\t\t\tif key in self.ack_events:\n\t\t\t\thandle = self.ack_events.pop(key)\n\t\t\t\tself.scheduler.remove(handle)\n\t\t\t\t\n\t\t\t\tif packet.type == TYPE_DISCONNECT:\n\t\t\t\t\tawait self.cleanup()\n\t\n\tasync def process_syn(self, packet):\n\t\tif packet.signature != self.packet_encoder.calc_packet_signature(packet, b\"\", b\"\"):\n\t\t\traise ValueError(\"Received SYN packet with invalid signature\")\n\t\tif not packet.flags & FLAG_ACK:\n\t\t\traise ValueError(\"Received unexpected SYN packet\")\n\t\tif packet.session_id != 0 or packet.packet_id != 0 or \\\n\t\t   packet.fragment_id != 0 or packet.substream_id != 0:\n\t\t\traise ValueError(\"Received invalid SYN/ACK packet\")\n\t\tif packet.max_substream_id > self.max_substream_id or \\\n\t\t   packet.minor_version > self.minor_ver or \\\n\t\t   packet.supported_functions & ~self.supported_functions:\n\t\t\traise ValueError(\"Received SYN/ACK packet with invalid negotiation parameters\")\n\t\t\n\t\tkey = (packet.type, packet.substream_id, packet.packet_id)\n\t\tif key in self.ack_events:\n\t\t\tself.state = STATE_CONNECTED\n\t\t\t\n\t\t\tself.max_substream_id = packet.max_substream_id\n\t\t\tself.minor_ver = packet.minor_version\n\t\t\tself.supported_functions = packet.supported_functions\n\t\t\t\n\t\t\tself.remote_signature = packet.connection_signature\n\t\t\t\n\t\t\tawait self.send_connect()\n\t\n\tasync def process_connect(self, packet):\n\t\tconnection_signature = self.packet_encoder.calc_connection_signature(self.remote_addr)\n\t\tif packet.signature != self.packet_encoder.calc_packet_signature(packet, b\"\", connection_signature):\n\t\t\traise ValueError(\"Received CONNECT packet with invalid signature\")\n\t\tif not packet.flags & FLAG_ACK:\n\t\t\traise ValueError(\"Received unexpected CONNECT packet\")\n\t\tif packet.packet_id != 1 or packet.fragment_id != 0 or \\\n\t\t   packet.substream_id != 0 or any(packet.connection_signature):\n\t\t\traise ValueError(\"Received invalid CONNECT/ACK packet\")\n\t\tif packet.max_substream_id != self.max_substream_id or \\\n\t\t   packet.minor_version != self.minor_ver or \\\n\t\t   packet.supported_functions != self.supported_functions:\n\t\t\traise ValueError(\"Received CONNECT/ACK packet with invalid negotiation parameters\")\n\t\t\n\t\tkey = (packet.type, packet.substream_id, packet.packet_id)\n\t\tif key in self.ack_events:\n\t\t\tself.check_connection_response(packet.payload)\n\t\t\tself.remote_session_id = packet.session_id\n\t\t\tself.handshake_event.set()\n\t\n\tasync def process_other(self, packet):\n\t\tconnection_signature = self.packet_encoder.calc_connection_signature(self.remote_addr)\n\t\tif packet.signature != self.packet_encoder.calc_packet_signature(packet, self.session_key, connection_signature):\n\t\t\traise ValueError(\"Received packet with invalid signature\")\n\t\t\n\t\tif packet.flags & FLAG_MULTI_ACK:\n\t\t\tself.handle_aggregate_ack(packet)\n\t\telse:\n\t\t\tif packet.substream_id > self.max_substream_id:\n\t\t\t\traise ValueError(\"Received packet with invalid substream id: %i\", packet.substream_id)\n\t\t\tif packet.session_id != self.remote_session_id:\n\t\t\t\traise ValueError(\"Received packet with invalid session id\")\n\t\t\t\n\t\t\tif not packet.flags & FLAG_ACK:\n\t\t\t\tif packet.flags & FLAG_NEED_ACK:\n\t\t\t\t\tawait self.send_ack(packet)\n\t\t\t\tif packet.flags & FLAG_RELIABLE:\n\t\t\t\t\tawait self.process_reliable(packet)\n\t\t\t\telse:\n\t\t\t\t\tif packet.type == TYPE_DATA:\n\t\t\t\t\t\tdata = self.payload_encoder.decode(packet)\n\t\t\t\t\t\tawait self.unreliable_packets.put(data)\n\t\t\t\t\telif packet.type == TYPE_DISCONNECT:\n\t\t\t\t\t\tlogger.info(\"Connection closed by other end point (forcefully)\")\n\t\t\t\t\t\tawait self.cleanup()\n\t\n\tasync def process_reliable(self, packet):\n\t\tsubstream = packet.substream_id\n\t\tfor packet in self.sliding_windows[substream].update(packet):\n\t\t\tif packet.type == TYPE_DATA:\n\t\t\t\tself.fragment_buffers[substream] += self.payload_encoder.decode(packet)\n\t\t\t\tif packet.fragment_id == 0:\n\t\t\t\t\tawait self.packets[substream].put(self.fragment_buffers[substream])\n\t\t\t\t\tself.fragment_buffers[substream] = b\"\"\n\t\t\telif packet.type == TYPE_DISCONNECT:\n\t\t\t\tlogger.info(\"Connection closed by other end point\")\n\t\t\t\tawait self.cleanup()\n\t\n\tdef is_new_aggregate_ack(self, packet):\n\t\tif self.settings[\"prudp.transport\"] == self.settings.TRANSPORT_UDP:\n\t\t\tif self.version == 0:\n\t\t\t\treturn False\n\t\t\treturn packet.substream_id == 1\n\t\treturn True\n\t\n\tdef verify_aggregate_ack(self, packet):\n\t\tif packet.type != TYPE_DATA:\n\t\t\traise ValueError(\"Aggregate ack must be a DATA packet\")\n\t\t\n\t\tif len(packet.payload) % 2:\n\t\t\traise ValueError(\"Aggregate ack payload size must be a multiple of 2\")\n\t\tif packet.substream_id not in [0, 1]:\n\t\t\traise ValueError(\"Aggregate ack packet has invalid stream id: %i\" %packet.substream_id)\n\t\t\n\t\tif self.is_new_aggregate_ack(packet):\n\t\t\tif len(packet.payload) != 4 + packet.payload[1] * 2:\n\t\t\t\traise ValueError(\"Aggregate ack payload has incorrect size\")\n\t\telif len(packet.payload) < 4:\n\t\t\traise ValueError(\"Aggregate ack payload is too small\")\n\t\n\tdef handle_aggregate_ack(self, packet):\n\t\tself.verify_aggregate_ack(packet)\n\t\tif self.is_new_aggregate_ack(packet):\n\t\t\tsubstream = packet.payload[0]\n\t\t\tbase_id = struct.unpack_from(\"<H\", packet.payload, 2)[0]\n\t\t\textra_ids = struct.unpack_from(\"<%iH\" %packet.payload[1], packet.payload, 4)\n\t\telse:\n\t\t\tsubstream = 0\n\t\t\tbase_id = packet.packet_id\n\t\t\textra_ids = struct.unpack(\"<%iH\" %(len(packet.payload) // 2), packet.payload)\n\t\t\n\t\tfor key in list(self.ack_events):\n\t\t\tif key[0] == TYPE_DATA and key[1] == substream and key[2] <= base_id:\n\t\t\t\tself.scheduler.remove(self.ack_events.pop(key))\n\t\t\n\t\tfor packet_id in extra_ids:\n\t\t\tkey = (TYPE_DATA, substream, packet_id)\n\t\t\tif key in self.ack_events:\n\t\t\t\tself.scheduler.remove(self.ack_events.pop(key))\n\t\t\t\t\n\tasync def cleanup(self):\n\t\tself.state = STATE_DISCONNECTED\n\t\tself.scheduler.remove_all()\n\t\tself.handshake_event.set()\n\t\tself.close_event.set()\n\t\tfor queue in self.packets:\n\t\t\tawait queue.eof()\n\t\tawait self.unreliable_packets.eof()\n\t\n\tasync def close(self):\n\t\tif self.state == STATE_DISCONNECTED: return\n\t\t\n\t\tlogger.debug(\"[%i] Closing PRUDP connection forcefully\", self.local_session_id)\n\t\t\n\t\tpacket = PRUDPPacket(TYPE_DISCONNECT, 0)\n\t\tfor i in range(3):\n\t\t\tawait self.send_packet(packet)\n\t\tawait self.cleanup()\n\t\n\tasync def disconnect(self):\n\t\tif self.state != STATE_CONNECTED: return\n\t\t\n\t\ttry:\n\t\t\tlogger.debug(\"[%i] Closing PRUDP connection\", self.local_session_id)\n\t\t\tself.state = STATE_DISCONNECTING\n\t\t\t\n\t\t\tpacket = PRUDPPacket(TYPE_DISCONNECT, FLAG_RELIABLE | FLAG_NEED_ACK)\n\t\t\tawait self.send_packet(packet)\n\t\t\tawait self.close_event.wait()\n\n\t\t\tlogger.debug(\"PRUDP connection is closed\")\n\t\tfinally:\n\t\t\tawait self.cleanup()\n\t\n\tasync def recv(self, substream=0):\n\t\treturn await self.packets[substream].get()\n\t\n\tasync def recv_unreliable(self):\n\t\treturn await self.unreliable_packets.get()\n\t\n\tdef pid(self):\n\t\treturn self.user_pid\n\tdef minor_version(self):\n\t\treturn self.minor_ver\n\t\n\tdef local_address(self):\n\t\treturn self.local_addr\n\tdef remote_address(self):\n\t\treturn self.remote_addr\n\t\t\n\tdef local_sid(self):\n\t\treturn self.local_port\n\tdef remote_sid(self):\n\t\treturn self.remote_port\n\n\nclass PRUDPPortTable:\n\tdef __init__(self, settings):\n\t\tself.num_ports = 32\n\t\tif settings[\"prudp.transport\"] == settings.TRANSPORT_UDP:\n\t\t\tself.num_ports = 16\n\t\tself.ports = {}\n\t\n\tdef __iter__(self):\n\t\treturn iter(self.ports.values())\n\t\n\tdef get(self, port, type):\n\t\tport |= type << 8\n\t\tif port not in self.ports:\n\t\t\traise ValueError(\"Port is not bound\")\n\t\treturn self.ports[port]\n\t\n\tdef allocate(self, type):\n\t\tfor i in reversed(range(self.num_ports)):\n\t\t\tif i | (type << 8) not in self.ports:\n\t\t\t\treturn i\n\t\traise ValueError(\"All ports are in use\")\n\t\n\t@contextlib.contextmanager\n\tdef bind(self, obj, port=None, type=10):\n\t\tif port is None:\n\t\t\tport = self.allocate(type)\n\t\t\n\t\tport |= type << 8\n\t\tif port in self.ports:\n\t\t\traise ValueError(\"Port is in use: %i\" %port)\n\t\t\n\t\tself.ports[port] = obj\n\t\ttry:\n\t\t\tyield port & 0xFF\n\t\tfinally:\n\t\t\tdel self.ports[port]\n\n\nclass PRUDPServerStream:\n\tdef __init__(self, settings, transport, handler, key, group, disconnect_timeout):\n\t\tself.settings = settings\n\t\tself.transport = transport\n\t\tself.handler = handler\n\t\tself.key = key\n\t\tself.group = group\n\t\tself.disconnect_timeout = disconnect_timeout\n\t\t\n\t\tself.packet_encoder = PRUDPMessageSelector(settings)\n\t\t\n\t\tself.supported_functions = settings[\"prudp.supported_functions\"]\n\t\tself.max_substream_id = settings[\"prudp.max_substream_id\"]\n\t\tself.minor_ver = settings[\"prudp.minor_version\"]\n\t\t\n\t\tself.addr = None\n\t\tself.port = None\n\t\tself.type = None\n\t\t\n\t\tself.clients = {}\n\t\n\tdef bind(self, addr, port, type):\n\t\tself.addr = addr\n\t\tself.port = port\n\t\tself.type = type\n\t\n\tdef get_client(self, packet, addr):\n\t\tkey = (addr, packet.source_port, packet.source_type)\n\t\treturn self.clients.get(key)\n\t\n\tasync def start_client(self, client):\n\t\tkey = (client.remote_address(), client.remote_port, client.remote_type)\n\t\ttry:\n\t\t\tawait self.serve_client(client)\n\t\texcept Exception as e:\n\t\t\tlogger.warning(\"An exception occurred while serving a client: %s\" %e)\n\t\tfinally:\n\t\t\tdel self.clients[key]\n\t\n\tasync def serve_client(self, client):\n\t\tasync with util.create_task_group() as group:\n\t\t\tasync with client:\n\t\t\t\tawait client.serve(group)\n\t\t\t\tawait self.handler(client)\n\t\t\t\twith anyio.move_on_after(self.disconnect_timeout):\n\t\t\t\t\tawait client.disconnect()\n\t\n\tasync def handle(self, packet, addr):\n\t\tif packet.type == TYPE_SYN and not packet.flags & FLAG_ACK:\n\t\t\tawait self.process_syn(packet, addr)\n\t\telif packet.type == TYPE_CONNECT and not packet.flags & FLAG_ACK:\n\t\t\tawait self.process_connect(packet, addr)\n\t\telse:\n\t\t\tawait self.process_other(packet, addr)\n\t\n\tasync def process_other(self, packet, addr):\n\t\tclient = self.get_client(packet, addr)\n\t\tif client is not None:\n\t\t\tawait client.handle(packet)\n\t\telse:\n\t\t\tlogger.warning(\"Received unexpected packet: %s\", packet)\n\t\t\t\n\tasync def process_syn(self, packet, addr):\n\t\tif packet.signature != self.packet_encoder.calc_packet_signature(packet, b\"\", b\"\"):\n\t\t\traise ValueError(\"Received packet with invalid signature\")\n\t\tif not packet.flags & FLAG_NEED_ACK:\n\t\t\traise ValueError(\"Received SYN packet without FLAG_NEED_ACK\")\n\t\tif packet.session_id != 0 or packet.packet_id != 0 or packet.fragment_id != 0 or \\\n\t\t   packet.substream_id != 0 or any(packet.connection_signature):\n\t\t\traise ValueError(\"Received invalid SYN packet: %s\" %packet)\n\t\t\n\t\tack = PRUDPPacket(TYPE_SYN, FLAG_ACK)\n\t\tack.version = packet.version\n\t\tack.source_type = self.type\n\t\tack.source_port = self.port\n\t\tack.dest_type = packet.source_type\n\t\tack.dest_port = packet.source_port\n\t\tack.connection_signature = self.packet_encoder.calc_connection_signature(addr, ack.version)\n\t\tack.max_substream_id = min(self.max_substream_id, packet.max_substream_id)\n\t\tack.minor_version = min(self.minor_ver, packet.minor_version)\n\t\tack.supported_functions = self.supported_functions & packet.supported_functions\n\t\tack.signature = self.packet_encoder.calc_packet_signature(ack, b\"\", b\"\")\n\t\tawait self.transport.send(ack, addr)\n\t\n\tasync def process_connect(self, packet, addr):\n\t\tconnection_signature = self.packet_encoder.calc_connection_signature(addr, packet.version)\n\t\tif packet.signature != self.packet_encoder.calc_packet_signature(packet, b\"\", connection_signature):\n\t\t\traise ValueError(\"Received packet with invalid signature\")\n\t\t\n\t\tif not packet.flags & FLAG_NEED_ACK or packet.packet_id != 1 or \\\n\t\t   packet.fragment_id != 0 or packet.substream_id != 0:\n\t\t\traise ValueError(\"Received invalid CONNECT packet\")\n\t\tif packet.max_substream_id > self.max_substream_id or \\\n\t\t   packet.minor_version > self.minor_ver or \\\n\t\t   packet.supported_functions & ~self.supported_functions != 0:\n\t\t\traise ValueError(\"Received CONNECT packet with invalid negotiation parameters\")\n\t\t\n\t\tkey = (addr, packet.source_port, packet.source_type)\n\t\tclient = self.clients.get(key)\n\t\tif client is None:\n\t\t\tclient = PRUDPClient(self.settings, self.transport, packet.version)\n\t\t\tclient.bind(self.addr, self.port, self.type)\n\t\t\tclient.connect(addr, packet.source_port, packet.source_type)\n\t\t\tclient.configure(packet.max_substream_id, packet.supported_functions, packet.minor_version)\n\t\t\tclient.remote(packet.connection_signature, packet.session_id)\n\t\t\n\t\tresponse = self.process_login_request(packet.payload, client)\n\t\t\n\t\tif key not in self.clients:\n\t\t\tself.clients[key] = client\n\t\t\tself.group.start_soon(self.start_client, client)\n\t\t\n\t\tack = PRUDPPacket(TYPE_CONNECT, FLAG_ACK | FLAG_HAS_SIZE)\n\t\tack.version = packet.version\n\t\tack.source_type = self.type\n\t\tack.source_port = self.port\n\t\tack.dest_type = packet.source_type\n\t\tack.dest_port = packet.source_port\n\t\tack.connection_signature = bytes(len(connection_signature))\n\t\tack.max_substream_id = packet.max_substream_id\n\t\tack.supported_functions = packet.supported_functions\n\t\tack.minor_version = packet.minor_version\n\t\tack.session_id = client.local_session_id\n\t\tack.packet_id = 1\n\t\tack.payload = response\n\t\tack.signature = self.packet_encoder.calc_packet_signature(ack, b\"\", packet.connection_signature)\n\t\tawait self.transport.send(ack, addr)\n\t\n\tdef process_login_request(self, data, client):\n\t\tif self.key is None:\n\t\t\treturn b\"\"\n\t\t\n\t\tstream = streams_nex.StreamIn(data, self.settings)\n\t\tticket_data = stream.buffer()\n\t\trequest_data = stream.buffer()\n\t\t\n\t\tticket = kerberos.ServerTicket.decrypt(ticket_data, self.key, self.settings)\n\t\tif ticket.timestamp.timestamp() < time.time() - 120:\n\t\t\traise ValueError(\"Ticket has expired\")\n\t\t\n\t\tkerb = kerberos.KerberosEncryption(ticket.session_key)\n\t\tdecrypted = kerb.decrypt(request_data)\n\t\t\n\t\tif len(decrypted) != self.settings[\"nex.pid_size\"] + 8:\n\t\t\traise ValueError(\"Invalid ticket size\")\n\t\t\n\t\tstream = streams_nex.StreamIn(decrypted, self.settings)\n\t\tif stream.pid() != ticket.source:\n\t\t\traise ValueError(\"Invalid pid in kerberos ticket\")\n\t\t\n\t\tclient.login(ticket.source, stream.u32(), ticket.session_key)\n\t\t\n\t\tcheck_value = stream.u32()\n\t\treturn struct.pack(\"<II\", 4, (check_value + 1) & 0xFFFFFFFF)\n\t\t\n\t\t\nclass PRUDPClientTransport:\n\tdef __init__(self, settings, socket, group):\n\t\tself.settings = settings\n\t\tself.socket = socket\n\t\tself.group = group\n\t\t\n\t\tself.ports = PRUDPPortTable(settings)\n\t\tself.packet_encoder = PRUDPMessageSelector(settings).select(settings[\"prudp.version\"])\n\t\n\t@contextlib.asynccontextmanager\n\tasync def connect(self, port, type=10, credentials=None, *, disconnect_timeout=None):\n\t\tclient = PRUDPClient(self.settings, self, self.settings[\"prudp.version\"])\n\t\twith self.ports.bind(client, type=type) as local_port:\n\t\t\tclient.bind(self.socket.local_address(), local_port, type)\n\t\t\tclient.connect(self.socket.remote_address(), port, type)\n\t\t\t\n\t\t\tasync with util.create_task_group() as group:\n\t\t\t\tasync with client:\n\t\t\t\t\tawait client.handshake(credentials, group)\n\t\t\t\t\tyield client\n\t\t\t\t\twith anyio.move_on_after(disconnect_timeout):\n\t\t\t\t\t\tawait client.disconnect()\n\t\n\tdef start(self):\n\t\tself.group.start_soon(self.process)\n\t\n\tasync def process(self):\n\t\twhile True:\n\t\t\tdata = await self.socket.recv()\n\t\t\tawait self.process_data(data)\n\t\t\t\n\tasync def process_data(self, data):\n\t\ttry:\n\t\t\tpackets = self.packet_encoder.decode(data)\n\t\t\tfor packet in packets:\n\t\t\t\tawait self.process_packet(packet)\n\t\texcept Exception as e:\n\t\t\tlogger.warning(\"[CLI] An exception occurred while processing a packet: %s\" %e)\n\t\n\tasync def process_packet(self, packet):\n\t\tlogger.debug(\"[CLI] Received packet: %s\" %packet)\n\t\tawait self.ports.get(packet.dest_port, packet.dest_type).handle(packet)\n\t\t\t\n\tasync def send(self, packet, addr):\n\t\tif addr != self.socket.remote_address():\n\t\t\traise ValueError(\"Destination address is invalid\")\n\t\t\n\t\tlogger.debug(\"[CLI] Sending packet: %s\" %packet)\n\t\t\n\t\tdata = self.packet_encoder.encode(packet)\n\t\tawait self.socket.send(data)\n\t\n\tdef local_address(self): return self.socket.local_address()\n\tdef remote_address(self): return self.socket.remote_address()\n\n\nclass PRUDPServerTransport:\n\tdef __init__(self, settings):\n\t\tself.settings = settings\n\t\t\n\t\tself.ports = PRUDPPortTable(settings)\n\t\tself.packet_encoder = PRUDPMessageSelector(settings)\n\t\n\t@contextlib.asynccontextmanager\n\tasync def serve(self, handler, port, type=10, key=None, *, disconnect_timeout=None):\n\t\tasync with util.create_task_group() as group:\n\t\t\tstream = PRUDPServerStream(self.settings, self, handler, key, group, disconnect_timeout)\n\t\t\twith self.ports.bind(stream, port, type) as port:\n\t\t\t\tstream.bind(self.local_address(), port, type)\n\t\t\t\tyield\n\t\t\t\n\tasync def send(self, packet, addr):\n\t\tlogger.debug(\"[SRV] Sending packet to %s: %s\" %(addr, packet))\n\t\t\n\t\tdata = self.packet_encoder.encode(packet)\n\t\tawait self.sendto(data, addr)\n\t\t\n\tasync def process_data(self, data, addr):\n\t\ttry:\n\t\t\tpackets = self.packet_encoder.decode(data)\n\t\t\tfor packet in packets:\n\t\t\t\tawait self.process_packet(packet, addr)\n\t\texcept Exception as e:\n\t\t\tlogger.warning(\"[SRV] An exception occurred while processing a packet: %s\" %e)\n\t\n\tasync def process_packet(self, packet, addr):\n\t\tlogger.debug(\"[SRV] Received packet from %s: %s\" %(addr, packet))\n\t\tawait self.ports.get(packet.dest_port, packet.dest_type).handle(packet, addr)\n\n\nclass PRUDPDatagramTransport(PRUDPServerTransport):\n\tdef __init__(self, settings, socket, group):\n\t\tsuper().__init__(settings)\n\t\tself.socket = socket\n\t\tself.group = group\n\t\t\n\tdef start(self):\n\t\tself.group.start_soon(self.process)\n\t\t\n\tasync def process(self):\n\t\twhile True:\n\t\t\tdata, addr = await self.socket.recv()\n\t\t\tawait self.process_data(data, addr)\n\t\n\tasync def sendto(self, data, addr):\n\t\tawait self.socket.send(data, addr)\n\t\n\tdef local_address(self):\n\t\treturn self.socket.local_address()\n\n\nclass PRUDPSocketTransport(PRUDPServerTransport):\n\tdef __init__(self, settings, addr):\n\t\tsuper().__init__(settings)\n\t\tself.clients = {}\n\t\tself.addr = addr\n\t\n\tasync def handle(self, client):\n\t\taddress = client.remote_address()\n\t\tself.clients[address] = client\n\t\ttry:\n\t\t\tawait self.process(client, address)\n\t\tfinally:\n\t\t\tdel self.clients[address]\n\t\n\tasync def process(self, client, addr):\n\t\twhile True:\n\t\t\ttry:\n\t\t\t\tdata = await client.recv()\n\t\t\texcept util.StreamError:\n\t\t\t\tlogger.debug(\"[SRV] underlying connection was closed\")\n\t\t\t\treturn\n\t\t\t\n\t\t\tawait self.process_data(data, addr)\n\t\n\tasync def sendto(self, data, addr):\n\t\tif addr not in self.clients:\n\t\t\traise anyio.BrokenResourceError(\"Transport connection is closed\")\n\t\tawait self.clients[addr].send(data)\n\t\n\tdef local_address(self):\n\t\treturn self.addr\n\n\ndef connect_transport_socket(settings, host, port, context):\n\ttransport = settings[\"prudp.transport\"]\n\tif transport == settings.TRANSPORT_UDP:\n\t\treturn udp.connect(host, port)\n\telif transport == settings.TRANSPORT_TCP:\n\t\treturn tls.connect(host, port, context)\n\treturn websocket.connect(\"%s:%i\" %(host, port), context, protocols=[\"NEX\"], disconnect_timeout=0)\n\ndef serve_transport_socket(handler, settings, host, port, context):\n\ttransport = settings[\"prudp.transport\"]\n\tif transport == settings.TRANSPORT_TCP:\n\t\treturn tls.serve(handler, host, port, context)\n\treturn websocket.serve(handler, host, port, context, protocol=\"NEX\", disconnect_timeout=0)\n\n@contextlib.asynccontextmanager\nasync def connect_transport(settings, host, port, context=None):\n\tlogger.debug(\"Connecting PRUDP transport to %s:%i\", host, port)\n\tasync with connect_transport_socket(settings, host, port, context) as socket:\n\t\tasync with util.create_task_group() as group:\n\t\t\ttransport = PRUDPClientTransport(settings, socket, group)\n\t\t\ttransport.start()\n\t\t\tyield transport\n\n@contextlib.asynccontextmanager\nasync def serve_transport(settings, host=\"\", port=0, context=None):\n\tlogger.debug(\"Serving PRUDP transport at %s:%i\", host, port)\n\ttransport = settings[\"prudp.transport\"]\n\tif transport == settings.TRANSPORT_UDP:\n\t\tasync with udp.bind(host, port) as socket:\n\t\t\tasync with util.create_task_group() as group:\n\t\t\t\ttransport = PRUDPDatagramTransport(settings, socket, group)\n\t\t\t\ttransport.start()\n\t\t\t\tyield transport\n\telse:\n\t\ttransport = PRUDPSocketTransport(settings, (host, port))\n\t\tasync with serve_transport_socket(transport.handle, settings, host, port, context):\n\t\t\tyield transport\n\n@contextlib.asynccontextmanager\nasync def connect(settings, host, port, vport=1, type=10, context=None, credentials=None, *, disconnect_timeout=None):\n\tasync with connect_transport(settings, host, port, context) as transport:\n\t\tasync with transport.connect(vport, type, credentials, disconnect_timeout=disconnect_timeout) as client:\n\t\t\tyield client\n\n@contextlib.asynccontextmanager\nasync def serve(handler, settings, host=\"\", port=0, vport=1, type=10, context=None, key=None, *, disconnect_timeout=None):\n\tasync with serve_transport(settings, host, port, context) as transport:\n\t\tasync with transport.serve(handler, vport, type, key, disconnect_timeout=disconnect_timeout):\n\t\t\tyield\n"
  },
  {
    "path": "nintendo/nex/ranking.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RankingOrderCalc:\n\tSTANDARD = 0\n\tORDINAL = 1\n\n\nclass RankingMode:\n\tGLOBAL = 0\n\tGLOBAL_AROUND_SELF = 1\n\tSELF = 4\n\n\nclass RankingStatFlags:\n\tRANKING_COUNT = 1\n\tTOTAL_SCORE = 2\n\tLOWEST_SCORE = 4\n\tHIGHEST_SCORE = 8\n\tAVERAGE_SCORE = 16\n\tALL = 31\n\n\nclass RankingOrderParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.order_calc = 0\n\t\tself.group_index = 255\n\t\tself.group_num = 0\n\t\tself.time_scope = 2\n\t\tself.offset = 0\n\t\tself.count = 10\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.order_calc = stream.u8()\n\t\tself.group_index = stream.u8()\n\t\tself.group_num = stream.u8()\n\t\tself.time_scope = stream.u8()\n\t\tself.offset = stream.u32()\n\t\tself.count = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.order_calc)\n\t\tstream.u8(self.group_index)\n\t\tstream.u8(self.group_num)\n\t\tstream.u8(self.time_scope)\n\t\tstream.u32(self.offset)\n\t\tstream.u8(self.count)\n\n\nclass RankingRankData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.unique_id = None\n\t\tself.rank = None\n\t\tself.category = None\n\t\tself.score = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\tself.common_data = None\n\t\tself.update_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'unique_id', 'rank', 'category', 'score', 'groups', 'param', 'common_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tfor field in ['update_time']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.unique_id = stream.u64()\n\t\tself.rank = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\tself.common_data = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.update_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\t\tstream.buffer(self.common_data)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.datetime(self.update_time)\n\n\nclass RankingResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\tself.total = None\n\t\tself.since_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data', 'total', 'since_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(RankingRankData)\n\t\tself.total = stream.u32()\n\t\tself.since_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.add)\n\t\tstream.u32(self.total)\n\t\tstream.datetime(self.since_time)\n\n\nclass RankingCachedResult(RankingResult):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.created_time = None\n\t\tself.expired_time = None\n\t\tself.max_length = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['created_time', 'expired_time', 'max_length']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.created_time = stream.datetime()\n\t\tself.expired_time = stream.datetime()\n\t\tself.max_length = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.datetime(self.created_time)\n\t\tstream.datetime(self.expired_time)\n\t\tstream.u8(self.max_length)\ncommon.DataHolder.register(RankingCachedResult, \"RankingCachedResult\")\n\n\nclass RankingStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.stats = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['stats']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.stats = stream.list(stream.double)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.stats, stream.double)\n\n\nclass RankingScoreData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.score = None\n\t\tself.order = None\n\t\tself.update_mode = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'score', 'order', 'update_mode', 'groups', 'param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.order = stream.u8()\n\t\tself.update_mode = stream.u8()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\t\tstream.u8(self.order)\n\t\tstream.u8(self.update_mode)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\n\nclass RankingChangeAttributesParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flags = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flags', 'groups', 'param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flags = stream.u8()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flags)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\n\nclass RankingProtocol:\n\tMETHOD_UPLOAD_SCORE = 1\n\tMETHOD_DELETE_SCORE = 2\n\tMETHOD_DELETE_ALL_SCORES = 3\n\tMETHOD_UPLOAD_COMMON_DATA = 4\n\tMETHOD_DELETE_COMMON_DATA = 5\n\tMETHOD_GET_COMMON_DATA = 6\n\tMETHOD_CHANGE_ATTRIBUTES = 7\n\tMETHOD_CHANGE_ALL_ATTRIBUTES = 8\n\tMETHOD_GET_RANKING = 9\n\tMETHOD_GET_APPROX_ORDER = 10\n\tMETHOD_GET_STATS = 11\n\tMETHOD_GET_RANKING_BY_PID_LIST = 12\n\tMETHOD_GET_RANKING_BY_UNIQUE_ID_LIST = 13\n\tMETHOD_GET_CACHED_TOPX_RANKING = 14\n\tMETHOD_GET_CACHED_TOPX_RANKINGS = 15\n\t\n\tPROTOCOL_ID = 0x70\n\n\nclass RankingClient(RankingProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def upload_score(self, score_data, unique_id):\n\t\tlogger.info(\"RankingClient.upload_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(score_data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.upload_score -> done\")\n\t\n\tasync def delete_score(self, category, unique_id):\n\t\tlogger.info(\"RankingClient.delete_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.delete_score -> done\")\n\t\n\tasync def delete_all_scores(self, unique_id):\n\t\tlogger.info(\"RankingClient.delete_all_scores()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_ALL_SCORES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.delete_all_scores -> done\")\n\t\n\tasync def upload_common_data(self, common_data, unique_id):\n\t\tlogger.info(\"RankingClient.upload_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.buffer(common_data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.upload_common_data -> done\")\n\t\n\tasync def delete_common_data(self, unique_id):\n\t\tlogger.info(\"RankingClient.delete_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.delete_common_data -> done\")\n\t\n\tasync def get_common_data(self, unique_id):\n\t\tlogger.info(\"RankingClient.get_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_common_data -> done\")\n\t\treturn data\n\t\n\tasync def change_attributes(self, category, param, unique_id):\n\t\tlogger.info(\"RankingClient.change_attributes()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(param)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_ATTRIBUTES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.change_attributes -> done\")\n\t\n\tasync def change_all_attributes(self, param, unique_id):\n\t\tlogger.info(\"RankingClient.change_all_attributes()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_ALL_ATTRIBUTES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.change_all_attributes -> done\")\n\t\n\tasync def get_ranking(self, mode, category, order, unique_id, pid):\n\t\tlogger.info(\"RankingClient.get_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_ranking -> done\")\n\t\treturn result\n\t\n\tasync def get_approx_order(self, category, order, score, unique_id, pid):\n\t\tlogger.info(\"RankingClient.get_approx_order()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u32(score)\n\t\tstream.u64(unique_id)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_APPROX_ORDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\torder = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_approx_order -> done\")\n\t\treturn order\n\t\n\tasync def get_stats(self, category, order, flags):\n\t\tlogger.info(\"RankingClient.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u32(flags)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(RankingStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_ranking_by_pid_list(self, pids, mode, category, order, unique_id):\n\t\tlogger.info(\"RankingClient.get_ranking_by_pid_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_PID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_ranking_by_pid_list -> done\")\n\t\treturn result\n\t\n\tasync def get_ranking_by_unique_id_list(self, ids, mode, category, order, unique_id):\n\t\tlogger.info(\"RankingClient.get_ranking_by_unique_id_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u64)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_UNIQUE_ID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_ranking_by_unique_id_list -> done\")\n\t\treturn result\n\t\n\tasync def get_cached_topx_ranking(self, category, order):\n\t\tlogger.info(\"RankingClient.get_cached_topx_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CACHED_TOPX_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingCachedResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_cached_topx_ranking -> done\")\n\t\treturn result\n\t\n\tasync def get_cached_topx_rankings(self, categories, order):\n\t\tlogger.info(\"RankingClient.get_cached_topx_rankings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(categories, stream.u32)\n\t\tstream.list(order, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CACHED_TOPX_RANKINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(RankingCachedResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClient.get_cached_topx_rankings -> done\")\n\t\treturn results\n\n\nclass RankingServer(RankingProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_UPLOAD_SCORE: self.handle_upload_score,\n\t\t\tself.METHOD_DELETE_SCORE: self.handle_delete_score,\n\t\t\tself.METHOD_DELETE_ALL_SCORES: self.handle_delete_all_scores,\n\t\t\tself.METHOD_UPLOAD_COMMON_DATA: self.handle_upload_common_data,\n\t\t\tself.METHOD_DELETE_COMMON_DATA: self.handle_delete_common_data,\n\t\t\tself.METHOD_GET_COMMON_DATA: self.handle_get_common_data,\n\t\t\tself.METHOD_CHANGE_ATTRIBUTES: self.handle_change_attributes,\n\t\t\tself.METHOD_CHANGE_ALL_ATTRIBUTES: self.handle_change_all_attributes,\n\t\t\tself.METHOD_GET_RANKING: self.handle_get_ranking,\n\t\t\tself.METHOD_GET_APPROX_ORDER: self.handle_get_approx_order,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_GET_RANKING_BY_PID_LIST: self.handle_get_ranking_by_pid_list,\n\t\t\tself.METHOD_GET_RANKING_BY_UNIQUE_ID_LIST: self.handle_get_ranking_by_unique_id_list,\n\t\t\tself.METHOD_GET_CACHED_TOPX_RANKING: self.handle_get_cached_topx_ranking,\n\t\t\tself.METHOD_GET_CACHED_TOPX_RANKINGS: self.handle_get_cached_topx_rankings,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on RankingServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_upload_score(self, client, input, output):\n\t\tlogger.info(\"RankingServer.upload_score()\")\n\t\t#--- request ---\n\t\tscore_data = input.extract(RankingScoreData)\n\t\tunique_id = input.u64()\n\t\tawait self.upload_score(client, score_data, unique_id)\n\t\n\tasync def handle_delete_score(self, client, input, output):\n\t\tlogger.info(\"RankingServer.delete_score()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tunique_id = input.u64()\n\t\tawait self.delete_score(client, category, unique_id)\n\t\n\tasync def handle_delete_all_scores(self, client, input, output):\n\t\tlogger.info(\"RankingServer.delete_all_scores()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_all_scores(client, unique_id)\n\t\n\tasync def handle_upload_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServer.upload_common_data()\")\n\t\t#--- request ---\n\t\tcommon_data = input.buffer()\n\t\tunique_id = input.u64()\n\t\tawait self.upload_common_data(client, common_data, unique_id)\n\t\n\tasync def handle_delete_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServer.delete_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_common_data(client, unique_id)\n\t\n\tasync def handle_get_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_common_data(client, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_change_attributes(self, client, input, output):\n\t\tlogger.info(\"RankingServer.change_attributes()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tparam = input.extract(RankingChangeAttributesParam)\n\t\tunique_id = input.u64()\n\t\tawait self.change_attributes(client, category, param, unique_id)\n\t\n\tasync def handle_change_all_attributes(self, client, input, output):\n\t\tlogger.info(\"RankingServer.change_all_attributes()\")\n\t\t#--- request ---\n\t\tparam = input.extract(RankingChangeAttributesParam)\n\t\tunique_id = input.u64()\n\t\tawait self.change_all_attributes(client, param, unique_id)\n\t\n\tasync def handle_get_ranking(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_ranking()\")\n\t\t#--- request ---\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.get_ranking(client, mode, category, order, unique_id, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_approx_order(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_approx_order()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tscore = input.u32()\n\t\tunique_id = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.get_approx_order(client, category, order, score, unique_id, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_stats()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tflags = input.u32()\n\t\tresponse = await self.get_stats(client, category, order, flags)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingStats):\n\t\t\traise RuntimeError(\"Expected RankingStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_pid_list(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_ranking_by_pid_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_ranking_by_pid_list(client, pids, mode, category, order, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_unique_id_list(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_ranking_by_unique_id_list()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u64)\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_ranking_by_unique_id_list(client, ids, mode, category, order, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_cached_topx_ranking(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_cached_topx_ranking()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tresponse = await self.get_cached_topx_ranking(client, category, order)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingCachedResult):\n\t\t\traise RuntimeError(\"Expected RankingCachedResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_cached_topx_rankings(self, client, input, output):\n\t\tlogger.info(\"RankingServer.get_cached_topx_rankings()\")\n\t\t#--- request ---\n\t\tcategories = input.list(input.u32)\n\t\torder = input.list(RankingOrderParam)\n\t\tresponse = await self.get_cached_topx_rankings(client, categories, order)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def upload_score(self, *args):\n\t\tlogger.warning(\"RankingServer.upload_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_score(self, *args):\n\t\tlogger.warning(\"RankingServer.delete_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_all_scores(self, *args):\n\t\tlogger.warning(\"RankingServer.delete_all_scores not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def upload_common_data(self, *args):\n\t\tlogger.warning(\"RankingServer.upload_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_common_data(self, *args):\n\t\tlogger.warning(\"RankingServer.delete_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_common_data(self, *args):\n\t\tlogger.warning(\"RankingServer.get_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_attributes(self, *args):\n\t\tlogger.warning(\"RankingServer.change_attributes not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_all_attributes(self, *args):\n\t\tlogger.warning(\"RankingServer.change_all_attributes not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking(self, *args):\n\t\tlogger.warning(\"RankingServer.get_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_approx_order(self, *args):\n\t\tlogger.warning(\"RankingServer.get_approx_order not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"RankingServer.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_pid_list(self, *args):\n\t\tlogger.warning(\"RankingServer.get_ranking_by_pid_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_unique_id_list(self, *args):\n\t\tlogger.warning(\"RankingServer.get_ranking_by_unique_id_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_cached_topx_ranking(self, *args):\n\t\tlogger.warning(\"RankingServer.get_cached_topx_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_cached_topx_rankings(self, *args):\n\t\tlogger.warning(\"RankingServer.get_cached_topx_rankings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/ranking2.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RankingMode:\n\tGLOBAL_AROUND_SELF = 1\n\tGLOBAL = 2\n\tFRIENDS = 3\n\n\nclass Ranking2CategorySetting(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.min_score = None\n\t\tself.max_score = None\n\t\tself.lowest_rank = None\n\t\tself.reset_month = None\n\t\tself.reset_day = None\n\t\tself.reset_hour = None\n\t\tself.reset_mode = None\n\t\tself.max_seasons_to_go_back = None\n\t\tself.score_order = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['min_score', 'max_score', 'lowest_rank', 'reset_month', 'reset_day', 'reset_hour', 'reset_mode', 'max_seasons_to_go_back', 'score_order']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.min_score = stream.u32()\n\t\tself.max_score = stream.u32()\n\t\tself.lowest_rank = stream.u32()\n\t\tself.reset_month = stream.u16()\n\t\tself.reset_day = stream.u8()\n\t\tself.reset_hour = stream.u8()\n\t\tself.reset_mode = stream.u8()\n\t\tself.max_seasons_to_go_back = stream.u8()\n\t\tself.score_order = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.min_score)\n\t\tstream.u32(self.max_score)\n\t\tstream.u32(self.lowest_rank)\n\t\tstream.u16(self.reset_month)\n\t\tstream.u8(self.reset_day)\n\t\tstream.u8(self.reset_hour)\n\t\tstream.u8(self.reset_mode)\n\t\tstream.u8(self.max_seasons_to_go_back)\n\t\tstream.bool(self.score_order)\n\n\nclass Ranking2ChartInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.create_time = None\n\t\tself.index = None\n\t\tself.category = None\n\t\tself.season = None\n\t\tself.bins_size = None\n\t\tself.sampling_rate = None\n\t\tself.score_order = None\n\t\tself.estimate_length = None\n\t\tself.estimate_highest_score = None\n\t\tself.estimate_lowest_score = None\n\t\tself.estimate_median_score = None\n\t\tself.estimate_average_score = None\n\t\tself.highest_bins_score = None\n\t\tself.lowest_bins_score = None\n\t\tself.bins_width = None\n\t\tself.attribute1 = None\n\t\tself.attribute2 = None\n\t\tself.quantities = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['create_time', 'index', 'category', 'season', 'bins_size', 'sampling_rate', 'score_order', 'estimate_length', 'estimate_highest_score', 'estimate_lowest_score', 'estimate_median_score', 'estimate_average_score', 'highest_bins_score', 'lowest_bins_score', 'bins_width', 'attribute1', 'attribute2', 'quantities']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.create_time = stream.datetime()\n\t\tself.index = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.season = stream.s32()\n\t\tself.bins_size = stream.u8()\n\t\tself.sampling_rate = stream.u8()\n\t\tself.score_order = stream.bool()\n\t\tself.estimate_length = stream.u32()\n\t\tself.estimate_highest_score = stream.u32()\n\t\tself.estimate_lowest_score = stream.u32()\n\t\tself.estimate_median_score = stream.u32()\n\t\tself.estimate_average_score = stream.double()\n\t\tself.highest_bins_score = stream.u32()\n\t\tself.lowest_bins_score = stream.u32()\n\t\tself.bins_width = stream.u32()\n\t\tself.attribute1 = stream.u32()\n\t\tself.attribute2 = stream.u32()\n\t\tself.quantities = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.datetime(self.create_time)\n\t\tstream.u32(self.index)\n\t\tstream.u32(self.category)\n\t\tstream.s32(self.season)\n\t\tstream.u8(self.bins_size)\n\t\tstream.u8(self.sampling_rate)\n\t\tstream.bool(self.score_order)\n\t\tstream.u32(self.estimate_length)\n\t\tstream.u32(self.estimate_highest_score)\n\t\tstream.u32(self.estimate_lowest_score)\n\t\tstream.u32(self.estimate_median_score)\n\t\tstream.double(self.estimate_average_score)\n\t\tstream.u32(self.highest_bins_score)\n\t\tstream.u32(self.lowest_bins_score)\n\t\tstream.u32(self.bins_width)\n\t\tstream.u32(self.attribute1)\n\t\tstream.u32(self.attribute2)\n\t\tstream.list(self.quantities, stream.u32)\n\n\nclass Ranking2ChartInfoInput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.chart_index = None\n\t\tself.seasons_to_go_back = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['chart_index', 'seasons_to_go_back']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.chart_index = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.chart_index)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2CommonData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.username = None\n\t\tself.mii = None\n\t\tself.binary_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['username', 'mii', 'binary_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.username = stream.string()\n\t\tself.mii = stream.qbuffer()\n\t\tself.binary_data = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.username)\n\t\tstream.qbuffer(self.mii)\n\t\tstream.qbuffer(self.binary_data)\n\n\nclass Ranking2EstimateScoreRankInput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.seasons_to_go_back = None\n\t\tself.score = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'seasons_to_go_back', 'score']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\tself.score = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u8(self.seasons_to_go_back)\n\t\tstream.u32(self.score)\n\n\nclass Ranking2EstimateScoreRankOutput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rank = None\n\t\tself.length = None\n\t\tself.score = None\n\t\tself.category = None\n\t\tself.season = None\n\t\tself.sampling_rate = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rank', 'length', 'score', 'category', 'season', 'sampling_rate']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rank = stream.u32()\n\t\tself.length = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.season = stream.s32()\n\t\tself.sampling_rate = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.length)\n\t\tstream.u32(self.score)\n\t\tstream.u32(self.category)\n\t\tstream.s32(self.season)\n\t\tstream.u8(self.sampling_rate)\n\n\nclass Ranking2GetByListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.offset = None\n\t\tself.length = None\n\t\tself.sort_flags = None\n\t\tself.option_flags = None\n\t\tself.seasons_to_go_back = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'offset', 'length', 'sort_flags', 'option_flags', 'seasons_to_go_back']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.offset = stream.u32()\n\t\tself.length = stream.u32()\n\t\tself.sort_flags = stream.u32()\n\t\tself.option_flags = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.offset)\n\t\tstream.u32(self.length)\n\t\tstream.u32(self.sort_flags)\n\t\tstream.u32(self.option_flags)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2GetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = 0\n\t\tself.pid = 0\n\t\tself.category = None\n\t\tself.offset = 0\n\t\tself.count = 10\n\t\tself.sort_flags = 0\n\t\tself.option_flags = 0\n\t\tself.mode = 2\n\t\tself.seasons_to_go_back = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\tself.offset = stream.u32()\n\t\tself.count = stream.u32()\n\t\tself.sort_flags = stream.u32()\n\t\tself.option_flags = stream.u32()\n\t\tself.mode = stream.u8()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.offset)\n\t\tstream.u32(self.count)\n\t\tstream.u32(self.sort_flags)\n\t\tstream.u32(self.option_flags)\n\t\tstream.u8(self.mode)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2Info(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\tself.lowest_rank = None\n\t\tself.num_entries = None\n\t\tself.season = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data', 'lowest_rank', 'num_entries', 'season']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(Ranking2RankData)\n\t\tself.lowest_rank = stream.u32()\n\t\tself.num_entries = stream.u32()\n\t\tself.season = stream.s32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.add)\n\t\tstream.u32(self.lowest_rank)\n\t\tstream.u32(self.num_entries)\n\t\tstream.s32(self.season)\n\n\nclass Ranking2RankData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.misc = None\n\t\tself.unique_id = None\n\t\tself.pid = None\n\t\tself.rank = None\n\t\tself.score = None\n\t\tself.common_data = Ranking2CommonData()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['misc', 'unique_id', 'pid', 'rank', 'score']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.misc = stream.u64()\n\t\tself.unique_id = stream.u64()\n\t\tself.pid = stream.pid()\n\t\tself.rank = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.common_data = stream.extract(Ranking2CommonData)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.misc)\n\t\tstream.u64(self.unique_id)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.score)\n\t\tstream.add(self.common_data)\n\n\nclass Ranking2ScoreData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.misc = None\n\t\tself.category = None\n\t\tself.score = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['misc', 'category', 'score']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.misc = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.misc)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\n\nclass Ranking2Protocol:\n\tMETHOD_PUT_SCORE = 1\n\tMETHOD_GET_COMMON_DATA = 2\n\tMETHOD_PUT_COMMON_DATA = 3\n\tMETHOD_DELETE_COMMON_DATA = 4\n\tMETHOD_GET_RANKING = 5\n\tMETHOD_GET_RANKING_BY_PRINCIPAL_ID = 6\n\tMETHOD_GET_CATEGORY_SETTING = 7\n\tMETHOD_GET_RANKING_CHART = 8\n\tMETHOD_GET_RANKING_CHARTS = 9\n\tMETHOD_GET_ESTIMATE_SCORE_RANK = 10\n\t\n\tPROTOCOL_ID = 0x7A\n\n\nclass Ranking2Client(Ranking2Protocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def put_score(self, socres, unique_id):\n\t\tlogger.info(\"Ranking2Client.put_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(socres, stream.add)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PUT_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.put_score -> done\")\n\t\n\tasync def get_common_data(self, option_flags, pid, unique_id):\n\t\tlogger.info(\"Ranking2Client.get_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(option_flags)\n\t\tstream.pid(pid)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommon_data = stream.extract(Ranking2CommonData)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_common_data -> done\")\n\t\treturn common_data\n\t\n\tasync def put_common_data(self, data, unique_id):\n\t\tlogger.info(\"Ranking2Client.put_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PUT_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.put_common_data -> done\")\n\t\n\tasync def delete_common_data(self, unique_id):\n\t\tlogger.info(\"Ranking2Client.delete_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.delete_common_data -> done\")\n\t\n\tasync def get_ranking(self, param):\n\t\tlogger.info(\"Ranking2Client.get_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(Ranking2Info)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking -> done\")\n\t\treturn info\n\t\n\tasync def get_ranking_by_principal_id(self, param, pids):\n\t\tlogger.info(\"Ranking2Client.get_ranking_by_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(Ranking2Info)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking_by_principal_id -> done\")\n\t\treturn info\n\t\n\tasync def get_category_setting(self, category):\n\t\tlogger.info(\"Ranking2Client.get_category_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CATEGORY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsetting = stream.extract(Ranking2CategorySetting)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_category_setting -> done\")\n\t\treturn setting\n\t\n\tasync def get_ranking_chart(self, input):\n\t\tlogger.info(\"Ranking2Client.get_ranking_chart()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(input)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_CHART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(Ranking2ChartInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking_chart -> done\")\n\t\treturn info\n\t\n\tasync def get_ranking_charts(self, inputs):\n\t\tlogger.info(\"Ranking2Client.get_ranking_charts()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(inputs, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_CHARTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(Ranking2ChartInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking_charts -> done\")\n\t\treturn infos\n\t\n\tasync def get_estimate_score_rank(self, input):\n\t\tlogger.info(\"Ranking2Client.get_estimate_score_rank()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(input)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ESTIMATE_SCORE_RANK, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\toutput = stream.extract(Ranking2EstimateScoreRankOutput)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_estimate_score_rank -> done\")\n\t\treturn output\n\n\nclass Ranking2Server(Ranking2Protocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PUT_SCORE: self.handle_put_score,\n\t\t\tself.METHOD_GET_COMMON_DATA: self.handle_get_common_data,\n\t\t\tself.METHOD_PUT_COMMON_DATA: self.handle_put_common_data,\n\t\t\tself.METHOD_DELETE_COMMON_DATA: self.handle_delete_common_data,\n\t\t\tself.METHOD_GET_RANKING: self.handle_get_ranking,\n\t\t\tself.METHOD_GET_RANKING_BY_PRINCIPAL_ID: self.handle_get_ranking_by_principal_id,\n\t\t\tself.METHOD_GET_CATEGORY_SETTING: self.handle_get_category_setting,\n\t\t\tself.METHOD_GET_RANKING_CHART: self.handle_get_ranking_chart,\n\t\t\tself.METHOD_GET_RANKING_CHARTS: self.handle_get_ranking_charts,\n\t\t\tself.METHOD_GET_ESTIMATE_SCORE_RANK: self.handle_get_estimate_score_rank,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on Ranking2Server: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_put_score(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.put_score()\")\n\t\t#--- request ---\n\t\tsocres = input.list(Ranking2ScoreData)\n\t\tunique_id = input.u64()\n\t\tawait self.put_score(client, socres, unique_id)\n\t\n\tasync def handle_get_common_data(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_common_data()\")\n\t\t#--- request ---\n\t\toption_flags = input.u32()\n\t\tpid = input.pid()\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_common_data(client, option_flags, pid, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2CommonData):\n\t\t\traise RuntimeError(\"Expected Ranking2CommonData, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_put_common_data(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.put_common_data()\")\n\t\t#--- request ---\n\t\tdata = input.extract(Ranking2CommonData)\n\t\tunique_id = input.u64()\n\t\tawait self.put_common_data(client, data, unique_id)\n\t\n\tasync def handle_delete_common_data(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.delete_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_common_data(client, unique_id)\n\t\n\tasync def handle_get_ranking(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(Ranking2GetParam)\n\t\tresponse = await self.get_ranking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2Info):\n\t\t\traise RuntimeError(\"Expected Ranking2Info, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_principal_id(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking_by_principal_id()\")\n\t\t#--- request ---\n\t\tparam = input.extract(Ranking2GetByListParam)\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_ranking_by_principal_id(client, param, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2Info):\n\t\t\traise RuntimeError(\"Expected Ranking2Info, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_category_setting(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_category_setting()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tresponse = await self.get_category_setting(client, category)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2CategorySetting):\n\t\t\traise RuntimeError(\"Expected Ranking2CategorySetting, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_chart(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking_chart()\")\n\t\t#--- request ---\n\t\tinput = input.extract(Ranking2ChartInfoInput)\n\t\tresponse = await self.get_ranking_chart(client, input)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2ChartInfo):\n\t\t\traise RuntimeError(\"Expected Ranking2ChartInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_charts(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking_charts()\")\n\t\t#--- request ---\n\t\tinputs = input.list(Ranking2ChartInfoInput)\n\t\tresponse = await self.get_ranking_charts(client, inputs)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_estimate_score_rank(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_estimate_score_rank()\")\n\t\t#--- request ---\n\t\tinput = input.extract(Ranking2EstimateScoreRankInput)\n\t\tresponse = await self.get_estimate_score_rank(client, input)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2EstimateScoreRankOutput):\n\t\t\traise RuntimeError(\"Expected Ranking2EstimateScoreRankOutput, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def put_score(self, *args):\n\t\tlogger.warning(\"Ranking2Server.put_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_common_data(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def put_common_data(self, *args):\n\t\tlogger.warning(\"Ranking2Server.put_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_common_data(self, *args):\n\t\tlogger.warning(\"Ranking2Server.delete_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_principal_id(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking_by_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_category_setting(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_category_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_chart(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking_chart not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_charts(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking_charts not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_estimate_score_rank(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_estimate_score_rank not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/ranking2_eagle.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RankingMode:\n\tGLOBAL_AROUND_SELF = 1\n\tGLOBAL = 2\n\tFRIENDS = 3\n\n\nclass Ranking2CategorySetting(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.min_score = None\n\t\tself.max_score = None\n\t\tself.lowest_rank = None\n\t\tself.reset_month = None\n\t\tself.reset_day = None\n\t\tself.reset_hour = None\n\t\tself.reset_mode = None\n\t\tself.max_seasons_to_go_back = None\n\t\tself.score_order = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['min_score', 'max_score', 'lowest_rank', 'reset_month', 'reset_day', 'reset_hour', 'reset_mode', 'max_seasons_to_go_back', 'score_order']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.min_score = stream.u32()\n\t\tself.max_score = stream.u32()\n\t\tself.lowest_rank = stream.u32()\n\t\tself.reset_month = stream.u16()\n\t\tself.reset_day = stream.u8()\n\t\tself.reset_hour = stream.u8()\n\t\tself.reset_mode = stream.u8()\n\t\tself.max_seasons_to_go_back = stream.u8()\n\t\tself.score_order = stream.bool()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.min_score)\n\t\tstream.u32(self.max_score)\n\t\tstream.u32(self.lowest_rank)\n\t\tstream.u16(self.reset_month)\n\t\tstream.u8(self.reset_day)\n\t\tstream.u8(self.reset_hour)\n\t\tstream.u8(self.reset_mode)\n\t\tstream.u8(self.max_seasons_to_go_back)\n\t\tstream.bool(self.score_order)\n\n\nclass Ranking2ChartInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.create_time = None\n\t\tself.index = None\n\t\tself.category = None\n\t\tself.season = None\n\t\tself.bins_size = None\n\t\tself.sampling_rate = None\n\t\tself.score_order = None\n\t\tself.estimate_length = None\n\t\tself.estimate_highest_score = None\n\t\tself.estimate_lowest_score = None\n\t\tself.estimate_median_score = None\n\t\tself.estimate_average_score = None\n\t\tself.highest_bins_score = None\n\t\tself.lowest_bins_score = None\n\t\tself.bins_width = None\n\t\tself.attribute1 = None\n\t\tself.attribute2 = None\n\t\tself.quantities = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['create_time', 'index', 'category', 'season', 'bins_size', 'sampling_rate', 'score_order', 'estimate_length', 'estimate_highest_score', 'estimate_lowest_score', 'estimate_median_score', 'estimate_average_score', 'highest_bins_score', 'lowest_bins_score', 'bins_width', 'attribute1', 'attribute2', 'quantities']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.create_time = stream.datetime()\n\t\tself.index = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.season = stream.s32()\n\t\tself.bins_size = stream.u8()\n\t\tself.sampling_rate = stream.u8()\n\t\tself.score_order = stream.bool()\n\t\tself.estimate_length = stream.u32()\n\t\tself.estimate_highest_score = stream.u32()\n\t\tself.estimate_lowest_score = stream.u32()\n\t\tself.estimate_median_score = stream.u32()\n\t\tself.estimate_average_score = stream.double()\n\t\tself.highest_bins_score = stream.u32()\n\t\tself.lowest_bins_score = stream.u32()\n\t\tself.bins_width = stream.u32()\n\t\tself.attribute1 = stream.u32()\n\t\tself.attribute2 = stream.u32()\n\t\tself.quantities = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.datetime(self.create_time)\n\t\tstream.u32(self.index)\n\t\tstream.u32(self.category)\n\t\tstream.s32(self.season)\n\t\tstream.u8(self.bins_size)\n\t\tstream.u8(self.sampling_rate)\n\t\tstream.bool(self.score_order)\n\t\tstream.u32(self.estimate_length)\n\t\tstream.u32(self.estimate_highest_score)\n\t\tstream.u32(self.estimate_lowest_score)\n\t\tstream.u32(self.estimate_median_score)\n\t\tstream.double(self.estimate_average_score)\n\t\tstream.u32(self.highest_bins_score)\n\t\tstream.u32(self.lowest_bins_score)\n\t\tstream.u32(self.bins_width)\n\t\tstream.u32(self.attribute1)\n\t\tstream.u32(self.attribute2)\n\t\tstream.list(self.quantities, stream.u32)\n\n\nclass Ranking2ChartInfoInput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.chart_index = None\n\t\tself.seasons_to_go_back = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['chart_index', 'seasons_to_go_back']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.chart_index = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.chart_index)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2CommonData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.username = None\n\t\tself.mii = None\n\t\tself.binary_data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['username', 'mii', 'binary_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.username = stream.string()\n\t\tself.mii = stream.qbuffer()\n\t\tself.binary_data = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.username)\n\t\tstream.qbuffer(self.mii)\n\t\tstream.qbuffer(self.binary_data)\n\n\nclass Ranking2EstimateScoreRankInput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.seasons_to_go_back = None\n\t\tself.score = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'seasons_to_go_back', 'score']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\tself.score = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u8(self.seasons_to_go_back)\n\t\tstream.u32(self.score)\n\n\nclass Ranking2EstimateScoreRankOutput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rank = None\n\t\tself.length = None\n\t\tself.score = None\n\t\tself.category = None\n\t\tself.season = None\n\t\tself.sampling_rate = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rank', 'length', 'score', 'category', 'season', 'sampling_rate']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rank = stream.u32()\n\t\tself.length = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.season = stream.s32()\n\t\tself.sampling_rate = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.length)\n\t\tstream.u32(self.score)\n\t\tstream.u32(self.category)\n\t\tstream.s32(self.season)\n\t\tstream.u8(self.sampling_rate)\n\n\nclass Ranking2GetByListParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.offset = None\n\t\tself.length = None\n\t\tself.sort_flags = None\n\t\tself.option_flags = None\n\t\tself.seasons_to_go_back = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'offset', 'length', 'sort_flags', 'option_flags', 'seasons_to_go_back']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.offset = stream.u32()\n\t\tself.length = stream.u32()\n\t\tself.sort_flags = stream.u32()\n\t\tself.option_flags = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.offset)\n\t\tstream.u32(self.length)\n\t\tstream.u32(self.sort_flags)\n\t\tstream.u32(self.option_flags)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2GetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = 0\n\t\tself.pid = 0\n\t\tself.category = None\n\t\tself.offset = 0\n\t\tself.count = 10\n\t\tself.sort_flags = 0\n\t\tself.option_flags = 0\n\t\tself.mode = 2\n\t\tself.seasons_to_go_back = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.pid = stream.pid()\n\t\tself.category = stream.u32()\n\t\tself.offset = stream.u32()\n\t\tself.count = stream.u32()\n\t\tself.sort_flags = stream.u32()\n\t\tself.option_flags = stream.u32()\n\t\tself.mode = stream.u8()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.offset)\n\t\tstream.u32(self.count)\n\t\tstream.u32(self.sort_flags)\n\t\tstream.u32(self.option_flags)\n\t\tstream.u8(self.mode)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2Info(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\tself.lowest_rank = None\n\t\tself.num_entries = None\n\t\tself.season = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data', 'lowest_rank', 'num_entries', 'season']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(Ranking2RankData)\n\t\tself.lowest_rank = stream.u32()\n\t\tself.num_entries = stream.u32()\n\t\tself.season = stream.s32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.add)\n\t\tstream.u32(self.lowest_rank)\n\t\tstream.u32(self.num_entries)\n\t\tstream.s32(self.season)\n\n\nclass Ranking2RankData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.misc = None\n\t\tself.unique_id = None\n\t\tself.pid = None\n\t\tself.rank = None\n\t\tself.score = None\n\t\tself.common_data = Ranking2CommonData()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['misc', 'unique_id', 'pid', 'rank', 'score']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.misc = stream.u64()\n\t\tself.unique_id = stream.u64()\n\t\tself.pid = stream.pid()\n\t\tself.rank = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.common_data = stream.extract(Ranking2CommonData)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.misc)\n\t\tstream.u64(self.unique_id)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.score)\n\t\tstream.add(self.common_data)\n\n\nclass Ranking2ScoreData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.misc = None\n\t\tself.category = None\n\t\tself.score = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['misc', 'category', 'score']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.misc = stream.u64()\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.misc)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\n\nclass Ranking2EstimateMyScoreRankInput(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.seasons_to_go_back = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'seasons_to_go_back']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.seasons_to_go_back = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u8(self.seasons_to_go_back)\n\n\nclass Ranking2Protocol:\n\tMETHOD_PUT_SCORE = 1\n\tMETHOD_GET_COMMON_DATA = 2\n\tMETHOD_PUT_COMMON_DATA = 3\n\tMETHOD_DELETE_COMMON_DATA = 4\n\tMETHOD_GET_RANKING = 5\n\tMETHOD_GET_RANKING_BY_PRINCIPAL_ID = 6\n\tMETHOD_GET_CATEGORY_SETTING = 7\n\tMETHOD_GET_RANKING_CHART = 8\n\tMETHOD_GET_RANKING_CHARTS = 9\n\tMETHOD_GET_ESTIMATE_SCORE_RANK = 10\n\tMETHOD_GET_ESTIMATE_MY_SCORE_RANK = 11\n\t\n\tPROTOCOL_ID = 0x7A\n\n\nclass Ranking2Client(Ranking2Protocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def put_score(self, socres, unique_id):\n\t\tlogger.info(\"Ranking2Client.put_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(socres, stream.add)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PUT_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.put_score -> done\")\n\t\n\tasync def get_common_data(self, option_flags, pid, unique_id):\n\t\tlogger.info(\"Ranking2Client.get_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(option_flags)\n\t\tstream.pid(pid)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tcommon_data = stream.extract(Ranking2CommonData)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_common_data -> done\")\n\t\treturn common_data\n\t\n\tasync def put_common_data(self, data, unique_id):\n\t\tlogger.info(\"Ranking2Client.put_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_PUT_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.put_common_data -> done\")\n\t\n\tasync def delete_common_data(self, unique_id):\n\t\tlogger.info(\"Ranking2Client.delete_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.delete_common_data -> done\")\n\t\n\tasync def get_ranking(self, param):\n\t\tlogger.info(\"Ranking2Client.get_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(Ranking2Info)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking -> done\")\n\t\treturn info\n\t\n\tasync def get_ranking_by_principal_id(self, param, pids):\n\t\tlogger.info(\"Ranking2Client.get_ranking_by_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(Ranking2Info)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking_by_principal_id -> done\")\n\t\treturn info\n\t\n\tasync def get_category_setting(self, category):\n\t\tlogger.info(\"Ranking2Client.get_category_setting()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CATEGORY_SETTING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsetting = stream.extract(Ranking2CategorySetting)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_category_setting -> done\")\n\t\treturn setting\n\t\n\tasync def get_ranking_chart(self, input):\n\t\tlogger.info(\"Ranking2Client.get_ranking_chart()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(input)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_CHART, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(Ranking2ChartInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking_chart -> done\")\n\t\treturn info\n\t\n\tasync def get_ranking_charts(self, inputs):\n\t\tlogger.info(\"Ranking2Client.get_ranking_charts()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(inputs, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_CHARTS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(Ranking2ChartInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_ranking_charts -> done\")\n\t\treturn infos\n\t\n\tasync def get_estimate_score_rank(self, input):\n\t\tlogger.info(\"Ranking2Client.get_estimate_score_rank()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(input)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ESTIMATE_SCORE_RANK, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\toutput = stream.extract(Ranking2EstimateScoreRankOutput)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_estimate_score_rank -> done\")\n\t\treturn output\n\t\n\tasync def get_estimate_my_score_rank(self, input):\n\t\tlogger.info(\"Ranking2Client.get_estimate_my_score_rank()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(input)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ESTIMATE_MY_SCORE_RANK, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\toutput = stream.extract(Ranking2EstimateScoreRankOutput)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"Ranking2Client.get_estimate_my_score_rank -> done\")\n\t\treturn output\n\n\nclass Ranking2Server(Ranking2Protocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_PUT_SCORE: self.handle_put_score,\n\t\t\tself.METHOD_GET_COMMON_DATA: self.handle_get_common_data,\n\t\t\tself.METHOD_PUT_COMMON_DATA: self.handle_put_common_data,\n\t\t\tself.METHOD_DELETE_COMMON_DATA: self.handle_delete_common_data,\n\t\t\tself.METHOD_GET_RANKING: self.handle_get_ranking,\n\t\t\tself.METHOD_GET_RANKING_BY_PRINCIPAL_ID: self.handle_get_ranking_by_principal_id,\n\t\t\tself.METHOD_GET_CATEGORY_SETTING: self.handle_get_category_setting,\n\t\t\tself.METHOD_GET_RANKING_CHART: self.handle_get_ranking_chart,\n\t\t\tself.METHOD_GET_RANKING_CHARTS: self.handle_get_ranking_charts,\n\t\t\tself.METHOD_GET_ESTIMATE_SCORE_RANK: self.handle_get_estimate_score_rank,\n\t\t\tself.METHOD_GET_ESTIMATE_MY_SCORE_RANK: self.handle_get_estimate_my_score_rank,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on Ranking2Server: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_put_score(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.put_score()\")\n\t\t#--- request ---\n\t\tsocres = input.list(Ranking2ScoreData)\n\t\tunique_id = input.u64()\n\t\tawait self.put_score(client, socres, unique_id)\n\t\n\tasync def handle_get_common_data(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_common_data()\")\n\t\t#--- request ---\n\t\toption_flags = input.u32()\n\t\tpid = input.pid()\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_common_data(client, option_flags, pid, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2CommonData):\n\t\t\traise RuntimeError(\"Expected Ranking2CommonData, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_put_common_data(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.put_common_data()\")\n\t\t#--- request ---\n\t\tdata = input.extract(Ranking2CommonData)\n\t\tunique_id = input.u64()\n\t\tawait self.put_common_data(client, data, unique_id)\n\t\n\tasync def handle_delete_common_data(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.delete_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_common_data(client, unique_id)\n\t\n\tasync def handle_get_ranking(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking()\")\n\t\t#--- request ---\n\t\tparam = input.extract(Ranking2GetParam)\n\t\tresponse = await self.get_ranking(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2Info):\n\t\t\traise RuntimeError(\"Expected Ranking2Info, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_principal_id(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking_by_principal_id()\")\n\t\t#--- request ---\n\t\tparam = input.extract(Ranking2GetByListParam)\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_ranking_by_principal_id(client, param, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2Info):\n\t\t\traise RuntimeError(\"Expected Ranking2Info, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_category_setting(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_category_setting()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tresponse = await self.get_category_setting(client, category)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2CategorySetting):\n\t\t\traise RuntimeError(\"Expected Ranking2CategorySetting, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_chart(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking_chart()\")\n\t\t#--- request ---\n\t\tinput = input.extract(Ranking2ChartInfoInput)\n\t\tresponse = await self.get_ranking_chart(client, input)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2ChartInfo):\n\t\t\traise RuntimeError(\"Expected Ranking2ChartInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_charts(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_ranking_charts()\")\n\t\t#--- request ---\n\t\tinputs = input.list(Ranking2ChartInfoInput)\n\t\tresponse = await self.get_ranking_charts(client, inputs)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_estimate_score_rank(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_estimate_score_rank()\")\n\t\t#--- request ---\n\t\tinput = input.extract(Ranking2EstimateScoreRankInput)\n\t\tresponse = await self.get_estimate_score_rank(client, input)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2EstimateScoreRankOutput):\n\t\t\traise RuntimeError(\"Expected Ranking2EstimateScoreRankOutput, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_estimate_my_score_rank(self, client, input, output):\n\t\tlogger.info(\"Ranking2Server.get_estimate_my_score_rank()\")\n\t\t#--- request ---\n\t\tinput = input.extract(Ranking2EstimateMyScoreRankInput)\n\t\tresponse = await self.get_estimate_my_score_rank(client, input)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, Ranking2EstimateScoreRankOutput):\n\t\t\traise RuntimeError(\"Expected Ranking2EstimateScoreRankOutput, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def put_score(self, *args):\n\t\tlogger.warning(\"Ranking2Server.put_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_common_data(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def put_common_data(self, *args):\n\t\tlogger.warning(\"Ranking2Server.put_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_common_data(self, *args):\n\t\tlogger.warning(\"Ranking2Server.delete_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_principal_id(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking_by_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_category_setting(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_category_setting not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_chart(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking_chart not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_charts(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_ranking_charts not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_estimate_score_rank(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_estimate_score_rank not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_estimate_my_score_rank(self, *args):\n\t\tlogger.warning(\"Ranking2Server.get_estimate_my_score_rank not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/ranking_mk8.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RankingOrderCalc:\n\tSTANDARD = 0\n\tORDINAL = 1\n\n\nclass RankingMode:\n\tGLOBAL = 0\n\tGLOBAL_AROUND_SELF = 1\n\tSELF = 4\n\n\nclass RankingStatFlags:\n\tRANKING_COUNT = 1\n\tTOTAL_SCORE = 2\n\tLOWEST_SCORE = 4\n\tHIGHEST_SCORE = 8\n\tAVERAGE_SCORE = 16\n\tALL = 31\n\n\nclass RankingOrderParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.order_calc = 0\n\t\tself.group_index = 255\n\t\tself.group_num = 0\n\t\tself.time_scope = 2\n\t\tself.offset = 0\n\t\tself.count = 10\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.order_calc = stream.u8()\n\t\tself.group_index = stream.u8()\n\t\tself.group_num = stream.u8()\n\t\tself.time_scope = stream.u8()\n\t\tself.offset = stream.u32()\n\t\tself.count = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.order_calc)\n\t\tstream.u8(self.group_index)\n\t\tstream.u8(self.group_num)\n\t\tstream.u8(self.time_scope)\n\t\tstream.u32(self.offset)\n\t\tstream.u8(self.count)\n\n\nclass RankingRankData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.unique_id = None\n\t\tself.rank = None\n\t\tself.category = None\n\t\tself.score = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\tself.common_data = None\n\t\tself.update_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'unique_id', 'rank', 'category', 'score', 'groups', 'param', 'common_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tfor field in ['update_time']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.unique_id = stream.u64()\n\t\tself.rank = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\tself.common_data = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.update_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\t\tstream.buffer(self.common_data)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.datetime(self.update_time)\n\n\nclass RankingResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\tself.total = None\n\t\tself.since_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data', 'total', 'since_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(RankingRankData)\n\t\tself.total = stream.u32()\n\t\tself.since_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.add)\n\t\tstream.u32(self.total)\n\t\tstream.datetime(self.since_time)\n\n\nclass RankingCachedResult(RankingResult):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.created_time = None\n\t\tself.expired_time = None\n\t\tself.max_length = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['created_time', 'expired_time', 'max_length']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.created_time = stream.datetime()\n\t\tself.expired_time = stream.datetime()\n\t\tself.max_length = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.datetime(self.created_time)\n\t\tstream.datetime(self.expired_time)\n\t\tstream.u8(self.max_length)\ncommon.DataHolder.register(RankingCachedResult, \"RankingCachedResult\")\n\n\nclass RankingStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.stats = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['stats']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.stats = stream.list(stream.double)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.stats, stream.double)\n\n\nclass RankingScoreData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.score = None\n\t\tself.order = None\n\t\tself.update_mode = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'score', 'order', 'update_mode', 'groups', 'param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.order = stream.u8()\n\t\tself.update_mode = stream.u8()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\t\tstream.u8(self.order)\n\t\tstream.u8(self.update_mode)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\n\nclass RankingChangeAttributesParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flags = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flags', 'groups', 'param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flags = stream.u8()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flags)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\n\nclass CompetitionRankingInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.num_participants = None\n\t\tself.team_scores = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'num_participants', 'team_scores']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\tself.team_scores = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.u32(self.num_participants)\n\t\tstream.list(self.team_scores, stream.u32)\n\n\nclass CompetitionRankingInfoGetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rank_order = None\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rank_order']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rank_order = stream.u8()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.rank_order)\n\t\tstream.add(self.range)\n\n\nclass CompetitionRankingUploadScoreParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.season_id = None\n\t\tself.unk3 = None\n\t\tself.score = None\n\t\tself.team_id = None\n\t\tself.team_score = None\n\t\tself.is_first_upload = None\n\t\tself.metadata = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'season_id', 'unk3', 'score', 'team_id', 'team_score', 'is_first_upload', 'metadata']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.season_id = stream.u32()\n\t\tself.unk3 = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.team_id = stream.u8()\n\t\tself.team_score = stream.u32()\n\t\tself.is_first_upload = stream.bool()\n\t\tself.metadata = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.u32(self.season_id)\n\t\tstream.u32(self.unk3)\n\t\tstream.u32(self.score)\n\t\tstream.u8(self.team_id)\n\t\tstream.u32(self.team_score)\n\t\tstream.bool(self.is_first_upload)\n\t\tstream.qbuffer(self.metadata)\n\n\nclass RankingProtocolMK8:\n\tMETHOD_UPLOAD_SCORE = 1\n\tMETHOD_DELETE_SCORE = 2\n\tMETHOD_DELETE_ALL_SCORES = 3\n\tMETHOD_UPLOAD_COMMON_DATA = 4\n\tMETHOD_DELETE_COMMON_DATA = 5\n\tMETHOD_GET_COMMON_DATA = 6\n\tMETHOD_CHANGE_ATTRIBUTES = 7\n\tMETHOD_CHANGE_ALL_ATTRIBUTES = 8\n\tMETHOD_GET_RANKING = 9\n\tMETHOD_GET_APPROX_ORDER = 10\n\tMETHOD_GET_STATS = 11\n\tMETHOD_GET_RANKING_BY_PID_LIST = 12\n\tMETHOD_GET_RANKING_BY_UNIQUE_ID_LIST = 13\n\tMETHOD_GET_COMPETITION_RANKING_SCORE = 14\n\tMETHOD_UPLOAD_COMPETITION_RANKING_SCORE = 15\n\tMETHOD_GET_COMPETITION_INFO = 16\n\t\n\tPROTOCOL_ID = 0x70\n\n\nclass RankingClientMK8(RankingProtocolMK8):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def upload_score(self, score_data, unique_id):\n\t\tlogger.info(\"RankingClientMK8.upload_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(score_data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.upload_score -> done\")\n\t\n\tasync def delete_score(self, category, unique_id):\n\t\tlogger.info(\"RankingClientMK8.delete_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.delete_score -> done\")\n\t\n\tasync def delete_all_scores(self, unique_id):\n\t\tlogger.info(\"RankingClientMK8.delete_all_scores()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_ALL_SCORES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.delete_all_scores -> done\")\n\t\n\tasync def upload_common_data(self, common_data, unique_id):\n\t\tlogger.info(\"RankingClientMK8.upload_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.buffer(common_data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.upload_common_data -> done\")\n\t\n\tasync def delete_common_data(self, unique_id):\n\t\tlogger.info(\"RankingClientMK8.delete_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.delete_common_data -> done\")\n\t\n\tasync def get_common_data(self, unique_id):\n\t\tlogger.info(\"RankingClientMK8.get_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_common_data -> done\")\n\t\treturn data\n\t\n\tasync def change_attributes(self, category, param, unique_id):\n\t\tlogger.info(\"RankingClientMK8.change_attributes()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(param)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_ATTRIBUTES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.change_attributes -> done\")\n\t\n\tasync def change_all_attributes(self, param, unique_id):\n\t\tlogger.info(\"RankingClientMK8.change_all_attributes()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_ALL_ATTRIBUTES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.change_all_attributes -> done\")\n\t\n\tasync def get_ranking(self, mode, category, order, unique_id, pid):\n\t\tlogger.info(\"RankingClientMK8.get_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_ranking -> done\")\n\t\treturn result\n\t\n\tasync def get_approx_order(self, category, order, score, unique_id, pid):\n\t\tlogger.info(\"RankingClientMK8.get_approx_order()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u32(score)\n\t\tstream.u64(unique_id)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_APPROX_ORDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\torder = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_approx_order -> done\")\n\t\treturn order\n\t\n\tasync def get_stats(self, category, order, flags):\n\t\tlogger.info(\"RankingClientMK8.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u32(flags)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(RankingStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_ranking_by_pid_list(self, pids, mode, category, order, unique_id):\n\t\tlogger.info(\"RankingClientMK8.get_ranking_by_pid_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_PID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_ranking_by_pid_list -> done\")\n\t\treturn result\n\t\n\tasync def get_ranking_by_unique_id_list(self, ids, mode, category, order, unique_id):\n\t\tlogger.info(\"RankingClientMK8.get_ranking_by_unique_id_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u64)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_UNIQUE_ID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_ranking_by_unique_id_list -> done\")\n\t\treturn result\n\t\n\tasync def upload_competition_ranking_score(self, param):\n\t\tlogger.info(\"RankingClientMK8.upload_competition_ranking_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_COMPETITION_RANKING_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.upload_competition_ranking_score -> done\")\n\t\treturn result\n\t\n\tasync def get_competition_info(self, param):\n\t\tlogger.info(\"RankingClientMK8.get_competition_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMPETITION_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.list(CompetitionRankingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8.get_competition_info -> done\")\n\t\treturn info\n\n\nclass RankingServerMK8(RankingProtocolMK8):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_UPLOAD_SCORE: self.handle_upload_score,\n\t\t\tself.METHOD_DELETE_SCORE: self.handle_delete_score,\n\t\t\tself.METHOD_DELETE_ALL_SCORES: self.handle_delete_all_scores,\n\t\t\tself.METHOD_UPLOAD_COMMON_DATA: self.handle_upload_common_data,\n\t\t\tself.METHOD_DELETE_COMMON_DATA: self.handle_delete_common_data,\n\t\t\tself.METHOD_GET_COMMON_DATA: self.handle_get_common_data,\n\t\t\tself.METHOD_CHANGE_ATTRIBUTES: self.handle_change_attributes,\n\t\t\tself.METHOD_CHANGE_ALL_ATTRIBUTES: self.handle_change_all_attributes,\n\t\t\tself.METHOD_GET_RANKING: self.handle_get_ranking,\n\t\t\tself.METHOD_GET_APPROX_ORDER: self.handle_get_approx_order,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_GET_RANKING_BY_PID_LIST: self.handle_get_ranking_by_pid_list,\n\t\t\tself.METHOD_GET_RANKING_BY_UNIQUE_ID_LIST: self.handle_get_ranking_by_unique_id_list,\n\t\t\tself.METHOD_GET_COMPETITION_RANKING_SCORE: self.handle_get_competition_ranking_score,\n\t\t\tself.METHOD_UPLOAD_COMPETITION_RANKING_SCORE: self.handle_upload_competition_ranking_score,\n\t\t\tself.METHOD_GET_COMPETITION_INFO: self.handle_get_competition_info,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on RankingServerMK8: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_upload_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.upload_score()\")\n\t\t#--- request ---\n\t\tscore_data = input.extract(RankingScoreData)\n\t\tunique_id = input.u64()\n\t\tawait self.upload_score(client, score_data, unique_id)\n\t\n\tasync def handle_delete_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.delete_score()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tunique_id = input.u64()\n\t\tawait self.delete_score(client, category, unique_id)\n\t\n\tasync def handle_delete_all_scores(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.delete_all_scores()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_all_scores(client, unique_id)\n\t\n\tasync def handle_upload_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.upload_common_data()\")\n\t\t#--- request ---\n\t\tcommon_data = input.buffer()\n\t\tunique_id = input.u64()\n\t\tawait self.upload_common_data(client, common_data, unique_id)\n\t\n\tasync def handle_delete_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.delete_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_common_data(client, unique_id)\n\t\n\tasync def handle_get_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_common_data(client, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_change_attributes(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.change_attributes()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tparam = input.extract(RankingChangeAttributesParam)\n\t\tunique_id = input.u64()\n\t\tawait self.change_attributes(client, category, param, unique_id)\n\t\n\tasync def handle_change_all_attributes(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.change_all_attributes()\")\n\t\t#--- request ---\n\t\tparam = input.extract(RankingChangeAttributesParam)\n\t\tunique_id = input.u64()\n\t\tawait self.change_all_attributes(client, param, unique_id)\n\t\n\tasync def handle_get_ranking(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_ranking()\")\n\t\t#--- request ---\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.get_ranking(client, mode, category, order, unique_id, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_approx_order(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_approx_order()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tscore = input.u32()\n\t\tunique_id = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.get_approx_order(client, category, order, score, unique_id, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_stats()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tflags = input.u32()\n\t\tresponse = await self.get_stats(client, category, order, flags)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingStats):\n\t\t\traise RuntimeError(\"Expected RankingStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_pid_list(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_ranking_by_pid_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_ranking_by_pid_list(client, pids, mode, category, order, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_unique_id_list(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_ranking_by_unique_id_list()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u64)\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_ranking_by_unique_id_list(client, ids, mode, category, order, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_competition_ranking_score(self, client, input, output):\n\t\tlogger.warning(\"RankingServerMK8.get_competition_ranking_score is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_upload_competition_ranking_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.upload_competition_ranking_score()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CompetitionRankingUploadScoreParam)\n\t\tresponse = await self.upload_competition_ranking_score(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_competition_info(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8.get_competition_info()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CompetitionRankingInfoGetParam)\n\t\tresponse = await self.get_competition_info(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def upload_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.upload_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.delete_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_all_scores(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.delete_all_scores not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def upload_common_data(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.upload_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_common_data(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.delete_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_common_data(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_attributes(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.change_attributes not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_all_attributes(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.change_all_attributes not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_approx_order(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_approx_order not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_pid_list(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_ranking_by_pid_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_unique_id_list(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_ranking_by_unique_id_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def upload_competition_ranking_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.upload_competition_ranking_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_competition_info(self, *args):\n\t\tlogger.warning(\"RankingServerMK8.get_competition_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/ranking_mk8d.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RankingOrderCalc:\n\tSTANDARD = 0\n\tORDINAL = 1\n\n\nclass RankingMode:\n\tGLOBAL = 0\n\tGLOBAL_AROUND_SELF = 1\n\tSELF = 4\n\n\nclass RankingStatFlags:\n\tRANKING_COUNT = 1\n\tTOTAL_SCORE = 2\n\tLOWEST_SCORE = 4\n\tHIGHEST_SCORE = 8\n\tAVERAGE_SCORE = 16\n\tALL = 31\n\n\nclass RankingOrderParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.order_calc = 0\n\t\tself.group_index = 255\n\t\tself.group_num = 0\n\t\tself.time_scope = 2\n\t\tself.offset = 0\n\t\tself.count = 10\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.order_calc = stream.u8()\n\t\tself.group_index = stream.u8()\n\t\tself.group_num = stream.u8()\n\t\tself.time_scope = stream.u8()\n\t\tself.offset = stream.u32()\n\t\tself.count = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.order_calc)\n\t\tstream.u8(self.group_index)\n\t\tstream.u8(self.group_num)\n\t\tstream.u8(self.time_scope)\n\t\tstream.u32(self.offset)\n\t\tstream.u8(self.count)\n\n\nclass RankingRankData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.pid = None\n\t\tself.unique_id = None\n\t\tself.rank = None\n\t\tself.category = None\n\t\tself.score = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\tself.common_data = None\n\t\tself.update_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['pid', 'unique_id', 'rank', 'category', 'score', 'groups', 'param', 'common_data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\tif settings[\"nex.version\"] >= 40000:\n\t\t\tfor field in ['update_time']:\n\t\t\t\tif getattr(self, field) is None:\n\t\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.pid = stream.pid()\n\t\tself.unique_id = stream.u64()\n\t\tself.rank = stream.u32()\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\tself.common_data = stream.buffer()\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tself.update_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.pid(self.pid)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u32(self.rank)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\t\tstream.buffer(self.common_data)\n\t\tif stream.settings[\"nex.version\"] >= 40000:\n\t\t\tstream.datetime(self.update_time)\n\n\nclass RankingResult(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\tself.total = None\n\t\tself.since_time = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data', 'total', 'since_time']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(RankingRankData)\n\t\tself.total = stream.u32()\n\t\tself.since_time = stream.datetime()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.add)\n\t\tstream.u32(self.total)\n\t\tstream.datetime(self.since_time)\n\n\nclass RankingCachedResult(RankingResult):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.created_time = None\n\t\tself.expired_time = None\n\t\tself.max_length = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['created_time', 'expired_time', 'max_length']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.created_time = stream.datetime()\n\t\tself.expired_time = stream.datetime()\n\t\tself.max_length = stream.u8()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.datetime(self.created_time)\n\t\tstream.datetime(self.expired_time)\n\t\tstream.u8(self.max_length)\ncommon.DataHolder.register(RankingCachedResult, \"RankingCachedResult\")\n\n\nclass RankingStats(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.stats = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['stats']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.stats = stream.list(stream.double)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.stats, stream.double)\n\n\nclass RankingScoreData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.category = None\n\t\tself.score = None\n\t\tself.order = None\n\t\tself.update_mode = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['category', 'score', 'order', 'update_mode', 'groups', 'param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.category = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.order = stream.u8()\n\t\tself.update_mode = stream.u8()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.category)\n\t\tstream.u32(self.score)\n\t\tstream.u8(self.order)\n\t\tstream.u8(self.update_mode)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\n\nclass RankingChangeAttributesParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.flags = None\n\t\tself.groups = None\n\t\tself.param = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['flags', 'groups', 'param']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.flags = stream.u8()\n\t\tself.groups = stream.list(stream.u8)\n\t\tself.param = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.flags)\n\t\tstream.list(self.groups, stream.u8)\n\t\tstream.u64(self.param)\n\n\nclass CommonDataList(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(stream.qbuffer)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.qbuffer)\n\n\nclass CompetitionRankingGetScoreParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.add(self.range)\n\n\nclass CompetitionRankingInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.num_participants = None\n\t\tself.team_scores = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'num_participants', 'team_scores']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.num_participants = stream.u32()\n\t\tself.team_scores = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.u32(self.num_participants)\n\t\tstream.list(self.team_scores, stream.u32)\n\n\nclass CompetitionRankingInfoGetParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rank_order = None\n\t\tself.range = common.ResultRange()\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rank_order']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rank_order = stream.u8()\n\t\tself.range = stream.extract(common.ResultRange)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u8(self.rank_order)\n\t\tstream.add(self.range)\n\n\nclass CompetitionRankingScoreData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.rank = None\n\t\tself.pid = None\n\t\tself.score = None\n\t\tself.last_update = None\n\t\tself.team_id = 255\n\t\tself.metadata = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['rank', 'pid', 'score', 'last_update', 'metadata']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.rank = stream.u32()\n\t\tself.pid = stream.pid()\n\t\tself.score = stream.u32()\n\t\tself.last_update = stream.datetime()\n\t\tself.team_id = stream.u8()\n\t\tself.metadata = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.rank)\n\t\tstream.pid(self.pid)\n\t\tstream.u32(self.score)\n\t\tstream.datetime(self.last_update)\n\t\tstream.u8(self.team_id)\n\t\tstream.qbuffer(self.metadata)\n\n\nclass CompetitionRankingScoreInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.season_id = None\n\t\tself.scores = None\n\t\tself.num_participants = None\n\t\tself.team_scores = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['season_id', 'scores', 'num_participants', 'team_scores']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.season_id = stream.u32()\n\t\tself.scores = stream.list(CompetitionRankingScoreData)\n\t\tself.num_participants = stream.u32()\n\t\tself.team_scores = stream.list(stream.u32)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.season_id)\n\t\tstream.list(self.scores, stream.add)\n\t\tstream.u32(self.num_participants)\n\t\tstream.list(self.team_scores, stream.u32)\n\n\nclass CompetitionRankingUploadScoreParam(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.id = None\n\t\tself.season_id = None\n\t\tself.unk3 = None\n\t\tself.score = None\n\t\tself.team_id = None\n\t\tself.team_score = None\n\t\tself.is_first_upload = None\n\t\tself.metadata = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['id', 'season_id', 'unk3', 'score', 'team_id', 'team_score', 'is_first_upload', 'metadata']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.id = stream.u32()\n\t\tself.season_id = stream.u32()\n\t\tself.unk3 = stream.u32()\n\t\tself.score = stream.u32()\n\t\tself.team_id = stream.u8()\n\t\tself.team_score = stream.u32()\n\t\tself.is_first_upload = stream.bool()\n\t\tself.metadata = stream.qbuffer()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u32(self.id)\n\t\tstream.u32(self.season_id)\n\t\tstream.u32(self.unk3)\n\t\tstream.u32(self.score)\n\t\tstream.u8(self.team_id)\n\t\tstream.u32(self.team_score)\n\t\tstream.bool(self.is_first_upload)\n\t\tstream.qbuffer(self.metadata)\n\n\nclass ScorePack(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.data = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['data']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.data = stream.list(stream.qbuffer)\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.list(self.data, stream.qbuffer)\n\n\nclass RankingProtocolMK8D:\n\tMETHOD_UPLOAD_SCORE = 1\n\tMETHOD_DELETE_SCORE = 2\n\tMETHOD_DELETE_ALL_SCORES = 3\n\tMETHOD_UPLOAD_COMMON_DATA = 4\n\tMETHOD_DELETE_COMMON_DATA = 5\n\tMETHOD_GET_COMMON_DATA = 6\n\tMETHOD_CHANGE_ATTRIBUTES = 7\n\tMETHOD_CHANGE_ALL_ATTRIBUTES = 8\n\tMETHOD_GET_RANKING = 9\n\tMETHOD_GET_APPROX_ORDER = 10\n\tMETHOD_GET_STATS = 11\n\tMETHOD_GET_RANKING_BY_PID_LIST = 12\n\tMETHOD_GET_RANKING_BY_UNIQUE_ID_LIST = 13\n\tMETHOD_GET_CACHED_TOPX_RANKING = 14\n\tMETHOD_GET_CACHED_TOPX_RANKINGS = 15\n\tMETHOD_GET_COMPETITION_RANKING_SCORE = 16\n\tMETHOD_UPLOAD_COMPETITION_RANKING_SCORE = 17\n\tMETHOD_GET_COMPETITION_INFO = 18\n\tMETHOD_UPLOAD_SCORE_PACK = 19\n\tMETHOD_GET_SCORE_PACK = 20\n\tMETHOD_EXECUTE_DELETE_SCORE_JOB = 21\n\tMETHOD_GET_COMMMON_DATA_BY_PID_LIST = 22\n\t\n\tPROTOCOL_ID = 0x70\n\n\nclass RankingClientMK8D(RankingProtocolMK8D):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def upload_score(self, score_data, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.upload_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(score_data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.upload_score -> done\")\n\t\n\tasync def delete_score(self, category, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.delete_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.delete_score -> done\")\n\t\n\tasync def delete_all_scores(self, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.delete_all_scores()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_ALL_SCORES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.delete_all_scores -> done\")\n\t\n\tasync def upload_common_data(self, common_data, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.upload_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.buffer(common_data)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.upload_common_data -> done\")\n\t\n\tasync def delete_common_data(self, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.delete_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_DELETE_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.delete_common_data -> done\")\n\t\n\tasync def get_common_data(self, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.get_common_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMMON_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tdata = stream.buffer()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_common_data -> done\")\n\t\treturn data\n\t\n\tasync def change_attributes(self, category, param, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.change_attributes()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(param)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_ATTRIBUTES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.change_attributes -> done\")\n\t\n\tasync def change_all_attributes(self, param, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.change_all_attributes()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_CHANGE_ALL_ATTRIBUTES, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.change_all_attributes -> done\")\n\t\n\tasync def get_ranking(self, mode, category, order, unique_id, pid):\n\t\tlogger.info(\"RankingClientMK8D.get_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_ranking -> done\")\n\t\treturn result\n\t\n\tasync def get_approx_order(self, category, order, score, unique_id, pid):\n\t\tlogger.info(\"RankingClientMK8D.get_approx_order()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u32(score)\n\t\tstream.u64(unique_id)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_APPROX_ORDER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\torder = stream.u32()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_approx_order -> done\")\n\t\treturn order\n\t\n\tasync def get_stats(self, category, order, flags):\n\t\tlogger.info(\"RankingClientMK8D.get_stats()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u32(flags)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STATS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tstats = stream.extract(RankingStats)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_stats -> done\")\n\t\treturn stats\n\t\n\tasync def get_ranking_by_pid_list(self, pids, mode, category, order, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.get_ranking_by_pid_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_PID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_ranking_by_pid_list -> done\")\n\t\treturn result\n\t\n\tasync def get_ranking_by_unique_id_list(self, ids, mode, category, order, unique_id):\n\t\tlogger.info(\"RankingClientMK8D.get_ranking_by_unique_id_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(ids, stream.u64)\n\t\tstream.u8(mode)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tstream.u64(unique_id)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_RANKING_BY_UNIQUE_ID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_ranking_by_unique_id_list -> done\")\n\t\treturn result\n\t\n\tasync def get_cached_topx_ranking(self, category, order):\n\t\tlogger.info(\"RankingClientMK8D.get_cached_topx_ranking()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(category)\n\t\tstream.add(order)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CACHED_TOPX_RANKING, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(RankingCachedResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_cached_topx_ranking -> done\")\n\t\treturn result\n\t\n\tasync def get_cached_topx_rankings(self, categories, order):\n\t\tlogger.info(\"RankingClientMK8D.get_cached_topx_rankings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(categories, stream.u32)\n\t\tstream.list(order, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_CACHED_TOPX_RANKINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresults = stream.list(RankingCachedResult)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_cached_topx_rankings -> done\")\n\t\treturn results\n\t\n\tasync def get_competition_ranking_score(self, param):\n\t\tlogger.info(\"RankingClientMK8D.get_competition_ranking_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMPETITION_RANKING_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.list(CompetitionRankingScoreInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_competition_ranking_score -> done\")\n\t\treturn info\n\t\n\tasync def upload_competition_ranking_score(self, param):\n\t\tlogger.info(\"RankingClientMK8D.upload_competition_ranking_score()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_COMPETITION_RANKING_SCORE, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.bool()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.upload_competition_ranking_score -> done\")\n\t\treturn result\n\t\n\tasync def get_competition_info(self, param):\n\t\tlogger.info(\"RankingClientMK8D.get_competition_info()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(param)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMPETITION_INFO, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.list(CompetitionRankingInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_competition_info -> done\")\n\t\treturn info\n\t\n\tasync def upload_score_pack(self, score_data, metadata):\n\t\tlogger.info(\"RankingClientMK8D.upload_score_pack()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(score_data)\n\t\tstream.qbuffer(metadata)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPLOAD_SCORE_PACK, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.upload_score_pack -> done\")\n\t\n\tasync def get_score_pack(self, pids, category):\n\t\tlogger.info(\"RankingClientMK8D.get_score_pack()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tstream.u32(category)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_SCORE_PACK, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tresult = stream.extract(ScorePack)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_score_pack -> done\")\n\t\treturn result\n\t\n\tasync def get_commmon_data_by_pid_list(self, pids):\n\t\tlogger.info(\"RankingClientMK8D.get_commmon_data_by_pid_list()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(pids, stream.pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_COMMMON_DATA_BY_PID_LIST, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tlist = stream.extract(CommonDataList)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RankingClientMK8D.get_commmon_data_by_pid_list -> done\")\n\t\treturn list\n\n\nclass RankingServerMK8D(RankingProtocolMK8D):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_UPLOAD_SCORE: self.handle_upload_score,\n\t\t\tself.METHOD_DELETE_SCORE: self.handle_delete_score,\n\t\t\tself.METHOD_DELETE_ALL_SCORES: self.handle_delete_all_scores,\n\t\t\tself.METHOD_UPLOAD_COMMON_DATA: self.handle_upload_common_data,\n\t\t\tself.METHOD_DELETE_COMMON_DATA: self.handle_delete_common_data,\n\t\t\tself.METHOD_GET_COMMON_DATA: self.handle_get_common_data,\n\t\t\tself.METHOD_CHANGE_ATTRIBUTES: self.handle_change_attributes,\n\t\t\tself.METHOD_CHANGE_ALL_ATTRIBUTES: self.handle_change_all_attributes,\n\t\t\tself.METHOD_GET_RANKING: self.handle_get_ranking,\n\t\t\tself.METHOD_GET_APPROX_ORDER: self.handle_get_approx_order,\n\t\t\tself.METHOD_GET_STATS: self.handle_get_stats,\n\t\t\tself.METHOD_GET_RANKING_BY_PID_LIST: self.handle_get_ranking_by_pid_list,\n\t\t\tself.METHOD_GET_RANKING_BY_UNIQUE_ID_LIST: self.handle_get_ranking_by_unique_id_list,\n\t\t\tself.METHOD_GET_CACHED_TOPX_RANKING: self.handle_get_cached_topx_ranking,\n\t\t\tself.METHOD_GET_CACHED_TOPX_RANKINGS: self.handle_get_cached_topx_rankings,\n\t\t\tself.METHOD_GET_COMPETITION_RANKING_SCORE: self.handle_get_competition_ranking_score,\n\t\t\tself.METHOD_UPLOAD_COMPETITION_RANKING_SCORE: self.handle_upload_competition_ranking_score,\n\t\t\tself.METHOD_GET_COMPETITION_INFO: self.handle_get_competition_info,\n\t\t\tself.METHOD_UPLOAD_SCORE_PACK: self.handle_upload_score_pack,\n\t\t\tself.METHOD_GET_SCORE_PACK: self.handle_get_score_pack,\n\t\t\tself.METHOD_EXECUTE_DELETE_SCORE_JOB: self.handle_execute_delete_score_job,\n\t\t\tself.METHOD_GET_COMMMON_DATA_BY_PID_LIST: self.handle_get_commmon_data_by_pid_list,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on RankingServerMK8D: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_upload_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.upload_score()\")\n\t\t#--- request ---\n\t\tscore_data = input.extract(RankingScoreData)\n\t\tunique_id = input.u64()\n\t\tawait self.upload_score(client, score_data, unique_id)\n\t\n\tasync def handle_delete_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.delete_score()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tunique_id = input.u64()\n\t\tawait self.delete_score(client, category, unique_id)\n\t\n\tasync def handle_delete_all_scores(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.delete_all_scores()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_all_scores(client, unique_id)\n\t\n\tasync def handle_upload_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.upload_common_data()\")\n\t\t#--- request ---\n\t\tcommon_data = input.buffer()\n\t\tunique_id = input.u64()\n\t\tawait self.upload_common_data(client, common_data, unique_id)\n\t\n\tasync def handle_delete_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.delete_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tawait self.delete_common_data(client, unique_id)\n\t\n\tasync def handle_get_common_data(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_common_data()\")\n\t\t#--- request ---\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_common_data(client, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bytes):\n\t\t\traise RuntimeError(\"Expected bytes, got %s\" %response.__class__.__name__)\n\t\toutput.buffer(response)\n\t\n\tasync def handle_change_attributes(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.change_attributes()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\tparam = input.extract(RankingChangeAttributesParam)\n\t\tunique_id = input.u64()\n\t\tawait self.change_attributes(client, category, param, unique_id)\n\t\n\tasync def handle_change_all_attributes(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.change_all_attributes()\")\n\t\t#--- request ---\n\t\tparam = input.extract(RankingChangeAttributesParam)\n\t\tunique_id = input.u64()\n\t\tawait self.change_all_attributes(client, param, unique_id)\n\t\n\tasync def handle_get_ranking(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_ranking()\")\n\t\t#--- request ---\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.get_ranking(client, mode, category, order, unique_id, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_approx_order(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_approx_order()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tscore = input.u32()\n\t\tunique_id = input.u64()\n\t\tpid = input.pid()\n\t\tresponse = await self.get_approx_order(client, category, order, score, unique_id, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u32(response)\n\t\n\tasync def handle_get_stats(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_stats()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tflags = input.u32()\n\t\tresponse = await self.get_stats(client, category, order, flags)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingStats):\n\t\t\traise RuntimeError(\"Expected RankingStats, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_pid_list(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_ranking_by_pid_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_ranking_by_pid_list(client, pids, mode, category, order, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_ranking_by_unique_id_list(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_ranking_by_unique_id_list()\")\n\t\t#--- request ---\n\t\tids = input.list(input.u64)\n\t\tmode = input.u8()\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tunique_id = input.u64()\n\t\tresponse = await self.get_ranking_by_unique_id_list(client, ids, mode, category, order, unique_id)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingResult):\n\t\t\traise RuntimeError(\"Expected RankingResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_cached_topx_ranking(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_cached_topx_ranking()\")\n\t\t#--- request ---\n\t\tcategory = input.u32()\n\t\torder = input.extract(RankingOrderParam)\n\t\tresponse = await self.get_cached_topx_ranking(client, category, order)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, RankingCachedResult):\n\t\t\traise RuntimeError(\"Expected RankingCachedResult, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_cached_topx_rankings(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_cached_topx_rankings()\")\n\t\t#--- request ---\n\t\tcategories = input.list(input.u32)\n\t\torder = input.list(RankingOrderParam)\n\t\tresponse = await self.get_cached_topx_rankings(client, categories, order)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_competition_ranking_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_competition_ranking_score()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CompetitionRankingGetScoreParam)\n\t\tresponse = await self.get_competition_ranking_score(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_upload_competition_ranking_score(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.upload_competition_ranking_score()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CompetitionRankingUploadScoreParam)\n\t\tresponse = await self.upload_competition_ranking_score(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, bool):\n\t\t\traise RuntimeError(\"Expected bool, got %s\" %response.__class__.__name__)\n\t\toutput.bool(response)\n\t\n\tasync def handle_get_competition_info(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_competition_info()\")\n\t\t#--- request ---\n\t\tparam = input.extract(CompetitionRankingInfoGetParam)\n\t\tresponse = await self.get_competition_info(client, param)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_upload_score_pack(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.upload_score_pack()\")\n\t\t#--- request ---\n\t\tscore_data = input.extract(RankingScoreData)\n\t\tmetadata = input.qbuffer()\n\t\tawait self.upload_score_pack(client, score_data, metadata)\n\t\n\tasync def handle_get_score_pack(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_score_pack()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tcategory = input.u32()\n\t\tresponse = await self.get_score_pack(client, pids, category)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, ScorePack):\n\t\t\traise RuntimeError(\"Expected ScorePack, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_execute_delete_score_job(self, client, input, output):\n\t\tlogger.warning(\"RankingServerMK8D.execute_delete_score_job is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_commmon_data_by_pid_list(self, client, input, output):\n\t\tlogger.info(\"RankingServerMK8D.get_commmon_data_by_pid_list()\")\n\t\t#--- request ---\n\t\tpids = input.list(input.pid)\n\t\tresponse = await self.get_commmon_data_by_pid_list(client, pids)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, CommonDataList):\n\t\t\traise RuntimeError(\"Expected CommonDataList, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def upload_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.upload_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.delete_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_all_scores(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.delete_all_scores not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def upload_common_data(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.upload_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def delete_common_data(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.delete_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_common_data(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_common_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_attributes(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.change_attributes not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def change_all_attributes(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.change_all_attributes not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_approx_order(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_approx_order not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_stats(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_stats not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_pid_list(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_ranking_by_pid_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_ranking_by_unique_id_list(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_ranking_by_unique_id_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_cached_topx_ranking(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_cached_topx_ranking not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_cached_topx_rankings(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_cached_topx_rankings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_competition_ranking_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_competition_ranking_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def upload_competition_ranking_score(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.upload_competition_ranking_score not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_competition_info(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_competition_info not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def upload_score_pack(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.upload_score_pack not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_score_pack(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_score_pack not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_commmon_data_by_pid_list(self, *args):\n\t\tlogger.warning(\"RankingServerMK8D.get_commmon_data_by_pid_list not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/remotelog.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RemoteLogDeviceProtocol:\n\tMETHOD_LOG = 1\n\t\n\tPROTOCOL_ID = 0x1\n\n\nclass RemoteLogDeviceClient(RemoteLogDeviceProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def log(self, message):\n\t\tlogger.info(\"RemoteLogDeviceClient.log()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.string(message)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_LOG, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"RemoteLogDeviceClient.log -> done\")\n\n\nclass RemoteLogDeviceServer(RemoteLogDeviceProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_LOG: self.handle_log,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on RemoteLogDeviceServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_log(self, client, input, output):\n\t\tlogger.info(\"RemoteLogDeviceServer.log()\")\n\t\t#--- request ---\n\t\tmessage = input.string()\n\t\tawait self.log(client, message)\n\t\n\tasync def log(self, *args):\n\t\tlogger.warning(\"RemoteLogDeviceServer.log not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/rmc.py",
    "content": "\nfrom nintendo.nex import prudp, common, streams\nfrom anynet import util\nimport contextlib\nimport struct\nimport anyio\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass RMCResponse:\n\tpass\n\n\nclass RMCMessage:\n\tREQUEST = 0\n\tRESPONSE = 1\n\t\n\tdef __init__(self, settings):\n\t\tself.settings = settings\n\t\t\n\t\tself.mode = RMCMessage.REQUEST\n\t\tself.protocol = None\n\t\tself.method = None\n\t\tself.call_id = 0\n\t\tself.error = -1\n\t\tself.body = b\"\"\n\t\t\n\t@staticmethod\n\tdef prepare(settings, mode, protocol, method, call_id, body):\n\t\tinst = RMCMessage(settings)\n\t\tinst.mode = mode\n\t\tinst.protocol = protocol\n\t\tinst.method = method\n\t\tinst.call_id = call_id\n\t\tinst.body = body\n\t\treturn inst\n\t\t\n\t@staticmethod\n\tdef request(settings, protocol, method, call_id, body):\n\t\treturn RMCMessage.prepare(\n\t\t\tsettings, RMCMessage.REQUEST, protocol, method, call_id, body\n\t\t)\n\t\t\n\t@staticmethod\n\tdef response(settings, protocol, method, call_id, body):\n\t\treturn RMCMessage.prepare(\n\t\t\tsettings, RMCMessage.RESPONSE, protocol, method, call_id, body\n\t\t)\n\t\t\n\t@staticmethod\n\tdef error(settings, protocol, method, call_id, error):\n\t\tinst = RMCMessage(settings)\n\t\tinst.mode = RMCMessage.RESPONSE\n\t\tinst.protocol = protocol\n\t\tinst.method = method\n\t\tinst.call_id = call_id\n\t\tinst.error = error\n\t\treturn inst\n\t\n\t@staticmethod\n\tdef parse(settings, data):\n\t\tinst = RMCMessage(settings)\n\t\tinst.decode(data)\n\t\treturn inst\n\t\t\n\tdef encode(self):\n\t\tstream = streams.StreamOut(self.settings)\n\t\t\n\t\tflag = 0x80 if self.mode == self.REQUEST else 0\n\t\tif self.protocol < 0x80:\n\t\t\tstream.u8(self.protocol | flag)\n\t\telse:\n\t\t\tstream.u8(0x7F | flag)\n\t\t\tstream.u16(self.protocol)\n\t\t\n\t\tif self.mode == self.REQUEST:\n\t\t\tstream.u32(self.call_id)\n\t\t\tstream.u32(self.method)\n\t\t\tstream.write(self.body)\n\t\telse:\n\t\t\tif self.error != -1 and self.error & 0x80000000:\n\t\t\t\tstream.bool(False)\n\t\t\t\tstream.u32(self.error)\n\t\t\t\tstream.u32(self.call_id)\n\t\t\telse:\n\t\t\t\tstream.bool(True)\n\t\t\t\tstream.u32(self.call_id)\n\t\t\t\tstream.u32(self.method | 0x8000)\n\t\t\t\tstream.write(self.body)\n\t\treturn struct.pack(\"I\", stream.size()) + stream.get()\n\t\n\tdef decode(self, data):\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\t\n\t\tlength = stream.u32()\n\t\tif length != stream.size() - 4:\n\t\t\traise ValueError(\"RMC message has unexpected size\")\n\t\t\n\t\tprotocol = stream.u8()\n\t\tself.protocol = protocol & ~0x80\n\t\tif self.protocol == 0x7F:\n\t\t\tself.protocol = stream.u16()\n\t\t\n\t\tif protocol & 0x80:\n\t\t\tself.mode = self.REQUEST\n\t\t\tself.call_id = stream.u32()\n\t\t\tself.method = stream.u32()\n\t\t\tself.body = stream.readall()\n\t\telse:\n\t\t\tself.mode = self.RESPONSE\n\t\t\tif stream.bool():\n\t\t\t\tself.call_id = stream.u32()\n\t\t\t\tself.method = stream.u32() & ~0x8000\n\t\t\t\tself.body = stream.readall()\n\t\t\telse:\n\t\t\t\tself.error = stream.u32()\n\t\t\t\tself.call_id = stream.u32()\n\t\t\t\tif not stream.eof():\n\t\t\t\t\traise ValueError(\"RMC error message is bigger than expected\")\n\n\nclass RMCClient:\n\tdef __init__(self, settings, client):\n\t\tself.settings = settings.copy()\n\t\tself.client = client\n\t\tself.call_id = 1\n\t\t\n\t\tif self.client.minor_version() >= 3:\n\t\t\tself.settings[\"nex.struct_header\"] = True\n\t\t\n\t\tself.servers = {}\n\t\tself.requests = {}\n\t\tself.responses = {}\n\t\t\n\t\tself.closed = False\n\n\tasync def __aenter__(self): return self\n\tasync def __aexit__(self, typ, val, tb):\n\t\tawait self.cleanup()\n\t\n\tdef register_server(self, server):\n\t\tif server.PROTOCOL_ID in self.servers:\n\t\t\traise ValueError(\"Server with protocol id %i already exists\" %server.PROTOCOL_ID)\n\t\tself.servers[server.PROTOCOL_ID] = server\n\t\n\tasync def cleanup(self):\n\t\tif not self.closed:\n\t\t\tself.closed = True\n\t\t\tfor event in self.requests.values():\n\t\t\t\tevent.set()\n\t\t\t\n\t\t\tfor server in self.servers.values():\n\t\t\t\tawait server.logout(self)\n\t\n\tasync def close(self):\n\t\tif not self.closed:\n\t\t\tawait self.cleanup()\n\t\t\tawait self.client.close()\n\t\n\tasync def disconnect(self):\n\t\tif not self.closed:\n\t\t\tawait self.cleanup()\n\t\t\tawait self.client.disconnect()\n\t\n\tasync def start(self, servers):\n\t\tfor server in servers:\n\t\t\tself.register_server(server)\n\t\t\n\t\twhile not self.closed:\n\t\t\ttry:\n\t\t\t\tdata = await self.client.recv()\n\t\t\texcept anyio.EndOfStream:\n\t\t\t\tlogger.info(\"Connection was closed\")\n\t\t\t\tawait self.cleanup()\n\t\t\t\treturn\n\t\t\t\n\t\t\tmessage = RMCMessage.parse(self.settings, data)\n\t\t\tif message.mode == RMCMessage.REQUEST:\n\t\t\t\tlogger.debug(\n\t\t\t\t\t\"Received RMC request: protocol=%i method=%i call=%i\",\n\t\t\t\t\tmessage.protocol, message.method, message.call_id\n\t\t\t\t)\n\t\t\t\tawait self.handle_request(message)\n\t\t\telse:\n\t\t\t\tlogger.debug(\n\t\t\t\t\t\"Received RMC response: protocol=%i method=%s call=%i\",\n\t\t\t\t\tmessage.protocol, message.method, message.call_id\n\t\t\t\t)\n\t\t\t\tif message.call_id in self.requests:\n\t\t\t\t\tself.responses[message.call_id] = message\n\t\t\t\t\tevent = self.requests.pop(message.call_id)\n\t\t\t\t\tevent.set()\n\t\t\t\telse:\n\t\t\t\t\tlogger.warning(\"RMC response has invalid call id\")\n\t\n\tasync def handle_request(self, request):\n\t\tinput = streams.StreamIn(request.body, self.settings)\n\t\toutput = streams.StreamOut(self.settings)\n\t\t\n\t\tresult = common.Result()\n\t\tif request.protocol in self.servers:\n\t\t\ttry:\n\t\t\t\tawait self.servers[request.protocol].handle(self, request.method, input, output)\n\t\t\texcept common.RMCError as e:\n\t\t\t\tlogger.warning(\"RMC failed: %s\" %e)\n\t\t\t\tresult = e.result()\n\t\t\texcept Exception as e:\n\t\t\t\tlogger.exception(\"Exception occurred while handling a method call\")\n\t\t\t\t\n\t\t\t\tif isinstance(e, TypeError): result = common.Result.error(\"PythonCore::TypeError\")\n\t\t\t\telif isinstance(e, IndexError): result = common.Result.error(\"PythonCore::IndexError\")\n\t\t\t\telif isinstance(e, MemoryError): result = common.Result.error(\"PythonCore::MemoryError\")\n\t\t\t\telif isinstance(e, KeyError): result = common.Result.error(\"PythonCore::KeyError\")\n\t\t\t\telse: result = common.Result.error(\"PythonCore::Exception\")\n\t\t\texcept anyio.ExceptionGroup as e:\n\t\t\t\tlogger.exception(\"Multiple exceptions occurred while handling a method call\")\n\t\t\t\t\n\t\t\t\tfiltered = []\n\t\t\t\tfor exc in e.exceptions:\n\t\t\t\t\tif not isinstance(exc, Exception):\n\t\t\t\t\t\traise\n\t\t\t\t\n\t\t\t\tresult = common.Result.error(\"PythonCore::Exception\")\n\t\t\t\n\t\t\tif getattr(self.servers[request.protocol], \"NORESPONSE\", False):\n\t\t\t\treturn\n\t\telse:\n\t\t\tlogger.warning(\"Received RMC request with unimplemented protocol id: %i\", request.protocol)\n\t\t\tresult = common.Result.error(\"Core::NotImplemented\")\n\t\t\n\t\tif result.is_success():\n\t\t\tresponse = RMCMessage.response(\n\t\t\t\tself.settings, request.protocol, request.method,\n\t\t\t\trequest.call_id, output.get()\n\t\t\t)\n\t\telse:\n\t\t\tresponse = RMCMessage.error(\n\t\t\t\tself.settings, request.protocol, request.method,\n\t\t\t\trequest.call_id, result.code()\n\t\t\t)\n\t\tawait self.client.send(response.encode())\n\t\n\tasync def request(self, protocol, method, body, noresponse=False):\n\t\tif self.closed:\n\t\t\traise RuntimeError(\"RMC connection is closed\")\n\t\t\n\t\tcall_id = self.call_id\n\t\tself.call_id = (self.call_id + 1) & 0xFFFFFFFF\n\t\t\n\t\tif not noresponse:\n\t\t\tevent = anyio.Event()\n\t\t\tself.requests[call_id] = event\n\t\t\n\t\tmessage = RMCMessage.request(self.settings, protocol, method, call_id, body)\n\t\tawait self.client.send(message.encode())\n\t\t\n\t\tif not noresponse:\n\t\t\tawait event.wait()\n\t\t\t\n\t\t\tif self.closed:\n\t\t\t\traise RuntimeError(\"RMC connection is closed\")\n\t\t\t\n\t\t\tmessage = self.responses.pop(call_id)\n\t\t\tif message.error != -1:\n\t\t\t\traise common.RMCError(message.error)\n\t\t\treturn message.body\n\t\n\tdef pid(self): return self.client.pid()\n\t\n\tdef local_address(self):\n\t\treturn self.client.local_address()\n\tdef remote_address(self):\n\t\treturn self.client.remote_address()\n\t\n\tdef local_sid(self):\n\t\treturn self.client.local_sid()\n\tdef remote_sid(self):\n\t\treturn self.client.remote_sid()\n\n\n@contextlib.asynccontextmanager\nasync def connect(settings, host, port, vport=1, context=None, credentials=None, servers=[]):\n\tlogger.debug(\"Connecting RMC client to %s:%i:%i\", host, port, vport)\n\tasync with prudp.connect(settings, host, port, vport, 10, context, credentials) as client:\n\t\tclient = RMCClient(settings, client)\n\t\tasync with client:\n\t\t\tasync with util.create_task_group() as group:\n\t\t\t\tgroup.start_soon(client.start, servers)\n\t\t\t\tyield client\n\tlogger.debug(\"RMC client is closed\")\n\n@contextlib.asynccontextmanager\nasync def serve(settings, servers, host=\"\", port=0, vport=1, context=None, key=None):\n\tasync def handle(client):\n\t\thost, port = client.remote_address()\n\t\tlogger.debug(\"New RMC connection: %s:%i\", host, port)\n\t\t\n\t\tclient = RMCClient(settings, client)\n\t\tasync with client:\n\t\t\tawait client.start(servers)\n\t\n\tlogger.info(\"Starting RMC server at %s:%i:%i\", host, port, vport)\n\tasync with prudp.serve(handle, settings, host, port, vport, 10, context, key):\n\t\tyield\n\tlogger.info(\"RMC server is closed\")\n\n@contextlib.asynccontextmanager\nasync def serve_on_transport(settings, servers, transport, port, key=None):\n\tasync def handle(client):\n\t\thost, port = client.remote_address()\n\t\tlogger.debug(\"New RMC connection: %s:%i\", host, port)\n\t\t\n\t\tclient = RMCClient(settings, client)\n\t\tasync with client:\n\t\t\tawait client.start(servers)\n\t\n\tlogger.info(\"Starting RMC server at PRUDP port %i\", port)\n\tasync with transport.serve(handle, port, 10, key):\n\t\tyield\n\tlogger.info(\"RMC server is closed\")\n\nserve_prudp = serve_on_transport\n"
  },
  {
    "path": "nintendo/nex/screening.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass ScreeningProtocol:\n\tMETHOD_REPORT_DATA_STORE_CONTENT = 1\n\tMETHOD_REPORT_USER = 2\n\t\n\tPROTOCOL_ID = 0x7C\n\n\nclass ScreeningClient(ScreeningProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\n\nclass ScreeningServer(ScreeningProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REPORT_DATA_STORE_CONTENT: self.handle_report_data_store_content,\n\t\t\tself.METHOD_REPORT_USER: self.handle_report_user,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on ScreeningServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_report_data_store_content(self, client, input, output):\n\t\tlogger.warning(\"ScreeningServer.report_data_store_content is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_report_user(self, client, input, output):\n\t\tlogger.warning(\"ScreeningServer.report_user is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/secure.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass ConnectionData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.station = None\n\t\tself.connection_id = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['station', 'connection_id']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.station = stream.stationurl()\n\t\tself.connection_id = stream.u32()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.stationurl(self.station)\n\t\tstream.u32(self.connection_id)\n\n\nclass NintendoLoginData(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.token = None\n\t\n\tdef check_required(self, settings, version):\n\t\tfor field in ['token']:\n\t\t\tif getattr(self, field) is None:\n\t\t\t\traise ValueError(\"No value assigned to required field: %s\" %field)\n\t\n\tdef load(self, stream, version):\n\t\tself.token = stream.string()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.string(self.token)\n\n\nclass SecureConnectionProtocol:\n\tMETHOD_REGISTER = 1\n\tMETHOD_REQUEST_CONNECTION_DATA = 2\n\tMETHOD_REQUEST_URLS = 3\n\tMETHOD_REGISTER_EX = 4\n\tMETHOD_TEST_CONNECTIVITY = 5\n\tMETHOD_UPDATE_URLS = 6\n\tMETHOD_REPLACE_URL = 7\n\tMETHOD_SEND_REPORT = 8\n\t\n\tPROTOCOL_ID = 0xB\n\n\nclass SecureConnectionClient(SecureConnectionProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def register(self, urls):\n\t\tlogger.info(\"SecureConnectionClient.register()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.connection_id = stream.u32()\n\t\tobj.public_station = stream.stationurl()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.register -> done\")\n\t\treturn obj\n\t\n\tasync def request_connection_data(self, cid, pid):\n\t\tlogger.info(\"SecureConnectionClient.request_connection_data()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(cid)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_CONNECTION_DATA, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.connection_data = stream.list(ConnectionData)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.request_connection_data -> done\")\n\t\treturn obj\n\t\n\tasync def request_urls(self, cid, pid):\n\t\tlogger.info(\"SecureConnectionClient.request_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(cid)\n\t\tstream.pid(pid)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REQUEST_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.bool()\n\t\tobj.urls = stream.list(stream.stationurl)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.request_urls -> done\")\n\t\treturn obj\n\t\n\tasync def register_ex(self, urls, login_data):\n\t\tlogger.info(\"SecureConnectionClient.register_ex()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(urls, stream.stationurl)\n\t\tstream.anydata(login_data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REGISTER_EX, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tobj = rmc.RMCResponse()\n\t\tobj.result = stream.result()\n\t\tobj.connection_id = stream.u32()\n\t\tobj.public_station = stream.stationurl()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.register_ex -> done\")\n\t\treturn obj\n\t\n\tasync def test_connectivity(self):\n\t\tlogger.info(\"SecureConnectionClient.test_connectivity()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_TEST_CONNECTIVITY, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.test_connectivity -> done\")\n\t\n\tasync def update_urls(self, urls):\n\t\tlogger.info(\"SecureConnectionClient.update_urls()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(urls, stream.stationurl)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_UPDATE_URLS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.update_urls -> done\")\n\t\n\tasync def replace_url(self, url, new):\n\t\tlogger.info(\"SecureConnectionClient.replace_url()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.stationurl(url)\n\t\tstream.stationurl(new)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_REPLACE_URL, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.replace_url -> done\")\n\t\n\tasync def send_report(self, report_id, data):\n\t\tlogger.info(\"SecureConnectionClient.send_report()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(report_id)\n\t\tstream.qbuffer(data)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_SEND_REPORT, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"SecureConnectionClient.send_report -> done\")\n\n\nclass SecureConnectionServer(SecureConnectionProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_REGISTER: self.handle_register,\n\t\t\tself.METHOD_REQUEST_CONNECTION_DATA: self.handle_request_connection_data,\n\t\t\tself.METHOD_REQUEST_URLS: self.handle_request_urls,\n\t\t\tself.METHOD_REGISTER_EX: self.handle_register_ex,\n\t\t\tself.METHOD_TEST_CONNECTIVITY: self.handle_test_connectivity,\n\t\t\tself.METHOD_UPDATE_URLS: self.handle_update_urls,\n\t\t\tself.METHOD_REPLACE_URL: self.handle_replace_url,\n\t\t\tself.METHOD_SEND_REPORT: self.handle_send_report,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on SecureConnectionServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_register(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.register()\")\n\t\t#--- request ---\n\t\turls = input.list(input.stationurl)\n\t\tresponse = await self.register(client, urls)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'connection_id', 'public_station']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.u32(response.connection_id)\n\t\toutput.stationurl(response.public_station)\n\t\n\tasync def handle_request_connection_data(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.request_connection_data()\")\n\t\t#--- request ---\n\t\tcid = input.u32()\n\t\tpid = input.pid()\n\t\tresponse = await self.request_connection_data(client, cid, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'connection_data']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.connection_data, output.add)\n\t\n\tasync def handle_request_urls(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.request_urls()\")\n\t\t#--- request ---\n\t\tcid = input.u32()\n\t\tpid = input.pid()\n\t\tresponse = await self.request_urls(client, cid, pid)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'urls']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.bool(response.result)\n\t\toutput.list(response.urls, output.stationurl)\n\t\n\tasync def handle_register_ex(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.register_ex()\")\n\t\t#--- request ---\n\t\turls = input.list(input.stationurl)\n\t\tlogin_data = input.anydata()\n\t\tresponse = await self.register_ex(client, urls, login_data)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, rmc.RMCResponse):\n\t\t\traise RuntimeError(\"Expected RMCResponse, got %s\" %response.__class__.__name__)\n\t\tfor field in ['result', 'connection_id', 'public_station']:\n\t\t\tif not hasattr(response, field):\n\t\t\t\traise RuntimeError(\"Missing field in RMCResponse: %s\" %field)\n\t\toutput.result(response.result)\n\t\toutput.u32(response.connection_id)\n\t\toutput.stationurl(response.public_station)\n\t\n\tasync def handle_test_connectivity(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.test_connectivity()\")\n\t\t#--- request ---\n\t\tawait self.test_connectivity(client)\n\t\n\tasync def handle_update_urls(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.update_urls()\")\n\t\t#--- request ---\n\t\turls = input.list(input.stationurl)\n\t\tawait self.update_urls(client, urls)\n\t\n\tasync def handle_replace_url(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.replace_url()\")\n\t\t#--- request ---\n\t\turl = input.stationurl()\n\t\tnew = input.stationurl()\n\t\tawait self.replace_url(client, url, new)\n\t\n\tasync def handle_send_report(self, client, input, output):\n\t\tlogger.info(\"SecureConnectionServer.send_report()\")\n\t\t#--- request ---\n\t\treport_id = input.u32()\n\t\tdata = input.qbuffer()\n\t\tawait self.send_report(client, report_id, data)\n\t\n\tasync def register(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.register not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_connection_data(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.request_connection_data not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def request_urls(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.request_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def register_ex(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.register_ex not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def test_connectivity(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.test_connectivity not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def update_urls(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.update_urls not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def replace_url(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.replace_url not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def send_report(self, *args):\n\t\tlogger.warning(\"SecureConnectionServer.send_report not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/settings.py",
    "content": "\r\nfrom nintendo import resources\r\n\r\n\r\nclass Settings:\r\n\tTRANSPORT_UDP = 0\r\n\tTRANSPORT_TCP = 1\r\n\tTRANSPORT_WEBSOCKET = 2\r\n\r\n\tCOMPRESSION_NONE = 0\r\n\tCOMPRESSION_ZLIB = 1\r\n\r\n\tENCRYPTION_NONE = 0\r\n\tENCRYPTION_RC4 = 1\r\n\t\r\n\tfield_types = {\r\n\t\t\"nex.version\": int,\r\n\t\t\"nex.client_version\": int,\r\n\t\t\"nex.struct_header\": int,\r\n\t\t\"nex.pid_size\": int,\r\n\t\t\r\n\t\t\"prudp.access_key\": str,\r\n\t\t\r\n\t\t\"prudp.version\": int,\r\n\t\t\"prudp.minor_version\": int,\r\n\t\t\"prudp.supported_functions\": int,\r\n\t\t\r\n\t\t\"prudp.transport\": int,\r\n\t\t\"prudp.compression\": int,\r\n\t\t\"prudp.encryption\": int,\r\n\t\t\r\n\t\t\"prudp.resend_timeout\": float,\r\n\t\t\"prudp.resend_limit\": int,\r\n\t\t\"prudp.ping_timeout\": float,\r\n\t\t\r\n\t\t\"prudp.fragment_size\": int,\r\n\t\t\"prudp.max_substream_id\": int,\r\n\t\t\r\n\t\t\"prudp_v0.signature_version\": int,\r\n\t\t\"prudp_v0.flags_version\": int,\r\n\t\t\"prudp_v0.checksum_version\": int,\r\n\r\n\t\t\"kerberos.key_size\": int,\r\n\t\t\"kerberos.key_derivation\": int,\r\n\t\t\"kerberos.ticket_version\": int\r\n\t}\r\n\t\r\n\tdef __init__(self, filename=None):\r\n\t\tself.settings = {}\r\n\t\tself.reset()\r\n\t\tif filename:\r\n\t\t\tself.load(filename)\r\n\t\t\r\n\tdef __getitem__(self, name): return self.settings[name]\r\n\tdef __setitem__(self, name, value):\r\n\t\tif name not in self.field_types:\r\n\t\t\traise KeyError(\"Unknown setting: %s\" %name)\r\n\t\tself.settings[name] = self.field_types[name](value)\r\n\t\r\n\tdef configure(self, access_key, nex_version, client_version=None):\r\n\t\tself[\"prudp.access_key\"] = access_key\r\n\t\tself[\"nex.version\"] = nex_version\r\n\t\tif nex_version >= 40400:\r\n\t\t\tif client_version is None:\r\n\t\t\t\traise ValueError(\"NEX 4.4.0 or later requires client version\")\r\n\t\t\tself[\"nex.client_version\"] = client_version\r\n\t\t\r\n\tdef reset(self): self.load(\"default\")\r\n\tdef copy(self):\r\n\t\tcopy = Settings()\r\n\t\tcopy.settings = self.settings.copy()\r\n\t\treturn copy\r\n\r\n\tdef load(self, name):\r\n\t\twith resources.open(\"files/config/%s.cfg\" %name) as f:\r\n\t\t\tlinenum = 1\r\n\t\t\tfor line in f:\r\n\t\t\t\tline = line.strip()\r\n\t\t\t\tif line:\r\n\t\t\t\t\tif \"=\" in line:\r\n\t\t\t\t\t\tfield, value = line.split(\"=\", 1)\r\n\t\t\t\t\t\tself[field.strip()] = value.strip()\r\n\t\t\t\t\telse:\r\n\t\t\t\t\t\traise ValueError(\"Syntax error at line %i\" %linenum)\r\n\t\t\t\tlinenum += 1\r\n\t\t\t\t\r\n\t\t\t\t\r\ndef default():\r\n\treturn Settings()\r\n\r\ndef load(name):\r\n\treturn Settings(name)\r\n"
  },
  {
    "path": "nintendo/nex/streams.py",
    "content": "\nfrom nintendo.nex import common\nfrom anynet import streams\n\n\nclass StreamOut(streams.StreamOut):\n\tdef __init__(self, settings):\n\t\tsuper().__init__(\"<\")\n\t\tself.settings = settings\n\t\t\n\tdef pid(self, value):\n\t\tif self.settings[\"nex.pid_size\"] == 8:\n\t\t\tself.u64(value)\n\t\telse:\n\t\t\tself.u32(value)\n\t\t\t\n\tdef result(self, result):\n\t\tself.u32(result.code())\n\n\tdef list(self, list, func):\n\t\tself.u32(len(list))\n\t\tself.repeat(list, func)\n\t\t\n\tdef map(self, map, keyfunc, valuefunc):\n\t\tself.u32(len(map))\n\t\tfor key, value in map.items():\n\t\t\tkeyfunc(key)\n\t\t\tvaluefunc(value)\n\t\t\n\tdef string(self, string):\n\t\tif string is None:\n\t\t\tself.u16(0)\n\t\telse:\n\t\t\tdata = (string + \"\\0\").encode(\"utf8\")\n\t\t\tself.u16(len(data))\n\t\t\tself.write(data)\n\t\t\t\n\tdef stationurl(self, url):\n\t\tself.string(str(url))\n\t\n\tdef datetime(self, datetime):\n\t\tself.u64(datetime.value())\n\t\t\n\tdef buffer(self, data):\n\t\tself.u32(len(data))\n\t\tself.write(data)\n\t\t\n\tdef qbuffer(self, data):\n\t\tself.u16(len(data))\n\t\tself.write(data)\n\t\t\n\tdef add(self, inst):\n\t\tinst.encode(self)\n\t\t\n\tdef anydata(self, inst):\n\t\tholder = common.DataHolder()\n\t\tholder.data = inst\n\t\tself.add(holder)\n\t\t\n\tdef variant(self, value):\n\t\t# We have to check for bool before int,\n\t\t# because bool is a subclass of int\n\t\tif value is None: self.u8(0)\n\t\telif isinstance(value, bool):\n\t\t\tself.u8(3)\n\t\t\tself.bool(value)\n\t\telif isinstance(value, int):\n\t\t\tif value < 0:\n\t\t\t\tself.u8(1)\n\t\t\t\tself.s64(value)\n\t\t\telse:\n\t\t\t\tself.u8(6)\n\t\t\t\tself.u64(value)\n\t\telif isinstance(value, float):\n\t\t\tself.u8(2)\n\t\t\tself.double(value)\n\t\telif isinstance(value, str):\n\t\t\tself.u8(4)\n\t\t\tself.string(value)\n\t\telif isinstance(value, common.DateTime):\n\t\t\tself.u8(5)\n\t\t\tself.datetime(value)\n\t\telse:\n\t\t\traise TypeError(\"Type is not compatible with 'variant'\")\n\t\t\n\t\t\nclass StreamIn(streams.StreamIn):\n\tdef __init__(self, data, settings):\n\t\tsuper().__init__(data, \"<\")\n\t\tself.settings = settings\n\t\t\n\tdef pid(self):\n\t\tif self.settings[\"nex.pid_size\"] == 8:\n\t\t\treturn self.u64()\n\t\treturn self.u32()\n\t\t\n\tdef result(self):\n\t\treturn common.Result(self.u32())\n\n\tdef list(self, func):\n\t\treturn self.repeat(func, self.u32())\n\t\t\n\tdef map(self, keyfunc, valuefunc):\n\t\tmap = {}\n\t\tfor i in range(self.u32()):\n\t\t\tkey = self.callback(keyfunc)\n\t\t\tvalue = self.callback(valuefunc)\n\t\t\tmap[key] = value\n\t\treturn map\n\t\t\n\tdef repeat(self, func, count):\n\t\treturn [self.callback(func) for i in range(count)]\n\t\t\n\tdef callback(self, func):\n\t\tif isinstance(func, type) and issubclass(func, common.Structure):\n\t\t\treturn self.extract(func)\n\t\treturn func()\n\t\t\n\tdef string(self):\n\t\tlength = self.u16()\n\t\tif length:\n\t\t\treturn self.read(length).decode(\"utf8\")[:-1] #Remove null-terminator\n\t\t\t\n\tdef stationurl(self):\n\t\treturn common.StationURL.parse(self.string())\n\t\t\n\tdef datetime(self):\n\t\treturn common.DateTime(self.u64())\n\t\t\n\tdef buffer(self): return self.read(self.u32())\n\tdef qbuffer(self): return self.read(self.u16())\n\t\t\n\tdef substream(self):\n\t\treturn StreamIn(self.buffer(), self.settings)\n\t\n\tdef extract(self, cls):\n\t\tinst = cls()\n\t\tinst.decode(self)\n\t\treturn inst\n\t\t\n\tdef anydata(self):\n\t\treturn self.extract(common.DataHolder).data\n\t\t\n\tdef variant(self):\n\t\ttype = self.u8()\n\t\tif type == 0: return None\n\t\telif type == 1: return self.s64()\n\t\telif type == 2: return self.double()\n\t\telif type == 3: return self.bool()\n\t\telif type == 4: return self.string()\n\t\telif type == 5: return self.datetime()\n\t\telif type == 6: return self.u64()\n\t\traise ValueError(\"Variant has invalid type id\")\n"
  },
  {
    "path": "nintendo/nex/subscriber.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass SubscriberProtocol:\n\tMETHOD_HELLO = 1\n\tMETHOD_POST_CONTENT = 2\n\tMETHOD_GET_CONTENT = 3\n\tMETHOD_FOLLOW = 4\n\tMETHOD_UNFOLLOW_ALL_AND_FOLLOW = 5\n\tMETHOD_UNFOLLOW = 6\n\tMETHOD_GET_FOLLOWING = 7\n\tMETHOD_GET_FOLLOWER = 8\n\tMETHOD_GET_NUM_FOLLOWERS = 9\n\tMETHOD_GET_TIMELINE = 10\n\tMETHOD_DELETE_CONTENT = 11\n\tMETHOD_GET_CONTENT_MULTI = 12\n\tMETHOD_UPDATE_USER_STATUS = 13\n\tMETHOD_GET_FRIEND_USER_STATUSES = 14\n\tMETHOD_GET_USER_STATUSES = 15\n\t\n\tPROTOCOL_ID = 0x79\n\n\nclass SubscriberClient(SubscriberProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\n\nclass SubscriberServer(SubscriberProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_HELLO: self.handle_hello,\n\t\t\tself.METHOD_POST_CONTENT: self.handle_post_content,\n\t\t\tself.METHOD_GET_CONTENT: self.handle_get_content,\n\t\t\tself.METHOD_FOLLOW: self.handle_follow,\n\t\t\tself.METHOD_UNFOLLOW_ALL_AND_FOLLOW: self.handle_unfollow_all_and_follow,\n\t\t\tself.METHOD_UNFOLLOW: self.handle_unfollow,\n\t\t\tself.METHOD_GET_FOLLOWING: self.handle_get_following,\n\t\t\tself.METHOD_GET_FOLLOWER: self.handle_get_follower,\n\t\t\tself.METHOD_GET_NUM_FOLLOWERS: self.handle_get_num_followers,\n\t\t\tself.METHOD_GET_TIMELINE: self.handle_get_timeline,\n\t\t\tself.METHOD_DELETE_CONTENT: self.handle_delete_content,\n\t\t\tself.METHOD_GET_CONTENT_MULTI: self.handle_get_content_multi,\n\t\t\tself.METHOD_UPDATE_USER_STATUS: self.handle_update_user_status,\n\t\t\tself.METHOD_GET_FRIEND_USER_STATUSES: self.handle_get_friend_user_statuses,\n\t\t\tself.METHOD_GET_USER_STATUSES: self.handle_get_user_statuses,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on SubscriberServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_hello(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.hello is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_post_content(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.post_content is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_content(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_content is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_follow(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.follow is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_unfollow_all_and_follow(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.unfollow_all_and_follow is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_unfollow(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.unfollow is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_following(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_following is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_follower(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_follower is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_num_followers(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_num_followers is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_timeline(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_timeline is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_delete_content(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.delete_content is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_content_multi(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_content_multi is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_update_user_status(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.update_user_status is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_friend_user_statuses(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_friend_user_statuses is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_get_user_statuses(self, client, input, output):\n\t\tlogger.warning(\"SubscriberServer.get_user_statuses is not supported\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nex/utility.py",
    "content": "\n# This file was generated automatically by generate_protocols.py\n\nfrom nintendo.nex import notification, rmc, common, streams\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nclass UniqueIdInfo(common.Structure):\n\tdef __init__(self):\n\t\tsuper().__init__()\n\t\tself.unique_id = 0\n\t\tself.password = 0\n\t\n\tdef check_required(self, settings, version):\n\t\tpass\n\t\n\tdef load(self, stream, version):\n\t\tself.unique_id = stream.u64()\n\t\tself.password = stream.u64()\n\t\n\tdef save(self, stream, version):\n\t\tself.check_required(stream.settings, version)\n\t\tstream.u64(self.unique_id)\n\t\tstream.u64(self.password)\n\n\nclass UtilityProtocol:\n\tMETHOD_ACQUIRE_NEX_UNIQUE_ID = 1\n\tMETHOD_ACQUIRE_NEX_UNIQUE_ID_WITH_PASSWORD = 2\n\tMETHOD_ASSOCIATE_NEX_UNIQUE_ID_WITH_MY_PRINCIPAL_ID = 3\n\tMETHOD_ASSOCIATE_NEX_UNIQUE_IDS_WITH_MY_PRINCIPAL_ID = 4\n\tMETHOD_GET_ASSOCIATED_NEX_UNIQUE_ID_WITH_MY_PRINCIPAL_ID = 5\n\tMETHOD_GET_ASSOCIATED_NEX_UNIQUE_IDS_WITH_MY_PRINCIPAL_ID = 6\n\tMETHOD_GET_INTEGER_SETTINGS = 7\n\tMETHOD_GET_STRING_SETTINGS = 8\n\t\n\tPROTOCOL_ID = 0x6E\n\n\nclass UtilityClient(UtilityProtocol):\n\tdef __init__(self, client):\n\t\tself.settings = client.settings\n\t\tself.client = client\n\t\n\tasync def acquire_nex_unique_id(self):\n\t\tlogger.info(\"UtilityClient.acquire_nex_unique_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACQUIRE_NEX_UNIQUE_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tunique_id = stream.u64()\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.acquire_nex_unique_id -> done\")\n\t\treturn unique_id\n\t\n\tasync def acquire_nex_unique_id_with_password(self):\n\t\tlogger.info(\"UtilityClient.acquire_nex_unique_id_with_password()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ACQUIRE_NEX_UNIQUE_ID_WITH_PASSWORD, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(UniqueIdInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.acquire_nex_unique_id_with_password -> done\")\n\t\treturn info\n\t\n\tasync def associate_nex_unique_id_with_my_principal_id(self, info):\n\t\tlogger.info(\"UtilityClient.associate_nex_unique_id_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.add(info)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ASSOCIATE_NEX_UNIQUE_ID_WITH_MY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.associate_nex_unique_id_with_my_principal_id -> done\")\n\t\n\tasync def associate_nex_unique_ids_with_my_principal_id(self, infos):\n\t\tlogger.info(\"UtilityClient.associate_nex_unique_ids_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.list(infos, stream.add)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_ASSOCIATE_NEX_UNIQUE_IDS_WITH_MY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.associate_nex_unique_ids_with_my_principal_id -> done\")\n\t\n\tasync def get_associated_nex_unique_id_with_my_principal_id(self):\n\t\tlogger.info(\"UtilityClient.get_associated_nex_unique_id_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ASSOCIATED_NEX_UNIQUE_ID_WITH_MY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfo = stream.extract(UniqueIdInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.get_associated_nex_unique_id_with_my_principal_id -> done\")\n\t\treturn info\n\t\n\tasync def get_associated_nex_unique_ids_with_my_principal_id(self):\n\t\tlogger.info(\"UtilityClient.get_associated_nex_unique_ids_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_ASSOCIATED_NEX_UNIQUE_IDS_WITH_MY_PRINCIPAL_ID, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tinfos = stream.list(UniqueIdInfo)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.get_associated_nex_unique_ids_with_my_principal_id -> done\")\n\t\treturn infos\n\t\n\tasync def get_integer_settings(self, index):\n\t\tlogger.info(\"UtilityClient.get_integer_settings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(index)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_INTEGER_SETTINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsettings = stream.map(stream.u16, stream.s32)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.get_integer_settings -> done\")\n\t\treturn settings\n\t\n\tasync def get_string_settings(self, index):\n\t\tlogger.info(\"UtilityClient.get_string_settings()\")\n\t\t#--- request ---\n\t\tstream = streams.StreamOut(self.settings)\n\t\tstream.u32(index)\n\t\tdata = await self.client.request(self.PROTOCOL_ID, self.METHOD_GET_STRING_SETTINGS, stream.get())\n\t\t\n\t\t#--- response ---\n\t\tstream = streams.StreamIn(data, self.settings)\n\t\tsettings = stream.map(stream.u16, stream.string)\n\t\tif not stream.eof():\n\t\t\traise ValueError(\"Response is bigger than expected (got %i bytes, but only %i were read)\" %(stream.size(), stream.tell()))\n\t\tlogger.info(\"UtilityClient.get_string_settings -> done\")\n\t\treturn settings\n\n\nclass UtilityServer(UtilityProtocol):\n\tdef __init__(self):\n\t\tself.methods = {\n\t\t\tself.METHOD_ACQUIRE_NEX_UNIQUE_ID: self.handle_acquire_nex_unique_id,\n\t\t\tself.METHOD_ACQUIRE_NEX_UNIQUE_ID_WITH_PASSWORD: self.handle_acquire_nex_unique_id_with_password,\n\t\t\tself.METHOD_ASSOCIATE_NEX_UNIQUE_ID_WITH_MY_PRINCIPAL_ID: self.handle_associate_nex_unique_id_with_my_principal_id,\n\t\t\tself.METHOD_ASSOCIATE_NEX_UNIQUE_IDS_WITH_MY_PRINCIPAL_ID: self.handle_associate_nex_unique_ids_with_my_principal_id,\n\t\t\tself.METHOD_GET_ASSOCIATED_NEX_UNIQUE_ID_WITH_MY_PRINCIPAL_ID: self.handle_get_associated_nex_unique_id_with_my_principal_id,\n\t\t\tself.METHOD_GET_ASSOCIATED_NEX_UNIQUE_IDS_WITH_MY_PRINCIPAL_ID: self.handle_get_associated_nex_unique_ids_with_my_principal_id,\n\t\t\tself.METHOD_GET_INTEGER_SETTINGS: self.handle_get_integer_settings,\n\t\t\tself.METHOD_GET_STRING_SETTINGS: self.handle_get_string_settings,\n\t\t}\n\t\n\tasync def logout(self, client):\n\t\tpass\n\t\n\tasync def handle(self, client, method_id, input, output):\n\t\tif method_id in self.methods:\n\t\t\tawait self.methods[method_id](client, input, output)\n\t\telse:\n\t\t\tlogger.warning(\"Unknown method called on UtilityServer: %i\", method_id)\n\t\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def handle_acquire_nex_unique_id(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.acquire_nex_unique_id()\")\n\t\t#--- request ---\n\t\tresponse = await self.acquire_nex_unique_id(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, int):\n\t\t\traise RuntimeError(\"Expected int, got %s\" %response.__class__.__name__)\n\t\toutput.u64(response)\n\t\n\tasync def handle_acquire_nex_unique_id_with_password(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.acquire_nex_unique_id_with_password()\")\n\t\t#--- request ---\n\t\tresponse = await self.acquire_nex_unique_id_with_password(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, UniqueIdInfo):\n\t\t\traise RuntimeError(\"Expected UniqueIdInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_associate_nex_unique_id_with_my_principal_id(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.associate_nex_unique_id_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tinfo = input.extract(UniqueIdInfo)\n\t\tawait self.associate_nex_unique_id_with_my_principal_id(client, info)\n\t\n\tasync def handle_associate_nex_unique_ids_with_my_principal_id(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.associate_nex_unique_ids_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tinfos = input.list(UniqueIdInfo)\n\t\tawait self.associate_nex_unique_ids_with_my_principal_id(client, infos)\n\t\n\tasync def handle_get_associated_nex_unique_id_with_my_principal_id(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.get_associated_nex_unique_id_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_associated_nex_unique_id_with_my_principal_id(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, UniqueIdInfo):\n\t\t\traise RuntimeError(\"Expected UniqueIdInfo, got %s\" %response.__class__.__name__)\n\t\toutput.add(response)\n\t\n\tasync def handle_get_associated_nex_unique_ids_with_my_principal_id(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.get_associated_nex_unique_ids_with_my_principal_id()\")\n\t\t#--- request ---\n\t\tresponse = await self.get_associated_nex_unique_ids_with_my_principal_id(client)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, list):\n\t\t\traise RuntimeError(\"Expected list, got %s\" %response.__class__.__name__)\n\t\toutput.list(response, output.add)\n\t\n\tasync def handle_get_integer_settings(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.get_integer_settings()\")\n\t\t#--- request ---\n\t\tindex = input.u32()\n\t\tresponse = await self.get_integer_settings(client, index)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, dict):\n\t\t\traise RuntimeError(\"Expected dict, got %s\" %response.__class__.__name__)\n\t\toutput.map(response, output.u16, output.s32)\n\t\n\tasync def handle_get_string_settings(self, client, input, output):\n\t\tlogger.info(\"UtilityServer.get_string_settings()\")\n\t\t#--- request ---\n\t\tindex = input.u32()\n\t\tresponse = await self.get_string_settings(client, index)\n\t\t\n\t\t#--- response ---\n\t\tif not isinstance(response, dict):\n\t\t\traise RuntimeError(\"Expected dict, got %s\" %response.__class__.__name__)\n\t\toutput.map(response, output.u16, output.string)\n\t\n\tasync def acquire_nex_unique_id(self, *args):\n\t\tlogger.warning(\"UtilityServer.acquire_nex_unique_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def acquire_nex_unique_id_with_password(self, *args):\n\t\tlogger.warning(\"UtilityServer.acquire_nex_unique_id_with_password not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def associate_nex_unique_id_with_my_principal_id(self, *args):\n\t\tlogger.warning(\"UtilityServer.associate_nex_unique_id_with_my_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def associate_nex_unique_ids_with_my_principal_id(self, *args):\n\t\tlogger.warning(\"UtilityServer.associate_nex_unique_ids_with_my_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_associated_nex_unique_id_with_my_principal_id(self, *args):\n\t\tlogger.warning(\"UtilityServer.get_associated_nex_unique_id_with_my_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_associated_nex_unique_ids_with_my_principal_id(self, *args):\n\t\tlogger.warning(\"UtilityServer.get_associated_nex_unique_ids_with_my_principal_id not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_integer_settings(self, *args):\n\t\tlogger.warning(\"UtilityServer.get_integer_settings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\t\n\tasync def get_string_settings(self, *args):\n\t\tlogger.warning(\"UtilityServer.get_string_settings not implemented\")\n\t\traise common.RMCError(\"Core::NotImplemented\")\n\n"
  },
  {
    "path": "nintendo/nnas.py",
    "content": "\nfrom anynet import http, tls\nfrom nintendo import resources\nimport datetime\nimport hashlib\nimport struct\nimport base64\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\ndef calc_password_hash(pid, password):\n\tdata = struct.pack(\"<I\", pid) + b\"\\x02\\x65\\x43\\x46\" + password.encode(\"ascii\")\n\treturn hashlib.sha256(data).hexdigest()\n\n\nclass NNASError(Exception):\n\tdef __init__(self, status_code, errors):\n\t\tself.status_code = status_code\n\t\tself.errors = errors\n\t\n\tdef __str__(self):\n\t\tif self.errors:\n\t\t\treturn \"Account request failed: %s\" %self.errors\n\t\telse:\n\t\t\treturn \"Account request failed with status %i\" %self.status_code\n\n\nclass OAuth20:\n\tdef __init__(self):\n\t\tself.token = None\n\t\tself.refresh_token = None\n\t\tself.expires_in = None\n\t\n\t@classmethod\n\tdef parse(cls, tree):\n\t\taccess_token = tree[\"access_token\"]\n\t\t\n\t\tinst = cls()\n\t\tinst.token = access_token[\"token\"].text\n\t\tinst.refresh_token = access_token[\"refresh_token\"].text\n\t\tinst.expires_in = int(access_token[\"expires_in\"].text)\n\t\treturn inst\n\n\nclass NexToken:\n\tdef __init__(self):\n\t\tself.host = None\n\t\tself.port = None\n\t\tself.pid = None\n\t\tself.password = None\n\t\tself.token = None\n\t\n\t@classmethod\n\tdef parse(cls, tree):\n\t\tinst = cls()\n\t\tinst.host = tree[\"host\"].text\n\t\tinst.port = int(tree[\"port\"].text)\n\t\tinst.pid = int(tree[\"pid\"].text)\n\t\tinst.password = tree[\"nex_password\"].text\n\t\tinst.token = tree[\"token\"].text\n\t\treturn inst\n\t\t\n\t\t\nclass MiiImage:\n\tdef __init__(self):\n\t\tself.id = None\n\t\tself.type = None\n\t\tself.url = None\n\t\tself.cached_url = None\n\t\n\t@classmethod\n\tdef parse(cls, image):\n\t\tinst = cls()\n\t\tinst.cached_url = image[\"cached_url\"].text\n\t\tinst.id = int(image[\"id\"].text)\n\t\tinst.url = image[\"url\"].text\n\t\tinst.type = image[\"type\"].text\n\t\treturn inst\n\t\t\n\nclass Mii:\n\tdef __init__(self):\n\t\tself.data = None\n\t\tself.id = None\n\t\tself.name = None\n\t\tself.images = None\n\t\tself.primary = None\n\t\tself.pid = None\n\t\tself.nnid = None\n\t\n\t@classmethod\n\tdef parse(cls, mii):\n\t\tinst = cls()\n\t\tinst.data = base64.b64decode(mii[\"data\"].text)\n\t\tinst.id = int(mii[\"id\"].text)\n\t\tinst.name = mii[\"name\"].text\n\t\tinst.images = [MiiImage.parse(image) for image in mii[\"images\"]]\n\t\tinst.primary = mii[\"primary\"].text == \"Y\"\n\t\tinst.pid = int(mii[\"pid\"].text)\n\t\tinst.nnid = mii[\"user_id\"].text\n\t\treturn inst\n\n\nclass Account:\n\tdef __init__(self):\n\t\tself.domain = None\n\t\tself.type = None\n\t\tself.username = None\n\t\n\t@classmethod\n\tdef parse(cls, account):\n\t\tinst = cls()\n\t\tinst.domain = account[\"domain\"].text\n\t\tinst.type = account[\"type\"].text\n\t\tinst.username = account[\"username\"].text\n\t\treturn inst\n\t\t\n\t\t\nclass DeviceAttribute:\n\tdef __init__(self):\n\t\tself.created_date = None\n\t\tself.name = None\n\t\tself.value = None\n\t\n\t@classmethod\n\tdef parse(cls, attribute):\n\t\tinst = cls()\n\t\tinst.created_date = datetime.datetime.fromisoformat(attribute[\"created_date\"].text)\n\t\tinst.name = attribute[\"name\"].text\n\t\tinst.value = attribute[\"value\"].text\n\t\treturn inst\n\t\t\n\t\t\nclass Email:\n\tdef __init__(self):\n\t\tself.address = None\n\t\tself.id = None\n\t\tself.parent = None\n\t\tself.primary = None\n\t\tself.reachable = None\n\t\tself.type = None\n\t\tself.validated = None\n\t\tself.validated_date = None\n\t\n\t@classmethod\n\tdef parse(cls, email):\n\t\tinst = cls()\n\t\tinst.address = email[\"address\"].text\n\t\tinst.id = int(email[\"id\"].text)\n\t\tinst.parent = email[\"parent\"].text == \"Y\"\n\t\tinst.primary = email[\"primary\"].text == \"Y\"\n\t\tinst.reachable = email[\"reachable\"].text == \"Y\"\n\t\tinst.type = email[\"type\"].text\n\t\tinst.validated = email[\"validated\"].text == \"Y\"\n\t\tinst.validated_date = datetime.datetime.fromisoformat(email[\"validated_date\"].text)\n\t\treturn inst\n\n\nclass ProfileMii:\n\tdef __init__(self):\n\t\tself.id = None\n\t\tself.data = None\n\t\tself.status = None\n\t\tself.hash = None\n\t\tself.images = None\n\t\tself.name = None\n\t\tself.primary = None\n\t\n\t@classmethod\n\tdef parse(cls, mii):\n\t\tinst = cls()\n\t\tinst.status = mii[\"status\"].text\n\t\tinst.data = base64.b64decode(mii[\"data\"].text)\n\t\tinst.id = int(mii[\"id\"].text)\n\t\tinst.hash = mii[\"mii_hash\"].text\n\t\tinst.images = [MiiImage.parse(image) for image in mii[\"mii_images\"]]\n\t\tinst.name = mii[\"name\"].text\n\t\tinst.primary = mii[\"primary\"].text == \"Y\"\n\t\treturn inst\n\n\nclass Profile:\n\tdef __init__(self):\n\t\tself.accounts = None\n\t\tself.active_flag = None\n\t\tself.birth_date = None\n\t\tself.country = None\n\t\tself.create_date = None\n\t\tself.device_attributes = None\n\t\tself.forgot_pw_email_sent = None\n\t\tself.gender = None\n\t\tself.language = None\n\t\tself.updated = None\n\t\tself.marketing_flag = None\n\t\tself.off_device_flag = None\n\t\tself.pid = None\n\t\tself.email = None\n\t\tself.mii = None\n\t\tself.region = None\n\t\tself.temporary_password_expiration = None\n\t\tself.tz_name = None\n\t\tself.nnid = None\n\t\tself.utc_offset = None\n\t\n\t@classmethod\n\tdef parse(cls, profile):\n\t\tinst = cls()\n\t\tinst.accounts = [Account.parse(account) for account in profile[\"accounts\"]]\n\t\tinst.active_flag = profile[\"active_flag\"] == \"Y\"\n\t\tinst.birth_date = datetime.date.fromisoformat(profile[\"birth_date\"].text)\n\t\tinst.country = profile[\"country\"].text\n\t\tinst.create_date = datetime.datetime.fromisoformat(profile[\"create_date\"].text)\n\t\tinst.device_attributes = [DeviceAttribute.parse(attrib) for attrib in profile[\"device_attributes\"]]\n\t\tif \"forgot_pw_email_sent\" in profile:\n\t\t\tinst.forgot_pw_email_sent = datetime.datetime.fromisoformat(profile[\"forgot_pw_email_sent\"].text)\n\t\tinst.gender = profile[\"gender\"].text\n\t\tinst.language = profile[\"language\"].text\n\t\tinst.updated = datetime.datetime.fromisoformat(profile[\"updated\"].text)\n\t\tinst.marketing_flag = profile[\"marketing_flag\"].text == \"Y\"\n\t\tinst.off_device_flag = profile[\"off_device_flag\"].text == \"Y\"\n\t\tinst.pid = int(profile[\"pid\"].text)\n\t\tinst.email = Email.parse(profile[\"email\"])\n\t\tinst.mii = ProfileMii.parse(profile[\"mii\"])\n\t\tinst.region = int(profile[\"region\"].text)\n\t\tif \"temporary_password_expiration\" in profile:\n\t\t\tinst.temporary_password_expiration = datetime.datetime.fromisoformat(profile[\"temporary_password_expiration\"].text)\n\t\tinst.tz_name = profile[\"tz_name\"].text\n\t\tinst.nnid = profile[\"user_id\"].text\n\t\tinst.utc_offset = int(profile[\"utc_offset\"].text)\n\t\treturn inst\n\n\nclass NNASClient:\n\tdef __init__(self):\n\t\tself.url = \"account.nintendo.net\"\n\n\t\tca = resources.certificate(\"Nintendo_CA_G3.der\")\n\t\tcert = resources.certificate(\"Wii_U_Common_Prod_1.der\")\n\t\tkey = resources.private_key(\"Wii_U_Common_Prod_1.key\")\n\t\t\n\t\tself.context = tls.TLSContext()\n\t\tself.context.set_authority(ca)\n\t\tself.context.set_certificate(cert, key)\n\t\t\n\t\tself.client_id = \"a2efa818a34fa16b8afbc8a74eba3eda\"\n\t\tself.client_secret = \"c91cdb5658bd4954ade78533a339cf9a\"\n\t\t\n\t\tself.platform_id = 1\n\t\tself.device_type = 2\n\t\t\n\t\tself.device_id = None\n\t\tself.serial_number = None\n\t\tself.system_version = 0x260\n\t\tself.device_cert = None\n\t\t\n\t\tself.region = 4\n\t\tself.country = \"NL\"\n\t\tself.language = \"en\"\n\t\t\n\t\tself.fpd_version = 0\n\t\tself.environment = \"L1\"\n\t\t\n\t\tself.title_id = None\n\t\tself.title_version = None\n\t\t\n\tdef set_context(self, context):\n\t\tself.context = context\n\t\n\tdef set_url(self, url): self.url = url\n\t\n\tdef set_client_id(self, client_id): self.client_id = client_id\n\tdef set_client_secret(self, client_secret): self.client_secret = client_secret\n\t\n\tdef set_platform_id(self, platform_id): self.platform_id = platform_id\n\tdef set_device_type(self, device_type): self.device_type = device_type\n\t\n\tdef set_device(self, device_id, serial_number, system_version, cert=None):\n\t\tself.device_id = device_id\n\t\tself.serial_number = serial_number\n\t\tself.system_version = system_version\n\t\tself.device_cert = cert\n\t\t\n\tdef set_locale(self, region, country, language):\n\t\tself.region = region\n\t\tself.country = country\n\t\tself.language = language\n\t\t\n\tdef set_fpd_version(self, version): self.fpd_version = version\n\tdef set_environment(self, environment): self.environment = environment\n\t\n\tdef set_title(self, title_id, title_version):\n\t\tself.title_id = title_id\n\t\tself.title_version = title_version\n\t\n\tdef prepare(self, req, auth=None, cert=None):\n\t\treq.headers[\"Host\"] = self.url\n\t\treq.headers[\"X-Nintendo-Platform-ID\"] = self.platform_id\n\t\treq.headers[\"X-Nintendo-Device-Type\"] = self.device_type\n\t\t\n\t\tif self.device_id is not None:\n\t\t\treq.headers[\"X-Nintendo-Device-ID\"] = self.device_id\n\t\tif self.serial_number is not None:\n\t\t\treq.headers[\"X-Nintendo-Serial-Number\"] = self.serial_number\n\t\t\t\n\t\treq.headers[\"X-Nintendo-System-Version\"] = \"%04X\" %self.system_version\n\t\treq.headers[\"X-Nintendo-Region\"] = self.region\n\t\treq.headers[\"X-Nintendo-Country\"] = self.country\n\t\treq.headers[\"Accept-Language\"] = self.language\n\t\t\n\t\treq.headers[\"X-Nintendo-Client-ID\"] = self.client_id\n\t\treq.headers[\"X-Nintendo-Client-Secret\"] = self.client_secret\n\t\t\t\n\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\treq.headers[\"X-Nintendo-FPD-Version\"] = \"%04X\" %self.fpd_version\n\t\treq.headers[\"X-Nintendo-Environment\"] = self.environment\n\t\t\n\t\tif self.title_id is not None:\n\t\t\treq.headers[\"X-Nintendo-Title-ID\"] = \"%016X\" %self.title_id\n\t\t\treq.headers[\"X-Nintendo-Unique-ID\"] = \"%05X\" %((self.title_id >> 8) & 0xFFFFF)\n\t\tif self.title_version is not None:\n\t\t\treq.headers[\"X-Nintendo-Application-Version\"] = \"%04X\" %self.title_version\n\t\t\t\n\t\tif cert is not None:\n\t\t\treq.headers[\"X-Nintendo-Device-Cert\"] = cert\n\t\t\t\n\t\tif auth is not None:\n\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + auth\n\t\t\t\n\tasync def request(self, req):\n\t\tresponse = await http.request(self.url, req, self.context)\n\t\tif response.error():\n\t\t\tlogger.error(\"Account request returned status code %i\\n%s\", response.status_code, response.text)\n\t\t\traise NNASError(response.status_code, response.xml)\n\t\treturn response.xml\n\t\t\n\tasync def login(self, username, password, password_type=None):\n\t\treq = http.HTTPRequest.post(\"/v1/api/oauth20/access_token/generate\")\n\t\tself.prepare(req, cert=self.device_cert)\n\t\t\n\t\treq.form = {\n\t\t\t\"grant_type\": \"password\",\n\t\t\t\"user_id\": username,\n\t\t\t\"password\": password,\n\t\t}\n\t\t\n\t\tif password_type is not None:\n\t\t\treq.form[\"password_type\"] = password_type\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn OAuth20.parse(response)\n\t\n\tasync def get_nex_token(self, access_token, game_server_id):\n\t\treq = http.HTTPRequest.get(\"/v1/api/provider/nex_token/@me\")\n\t\treq.params = {\n\t\t\t\"game_server_id\": \"%08X\" %game_server_id\n\t\t}\n\t\t\n\t\tself.prepare(req, access_token)\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn NexToken.parse(response)\n\t\n\tasync def get_service_token(self, access_token, client_id):\n\t\treq = http.HTTPRequest.get(\"/v1/api/provider/service_token/@me\")\n\t\treq.params = {\n\t\t\t\"client_id\": client_id\n\t\t}\n\t\t\n\t\tself.prepare(req, access_token)\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn response[\"token\"].text\n\t\n\tasync def get_profile(self, access_token):\n\t\treq = http.HTTPRequest.get(\"/v1/api/people/@me/profile\")\n\t\tself.prepare(req, access_token)\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn Profile.parse(response)\n\t\t\n\t#The following functions can be used without logging in\n\t\t\n\tasync def get_miis(self, pids):\n\t\treq = http.HTTPRequest.get(\"/v1/api/miis\")\n\t\treq.params = {\n\t\t\t\"pids\": \",\".join([str(pid) for pid in pids])\n\t\t}\n\t\t\n\t\tself.prepare(req)\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn [Mii.parse(mii) for mii in response]\n\t\n\tasync def get_pids(self, nnids):\n\t\treq = http.HTTPRequest.get(\"/v1/api/admin/mapped_ids\")\n\t\treq.params = {\n\t\t\t\"input_type\": \"user_id\",\n\t\t\t\"output_type\": \"pid\",\n\t\t\t\"input\": \",\".join(nnids)\n\t\t}\n\t\tself.prepare(req)\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn {id[\"in_id\"].text: int(id[\"out_id\"].text) for id in response if id[\"out_id\"].text}\n\t\t\n\tasync def get_nnids(self, pids):\n\t\treq = http.HTTPRequest.get(\"/v1/api/admin/mapped_ids\")\n\t\treq.params = {\n\t\t\t\"input_type\": \"pid\",\n\t\t\t\"output_type\": \"user_id\",\n\t\t\t\"input\": \",\".join([str(pid) for pid in pids])\n\t\t}\n\t\tself.prepare(req)\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn {int(id[\"in_id\"].text): id[\"out_id\"].text for id in response if id[\"out_id\"].text}\n\t\n\tasync def get_mii(self, pid): return (await self.get_miis([pid]))[0]\n\tasync def get_pid(self, nnid): return (await self.get_pids([nnid]))[nnid]\n\tasync def get_nnid(self, pid): return (await self.get_nnids([pid]))[pid]\n"
  },
  {
    "path": "nintendo/resources.py",
    "content": "\nfrom anynet import tls\nimport importlib.resources\n\n\ndef get(path):\n\treturn importlib.resources.files(\"nintendo\").joinpath(path)\n\ndef open(path, mode=\"r\", *, encoding=\"utf-8\"):\n\treturn get(path).open(mode, encoding=encoding)\n\ndef read_bytes(path):\n\treturn get(path).read_bytes()\n\ndef certificate(name):\n\tdata = read_bytes(\"files/cert/%s\" %name)\n\treturn tls.TLSCertificate.parse(data, tls.TYPE_DER)\n\ndef private_key(name):\n\tdata = read_bytes(\"files/cert/%s\" %name)\n\treturn tls.TLSPrivateKey.parse(data, tls.TYPE_DER)\n"
  },
  {
    "path": "nintendo/switch/__init__.py",
    "content": "\r\nfrom Crypto.Cipher import AES\r\nfrom Crypto.PublicKey import RSA\r\nfrom anynet import tls\r\nimport hashlib\r\nimport struct\r\n\r\n\r\ndef load_keys(filename):\r\n\twith open(filename) as f:\r\n\t\tlines = f.readlines()\r\n\t\r\n\tkeys = {}\r\n\tfor line in lines:\r\n\t\tline = line.strip()\r\n\t\tif line:\r\n\t\t\tname, key = line.split(\"=\")\r\n\t\t\tkeys[name.strip()] = bytes.fromhex(key)\r\n\treturn keys\r\n\r\n\r\ntable = [\r\n\t0x0000, 0xCC01, 0xD801, 0x1400, 0xF001, 0x3C00, 0x2800, 0xE401,\r\n\t0xA001, 0x6C00, 0x7800, 0xB401, 0x5000, 0x9C01, 0x8801, 0x4400\r\n]\r\n\r\ndef crc16(data):\r\n\thash = 0x55AA\r\n\tfor byte in data:\r\n\t\tr = table[hash & 0xF]\r\n\t\thash = (hash >> 4) ^ r ^ table[byte & 0xF]\r\n\t\t\r\n\t\tr = table[hash & 0xF]\r\n\t\thash = (hash >> 4) ^ r ^ table[byte >> 4]\r\n\treturn hash\r\n\r\n\r\nclass ProdInfo:\r\n\tdef __init__(self, keys, filename):\r\n\t\tself.keys = keys\r\n\t\twith open(filename, \"rb\") as f:\r\n\t\t\tself.data = f.read()\r\n\t\t\t\r\n\tdef check(self, offset, size):\r\n\t\tend = offset + size - 2\r\n\t\t\r\n\t\texpected = struct.unpack_from(\"<H\", self.data, end)[0]\r\n\t\tif crc16(self.data[offset : end]) != expected:\r\n\t\t\traise ValueError(\"CRC16 check failed\")\r\n\t\r\n\tdef get_device_id(self):\r\n\t\tself.check(0x2A90, 0x250)\r\n\t\treturn int(self.data[0x2B56:0x2B66], 16)\r\n\t\r\n\tdef get_tls_cert(self):\r\n\t\tself.check(0xAD0, 0x10)\r\n\t\t\r\n\t\tlength = struct.unpack_from(\"<I\", self.data, 0xAD0)[0]\r\n\t\tif length > 0x800:\r\n\t\t\traise ValueError(\"TLS certificate is too big\")\r\n\t\t\t\r\n\t\tdata = self.data[0xAE0 : 0xAE0 + length]\r\n\t\thash = hashlib.sha256(data).digest()\r\n\t\tif hash != self.data[0x12E0 : 0x1300]:\r\n\t\t\traise ValueError(\"SHA256 check failed\")\r\n\t\t\r\n\t\treturn tls.TLSCertificate.parse(data, tls.TYPE_DER)\r\n\t\t\r\n\tdef get_tls_key(self):\r\n\t\tself.check(0x3AE0, 0x140)\r\n\t\t\r\n\t\tinitial = self.data[0x3AE0 : 0x3AF0]\r\n\t\tcipher = self.data[0x3AF0 : 0x3BF0]\r\n\t\t\r\n\t\tkek = self.keys[\"ssl_rsa_kek_personalized\"] if \"ssl_rsa_kek_personalized\" in self.keys else self.keys[\"ssl_rsa_kek\"]\r\n\t\taes = AES.new(kek, AES.MODE_CTR, nonce=b\"\", initial_value=initial)\r\n\t\td = int.from_bytes(aes.decrypt(cipher), \"big\")\r\n\t\t\r\n\t\tpubkey = self.get_tls_cert().public_key()\r\n\t\t\r\n\t\trsa = RSA.construct((pubkey.n, pubkey.e, d))\r\n\t\tder = rsa.export_key(\"DER\")\r\n\t\treturn tls.TLSPrivateKey.parse(der, tls.TYPE_DER)\r\n"
  },
  {
    "path": "nintendo/switch/aauth.py",
    "content": "\nfrom Crypto.Util.Padding import pad\nfrom Crypto.Cipher import AES, PKCS1_OAEP\nfrom Crypto.PublicKey import RSA\nfrom Crypto.Hash import SHA256\nfrom Crypto.Random import get_random_bytes\nfrom anynet import tls, http\nfrom nintendo import resources\nimport struct\nimport base64\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nRSA_MODULUS =  int(\n\t\"2903599220185509629948246004681271806662185201109683699434876284\"\n\t\"9306378942456577312580648895443616535088601867223713942187399041\"\n\t\"4854872772034425863387471719375473684104853507768450203982749294\"\n\t\"8967945831738920699512732919046223059402955082098739033920491649\"\n\t\"6879108565068863591362496844602988110766097564477545097467537357\"\n\t\"3183749964356608012071405755940871989007021731074728723470759285\"\n\t\"8155278592486462922448753256166071381157786436864032235809243318\"\n\t\"2591089355065715995209202752330511548478896205428626608544326862\"\n\t\"4782505679727111312756904637828438785474471375120478991907979820\"\n\t\"98870089661523253199182993983393803812441\"\n)\n\nRSA_EXPONENT = 65537\n\n\nUSER_AGENT = {\n\t 900: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 901: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 910: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 920: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t1000: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1001: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1002: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1003: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1004: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1010: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1011: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1020: \"libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1100: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 11.4.0.0; Add-on 11.4.0.0)\",\n\t1101: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 11.4.0.0; Add-on 11.4.0.0)\",\n\t1200: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1201: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1202: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1203: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1210: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1300: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.3.0.0; Add-on 13.3.0.0)\",\n\t1310: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1320: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1321: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1400: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1410: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1411: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1412: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1500: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\",\n\t1501: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\",\n\t1600: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1601: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1602: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1603: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1610: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1700: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 17.5.0.0; Add-on 17.5.0.0)\",\n\t1701: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 17.5.0.0; Add-on 17.5.0.0)\",\n\t1800: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1801: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1810: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1900: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\",\n\t1901: \"libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\",\n\t2000: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2001: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2010: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2011: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2015: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2020: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2030: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2040: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2050: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\n\t2100: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\n\t2101: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\n\t2110: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\n\t2120: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\n\t2200: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 22.2.0.0)\",\n\t2210: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 22.2.0.0)\",\n}\n\nAPI_VERSION = {\n\t 900: 3,\n\t 901: 3,\n\t 910: 3,\n\t 920: 3,\n\t1000: 3,\n\t1001: 3,\n\t1002: 3,\n\t1003: 3,\n\t1004: 3,\n\t1010: 3,\n\t1011: 3,\n\t1020: 3,\n\t1100: 3,\n\t1101: 3,\n\t1200: 3,\n\t1201: 3,\n\t1202: 3,\n\t1203: 3,\n\t1210: 3,\n\t1300: 3,\n\t1310: 3,\n\t1320: 3,\n\t1321: 3,\n\t1400: 3,\n\t1410: 3,\n\t1411: 3,\n\t1412: 3,\n\t1500: 4,\n\t1501: 4,\n\t1600: 4,\n\t1601: 4,\n\t1602: 4,\n\t1603: 4,\n\t1610: 4,\n\t1700: 4,\n\t1701: 4,\n\t1800: 4,\n\t1801: 4,\n\t1810: 4,\n\t1900: 5,\n\t1901: 5,\n\t2000: 5,\n\t2001: 5,\n\t2010: 5,\n\t2011: 5,\n\t2015: 5,\n\t2020: 5,\n\t2030: 5,\n\t2040: 5,\n\t2050: 5,\n\t2100: 5,\n\t2101: 5,\n\t2110: 5,\n\t2120: 5,\n\t2200: 5,\n\t2210: 5,\n}\n\nLATEST_VERSION = 2210\n\n\nclass AAuthError(Exception):\n\tDEVICE_TOKEN_EXPIRED = 103\n\tROMID_BANNED = 105\n\tUNAUTHORIZED_APPLICATION = 106\n\tSERVICE_CLOSED = 109\n\tAPPLICATION_UPDATE_REQUIRED = 111\n\tINTERNAL_SERVER_ERROR = 112\n\tGENERIC = 118\n\tREGION_MISMATCH = 121\n\t\n\tdef __init__(self, response):\n\t\tself.response = response\n\t\tself.code = int(response.json[\"errors\"][0][\"code\"])\n\t\tself.message = response.json[\"errors\"][0][\"message\"]\n\t\n\tdef __str__(self):\n\t\treturn self.message\n\n\nclass AAuthClient:\n\tdef __init__(self):\n\t\tself.request_callback = http.request\n\t\t\n\t\tself.context = tls.TLSContext()\n\t\tself.context_overridden = False\n\t\t\n\t\tself.host_overridden = False\n\n\t\tself.power_state = \"FA\"\n\n\t\tself.set_system_version(LATEST_VERSION)\n\n\tdef set_request_callback(self, callback): self.request_callback = callback\n\n\tdef set_context(self, context):\n\t\tself.context = context\n\t\tself.context_overridden = True\n\t\n\tdef set_certificate(self, cert, key):\n\t\tself.context.set_certificate(cert, key)\n\t\n\tdef set_host(self, host):\n\t\tself.host = host\n\t\tself.host_overridden = True\n\t\n\tdef set_power_state(self, state): self.power_state = state\n\t\n\tdef set_system_version(self, version):\n\t\tif version not in USER_AGENT:\n\t\t\traise ValueError(\"Unknown system version\")\n\t\t\n\t\tself.system_version = version\n\t\tself.user_agent = USER_AGENT[version]\n\t\tself.api_version = API_VERSION[version]\n\n\t\tif version >= 2000:\n\t\t\tcaname = \"Nintendo_Root_CA_G4.der\"\n\t\t\thost = \"aauth.hac.lp1.ndas.srv.nintendo.net\"\n\t\telse:\n\t\t\tcaname = \"Nintendo_CA_G3.der\"\n\t\t\thost = \"aauth-lp1.ndas.srv.nintendo.net\"\n\t\t\n\t\tif not self.context_overridden:\n\t\t\tca = resources.certificate(caname)\n\t\t\tself.context.set_authority(ca)\n\t\t\n\t\tif not self.host_overridden:\n\t\t\tself.host = host\n\t\n\tasync def request(self, req, use_power_state):\n\t\tif self.system_version < 1800:\n\t\t\treq.headers[\"Host\"] = self.host\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\tif use_power_state:\n\t\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\n\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\n\t\telif self.system_version < 2000:\n\t\t\treq.headers[\"Host\"] = self.host\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\t\n\t\t\tif use_power_state:\n\t\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\n\t\t\treq.headers[\"Content-Length\"] = 0\n\t\telse:\n\t\t\treq.headers[\"Host\"] = self.host\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent\n\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\n\t\t\tif use_power_state:\n\t\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\n\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\n\t\tresponse = await self.request_callback(self.host, req, self.context)\n\t\tif response.json and \"errors\" in response.json:\n\t\t\tlogger.error(\"AAuth server returned errors:\")\n\t\t\tfor error in response.json[\"errors\"]:\n\t\t\t\tlogger.error(\"  (%s) %s\", error[\"code\"], error[\"message\"])\n\t\t\traise AAuthError(response)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\t\n\tdef verify_ticket(self, ticket, title_id):\n\t\t# Verify ticket, in case someone accidentally\n\t\t# provides the wrong ticket\n\t\tif len(ticket) != 0x2C0:\n\t\t\traise ValueError(\"Ticket has unexpected size\")\n\t\tif struct.unpack_from(\"<I\", ticket)[0] != 0x10004:\n\t\t\traise ValueError(\"Ticket has invalid signature type\")\n\t\tif struct.unpack_from(\">Q\", ticket, 0x2A0)[0] != title_id:\n\t\t\traise ValueError(\"Ticket has different title id\")\n\t\tif struct.unpack_from(\">Q\", ticket, 0x2A8)[0] != ticket[0x285]:\n\t\t\traise ValueError(\"Ticket has inconsistent master key revision\")\n\t\n\tdef verify_token(self, token):\n\t\t# Just a basic check, to make sure that people do not\n\t\t# accidentally pass a ticket instead of a JWT\n\t\tif not isinstance(token, str) or token.count(\".\") != 2:\n\t\t\traise ValueError(\"Cert must contain a valid JWT\")\n\t\n\tasync def get_time(self):\n\t\treq = http.HTTPRequest.get(\"/v1/time\")\n\t\treq.headers[\"Host\"] = self.host\n\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\n\t\tresponse = await http.request(self.host, req, self.context)\n\t\tresponse.raise_if_error()\n\t\t\n\t\ttime = int(response.headers[\"X-NINTENDO-UNIXTIME\"])\n\t\tip = response.headers[\"X-NINTENDO-GLOBAL-IP\"]\n\t\treturn time, ip\n\t\n\tasync def challenge(self, device_token):\n\t\tparam_name = \"&device_auth_token\" if self.system_version < 1800 else \"device_auth_token\"\n\n\t\treq = http.HTTPRequest.post(\"/v%i/challenge\" %self.api_version)\n\t\treq.rawform = {\n\t\t\tparam_name: device_token\n\t\t}\n\t\t\n\t\tresponse = await self.request(req, False)\n\t\treturn response.json\n\n\t# Warning: do not use auth_nocert on a production server.\n\t# It will immediately ban your Switch.\n\tasync def auth_nocert(self, title_id, title_version, device_token):\n\t\tauth_type = \"media_type\" if self.api_version < 5 else \"auth_type\"\n\n\t\treq = http.HTTPRequest.post(\"/v%i/application_auth_token\" %self.api_version)\n\t\treq.form = {\n\t\t\t\"application_id\": \"%016x\" %title_id,\n\t\t\t\"application_version\": \"%08x\" %title_version,\n\t\t\t\"device_auth_token\": device_token,\n\t\t\tauth_type: \"NO_CERT\"\n\t\t}\n\t\t\n\t\tresponse = await self.request(req, True)\n\t\treturn response.json\n\n\tasync def auth_system(self, title_id, title_version, device_token):\n\t\tauth_type = \"media_type\" if self.api_version < 5 else \"auth_type\"\n\n\t\treq = http.HTTPRequest.post(\"/v%i/application_auth_token\" %self.api_version)\n\t\treq.form = {\n\t\t\t\"application_id\": \"%016x\" %title_id,\n\t\t\t\"application_version\": \"%08x\" %title_version,\n\t\t\t\"device_auth_token\": device_token,\n\t\t\tauth_type: \"SYSTEM\"\n\t\t}\n\n\t\tresponse = await self.request(req, True)\n\t\treturn response.json\n\n\tasync def auth_digital(self, title_id, title_version, device_token, cert):\n\t\tauth_type = \"media_type\" if self.api_version < 5 else \"auth_type\"\n\n\t\treq = http.HTTPRequest.post(\"/v%i/application_auth_token\" %self.api_version)\n\t\treq.form = {\n\t\t\t\"application_id\": \"%016x\" %title_id,\n\t\t\t\"application_version\": \"%08x\" %title_version,\n\t\t\t\"device_auth_token\": device_token,\n\t\t\tauth_type: \"DIGITAL\"\n\t\t}\n\t\t\n\t\tif self.api_version == 3:\n\t\t\tself.verify_ticket(cert, title_id)\n\t\t\t\n\t\t\tplain_key = get_random_bytes(16)\n\t\t\t\n\t\t\taes = AES.new(plain_key, AES.MODE_CBC, iv=bytes(16))\n\t\t\tencrypted_ticket = aes.encrypt(pad(cert, 16))\n\t\t\t\n\t\t\trsa_key = RSA.construct((RSA_MODULUS, RSA_EXPONENT))\n\t\t\trsa = PKCS1_OAEP.new(rsa_key, SHA256)\n\t\t\tencrypted_key = rsa.encrypt(plain_key)\n\t\t\n\t\t\treq.form[\"cert\"] = base64.b64encode(encrypted_ticket, b\"-_\").decode().rstrip(\"=\")\n\t\t\treq.form[\"cert_key\"] = base64.b64encode(encrypted_key, b\"-_\").decode().rstrip(\"=\")\n\t\t\n\t\telif self.api_version >= 4:\n\t\t\tself.verify_token(cert)\n\t\t\t\n\t\t\treq.form[\"cert\"] = cert\n\t\t\n\t\tresponse = await self.request(req, True)\n\t\treturn response.json\n\n\tasync def auth_gamecard(self, title_id, title_version, device_token, cert, gvt, challenge=None, challenge_src=None):\n\t\tauth_type = \"media_type\" if self.api_version < 5 else \"auth_type\"\n\n\t\treq = http.HTTPRequest.post(\"/v%i/application_auth_token\" %self.api_version)\n\t\treq.form = {\n\t\t\t\"application_id\": \"%016x\" %title_id,\n\t\t\t\"application_version\": \"%08x\" %title_version,\n\t\t\t\"device_auth_token\": device_token,\n\t\t\tauth_type: \"GAMECARD\",\n\t\t\t\"gvt\": base64.b64encode(gvt, b\"-_\").decode().rstrip(\"=\"),\n\t\t\t\"cert\": base64.b64encode(cert, b\"-_\").decode().rstrip(\"=\")\n\t\t}\n\n\t\tif self.api_version >= 5:\n\t\t\treq.form[\"challenge\"] = challenge\n\t\t\treq.form[\"challenge_src\"] = challenge_src\n\n\t\tresponse = await self.request(req, True)\n\t\treturn response.json\n"
  },
  {
    "path": "nintendo/switch/atumn.py",
    "content": "\nfrom anynet import tls, http\nfrom nintendo import resources\nfrom nintendo.switch import common\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nUSER_AGENT = \"NintendoSDK Firmware/%s (platform:NX; did:%016x; eid:lp1)\"\n\nLATEST_VERSION = 2210\n\n\nclass AtumnClient:\n\tdef __init__(self, device_id):\n\t\tself.device_id = device_id\n\t\t\n\t\tself.request_callback = http.request\n\t\t\n\t\tca = resources.certificate(\"Nintendo_Class_2_CA_G3.der\")\n\t\tself.context = tls.TLSContext()\n\t\tself.context.set_authority(ca)\n\t\t\n\t\tself.host = \"atumn.hac.lp1.d4c.nintendo.net\"\n\t\t\n\t\tself.user_agent = USER_AGENT %(common.FIRMWARE_VERSIONS[LATEST_VERSION], self.device_id)\n\t\n\tdef set_request_callback(self, callback): self.request_callback = callback\n\t\n\tdef set_context(self, context): self.context = context\n\tdef set_certificate(self, cert, key): self.context.set_certificate(cert, key)\n\t\n\tdef set_host(self, host): self.host = host\n\t\n\tdef set_system_version(self, version):\n\t\tif version not in common.FIRMWARE_VERSIONS:\n\t\t\traise ValueError(\"Unknown system version: %i\" %version)\n\t\tself.user_agent = USER_AGENT %(common.FIRMWARE_VERSIONS[version], self.device_id)\n\t\n\tasync def request(self, req):\n\t\treq.headers[\"Host\"] = self.host\n\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\treq.headers[\"User-Agent\"] = self.user_agent\n\t\t\n\t\tresponse = await self.request_callback(self.host, req, self.context)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\n\tasync def download_content_metadata(self, title_id, title_version, *, system_update=False):\n\t\tcontent_type = \"s\" if system_update else \"a\"\n\n\t\treq = http.HTTPRequest.head(\"/t/%c/%016x/%i\" %(content_type, title_id, title_version))\n\t\treq.params = {\n\t\t\t\"device_id\": \"%016x\" %self.device_id\n\t\t}\n\n\t\tresponse = await self.request(req)\n\t\tcontent_id = response.headers[\"X-Nintendo-Content-ID\"]\n\n\t\treq = http.HTTPRequest.get(\"/c/%s/%s\" %(content_type, content_id))\n\t\tresponse = await self.request(req)\n\t\treturn response.body\n\t\n\tasync def download_content(self, content_id):\n\t\treq = http.HTTPRequest.get(\"/c/c/%s\" %content_id)\n\t\tresponse = await self.request(req)\n\t\treturn response.body\n"
  },
  {
    "path": "nintendo/switch/baas.py",
    "content": "\nfrom anynet import tls, http\nimport json\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nMODULE_ACCOUNT = \"nnAccount\"\nMODULE_FRIENDS = \"nnFriends\"\n\nUSER_AGENT = {\n\t 900: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 901: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 910: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 920: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t1000: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1001: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1002: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1003: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1004: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1010: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1011: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1020: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1100: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 11.4.0.0; Add-on 11.4.0.0)\",\n\t1101: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 11.4.0.0; Add-on 11.4.0.0)\",\n\t1200: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1201: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1202: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1203: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1210: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1300: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.3.0.0; Add-on 13.3.0.0)\",\n\t1310: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1320: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1321: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1400: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1410: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1411: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1412: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1500: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\",\n\t1501: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\",\n\t1600: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1601: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1602: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1603: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1610: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1700: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 17.5.0.0; Add-on 17.5.0.0)\",\n\t1701: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 17.5.0.0; Add-on 17.5.0.0)\",\n\t1800: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1801: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1810: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1900: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\",\n\t1901: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\",\n\t2000: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2001: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2010: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2011: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2015: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2020: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2030: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2040: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2050: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2100: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2101: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2110: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2120: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2220: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 22.2.0.0; Add-on 22.2.0.0)\",\n\t2210: \"libcurl (%s; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 22.2.0.0; Add-on 22.2.0.0)\",\n}\n\nLATEST_VERSION = 2210\n\n\nclass PresenceState:\n\tINACTIVE = \"INACTIVE\"\n\tONLINE = \"ONLINE\"\n\tPLAYING = \"PLAYING\"\n\n\nclass BAASError(Exception):\n\tdef __init__(self, response):\n\t\tself.response = response\n\t\t\n\t\tself.type = response.json[\"type\"]\n\t\tself.name = response.json[\"errorCode\"]\n\t\tself.title = response.json[\"title\"]\n\t\tself.detail = response.json[\"detail\"]\n\t\tself.status = response.json[\"status\"]\n\t\tself.instance = response.json[\"instance\"]\n\t\n\tdef __str__(self):\n\t\treturn self.title\n\n\nclass BAASClient:\n\tdef __init__(self):\n\t\tself.request_callback = http.request\n\t\t\n\t\tself.context = tls.TLSContext()\n\t\t\n\t\tself.host = None\n\t\tself.power_state = \"FA\"\n\n\t\tself.system_version = LATEST_VERSION\n\t\tself.user_agent = USER_AGENT[LATEST_VERSION]\n\t\n\tdef set_request_callback(self, callback): self.request_callback = callback\n\tdef set_context(self, context): self.context = context\n\t\n\tdef set_certificate(self, cert, key):\n\t\tself.context.set_certificate(cert, key)\n\t\n\tdef set_host(self, host): self.host = host\n\tdef set_power_state(self, state): self.power_state = state\n\t\n\tdef set_system_version(self, version):\n\t\tif version not in USER_AGENT:\n\t\t\traise ValueError(\"Unknown system version\")\n\t\tself.system_version = version\n\t\tself.user_agent = USER_AGENT[version]\n\t\n\tdef get_host(self, module):\n\t\tif self.host:\n\t\t\treturn self.host\n\t\t\n\t\tif module == MODULE_ACCOUNT and self.system_version >= 2100:\n\t\t\treturn \"m-lp1.baas.nintendo.com\"\n\t\treturn \"e0d67c509fb203858ebcb2fe3f88c2aa.baas.nintendo.com\"\n\t\t\n\tasync def request(self, req, token, module, *, use_power_state=False):\n\t\t# This is somewhat complicated because we want to\n\t\t# put the headers in the correct order\n\t\tcontent_type = \"application/x-www-form-urlencoded\"\n\t\tif req.json is not None:\n\t\t\tcontent_type = \"application/json-patch+json\" if req.method == \"PATCH\" else \"application/json\"\n\t\t\n\t\treq.headers[\"Host\"] = self.host\n\t\tif module == MODULE_ACCOUNT and self.system_version >= 2100:\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent %module\n\t\t\tif req.method != \"GET\":\n\t\t\t\treq.headers[\"Content-Type\"] = content_type\n\t\t\tif token:\n\t\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + token\n\t\t\tif use_power_state:\n\t\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\n\t\t\tif req.method != \"GET\":\n\t\t\t\treq.headers[\"Content-Length\"] = 0\n\t\telse:\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent %module\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\tif module == MODULE_FRIENDS and req.json is not None:\n\t\t\t\treq.headers[\"Content-Type\"] = content_type\n\t\t\tif token:\n\t\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + token\n\t\t\tif use_power_state:\n\t\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\n\t\t\t\n\t\t\tif req.method != \"GET\":\n\t\t\t\tif req.json is None:\n\t\t\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\t\t\treq.headers[\"Content-Type\"] = content_type\n\t\t\t\telse:\n\t\t\t\t\tif module != MODULE_FRIENDS:\n\t\t\t\t\t\treq.headers[\"Content-Type\"] = content_type\n\t\t\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\n\t\tresponse = await self.request_callback(self.host, req, self.context)\n\t\tif response.json and \"errorCode\" in response.json:\n\t\t\tlogger.warning(\"BAAS server returned an error: %s\" %response.json)\n\t\t\traise BAASError(response)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\t\n\tasync def authenticate(self, device_token, penne_id=None):\n\t\treq = http.HTTPRequest.post(\"/1.0.0/application/token\")\n\t\treq.form = {\n\t\t\t\"grantType\": \"public_client\",\n\t\t\t\"assertion\": device_token\n\t\t}\n\t\tif self.system_version >= 1900 and penne_id is not None:\n\t\t\treq.form[\"penneId\"] = penne_id\n\n\t\tresponse = await self.request(req, None, MODULE_ACCOUNT, use_power_state=True)\n\t\treturn response.json\n\t\n\tasync def login(self, id, password, access_token, app_token=None, na_country=None, skip_verification=False, is_persistent=True):\n\t\treq = http.HTTPRequest.post(\"/1.0.0/login\")\n\t\treq.form = {\n\t\t\t\"id\": \"%016x\" %id,\n\t\t\t\"password\": password\n\t\t}\n\t\t\n\t\tif app_token:\n\t\t\treq.form[\"appAuthNToken\"] = app_token\n\t\t\n\t\tif self.system_version >= 1800:\n\t\t\tif na_country is None:\n\t\t\t\traise ValueError(\"na_country parameter is required for system version 18.0.0 and later\")\n\t\t\treq.form[\"naCountry\"] = na_country\n\t\t\n\t\tif self.system_version >= 2000:\n\t\t\treq.form[\"isPersistent\"] = \"true\" if is_persistent else \"false\"\n\t\t\n\t\tif skip_verification:\n\t\t\treq.form[\"skipOp2Verification\"] = \"1\"\n\t\t\t\n\t\tresponse = await self.request(req, access_token, MODULE_ACCOUNT, use_power_state=True)\n\t\treturn response.json\n\t\n\tasync def register(self, access_token):\n\t\treq = http.HTTPRequest.post(\"/1.0.0/users\")\n\t\t\n\t\tresponse = await self.request(req, access_token, MODULE_ACCOUNT)\n\t\treturn response.json\n\t\n\tasync def update_presence(self, user_id, device_account_id, access_token, state, title_id, presence_group_id, app_fields={}, acd_index=0):\n\t\tapp_fields = json.dumps(app_fields, separators=(\",\", \":\"))\n\t\t\n\t\treq = http.HTTPRequest.patch(\"/1.0.0/users/%016x/device_accounts/%016x\" %(user_id, device_account_id))\n\t\treq.json = [\n\t\t\t{\"op\": \"replace\", \"path\": \"/presence/state\", \"value\": state},\n\t\t\t{\"op\": \"add\", \"path\": \"/presence/extras/friends/appField\", \"value\": app_fields},\n\t\t\t{\"op\": \"add\", \"path\": \"/presence/extras/friends/appInfo:appId\", \"value\": \"%016x\" %title_id}\n\t\t]\n\t\tif self.system_version >= 1900:\n\t\t\treq.json.append({\"op\": \"add\", \"path\": \"/presence/extras/friends/appInfo:acdIndex\", \"value\": acd_index})\n\t\treq.json.append({\"op\": \"add\", \"path\": \"/presence/extras/friends/appInfo:presenceGroupId\", \"value\": \"%016x\" %presence_group_id})\n\n\t\tresponse = await self.request(req, access_token, MODULE_FRIENDS)\n\t\treturn response.json\n\t\n\tasync def get_friends(self, user_id, access_token, count=300):\n\t\treq = http.HTTPRequest.get(\"/2.0.0/users/%016x/friends\" %user_id)\n\t\treq.params = {\"count\": count}\n\t\tresponse = await self.request(req, access_token, MODULE_FRIENDS)\n\t\treturn response.json\n"
  },
  {
    "path": "nintendo/switch/common.py",
    "content": "\nFIRMWARE_VERSIONS = {\n\t900: \"9.0.0-4.0\",\n\t901: \"9.0.1-1.0\",\n\t910: \"9.1.0-1.0\",\n\t920: \"9.2.0-1.0\",\n\t1000: \"10.0.0-6.0\",\n\t1001: \"10.0.1-1.0\",\n\t1002: \"10.0.2-1.0\",\n\t1003: \"10.0.3-1.0\",\n\t1004: \"10.0.3-1.0\",\n\t1010: \"10.1.0-1.0\",\n\t1011: \"10.1.0-1.0\",\n\t1020: \"10.2.0-1.0\",\n\t1100: \"11.0.0-5.0\",\n\t1101: \"11.0.1-1.0\",\n\t1200: \"12.0.0-4.0\",\n\t1201: \"12.0.1-1.0\",\n\t1202: \"12.0.2-1.0\",\n\t1203: \"12.0.3-1.0\",\n\t1210: \"12.1.0-1.0\",\n\t1300: \"13.0.0-4.0\",\n\t1310: \"13.1.0-1.2\",\n\t1320: \"13.2.0-1.0\",\n\t1321: \"13.2.1-1.0\",\n\t1400: \"14.0.0-4.0\",\n\t1410: \"14.1.0-1.0\",\n\t1411: \"14.1.1-1.0\",\n\t1412: \"14.1.2-1.0\",\n\t1500: \"15.0.0-4.0\",\n\t1501: \"15.0.1-1.0\",\n\t1600: \"16.0.0-3.0\",\n\t1601: \"16.0.1-1.0\",\n\t1602: \"16.0.2-1.0\",\n\t1603: \"16.0.3-1.0\",\n\t1610: \"16.1.0-1.0\",\n\t1700: \"17.0.0-6.0\",\n\t1701: \"17.0.1-1.0\",\n\t1800: \"18.0.0-4.0\",\n\t1801: \"18.0.1-1.0\",\n\t1810: \"18.1.0-1.0\",\n\t1900: \"19.0.0-4.0\",\n\t1901: \"19.0.1-1.0\",\n\t2000: \"20.0.0-9.0\",\n\t2001: \"20.0.1-1.0\",\n\t2010: \"20.1.0-1.0\",\n\t2011: \"20.1.1-1.0\",\n    2015: \"20.1.5-1.0\",\n    2020: \"20.2.0-1.0\",\n    2030: \"20.3.0-1.0\",\n    2040: \"20.4.0-1.0\",\n    2050: \"20.5.0-1.0\",\n    2100: \"21.0.0-5.0\",\n    2101: \"21.0.1-1.0\",\n    2110: \"21.1.0-1.0\",\n\t2120: \"21.2.0-1.0\",\n    2200: \"22.0.0-3.0\",\n    2210: \"22.1.0-1.0\",\n}\n"
  },
  {
    "path": "nintendo/switch/dauth.py",
    "content": "\r\nfrom Crypto.Hash import CMAC\r\nfrom Crypto.Cipher import AES\r\nfrom anynet import tls, http\r\nfrom nintendo import resources\r\nimport base64\r\nimport json\r\nimport time\r\n\r\nimport logging\r\nlogger = logging.getLogger(__name__)\r\n\r\n\r\nDAUTH_SOURCE = bytes.fromhex(\"8be45abcf987021523ca4f5e2300dbf0\")\r\n\r\nSYSTEM_VERSION_DIGEST = {\r\n\t900:  \"CusHY#00090000#-80vwBkUjWLb5Kpb_cnuTjBZ0rHwZHhN7R1-vg0Ti5c=\",\r\n\t901:  \"CusHY#00090001#qVDSOCehwMDCHyDnkXiTSJ1wEJZHtpRV_CLMKgD-fSw=\",\r\n\t910:  \"CusHY#00090100#vIPNrRbf30SoU8ZJ6uGklMqKAkyjHfdE9m6yLFeChkE=\",\r\n\t920:  \"CusHY#00090200#Uxxmc8gYnfMqxzdZdygZ_OrKo98O7QA65s_EkZnGsDo=\",\r\n\t1000: \"CusHY#000a0000#EmdxOnZjZ9Ihf3Zskt_48pYgowAUeeJccU6tCBIweEc=\",\r\n\t1001: \"CusHY#000a0001#JEuSEdid24qqHqQzfW1tuNsCGcCk-86gcPq0I7M1x18=\",\r\n\t1002: \"CusHY#000a0002#BTOGo0giC7bbrNoi8JEm-FBzmXb2Kgpq4K3OzQrD5l8=\",\r\n\t1003: \"CusHY#000a0003#4mBbTFYnE0Rtmh8NLCVq61rbvx0kJPQUxXkDpwj0V84=\",\r\n\t1004: \"CusHY#000a0003#4mBbTFYnE0Rtmh8NLCVq61rbvx0kJPQUxXkDpwj0V84=\",\r\n\t1010: \"CusHY#000a0100#Vlw9dIEqjxE2F5jDOQPYWXs2p7wIGyDYWXXIyQGdxcE=\",\r\n\t1011: \"CusHY#000a0100#Vlw9dIEqjxE2F5jDOQPYWXs2p7wIGyDYWXXIyQGdxcE=\",\r\n\t1020: \"CusHY#000a0200#90k0dE_eO7hRcs6ByTZMvgUm4lhEoqAlik96WkznQcQ=\",\r\n\t1100: \"CusHY#000b0000#VyA0fsWi6ZBEOzVsseXIcEfFLqQMgW0tWzN2oJ7viqk=\",\r\n\t1101: \"CusHY#000b0001#iI0rZ0Q2dg3Evhd-8GoYmp-KTE8malKe0GOJgXa-XG8=\",\r\n\t1200: \"CusHY#000c0000#C-BynYNPXdQJNBZjx02Hizi8lRUSIKLwPGa5p8EY1uo=\",\r\n\t1201: \"CusHY#000c0001#YXsU5FTbkUh18QH27L3woGqw5n1gIDpMGbPXM8oACzY=\",\r\n\t1202: \"CusHY#000c0002#6tB3UVnmvT_nsNBMPSD-K1oe0IA1cYvYDyqDCjy2W_I=\",\r\n\t1203: \"CusHY#000c0003#E8Ph6vISWsJtN0E3hsfVRoZMG1Qqkc-qGRlAp-Bs2SI=\",\r\n\t1210: \"CusHY#000c0100#Hzs8Gtp6yKgGKMb732-5Q-NvbQcHCgBh_LQrrpg0bIs=\",\r\n\t1300: \"CusHY#000d0000#r1xneESd4PiTRYIhVIl0bK1ST5L5BUmv_uGPLqc4PPo=\",\r\n\t1310: \"CusHY#000d0100#plps6S3C43QHhkI2oNvYIFjNxQjTcLdUX2_biEI5w2w=\",\r\n\t1320: \"CusHY#000d0200#JFVNVuG9x3V5tRshdD9FdJjgHOmzsrgXHocEPvW5eMM=\",\r\n\t1321: \"CusHY#000d0201#V1i7M7oEhkDaH1lcGlHhGAnyHONMAnTAA6pGdZ7MFqc=\",\r\n\t1400: \"CusHY#000e0000#35hWb15SBXTnbUfTMLBz9sCnfheuRGis0OTZqa7l8yw=\",\r\n\t1410: \"CusHY#000e0100#ctIxSPR4jenzQNGc6y4zXIvzvF75ty53jN0T15Rjtmk=\",\r\n\t1411: \"CusHY#000e0101#uTt4IVydkYqwYArOFR3BzOCmw0MkEeF_tZxHENYDh4E=\",\r\n\t1412: \"CusHY#000e0102#jHk6_VwXVPPl3ijRZ5jRy5MIAcUW_Q2uFdfJ0vrjhCA=\",\r\n\t1500: \"CusHY#000f0000#MJE7we0zvVhAnXN9uCU7fQAM7GiqGHpR5ECuC9G_nuU=\",\r\n\t1501: \"CusHY#000f0001#TMqizZGvUaBZApmHHQE0Uo7vQ6xWuQxZ8JH87_HnnqI=\",\r\n\t1600: \"CusHY#00100000#k_VrW8iX7QgupPlYZYhg3dLEVDhqGN_iXW5Mm0VYEvQ=\",\r\n\t1601: \"CusHY#00100001#qHay53MkzVLOUU_Iy7_kyPlUMnaoi7HXCAmESYTft_c=\",\r\n\t1602: \"CusHY#00100002#qjeCnaxVt5NjGjxosJOMVw-ZyR219B3qgAB3YtSil6g=\",\r\n\t1603: \"CusHY#00100003#Lis4m_Z4pXlDAaBBxeRO66_glyu92IAf2-dHKNxYAJs=\",\r\n\t1610: \"CusHY#00100100#3kOLHmbuMWa-kHN-SMtCkgNvwdwBHIb2b4f60BNNmrw=\",\r\n\t1700: \"CusHY#00110000#ntMZ00Jmb7Rdu18Fy1FPZo7RO3h_MYIqxozbQQDcVaA=\",\r\n\t1701: \"CusHY#00110001#7CmXEDXEN8wnVu-e7WY6Cv5CvmzjuG6EnKEkf1_jaC8=\",\r\n\t1800: \"CusHY#00120000#U531L4Si9RbhOVeyVppe18WHkJ0k4_KzrNtygsekMNo=\",\r\n\t1801: \"CusHY#00120001#chuxR_O35JFyJq7dIlT8yP1A-j1yBcF-iU4iVDjHt9g=\",\r\n\t1810: \"CusHY#00120100#7pfwz-8raijuW2lv4UOi4Hukp-DuY898HEK6hEYUjSM=\",\r\n\t1900: \"CusHY#00130000#x2jf5al2EkqJmdvmnTFaL6s4ic7X68N0dY9jnwwcL98=\",\r\n\t1901: \"CusHY#00130001#6I1eeoSqDdjA7eXPDrsWBbdM-VxVhveQYiG1oNfNSt0=\",\r\n}\r\n\r\nSYSTEM_VERSION_HEX = {\r\n\t2000: \"7147e1386c9b6c15d8f14e6ed68c4b9a7f28fb9b\",\r\n\t2001: \"0b2540e5cd7498dd61f6caeca5136c73d9b1d21a\",\r\n\t2010: \"fa9b24a1d97b9adf5fe462f7f0ee97e6ed6294d0\",\r\n\t2011: \"9ffad64d79dd150490201461bdf66c8db963f57d\",\r\n\t2015: \"0605c36a7aa2535fb8989a0d133a0b96b0d97a12\",\r\n\t2020: \"ad939aa8ed828aa87f8ca9c6231bc76697298b8d\",\r\n\t2030: \"c6061464f68281807f4780ae737392516d4813c7\",\r\n\t2040: \"cc744ded0c0eb7b0a71917a97ec00926427cd652\",\r\n\t2050: \"c7f472f9b64b7b0cba46a25e6a610f70613a4792\",\r\n\t2100: \"f6b2425b6888a66590db104fc734891696e0ecb3\",\r\n\t2101: \"066a75e6fab7316de34b88b60d229a0b2729e421\",\r\n\t2110: \"0d7a6334ddc3d637f69ec3976b17a260efd68fd4\",\r\n\t2120: \"ff8d6ddacae7c7fd1287e22c3c88bb961acb290c\",\r\n\t2200: \"da42070c4ad25840c9ee25344bde9d0a8584f5a9\",\r\n\t2210: \"1927752d2a83389d84e6d31c4c91710e04fa69aa\",\r\n}\r\n\r\nUSER_AGENT = {\r\n\t900:  \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 9.3.0.0)\",\r\n\t901:  \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 9.3.0.0)\",\r\n\t910:  \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 9.3.0.0)\",\r\n\t920:  \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 9.3.0.0)\",\r\n\t1000: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1001: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1002: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1003: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1004: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1010: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1011: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1020: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 10.4.0.0)\",\r\n\t1100: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 11.4.0.0)\",\r\n\t1101: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 11.4.0.0)\",\r\n\t1200: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\",\r\n\t1201: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\",\r\n\t1202: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\",\r\n\t1203: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\",\r\n\t1210: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\",\r\n\t1300: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 13.3.0.0)\",\r\n\t1310: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 13.4.0.0)\",\r\n\t1320: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 13.4.0.0)\",\r\n\t1321: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 13.4.0.0)\",\r\n\t1400: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 14.3.0.0)\",\r\n\t1410: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 14.3.0.0)\",\r\n\t1411: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 14.3.0.0)\",\r\n\t1412: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 14.3.0.0)\",\r\n\t1500: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 15.3.0.0)\",\r\n\t1501: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 15.3.0.0)\",\r\n\t1600: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 16.2.0.0)\",\r\n\t1601: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 16.2.0.0)\",\r\n\t1602: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 16.2.0.0)\",\r\n\t1603: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 16.2.0.0)\",\r\n\t1610: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 16.2.0.0)\",\r\n\t1700: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 17.5.0.0)\",\r\n\t1701: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 17.5.0.0)\",\r\n\t1800: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 18.3.0.0)\",\r\n\t1801: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 18.3.0.0)\",\r\n\t1810: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 18.3.0.0)\",\r\n\t1900: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 19.3.0.0)\",\r\n\t1901: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 19.3.0.0)\",\r\n\t2000: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2001: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2010: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2011: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2015: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2020: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2030: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2040: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2050: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\",\r\n\t2100: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\r\n\t2101: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\r\n\t2110: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\r\n\t2120: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 21.4.0.0)\",\r\n\t2200: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 22.2.0.0)\",\r\n\t2210: \"libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 22.2.0.0)\",\r\n}\r\n\r\nKEY_GENERATION = {\r\n\t900:  10,\r\n\t901:  10,\r\n\t910:  11,\r\n\t920:  11,\r\n\t1000: 11,\r\n\t1001: 11,\r\n\t1002: 11,\r\n\t1003: 11,\r\n\t1004: 11,\r\n\t1010: 11,\r\n\t1011: 11,\r\n\t1020: 11,\r\n\t1100: 11,\r\n\t1101: 11,\r\n\t1200: 11,\r\n\t1201: 11,\r\n\t1202: 11,\r\n\t1203: 11,\r\n\t1210: 11,\r\n\t1300: 13,\r\n\t1310: 13,\r\n\t1320: 13,\r\n\t1321: 13,\r\n\t1400: 14,\r\n\t1410: 14,\r\n\t1411: 14,\r\n\t1412: 14,\r\n\t1500: 15,\r\n\t1501: 15,\r\n\t1600: 16,\r\n\t1601: 16,\r\n\t1602: 16,\r\n\t1603: 16,\r\n\t1610: 16,\r\n\t1700: 17,\r\n\t1701: 17,\r\n\t1800: 17,\r\n\t1801: 17,\r\n\t1810: 17,\r\n\t1900: 19,\r\n\t1901: 19,\r\n\t2000: 20,\r\n\t2001: 20,\r\n\t2010: 20,\r\n\t2011: 20,\r\n\t2015: 20,\r\n\t2020: 20,\r\n\t2030: 20,\r\n\t2040: 20,\r\n\t2050: 20,\r\n\t2100: 21,\r\n\t2101: 21,\r\n\t2110: 21,\r\n\t2120: 21,\r\n\t2200: 22,\r\n\t2210: 22,\r\n}\r\n\r\nAPI_VERSION = {\r\n\t900: 6,\r\n\t901: 6,\r\n\t910: 6,\r\n\t920: 6,\r\n\t1000: 6,\r\n\t1001: 6,\r\n\t1002: 6,\r\n\t1003: 6,\r\n\t1004: 6,\r\n\t1010: 6,\r\n\t1011: 6,\r\n\t1020: 6,\r\n\t1100: 6,\r\n\t1101: 6,\r\n\t1200: 6,\r\n\t1201: 6,\r\n\t1202: 6,\r\n\t1203: 6,\r\n\t1210: 6,\r\n\t1300: 7,\r\n\t1310: 7,\r\n\t1320: 7,\r\n\t1321: 7,\r\n\t1400: 7,\r\n\t1410: 7,\r\n\t1411: 7,\r\n\t1412: 7,\r\n\t1500: 7,\r\n\t1501: 7,\r\n\t1600: 7,\r\n\t1601: 7,\r\n\t1602: 7,\r\n\t1603: 7,\r\n\t1610: 7,\r\n\t1700: 7,\r\n\t1701: 7,\r\n\t1800: 7,\r\n\t1801: 7,\r\n\t1810: 7,\r\n\t1900: 7,\r\n\t1901: 7,\r\n\t2000: 8,\r\n\t2001: 8,\r\n\t2010: 8,\r\n\t2011: 8,\r\n\t2015: 8,\r\n\t2020: 8,\r\n\t2030: 8,\r\n\t2040: 8,\r\n\t2050: 8,\r\n\t2100: 8,\r\n\t2101: 8,\r\n\t2110: 8,\r\n\t2120: 8,\r\n\t2200: 8,\r\n\t2210: 8,\r\n}\r\n\r\nLATEST_VERSION = 2210\r\n\r\n\r\nCLIENT_ID_SCSI = 0x146C8AC7B8A0DB52\r\nCLIENT_ID_ER = 0x16E96F76850156D1\r\nCLIENT_ID_ATUM = 0x3117B250CAB38F45\r\nCLIENT_ID_ESHOP = 0x41F4A6491028E3C4\r\nCLIENT_ID_BCAT = 0x67BF9945B45248C6\r\nCLIENT_ID_SATA = 0x6AC5A6873FE5F68C\r\nCLIENT_ID_ACCOUNT_APPLET = 0x75FE236362FF5F8B\r\nCLIENT_ID_ACCOUNT = 0x81333C548B2E876D\r\nCLIENT_ID_NPNS = 0x83B72B05DC3278D7\r\nCLIENT_ID_BAAS = 0x8F849B5D34778D8E\r\nCLIENT_ID_BEACH = 0x93AF0ACB26258DE9\r\nCLIENT_ID_SPROFILE = 0xBAD8156F44AC935A\r\nCLIENT_ID_DRAGONS = 0xD5B6CAC2C1514C56\r\nCLIENT_ID_SCSI_POLICY = 0xD98185ACB55994B4\r\nCLIENT_ID_PCTL = 0xDC656EA03B63CF68\r\nCLIENT_ID_PREPO = 0xDF51C436BC01C437\r\nCLIENT_ID_PENNE = 0xE58171FE439390CE\r\n\r\n\r\nPRELOADED_DEVICE_TOKENS = [\r\n\tCLIENT_ID_BAAS,\r\n\tCLIENT_ID_PCTL,\r\n\tCLIENT_ID_BEACH,\r\n\tCLIENT_ID_PREPO,\r\n\tCLIENT_ID_ER,\r\n\tCLIENT_ID_PENNE,\r\n\tCLIENT_ID_ACCOUNT,\r\n\tCLIENT_ID_ACCOUNT_APPLET,\r\n\tCLIENT_ID_SCSI,\r\n\tCLIENT_ID_DRAGONS,\r\n\tCLIENT_ID_SPROFILE\r\n]\r\n\r\nPRELOADED_EDGE_TOKENS = [\r\n\t(CLIENT_ID_BEACH, \"akamai\"),\r\n\t(CLIENT_ID_BCAT, \"akamai\"),\r\n\t(CLIENT_ID_SCSI_POLICY, \"akamai\"),\r\n\t(CLIENT_ID_SCSI, \"akamai\"),\r\n\t(CLIENT_ID_ESHOP, \"akamai\"),\r\n\t(CLIENT_ID_ATUM, \"akamai\"),\r\n\t(CLIENT_ID_ATUM, \"fastly\")\r\n]\r\n\r\n\r\nclass DAuthError(Exception):\r\n\tUNAUTHORIZED_DEVICE = 4\r\n\tSYSTEM_UPDATE_REQUIRED = 7\r\n\tBANNED_DEVICE = 8\r\n\tINTERNAL_SERVER_ERROR = 9\r\n\tGENERIC = 14\r\n\tCHALLENGE_EXPIRED = 15\r\n\tWRONG_MAC = 16\r\n\tBROKEN_DEVICE = 17\r\n\t\r\n\tdef __init__(self, response, error):\r\n\t\tself.response = response\r\n\t\tself.code = int(error[\"code\"])\r\n\t\tself.message = error[\"message\"]\r\n\t\r\n\tdef __str__(self):\r\n\t\treturn self.message\r\n\r\n\r\nclass DAuthClient:\r\n\tdef __init__(self, keys):\r\n\t\tself.keys = keys\r\n\t\t\r\n\t\tself.request_callback = http.request\r\n\t\t\r\n\t\tca = resources.certificate(\"Nintendo_CA_G3.der\")\r\n\t\tself.context = tls.TLSContext()\r\n\t\tself.context.set_authority(ca)\r\n\t\t\r\n\t\tself.host = \"dauth-lp1.ndas.srv.nintendo.net\"\r\n\t\t\r\n\t\tself.power_state = \"FA\"\r\n\t\tself.region = 1\r\n\r\n\t\tself.system_version = LATEST_VERSION\r\n\t\tself.user_agent = USER_AGENT[self.system_version]\r\n\t\tself.system_version_hash = SYSTEM_VERSION_HEX[self.system_version]\r\n\t\tself.key_generation = KEY_GENERATION[self.system_version]\r\n\t\tself.api_version = API_VERSION[self.system_version]\r\n\t\t\r\n\tdef set_request_callback(self, callback): self.request_callback = callback\r\n\t\r\n\tdef set_context(self, context): self.context = context\r\n\tdef set_certificate(self, cert, key): self.context.set_certificate(cert, key)\r\n\t\r\n\tdef set_power_state(self, state): self.power_state = state\r\n\tdef set_platform_region(self, region): self.region = region\r\n\t\r\n\tdef set_host(self, host): self.host = host\r\n\t\r\n\tdef set_system_version(self, version):\r\n\t\tif version not in USER_AGENT:\r\n\t\t\traise ValueError(\"Unknown system version: %i\" %version)\r\n\t\tself.system_version = version\r\n\t\tself.user_agent = USER_AGENT[version]\r\n\t\tself.key_generation = KEY_GENERATION[version]\r\n\t\tself.api_version = API_VERSION[version]\r\n\t\tif self.api_version < 8:\r\n\t\t\tself.system_version_hash = SYSTEM_VERSION_DIGEST[version]\r\n\t\telse:\r\n\t\t\tself.system_version_hash = SYSTEM_VERSION_HEX[version]\r\n\t\t\r\n\tasync def request(self, req):\r\n\t\tif self.system_version < 1800:\r\n\t\t\treq.headers[\"Host\"] = self.host\r\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent\r\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\r\n\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\r\n\t\t\treq.headers[\"Content-Length\"] = 0\r\n\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\r\n\t\telif self.system_version < 2000:\r\n\t\t\treq.headers[\"Host\"] = self.host\r\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\r\n\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\r\n\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\r\n\t\t\treq.headers[\"Content-Length\"] = 0\r\n\t\telse:\r\n\t\t\treq.headers[\"Host\"] = self.host\r\n\t\t\treq.headers[\"Accept\"] = \"*/*\"\r\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent\r\n\t\t\tif req.json:\r\n\t\t\t\treq.headers[\"Content-Type\"] = \"application/json\"\r\n\t\t\telse:\r\n\t\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\r\n\t\t\treq.headers[\"X-Nintendo-PowerState\"] = self.power_state\r\n\t\t\treq.headers[\"Content-Length\"] = 0\r\n\t\t\r\n\t\tresponse = await self.request_callback(self.host, req, self.context)\r\n\t\tif response.json and \"errors\" in response.json:\r\n\t\t\tlogger.error(\"DAuth server returned errors:\")\r\n\t\t\tfor error in response.json[\"errors\"]:\r\n\t\t\t\tlogger.error(\"  (%s) %s\", error[\"code\"], error[\"message\"])\r\n\t\t\traise DAuthError(response, response.json[\"errors\"][0])\r\n\t\tresponse.raise_if_error()\r\n\t\treturn response\r\n\t\t\r\n\tasync def challenge(self):\r\n\t\treq = http.HTTPRequest.post(\"/v%i/challenge\" %self.api_version)\r\n\t\treq.form = {\r\n\t\t\t\"key_generation\": self.key_generation\r\n\t\t}\r\n\t\t\r\n\t\tresponse = await self.request(req)\r\n\t\treturn response.json\r\n\t\r\n\tasync def request_token(self, client_id, vendor_id=\"akamai\", *, edge_token):\r\n\t\t# This is a generic method to reduce code duplication between device_token and edge_token\r\n\r\n\t\t# Use one of the preload_* functions on system version 20.0.0 and later, to mimic the\r\n\t\t# behavior of a real Switch.\r\n\t\tif self.system_version >= 2000:\r\n\t\t\traise ValueError(\"This method is only available up to system version 19.0.1\")\r\n\t\t\r\n\t\tchallenge = await self.challenge()\r\n\t\tdata = base64.b64decode(challenge[\"data\"] + \"==\", \"-_\")\r\n\r\n\t\tpath = \"/v%i/device_auth_token\" %self.api_version\r\n\t\tif edge_token:\r\n\t\t\tpath = \"/v%i/edge_token\" %self.api_version\r\n\t\t\r\n\t\treq = http.HTTPRequest.post(path)\r\n\t\treq.rawform = {\r\n\t\t\t\"challenge\": challenge[\"challenge\"],\r\n\t\t\t\"client_id\": \"%016x\" %client_id,\r\n\t\t\t\"ist\": \"true\" if self.region == 2 else \"false\",\r\n\t\t\t\"key_generation\": self.key_generation,\r\n\t\t\t\"system_version\": self.system_version_hash\r\n\t\t}\r\n\t\tif self.api_version >= 7 and edge_token:\r\n\t\t\treq.rawform[\"vendor_id\"] = vendor_id\r\n\r\n\t\tstring = http.formencode(req.rawform, False)\r\n\t\treq.rawform[\"mac\"] = self.calculate_mac(string, data)\r\n\r\n\t\tresponse = await self.request(req)\r\n\t\treturn response.json\r\n\t\r\n\tasync def request_tokens(self, token_requests, *, edge_tokens):\r\n\t\t# This is a generic method to reduce code duplication between device_tokens and edge_tokens\r\n\r\n\t\tif self.system_version < 2000:\r\n\t\t\traise ValueError(\"This method is only available on system version 20.0.0 and above.\")\r\n\t\t\r\n\t\tchallenge = await self.challenge()\r\n\t\tdata = base64.b64decode(challenge[\"data\"] + \"==\", \"-_\")\r\n\r\n\t\tsystem_version = \"00%02x%02x%02x\" %(\r\n\t\t\tself.system_version // 100,\r\n\t\t\t(self.system_version // 10) % 10,\r\n\t\t\tself.system_version % 10\r\n\t\t)\r\n\r\n\t\tform = {\r\n\t\t\t\"challenge\": challenge[\"challenge\"],\r\n\t\t\t\"fw_revision\": self.system_version_hash,\r\n\t\t\t\"ist\": \"true\" if self.region == 2 else \"false\",\r\n\t\t\t\"key_generation\": self.key_generation,\r\n\t\t\t\"system_version\": system_version,\r\n\t\t\t\"token_requests\": json.dumps(token_requests, separators=(\",\", \":\"))\r\n\t\t}\r\n\t\tstring = http.formencode(form, False)\r\n\t\tmac = self.calculate_mac(string, data)\r\n\r\n\t\tpath = \"/v%i/device_auth_tokens\" %self.api_version\r\n\t\tif edge_tokens:\r\n\t\t\tpath = \"/v%i/edge_tokens\" %self.api_version\r\n\r\n\t\treq = http.HTTPRequest.post(path)\r\n\t\treq.json = {\r\n\t\t\t\"system_version\": system_version,\r\n\t\t\t\"fw_revision\": self.system_version_hash,\r\n\t\t\t\"ist\": self.region == 2,\r\n\t\t\t\"token_requests\": token_requests,\r\n\t\t\t\"key_generation\": self.key_generation,\r\n\t\t\t\"challenge\": challenge[\"challenge\"],\r\n\t\t\t\"mac\": mac\r\n\t\t}\r\n\r\n\t\tresponse = await self.request(req)\r\n\r\n\t\t# Check if any errors have occurred\r\n\t\terrors = []\r\n\t\tfor result in response.json[\"results\"]:\r\n\t\t\tif \"error\" in result:\r\n\t\t\t\terrors.append(result[\"error\"])\r\n\t\t\r\n\t\tif errors:\r\n\t\t\tlogger.error(\"DAuth server returned errors:\")\r\n\t\t\tfor error in errors:\r\n\t\t\t\tlogger.error(\"  (%s) %s\", error[\"code\"], error[\"message\"])\r\n\t\t\traise DAuthError(response, errors[0])\r\n\r\n\t\treturn response.json\r\n\t\r\n\tasync def device_token(self, client_id):\r\n\t\treturn await self.request_token(client_id, edge_token=False)\r\n\t\r\n\tasync def edge_token(self, client_id, vendor_id=\"akamai\"):\r\n\t\treturn await self.request_token(client_id, vendor_id, edge_token=True)\r\n\t\t\r\n\tasync def device_tokens(self, client_ids):\r\n\t\ttoken_requests = [{\"client_id\": \"%016x\" %client_id} for client_id in client_ids]\r\n\t\treturn await self.request_tokens(token_requests, edge_tokens=False)\r\n\r\n\tasync def edge_tokens(self, token_requests):\r\n\t\ttoken_requests = [{\"client_id\": \"%016x\" %client_id, \"vendor_id\": vendor_id} for client_id, vendor_id in token_requests]\r\n\t\treturn await self.request_tokens(token_requests, edge_tokens=True)\r\n\r\n\tasync def preload_device_tokens(self):\r\n\t\treturn await self.device_tokens(PRELOADED_DEVICE_TOKENS)\r\n\t\r\n\tasync def preload_edge_tokens(self):\r\n\t\treturn await self.edge_tokens(PRELOADED_EDGE_TOKENS)\r\n\t\t\r\n\tdef get_master_key(self):\r\n\t\tkeygen = self.key_generation\r\n\t\tkeyname = \"master_key_%02x\" %(keygen - 1)\r\n\t\treturn self.keys[keyname]\r\n\t\r\n\tdef decrypt_key(self, key, kek):\r\n\t\taes = AES.new(kek, AES.MODE_ECB)\r\n\t\treturn aes.decrypt(key)\r\n\t\t\r\n\tdef calculate_mac(self, form, data):\r\n\t\tkek_source = self.keys[\"aes_kek_generation_source\"]\r\n\t\tmaster_key = self.get_master_key()\r\n\t\t\r\n\t\tkey = self.decrypt_key(kek_source, master_key)\r\n\t\tkey = self.decrypt_key(DAUTH_SOURCE, key)\r\n\t\tkey = self.decrypt_key(data, key)\r\n\t\t\r\n\t\tmac = CMAC.new(key, ciphermod=AES)\r\n\t\tmac.update(form.encode())\r\n\t\treturn base64.b64encode(mac.digest(), b\"-_\").decode().rstrip(\"=\")\r\n\r\n\r\nclass DAuthCache:\r\n\tdef __init__(self, client, expiration=None):\r\n\t\tself.client = client\r\n\t\tself.expiration = expiration\r\n\r\n\t\tself.device_tokens = {}\r\n\t\tself.edge_tokens = {}\r\n\t\r\n\tasync def device_token(self, client_id):\r\n\t\tnow = time.time()\r\n\t\tif client_id in self.device_tokens and self.device_tokens[client_id][1] > now:\r\n\t\t\treturn self.device_tokens[client_id][0]\r\n\t\t\r\n\t\tif client_id in PRELOADED_DEVICE_TOKENS:\r\n\t\t\tresponse = await self.client.preload_device_tokens()\r\n\t\telse:\r\n\t\t\tresponse = await self.client.device_tokens([client_id])\r\n\t\t\r\n\t\tfor result in response[\"results\"]:\r\n\t\t\tif self.expiration is not None:\r\n\t\t\t\texpiration = now + self.expiration\r\n\t\t\telse:\r\n\t\t\t\texpiration = now + result[\"expires_in\"]\r\n\t\t\tself.device_tokens[int(result[\"client_id\"], 16)] = (result[\"device_auth_token\"], expiration)\r\n\r\n\t\treturn self.device_tokens[client_id][0]\r\n\r\n\tasync def edge_token(self, client_id, vendor_id=\"akamai\"):\r\n\t\tnow = time.time()\r\n\t\tkey = (client_id, vendor_id)\r\n\t\tif key in self.edge_tokens and self.edge_tokens[key][1] > now:\r\n\t\t\treturn self.edge_tokens[key][0]\r\n\t\t\r\n\t\tif key in PRELOADED_EDGE_TOKENS:\r\n\t\t\tresponse = await self.client.preload_edge_tokens()\r\n\t\telse:\r\n\t\t\tresponse = await self.client.edge_tokens([key])\r\n\t\t\r\n\t\tfor result in response[\"results\"]:\r\n\t\t\tresult_key = (int(result[\"client_id\"], 16), result[\"vendor_id\"])\r\n\t\t\tif self.expiration is not None:\r\n\t\t\t\texpiration = now + self.expiration\r\n\t\t\telse:\r\n\t\t\t\texpiration = now + result[\"expires_in\"]\r\n\t\t\tself.edge_tokens[result_key] = (result[\"dtoken\"], expiration)\r\n\t\t\r\n\t\treturn self.edge_tokens[key][0]\r\n"
  },
  {
    "path": "nintendo/switch/dragons.py",
    "content": "\nfrom anynet import tls, http\nfrom nintendo import resources\nfrom nintendo.switch import common, dauth\nimport base64\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nUSER_AGENT = \"NintendoSDK Firmware/%s (platform:NX; did:%016x; eid:lp1)\"\n\nAPI_VERSION = {\n\t 900: 1,\n\t 901: 1,\n\t 910: 1,\n\t 920: 1,\n\t1000: 1,\n\t1001: 1,\n\t1002: 1,\n\t1003: 1,\n\t1004: 1,\n\t1010: 1,\n\t1011: 1,\n\t1020: 1,\n\t1100: 1,\n\t1101: 1,\n\t1200: 1,\n\t1201: 1,\n\t1202: 1,\n\t1203: 1,\n\t1210: 1,\n\t1300: 1,\n\t1310: 1,\n\t1320: 1,\n\t1321: 1,\n\t1400: 1,\n\t1410: 1,\n\t1411: 1,\n\t1412: 1,\n\t1500: 1,\n\t1501: 1,\n\t1600: 1,\n\t1601: 1,\n\t1602: 1,\n\t1603: 1,\n\t1610: 1,\n\t1700: 1,\n\t1701: 1,\n\t1800: 1,\n\t1801: 1,\n\t1810: 1,\n\t1900: 1,\n\t1901: 1,\n\t2000: 2,\n\t2001: 2,\n\t2010: 2,\n\t2011: 2,\n\t2015: 2,\n\t2020: 2,\n\t2030: 2,\n\t2040: 2,\n\t2050: 2,\n\t2100: 2,\n\t2101: 2,\n\t2110: 2,\n\t2120: 2,\n\t2200: 2,\n\t2210: 2,\n}\n\nLATEST_VERSION = 2210\n\n\nclass DragonsError(Exception):\n\tdef __init__(self, response):\n\t\tself.response = response\n\t\t\n\t\tself.type = response.json[\"type\"]\n\t\tself.name = response.json[\"type\"].split(\"/\")[-1]\n\t\tself.title = response.json[\"title\"]\n\t\tself.detail = response.json[\"detail\"]\n\t\tself.status = response.json[\"number\"]\n\t\tself.invalid_params = response.json.get(\"invalid-params\")\n\t\n\tdef __str__(self):\n\t\treturn self.title\n\n\nclass DragonsClient:\n\tdef __init__(self, device_id=None):\n\t\tself.device_id = device_id\n\t\t\n\t\tself.request_callback = http.request\n\t\t\n\t\tca = resources.certificate(\"Nintendo_Class_2_CA_G3.der\")\n\t\tself.context = tls.TLSContext()\n\t\tself.context.set_authority(ca)\n\t\t\n\t\tself.host_dragons = \"dragons.hac.lp1.dragons.nintendo.net\"\n\t\tself.host_dragonst = \"dragonst.hac.lp1.dragons.nintendo.net\"\n\t\tself.host_tigers = \"tigers.hac.lp1.dragons.nintendo.net\"\n\t\t\n\t\tself.system_version = LATEST_VERSION\n\t\tself.user_agent_nim = None\n\t\tif self.device_id is not None:\n\t\t\tself.user_agent_nim = USER_AGENT %(common.FIRMWARE_VERSIONS[LATEST_VERSION], self.device_id)\n\t\tself.user_agent_dauth = dauth.USER_AGENT[LATEST_VERSION]\n\t\tself.api_version = API_VERSION[self.system_version]\n\t\n\tdef set_request_callback(self, callback): self.request_callback = callback\n\t\n\tdef set_context(self, context): self.context = context\n\tdef set_certificate(self, cert, key): self.context.set_certificate(cert, key)\n\t\n\tdef set_hosts(self, dragons, dragonst, tigers):\n\t\tself.host_dragons = dragons\n\t\tself.host_dragonst = dragonst\n\t\tself.host_tigers = tigers\n\t\n\tdef set_system_version(self, version):\n\t\tif version not in common.FIRMWARE_VERSIONS:\n\t\t\traise ValueError(\"Unknown system version: %i\" %version)\n\t\t\n\t\tself.system_version = version\n\t\tif self.device_id is not None:\n\t\t\tself.user_agent_nim = USER_AGENT %(common.FIRMWARE_VERSIONS[version], self.device_id)\n\t\tself.user_agent_dauth = dauth.USER_AGENT[version]\n\t\tself.api_version = API_VERSION[self.system_version]\n\t\n\tasync def request(self, req, host, device_token, *, account_id=None):\n\t\tif self.user_agent_nim is None:\n\t\t\traise ValueError(\"This request requires a device id\")\n\t\t\n\t\treq.headers[\"Host\"] = host\n\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\treq.headers[\"User-Agent\"] = self.user_agent_nim\n\t\treq.headers[\"DeviceAuthorization\"] = \"Bearer \" + device_token\n\t\tif account_id is not None:\n\t\t\treq.headers[\"Nintendo-Account-Id\"] = \"%016x\" %account_id\n\t\tif req.json is not None:\n\t\t\treq.headers[\"Content-Type\"] = \"application/json\"\n\t\t\treq.headers[\"Content-Length\"] = 0\n\t\telse:\n\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\n\t\t\n\t\tresponse = await self.request_callback(host, req, self.context)\n\t\tif response.error() and response.json:\n\t\t\tlogger.error(\"Dragons server returned an error: %s\" %response.json)\n\t\t\traise DragonsError(response)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\t\n\tasync def request_dauth(self, req, device_token, title_id):\n\t\treq.headers[\"Host\"] = self.host_dragons\n\t\tif self.system_version < 1800:\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent_dauth\n\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\tif self.system_version >= 2000:\n\t\t\treq.headers[\"User-Agent\"] = self.user_agent_dauth\n\t\treq.headers[\"Content-Type\"] = \"application/json\"\n\t\treq.headers[\"DeviceAuthorization\"] = \"Bearer \" + device_token\n\t\treq.headers[\"Nintendo-Application-Id\"] = \"%016x\" %title_id\n\t\treq.headers[\"Content-Length\"] = 0\n\t\t\n\t\tresponse = await self.request_callback(self.host_dragons, req, self.context)\n\t\tif response.error() and response.json:\n\t\t\tlogger.error(\"Dragons server returned an error: %s\" %response.json)\n\t\t\traise DragonsError(response)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\t\n\tasync def publish_elicense_archive(self, device_token, challenge, certificate, account_id):\n\t\treq = http.HTTPRequest.post(\"/v%i/elicense_archives/publish\" %self.api_version)\n\t\treq.json = {\n\t\t\t\"challenge\": challenge,\n\t\t\t\"certificate\": base64.b64encode(certificate).decode()\n\t\t}\n\t\t\n\t\tresponse = await self.request(req, self.host_dragons, device_token, account_id=account_id)\n\t\treturn response.json\n\t\n\tasync def report_elicense_archive(self, device_token, elicense_archive_id, account_id):\n\t\treq = http.HTTPRequest.put(\"/v%i/elicense_archives/%s/report\" %(self.api_version, elicense_archive_id))\n\t\tawait self.request(req, self.host_dragons, device_token, account_id=account_id)\n\t\n\tasync def publish_device_linked_elicenses(self, device_token):\n\t\treq = http.HTTPRequest.post(\"/v%i/rights/publish_device_linked_elicenses\" %self.api_version)\n\t\tresponse = await self.request(req, self.host_dragons, device_token)\n\t\treturn response.json\n\t\n\tasync def exercise_elicense(self, device_token, elicense_ids, account_ids, current_account_id):\n\t\treq = http.HTTPRequest.post(\"/v%i/elicenses/exercise\" %self.api_version)\n\t\treq.json = {\n\t\t\t\"elicense_ids\": elicense_ids,\n\t\t\t\"account_ids\": [\"%016x\" %i for i in account_ids]\n\t\t}\n\t\tawait self.request(req, self.host_dragons, device_token, account_id=current_account_id)\n\t\n\tasync def contents_authorization_token_for_aauth(self, device_token, elicense_id, na_id, title_id):\n\t\tif self.system_version < 1500:\n\t\t\traise ValueError(\"contents_authorization_token_for_aauth was added in system version 15.0.0\")\n\t\t\n\t\treq = http.HTTPRequest.post(\"/v%i/contents_authorization_token_for_aauth/issue\" %self.api_version)\n\t\treq.json = {\n\t\t\t\"elicense_id\": elicense_id,\n\t\t\t\"na_id\": \"%016x\" %na_id\n\t\t}\n\t\t\n\t\tresponse = await self.request_dauth(req, device_token, title_id)\n\t\treturn response.json\n"
  },
  {
    "path": "nintendo/switch/five.py",
    "content": "\nfrom anynet import tls, http\nfrom nintendo import resources\nimport base64\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nUSER_AGENT = {\n\t 900: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 901: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 910: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t 920: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 9.3.0.0; Add-on 9.3.0.0)\",\n\t1000: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1001: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1002: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1003: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1004: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1010: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1011: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1020: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 10.4.0.0; Add-on 10.4.0.0)\",\n\t1100: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 11.4.0.0; Add-on 11.4.0.0)\",\n\t1101: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 11.4.0.0; Add-on 11.4.0.0)\",\n\t1200: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1201: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1202: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1203: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1210: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\",\n\t1300: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.3.0.0; Add-on 13.3.0.0)\",\n\t1310: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1320: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1321: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.4.0.0; Add-on 13.4.0.0)\",\n\t1400: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1410: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1411: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1412: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 14.3.0.0; Add-on 14.3.0.0)\",\n\t1500: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\",\n\t1501: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\",\n\t1600: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1601: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1602: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1603: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1610: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 16.2.0.0; Add-on 16.2.0.0)\",\n\t1700: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 17.5.0.0; Add-on 17.5.0.0)\",\n\t1701: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 17.5.0.0; Add-on 17.5.0.0)\",\n\t1800: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1801: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1810: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 18.3.0.0; Add-on 18.3.0.0)\",\n\t1900: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\",\n\t1901: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\",\n\t2000: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2001: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2010: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2011: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2015: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2020: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2030: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2040: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2050: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\",\n\t2100: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2101: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2110: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2120: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\",\n\t2200: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 22.2.0.0; Add-on 22.2.0.0)\",\n\t2210: \"libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 22.2.0.0; Add-on 22.2.0.0)\",\n}\n\nLATEST_VERSION = 2210\n\nLANGUAGES = [\n\t\"en-US\", \"en-GB\", \"ja\", \"fr\", \"de\", \"es-419\", \"es\", \"it\", \"nl\"\n\t\"fr-CA\", \"pt\", \"ru\", \"zh-Hans\", \"zh-Hant\", \"ko\", \"pt-BR\"\n]\n\n\nclass FiveError(Exception):\n\tINVALID_PARAMETER = 2\n\tINVALID_REQUEST_URI = 3\n\tUNAUTHORIZED = 6\n\tRESOURCE_NOT_FOUND = 10\n\tAPPLICATION_DATA_TOO_LARGE = 11\n\t\n\tdef __init__(self, response):\n\t\tself.response = response\n\t\t\n\t\tself.code = int(response.json[\"error\"][\"code\"])\n\t\tself.message = response.json[\"error\"][\"message\"]\n\t\n\tdef __str__(self):\n\t\treturn self.message\n\n\nclass FiveClient:\n\tdef __init__(self):\n\t\tself.request_callback = http.request\n\t\t\n\t\tca = resources.certificate(\"Nintendo_CA_G3.der\")\n\t\tself.context = tls.TLSContext()\n\t\tself.context.set_authority(ca)\n\t\t\n\t\tself.host = \"app.lp1.five.nintendo.net\"\n\t\t\n\t\tself.system_version = LATEST_VERSION\n\t\tself.user_agent = USER_AGENT[LATEST_VERSION]\n\t\n\tdef set_request_callback(self, callback): self.request_callback = callback\n\tdef set_context(self, context): self.context = context\n\tdef set_host(self, host): self.host = host\n\t\n\tdef set_system_version(self, version):\n\t\tif version not in USER_AGENT:\n\t\t\traise ValueError(\"Unknown system version\")\n\t\tself.system_version = version\n\t\tself.user_agent = USER_AGENT[version]\n\t\n\tasync def request(self, req, access_token):\n\t\treq.headers[\"Host\"] = self.host\n\t\treq.headers[\"User-Agent\"] = self.user_agent\n\t\treq.headers[\"Accept\"] = \"*/*\"\n\t\t\n\t\tif req.method != \"GET\":\n\t\t\tif req.json is not None:\n\t\t\t\treq.headers[\"Content-Type\"] = \"application/json\"\n\t\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + access_token\n\t\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\telif req.form is not None:\n\t\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\n\t\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + access_token\n\t\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\telse:\n\t\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + access_token\n\t\t\t\treq.headers[\"Content-Length\"] = 0\n\t\t\t\treq.headers[\"Content-Type\"] = \"application/x-www-form-urlencoded\"\n\t\telse:\n\t\t\treq.headers[\"Authorization\"] = \"Bearer \" + access_token\n\t\t\n\t\tresponse = await self.request_callback(self.host, req, self.context)\n\t\tif response.json and \"error\" in response.json:\n\t\t\tlogger.warning(\"Five server returned an error: %s\" %response.json)\n\t\t\traise FiveError(response)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\t\n\tasync def get_unread_invitation_count(self, access_token, user_id):\n\t\tif self.system_version < 2000:\n\t\t\treq = http.HTTPRequest.get(\"/v1/users/%016x/invitations/inbox\" %user_id)\n\t\t\treq.params = {\n\t\t\t\t\"fields\": \"count\",\n\t\t\t\t\"read\": \"false\"\n\t\t\t}\n\t\telse:\n\t\t\treq = http.HTTPRequest.get(\"/v2/users/%016x/invitations/inbox\" %user_id)\n\t\t\treq.params = {\n\t\t\t\t\"fields\": \"count\",\n\t\t\t\t\"read\": \"false\",\n\t\t\t\t\"invitation_types\": \"friend\"\n\t\t\t}\n\t\tresponse = await self.request(req, access_token)\n\t\treturn response.json[\"count\"]\n\t\n\tasync def get_inbox(self, access_token, user_id):\n\t\tif self.system_version < 2000:\n\t\t\treq = http.HTTPRequest.get(\"/v1/users/%016x/invitations/inbox\" %user_id)\n\t\telse:\n\t\t\treq = http.HTTPRequest.get(\"/v2/users/%016x/invitations/inbox\" %user_id)\n\t\t\treq.params = {\n\t\t\t\t\"invitation_types\": \"friend\"\n\t\t\t}\n\t\tresponse = await self.request(req, access_token)\n\t\treturn response.json\n\n\tasync def get_invitation_group(self, access_token, invitation_group_id):\n\t\treq = http.HTTPRequest.get(\"/v1/invitation_groups/%i\" %invitation_group_id)\n\t\tresponse = await self.request(req, access_token)\n\t\treturn response.json\n\t\n\tasync def mark_as_read(self, access_token, ids):\n\t\treq = http.HTTPRequest.patch(\"/v1/invitations\")\n\t\treq.form = {\n\t\t\t\"read\": \"true\",\n\t\t\t\"ids\": \",\".join(\"%016x\" %id for id in ids)\n\t\t}\n\t\tawait self.request(req, access_token)\n\t\n\tasync def mark_all_as_read(self, access_token, user_id):\n\t\treq = http.HTTPRequest.patch(\"/v1/users/%016x/invitations/mark_as_read\" %user_id)\n\t\tawait self.request(req, access_token)\n\n\tasync def send_invitation(\n\t\tself, access_token, receivers, application_id, application_group_id,\n\t\tapplication_data, messages, application_id_match=False,\n\t\tacd_index=0\n\t):\n\t\t# Sanity checks\n\t\tif len(receivers) > 16:\n\t\t\traise ValueError(\"Too many receiver ids\")\n\t\tfor language, message in messages.items():\n\t\t\tif language not in LANGUAGES:\n\t\t\t\traise ValueError(\"'%s' is not a valid language\" %language)\n\t\t\tif len(message) >= 0xC0:\n\t\t\t\traise ValueError(\"Message for language '%s' is too long\" %language)\n\t\tif len(application_data) > 0x400:\n\t\t\traise ValueError(\"Application data is too large\")\n\t\t\n\t\turl = \"/v1/invitation_groups\"\n\t\tif self.system_version >= 2000:\n\t\t\turl = \"/v2/invitation_groups\"\n\t\t\n\t\treq = http.HTTPRequest.post(url)\n\n\t\treq.json = {\n\t\t\t\"receiver_ids\": [\"%016x\" %id for id in receivers],\n\t\t}\n\n\t\tif self.system_version >= 2000:\n\t\t\treq.json[\"invitation_type\"] = \"friend\"\n\t\t\n\t\treq.json[\"application_id\"] = \"%016x\" %application_id\n\n\t\tif self.system_version >= 1900:\n\t\t\treq.json[\"acd_index\"] = acd_index\n\t\t\n\t\treq.json[\"application_group_id\"] = \"%016x\" %application_group_id\n\t\t\n\t\tif application_data:\n\t\t\treq.json[\"application_data\"] = base64.b64encode(application_data).decode()\n\t\t\n\t\treq.json[\"messages\"] = messages\n\t\tfor language in LANGUAGES:\n\t\t\tif language in messages:\n\t\t\t\treq.json[\"messages\"][language] = messages[language]\n\t\treq.json[\"application_id_match\"] = application_id_match\n\t\t\n\t\treq.json_options[\"ensure_ascii\"] = False\n\t\t\n\t\tresponse = await self.request(req, access_token)\n\t\treturn response.json\n"
  },
  {
    "path": "nintendo/switch/sun.py",
    "content": "\nfrom anynet import tls, http\nfrom nintendo import resources\nfrom nintendo.switch import common\n\nimport logging\nlogger = logging.getLogger(__name__)\n\n\nUSER_AGENT = \"NintendoSDK Firmware/%s (platform:NX; did:%016x; eid:lp1)\"\n\nLATEST_VERSION = 2210\n\n\nclass SunError(Exception):\n\tdef __init__(self, response):\n\t\tself.response = response\n\n\t\tself.code = response.json[\"error\"][\"code\"]\n\t\tself.message = response.json[\"error\"][\"message\"]\n\t\n\tdef __str__(self):\n\t\treturn self.message\n\n\nclass SunClient:\n\tdef __init__(self, device_id):\n\t\tself.device_id = device_id\n\t\t\n\t\tself.request_callback = http.request\n\t\t\n\t\tca = resources.certificate(\"Nintendo_Class_2_CA_G3.der\")\n\t\tself.context = tls.TLSContext()\n\t\tself.context.set_authority(ca)\n\t\t\n\t\tself.host = \"sun.hac.lp1.d4c.nintendo.net\"\n\t\t\n\t\tself.user_agent = USER_AGENT %(common.FIRMWARE_VERSIONS[LATEST_VERSION], self.device_id)\n\t\n\tdef set_request_callback(self, callback): self.request_callback = callback\n\t\n\tdef set_context(self, context): self.context = context\n\tdef set_certificate(self, cert, key): self.context.set_certificate(cert, key)\n\t\n\tdef set_host(self, host): self.host = host\n\t\n\tdef set_system_version(self, version):\n\t\tif version not in common.FIRMWARE_VERSIONS:\n\t\t\traise ValueError(\"Unknown system version: %i\" %version)\n\t\tself.user_agent = USER_AGENT %(common.FIRMWARE_VERSIONS[version], self.device_id)\n\t\n\tasync def request(self, req):\n\t\treq.headers[\"Host\"] = self.host\n\t\treq.headers[\"User-Agent\"] = self.user_agent\n\t\treq.headers[\"Accept\"] = \"application/json\"\n\t\t\n\t\tresponse = await self.request_callback(self.host, req, self.context)\n\t\tif response.error() and response.json:\n\t\t\tlogger.error(\"Sun server returned an error: %s\" %response.json)\n\t\t\traise SunError(response)\n\t\tresponse.raise_if_error()\n\t\treturn response\n\t\n\tasync def system_update_meta(self):\n\t\treq = http.HTTPRequest.get(\"/v1/system_update_meta\")\n\t\treq.params = {\n\t\t\t\"device_id\": \"%016x\" %self.device_id\n\t\t}\n\t\t\n\t\tresponse = await self.request(req)\n\t\treturn response.json\n"
  },
  {
    "path": "setup.py",
    "content": "\nimport setuptools\n\nlong_description = \\\n\t\"This library implements various network protocols made by Nintendo.\"\n\nsetuptools.setup(\n\tname = \"nintendoclients\",\n\tversion = \"4.4.0\",\n\tdescription = \"Nintendo network library\",\n\tlong_description = long_description,\n\tauthor = \"Yannik Marchand\",\n\tauthor_email = \"ymarchand@me.com\",\n\turl = \"https://github.com/kinnay/NintendoClients\",\n\tlicense = \"MIT\",\n\tpackages = [\n\t\t\"nintendo\", \"nintendo.nex\", \"nintendo.switch\"\n\t],\n\tpackage_data = {\n\t\t\"nintendo\": [\"files/config/*\", \"files/cert/*\"]\n\t},\n\tinstall_requires = [\n\t\t\"anynet ~= 1.1\",\n\t\t\"pycryptodome\"\n\t]\n)\n"
  },
  {
    "path": "tests/nex/test_backend.py",
    "content": "\r\nfrom nintendo.nex import backend, rmc, common, authentication, \\\r\n\tkerberos, account, settings\r\nimport pytest\r\n\r\n\r\nHOST = \"127.0.0.1\"\r\n\r\n\r\nclass AuthenticationServer(authentication.AuthenticationServer):\r\n\tdef __init__(self, settings):\r\n\t\tsuper().__init__()\r\n\t\tself.settings = settings\r\n\t\r\n\tasync def login(self, client, username):\r\n\t\tassert username == \"username\"\r\n\t\t\r\n\t\tpid = 1001\r\n\t\t\r\n\t\tstick = kerberos.ServerTicket()\r\n\t\tstick.timestamp = common.DateTime.now()\r\n\t\tstick.source = pid\r\n\t\tstick.session_key = bytes(32)\r\n\t\t\r\n\t\tctick = kerberos.ClientTicket()\r\n\t\tctick.session_key = bytes(32)\r\n\t\tctick.target = 100\r\n\t\tctick.internal = stick.encrypt(b\"testkey\", self.settings)\r\n\t\t\r\n\t\tkerb = kerberos.KeyDerivationOld(65000, 1024)\r\n\t\tkey = kerb.derive_key(b\"password\", pid)\r\n\t\t\r\n\t\tconnection_data = authentication.RVConnectionData()\r\n\t\tconnection_data.main_station = common.StationURL(\r\n\t\t\taddress=HOST, port=12346, PID=100, sid=1\r\n\t\t)\r\n\t\tconnection_data.special_protocols = []\r\n\t\tconnection_data.special_station = common.StationURL()\r\n\t\tconnection_data.server_time = common.DateTime.now()\r\n\t\t\r\n\t\tresponse = rmc.RMCResponse()\r\n\t\tresponse.result = common.Result.success()\r\n\t\tresponse.pid = pid\r\n\t\tresponse.ticket = ctick.encrypt(key, self.settings)\r\n\t\tresponse.connection_data = connection_data\r\n\t\tresponse.server_name = \"server build name\"\r\n\t\treturn response\r\n\t\t\r\n\t\t\r\nclass AccountManagementServer(account.AccountServer):\r\n\tasync def get_name(self, client, pid):\r\n\t\tassert pid == 1000\r\n\t\treturn \"test\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_backend():\r\n\ts = settings.default()\r\n\t\r\n\tauth_servers = [AuthenticationServer(s)]\r\n\tsecure_servers = [AccountManagementServer()]\r\n\tasync with rmc.serve(s, auth_servers, HOST, 12345):\r\n\t\tasync with rmc.serve(s, secure_servers, HOST, 12346, key=b\"testkey\"):\r\n\t\t\tasync with backend.connect(s, HOST, 12345) as client:\r\n\t\t\t\tasync with client.login(\"username\", \"password\") as secure_client:\r\n\t\t\t\t\tact = account.AccountClient(secure_client)\r\n\t\t\t\t\tassert await act.get_name(1000) == \"test\"\r\n"
  },
  {
    "path": "tests/nex/test_common.py",
    "content": "\r\nfrom nintendo.nex import common\r\nimport pytest\r\n\r\n\r\ndef test_result():\r\n\tresult = common.Result.success()\r\n\tassert result.is_success()\r\n\tassert not result.is_error()\r\n\tassert result.code() == 0x10001\r\n\tassert result.name() == \"success\"\r\n\tresult.raise_if_error()\r\n\t\r\n\tresult = common.Result.success(0x1000A)\r\n\tassert result.code() == 0x1000A\r\n\tassert result.name() == \"success\"\r\n\t\r\n\tresult = common.Result.error(\"Core::InvalidArgument\")\r\n\tassert not result.is_success()\r\n\tassert result.is_error()\r\n\tassert result.code() == 0x8001000A\r\n\tassert result.name() == \"Core::InvalidArgument\"\r\n\t\r\n\twith pytest.raises(common.RMCError):\r\n\t\tresult.raise_if_error()\r\n\r\n\r\ndef test_rmcerror():\r\n\terror = common.RMCError()\r\n\tassert error.name() == \"Core::Unknown\"\r\n\tassert error.code() == 0x80010001\r\n\t\r\n\tresult = common.RMCError().result()\r\n\tassert result.is_error()\r\n\tassert result.name() == \"Core::Unknown\"\r\n\tassert result.code() == 0x80010001\r\n\t\r\n\tresult = common.RMCError(\"Core::InvalidArgument\").result()\r\n\tassert result.name() == \"Core::InvalidArgument\"\r\n\tassert result.code() == 0x8001000A\r\n\t\r\n\tresult = common.RMCError(0x8001000A).result()\r\n\tassert result.name() == \"Core::InvalidArgument\"\r\n\tassert result.code() == 0x8001000A\r\n\t\r\n\t\r\ndef test_resultrange():\r\n\trr = common.ResultRange()\r\n\tassert rr.offset == 0\r\n\tassert rr.size == 10\r\n\t\r\n\trr = common.ResultRange(50, 100)\r\n\tassert rr.offset == 50\r\n\tassert rr.size == 100\r\n\r\n\r\nclass TestStationURL:\r\n\tdef test_repr(self):\r\n\t\turl = common.StationURL(PID=12345)\r\n\t\tassert repr(url) == \"prudp:/PID=12345\"\r\n\t\r\n\tdef test_parse(self):\r\n\t\turl = common.StationURL.parse(\"prudp:/PID=12345\")\r\n\t\tassert repr(url) == \"prudp:/PID=12345\"\r\n\t\t\r\n\tdef test_parse_empty(self):\r\n\t\turl = common.StationURL.parse(\"\")\r\n\t\tassert repr(url) == \"prudp:/\"\r\n\t\r\n\tdef test_getitem(self):\r\n\t\turl = common.StationURL.parse(\"prudp:/address=1.2.3.4;port=12345\")\r\n\t\tassert url[\"address\"] == \"1.2.3.4\"\r\n\t\tassert url[\"port\"] == 12345\r\n\t\tassert url[\"PID\"] == 0\r\n\t\twith pytest.raises(KeyError):\r\n\t\t\turl[\"test\"]\r\n\t\r\n\tdef test_setitem(self):\r\n\t\turl = common.StationURL.parse(\"prudp:/address=1.2.3.4;port=12345\")\r\n\t\turl[\"port\"] = 12346\r\n\t\turl[\"natf\"] = 1\r\n\t\tassert url[\"port\"] == 12346\r\n\t\tassert url[\"natf\"] == 1\r\n\t\r\n\tdef test_scheme(self):\r\n\t\turl = common.StationURL.parse(\"prudps:/PID=100\")\r\n\t\tassert url.scheme() == \"prudps\"\r\n\t\r\n\tdef test_address(self):\r\n\t\turl = common.StationURL.parse(\"prudp:/address=1.2.3.4;port=12345\")\r\n\t\tassert url.address() == (\"1.2.3.4\", 12345)\r\n\t\r\n\tdef test_flags(self):\r\n\t\turl = common.StationURL(type=3)\r\n\t\tassert url.is_public()\r\n\t\tassert url.is_behind_nat()\r\n\t\tassert not url.is_global()\r\n\t\t\r\n\t\turl = common.StationURL(type=2)\r\n\t\tassert url.is_public()\r\n\t\tassert not url.is_behind_nat()\r\n\t\tassert url.is_global()\r\n\r\n\r\nclass TestDateTime:\r\n\tdef test_value(self):\r\n\t\tdatetime = common.DateTime(135593643393)\r\n\t\tassert datetime.value() == 135593643393\r\n\t\r\n\tdef test_datetime(self):\r\n\t\tdatetime = common.DateTime(135593643393)\r\n\t\tassert datetime.second() == 1\r\n\t\tassert datetime.minute() == 54\r\n\t\tassert datetime.hour() == 12\r\n\t\tassert datetime.day() == 1\r\n\t\tassert datetime.month() == 8\r\n\t\tassert datetime.year() == 2020\r\n\t\r\n\tdef test_standard_datetime(self):\r\n\t\timport datetime\r\n\t\tdt = common.DateTime(135593643393).standard_datetime()\r\n\t\tassert dt == datetime.datetime(2020, 8, 1, 12, 54, 1, tzinfo=datetime.timezone.utc)\r\n\t\r\n\tdef test_timestamp(self):\r\n\t\tdatetime = common.DateTime(135593643393)\r\n\t\tassert datetime.timestamp() == 1596286441\r\n\t\r\n\tdef test_make(self):\r\n\t\tdatetime = common.DateTime.make(2020, 10, 31, 14)\r\n\t\tassert datetime.timestamp() == 1604152800\r\n\t\r\n\tdef test_fromtimestamp(self):\r\n\t\tdatetime = common.DateTime.fromtimestamp(1604149200)\r\n\t\tassert datetime.value() == 135605964800\r\n\t\r\n\tdef test_now(self):\r\n\t\tdatetime = common.DateTime.now()\r\n\t\tassert datetime.year() >= 2020\r\n\t\r\n\tdef test_never(self):\r\n\t\tdatetime = common.DateTime.never()\r\n\t\tassert datetime.value() == 0\r\n\t\r\n\tdef test_future(self):\r\n\t\tdatetime = common.DateTime.future()\r\n\t\tassert datetime.value() == 0x9C3F3F7EFB\r\n"
  },
  {
    "path": "tests/nex/test_errors.py",
    "content": "\r\nfrom nintendo.nex import errors\r\n\r\ndef test_basic():\r\n\tassert errors.error_names[0x10001] == \"Core::Unknown\"\r\n\tassert errors.error_codes[\"Core::Unknown\"] == 0x10001\r\n"
  },
  {
    "path": "tests/nex/test_kerberos.py",
    "content": "\r\nfrom nintendo.nex import kerberos, settings, common\r\n\r\ndef test_key_derivation_old():\r\n\tkeyderiv1 = kerberos.KeyDerivationOld()\r\n\tkeyderiv2 = kerberos.KeyDerivationOld(5, 10)\r\n\tassert keyderiv1.derive_key(b\"password\", 123456) == bytes.fromhex(\"bd9d83b0d4102b72de3e14f44938c989\")\r\n\tassert keyderiv2.derive_key(b\"password\", 123456) == bytes.fromhex(\"6ba537f0cc7e0d25813f2ea010eb2115\")\r\n\r\ndef test_key_derivation_new():\r\n\tkeyderiv1 = kerberos.KeyDerivationNew()\r\n\tkeyderiv2 = kerberos.KeyDerivationNew(5, 10)\r\n\tassert keyderiv1.derive_key(b\"password\", 123456) == bytes.fromhex(\"591b45defe20abcd6ec412b63fbacff5\")\r\n\tassert keyderiv2.derive_key(b\"password\", 123456) == bytes.fromhex(\"09409830bf949ab56fae81bd028fe18d\")\r\n\r\ndef test_kerberos_encryption():\r\n\tkerb = kerberos.KerberosEncryption(b\"key\")\r\n\t\r\n\tdata = kerb.encrypt(b\"test message\")\r\n\tassert data == bytes.fromhex(\"7f09479904e21e393b2a6f1ed5b96acc69a869dce66679d0cedb242d\")\r\n\tassert kerb.check(data)\r\n\tassert not kerb.check(b\"\\x7e\" + data[1:])\r\n\tassert kerb.decrypt(data) == b\"test message\"\r\n\r\ndef test_client_ticket():\r\n\tticket = kerberos.ClientTicket()\r\n\tticket.session_key = bytes(range(32))\r\n\tticket.internal = b\"internal buffer\"\r\n\tticket.target = 123456\r\n\t\r\n\ts = settings.default()\r\n\tdata = ticket.encrypt(b\"key\", s)\r\n\tticket = kerberos.ClientTicket.decrypt(data, b\"key\", s)\r\n\t\r\n\tassert ticket.session_key == bytes(range(32))\r\n\tassert ticket.internal == b\"internal buffer\"\r\n\tassert ticket.target == 123456\r\n\t\r\ndef test_server_ticket():\r\n\tticket = kerberos.ServerTicket()\r\n\tticket.timestamp = common.DateTime.fromtimestamp(1596279690)\r\n\tticket.session_key = bytes(range(32))\r\n\tticket.source = 123456\r\n\t\r\n\ts = settings.default()\r\n\tdata = ticket.encrypt(b\"key\", s)\r\n\tticket = kerberos.ServerTicket.decrypt(data, b\"key\", s)\r\n\t\r\n\tassert ticket.timestamp.timestamp() == 1596279690\r\n\tassert ticket.session_key == bytes(range(32))\r\n\tassert ticket.source == 123456\r\n\r\ndef test_server_ticket_old():\r\n\tticket = kerberos.ServerTicket()\r\n\tticket.timestamp = common.DateTime.fromtimestamp(1596279690)\r\n\tticket.session_key = bytes(range(32))\r\n\tticket.source = 123456\r\n\t\r\n\ts = settings.default()\r\n\ts[\"kerberos.ticket_version\"] = 0\r\n\t\r\n\tdata = ticket.encrypt(b\"key\", s)\r\n\tticket = kerberos.ServerTicket.decrypt(data, b\"key\", s)\r\n\t\r\n\tassert ticket.timestamp.timestamp() == 1596279690\r\n\tassert ticket.session_key == bytes(range(32))\r\n\tassert ticket.source == 123456\r\n\r\ndef test_credentials():\r\n\tticket = kerberos.ClientTicket()\r\n\tcreds = kerberos.Credentials(ticket, 1000, 2000)\r\n\tassert creds.ticket == ticket\r\n\tassert creds.pid == 1000\r\n\tassert creds.cid == 2000\r\n"
  },
  {
    "path": "tests/nex/test_nex_streams.py",
    "content": "\r\nfrom nintendo.nex import streams, settings, common\r\n\r\n\r\nclass TestStreamOut:\r\n\tdef test_pid(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.pid(12345)\r\n\t\tassert stream.get() == bytes.fromhex(\"39300000\")\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.load(\"switch\"))\r\n\t\tstream.pid(12345)\r\n\t\tassert stream.get() == bytes.fromhex(\"3930000000000000\")\r\n\t\r\n\tdef test_result(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.result(common.Result.success())\r\n\t\tassert stream.get() == bytes.fromhex(\"01000100\")\r\n\t\r\n\tdef test_list(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.list([1,2,3,4], stream.u8)\r\n\t\tassert stream.get() == bytes.fromhex(\"0400000001020304\")\r\n\t\r\n\tdef test_map(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.map({1: 10, 2: 11}, stream.u8, stream.u16)\r\n\t\tassert stream.get() == bytes.fromhex(\"02000000010a00020b00\")\r\n\t\r\n\tdef test_string(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.string(\"test string\")\r\n\t\tassert stream.get() == b\"\\x0C\\0test string\\0\"\r\n\t\r\n\tdef test_stationurl(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.stationurl(common.StationURL(\"prudps\", PID=1, CID=100))\r\n\t\tassert stream.get() == b\"\\x16\\0prudps:/PID=1;CID=100\\0\"\r\n\t\r\n\tdef test_datetime(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.datetime(common.DateTime(135605968896))\r\n\t\tassert stream.get() == bytes.fromhex(\"00e0be921f000000\")\r\n\t\r\n\tdef test_buffer(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.buffer(b\"test buffer\")\r\n\t\tassert stream.get() == b\"\\x0B\\0\\0\\0test buffer\"\r\n\t\r\n\tdef test_qbuffer(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.qbuffer(b\"test qbuffer\")\r\n\t\tassert stream.get() == b\"\\x0C\\0test qbuffer\"\r\n\t\r\n\tdef test_add(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.add(common.ResultRange())\r\n\t\tassert stream.get() == bytes.fromhex(\"000000000a000000\")\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.load(\"switch\"))\r\n\t\tstream.add(common.ResultRange())\r\n\t\tassert stream.get() == bytes.fromhex(\"0008000000000000000a000000\")\r\n\t\r\n\tdef test_anydata(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.anydata(common.NullData())\r\n\t\tassert stream.get() == b\"\\x09\\0NullData\\0\\x04\\0\\0\\0\\0\\0\\0\\0\"\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.load(\"switch\"))\r\n\t\tstream.anydata(common.NullData())\r\n\t\tassert stream.get() == b\"\\x09\\0NullData\\0\\x0E\\0\\0\\0\\x0A\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"\r\n\t\r\n\tdef test_variant(self):\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(None)\r\n\t\tassert stream.get() == b\"\\0\"\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(-12345)\r\n\t\tassert stream.get() == bytes.fromhex(\"01c7cfffffffffffff\")\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(123.45)\r\n\t\tassert stream.get() == bytes.fromhex(\"02cdccccccccdc5e40\")\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(True)\r\n\t\tstream.variant(False)\r\n\t\tassert stream.get() == bytes.fromhex(\"03010300\")\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(\"hello\")\r\n\t\tassert stream.get() == b\"\\x04\\x06\\0hello\\0\"\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(common.DateTime.never())\r\n\t\tassert stream.get() == bytes.fromhex(\"050000000000000000\")\r\n\t\t\r\n\t\tstream = streams.StreamOut(settings.default())\r\n\t\tstream.variant(12345)\r\n\t\tassert stream.get() == bytes.fromhex(\"063930000000000000\")\r\n\r\n\r\nclass TestStreamIn:\r\n\tdef test_pid(self):\r\n\t\tdata = bytes.fromhex(\"39300000\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.pid() == 12345\r\n\t\tassert stream.eof()\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"3930000000000000\")\r\n\t\tstream = streams.StreamIn(data, settings.load(\"switch\"))\r\n\t\tassert stream.pid() == 12345\r\n\t\tassert stream.eof()\r\n\t\r\n\tdef test_result(self):\r\n\t\tdata = bytes.fromhex(\"01000100\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.result().code() == 0x10001\r\n\t\r\n\tdef test_repeat(self):\r\n\t\tdata = bytes.fromhex(\"0102030400000000140000001400000020000000\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\t\r\n\t\tints = stream.repeat(stream.u8, 4)\r\n\t\trrs = stream.repeat(common.ResultRange, 2)\r\n\t\tassert ints == [1, 2, 3, 4]\r\n\t\tassert rrs[0].offset == 0 and rrs[0].size == 20\r\n\t\tassert rrs[1].offset == 20 and rrs[1].size == 32\r\n\t\r\n\tdef test_list(self):\r\n\t\tdata = bytes.fromhex(\"0400000001020304\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.list(stream.u8) == [1, 2, 3, 4]\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"020000000000000014000000280000003c000000\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\trrs = stream.list(common.ResultRange)\r\n\t\tassert rrs[0].offset == 0 and rrs[0].size == 20\r\n\t\tassert rrs[1].offset == 40 and rrs[1].size == 60\r\n\t\r\n\tdef test_map(self):\r\n\t\tvalue = {1: 10, 2: 11}\r\n\t\tdata = bytes.fromhex(\"02000000010a00020b00\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.map(stream.u8, stream.u16) == value\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"01000000393000001400000005000000\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tmap = stream.map(stream.pid, common.ResultRange)\r\n\t\tassert map[12345].offset == 20\r\n\t\tassert map[12345].size == 5\r\n\t\r\n\tdef test_string(self):\r\n\t\tdata = b\"\\x0C\\0test string\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.string() == \"test string\"\r\n\t\r\n\tdef test_stationurl(self):\r\n\t\tdata = b\"\\x16\\0prudps:/PID=1;CID=100\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\turl = stream.stationurl()\r\n\t\tassert url.scheme() == \"prudps\"\r\n\t\tassert url[\"PID\"] == 1\r\n\t\tassert url[\"CID\"] == 100\r\n\t\r\n\tdef test_datetime(self):\r\n\t\tdata = bytes.fromhex(\"00e0be921f000000\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.datetime().value() == 135605968896\r\n\t\r\n\tdef test_buffer(self):\r\n\t\tdata = b\"\\x0B\\0\\0\\0test buffer\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.buffer() == b\"test buffer\"\r\n\t\r\n\tdef test_qbuffer(self):\r\n\t\tdata = b\"\\x0C\\0test qbuffer\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.qbuffer() == b\"test qbuffer\"\r\n\t\r\n\tdef test_substream(self):\r\n\t\tdata = b\"\\x08\\0\\0\\0\\x64\\0\\0\\0\\xc8\\0\\0\\0\\xff\\0\\0\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tsubstream = stream.substream()\r\n\t\t\r\n\t\tassert stream.u32() == 255\r\n\t\tassert substream.u32() == 100\r\n\t\tassert substream.u32() == 200\r\n\t\tassert substream.eof()\r\n\t\r\n\tdef test_extract(self):\r\n\t\tdata = b\"\\0\\0\\0\\0\\x0a\\0\\0\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\trr = stream.extract(common.ResultRange)\r\n\t\tassert rr.offset == 0\r\n\t\tassert rr.size == 10\r\n\t\t\r\n\t\tdata = b\"\\0\\x08\\0\\0\\0\\0\\0\\0\\0\\x0a\\0\\0\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.load(\"switch\"))\r\n\t\trr = stream.extract(common.ResultRange)\r\n\t\tassert rr.offset == 0\r\n\t\tassert rr.size == 10\r\n\t\t\r\n\tdef test_anydata(self):\r\n\t\tdata = b\"\\x09\\0NullData\\0\\x04\\0\\0\\0\\0\\0\\0\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert isinstance(stream.anydata(), common.NullData)\r\n\t\tassert stream.eof()\r\n\t\t\r\n\t\tdata = b\"\\x09\\0NullData\\0\\x0E\\0\\0\\0\\x0A\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.load(\"switch\"))\r\n\t\tassert isinstance(stream.anydata(), common.NullData)\r\n\t\tassert stream.eof()\r\n\t\r\n\tdef test_variant(self):\r\n\t\tdata = b\"\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant() is None\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"01c7cfffffffffffff\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant() == -12345\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"02cdccccccccdc5e40\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant() == 123.45\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"03010300\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant() is True\r\n\t\tassert stream.variant() is False\r\n\t\t\r\n\t\tdata = b\"\\x04\\x06\\0hello\\0\"\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant() == \"hello\"\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"050000000000000000\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant().value() == 0\r\n\t\t\r\n\t\tdata = bytes.fromhex(\"06c7cfffffffffffff\")\r\n\t\tstream = streams.StreamIn(data, settings.default())\r\n\t\tassert stream.variant() == 0xFFFFFFFFFFFFCFC7\r\n"
  },
  {
    "path": "tests/nex/test_prudp.py",
    "content": "\r\nfrom nintendo.nex import prudp, settings, kerberos, common\r\nimport pytest\r\n\r\n\r\nHOST = \"127.0.0.1\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_v0():\r\n\ts = settings.load(\"3ds\")\r\n\ts[\"prudp.access_key\"] = b\"access key\"\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv() == b\"ping\"\r\n\t\tawait client.send(b\"pong\")\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tassert client.remote_address() == (HOST, 12345)\r\n\t\t\t\r\n\t\t\tawait client.send(b\"ping\")\r\n\t\t\tassert await client.recv() == b\"pong\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_v1():\r\n\ts = settings.default()\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv() == b\"ping\"\r\n\t\tawait client.send(b\"pong\")\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send(b\"ping\")\r\n\t\t\tassert await client.recv() == b\"pong\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_lite():\r\n\ts = settings.load(\"switch\")\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv() == b\"ping\"\r\n\t\tawait client.send(b\"pong\")\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send(b\"ping\")\r\n\t\t\tassert await client.recv() == b\"pong\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_v0_alt():\r\n\ts = settings.load(\"3ds\")\r\n\ts[\"prudp_v0.signature_version\"] = 1\r\n\ts[\"prudp_v0.flags_version\"] = 0\r\n\ts[\"prudp_v0.checksum_version\"] = 0\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv() == b\"ping\"\r\n\t\tawait client.send(b\"pong\")\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send(b\"ping\")\r\n\t\t\tassert await client.recv() == b\"pong\"\r\n\t\t\t\r\n\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_compression():\r\n\ts = settings.default()\r\n\ts[\"prudp.compression\"] = s.COMPRESSION_ZLIB\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv() == b\"ping\"\r\n\t\tawait client.send(b\"pong\")\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send(b\"ping\")\r\n\t\t\tassert await client.recv() == b\"pong\"\r\n\t\t\t\r\n\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_fragmentation():\r\n\ts = settings.default()\r\n\ts[\"prudp.fragment_size\"] = 10\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv() == b\"a\" * 40\r\n\t\tawait client.send(b\"b\" * 40)\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send(b\"a\" * 40)\r\n\t\t\tassert await client.recv() == b\"b\" * 40\r\n\t\t\t\r\n\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_unreliable():\r\n\ts = settings.default()\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv_unreliable() == b\"ping\"\r\n\t\tawait client.send_unreliable(b\"pong\")\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send_unreliable(b\"ping\")\r\n\t\t\tassert await client.recv_unreliable() == b\"pong\"\r\n\t\t\t\r\n\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_substreams():\r\n\ts = settings.default()\r\n\ts[\"prudp.max_substream_id\"] = 1\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert await client.recv(0) == b\"test1\"\r\n\t\tassert await client.recv(0) == b\"test3\"\r\n\t\tassert await client.recv(1) == b\"test2\"\r\n\t\tawait client.send(b\"pong\", 1)\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tawait client.send(b\"test1\", 0)\r\n\t\t\tawait client.send(b\"test2\", 1)\r\n\t\t\tawait client.send(b\"test3\", 0)\r\n\t\t\tassert await client.recv(1) == b\"pong\"\r\n\t\t\t\r\n\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_client_transport():\r\n\ts = settings.default()\r\n\t\r\n\tasync def handler(client):\r\n\t\tdata = await client.recv()\r\n\t\tawait client.send(data[::-1])\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect_transport(s, HOST, 12345) as transport:\r\n\t\t\tasync with transport.connect(1) as client1:\r\n\t\t\t\tasync with transport.connect(1) as client2:\r\n\t\t\t\t\tawait client1.send(b\"ping\")\r\n\t\t\t\t\tawait client2.send(b\"test\")\r\n\t\t\t\t\tassert await client1.recv() == b\"gnip\"\r\n\t\t\t\t\tassert await client2.recv() == b\"tset\"\r\n\t\t\t\r\n\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_server_transport():\r\n\ts = settings.default()\r\n\t\r\n\tasync def handler1(client):\r\n\t\tassert await client.recv() == b\"ping1\"\r\n\t\tawait client.send(b\"pong1\")\r\n\t\r\n\tasync def handler2(client):\r\n\t\tassert await client.recv() == b\"ping2\"\r\n\t\tawait client.send(b\"pong2\")\r\n\t\r\n\tasync with prudp.serve_transport(s, HOST, 12345) as transport:\r\n\t\tasync with transport.serve(handler1, 1):\r\n\t\t\tasync with transport.serve(handler2, 2):\r\n\t\t\t\tasync with prudp.connect(s, HOST, 12345, 1) as client:\r\n\t\t\t\t\tawait client.send(b\"ping1\")\r\n\t\t\t\t\tassert await client.recv() == b\"pong1\"\r\n\t\t\t\tasync with prudp.connect(s, HOST, 12345, 2) as client:\r\n\t\t\t\t\tawait client.send(b\"ping2\")\r\n\t\t\t\t\tassert await client.recv() == b\"pong2\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_negotiation():\r\n\ts1 = settings.default()\r\n\ts1[\"prudp.minor_version\"] = 2\r\n\t\r\n\ts2 = settings.default()\r\n\ts2[\"prudp.minor_version\"] = 5\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert client.minor_version() == 2\r\n\t\r\n\tasync with prudp.serve(handler, s1, HOST, 12345):\r\n\t\tasync with prudp.connect(s2, HOST, 12345) as client:\r\n\t\t\tassert client.minor_version() == 2\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_pid():\r\n\ts = settings.default()\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert client.pid() is None\r\n\t\r\n\tasync with prudp.serve(handler, s, HOST, 12345):\r\n\t\tasync with prudp.connect(s, HOST, 12345) as client:\r\n\t\t\tassert client.pid() is None\r\n\t\r\n\t\r\n@pytest.mark.anyio\r\nasync def test_credentials():\r\n\ts = settings.default()\r\n\t\r\n\tasync def handler(client):\r\n\t\tassert client.pid() == 1000\r\n\t\r\n\tticket = kerberos.ServerTicket()\r\n\tticket.timestamp = common.DateTime.now()\r\n\tticket.source = 1000\r\n\tticket.session_key = bytes(32)\r\n\tdata = ticket.encrypt(b\"server key\", s)\r\n\t\r\n\tticket = kerberos.ClientTicket()\r\n\tticket.session_key = bytes(32)\r\n\tticket.target = 1001\r\n\tticket.internal = data\r\n\t\r\n\tcreds = kerberos.Credentials(ticket, 1000, 2000)\r\n\tasync with prudp.serve(handler, s, HOST, 12345, key=b\"server key\"):\r\n\t\tasync with prudp.connect(s, HOST, 12345, credentials=creds) as client:\r\n\t\t\tassert client.pid() == 1000\r\n"
  },
  {
    "path": "tests/nex/test_rmc.py",
    "content": "\r\nfrom nintendo.nex import rmc, common, authentication, settings\r\nimport pytest\r\nimport anyio\r\n\r\n\r\nHOST = \"127.0.0.1\"\r\n\r\n\r\nclass AuthenticationServer(authentication.AuthenticationServer):\r\n\tdef __init__(self):\r\n\t\tsuper().__init__()\r\n\t\tself.flag = False\r\n\t\r\n\tasync def logout(self, client):\r\n\t\tself.flag = True\r\n\t\r\n\tasync def get_name(self, client, pid):\r\n\t\treturn str(pid)\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_simple():\r\n\ts = settings.default()\r\n\t\r\n\tservers = [AuthenticationServer()]\r\n\tasync with rmc.serve(s, servers, HOST, 12345):\r\n\t\tasync with rmc.connect(s, HOST, 12345) as client:\r\n\t\t\tassert client.remote_address() == (HOST, 12345)\r\n\t\t\t\r\n\t\t\tauth = authentication.AuthenticationClient(client)\r\n\t\t\tresult = await auth.get_name(12345)\r\n\t\t\tassert result == \"12345\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_unimplemented_protocol():\r\n\ts = settings.default()\r\n\t\r\n\tservers = []\r\n\tasync with rmc.serve(s, servers, HOST, 12345):\r\n\t\tasync with rmc.connect(s, HOST, 12345) as client:\r\n\t\t\tassert client.remote_address() == (HOST, 12345)\r\n\t\t\t\r\n\t\t\tauth = authentication.AuthenticationClient(client)\r\n\t\t\ttry:\r\n\t\t\t\tresult = await auth.get_name(12345)\r\n\t\t\texcept common.RMCError as e:\r\n\t\t\t\tassert e.result().name() == \"Core::NotImplemented\"\r\n\t\t\t\t\r\n\t\t\t\t\r\n@pytest.mark.anyio\r\nasync def test_logout_event():\r\n\ts = settings.default()\r\n\t\r\n\tserver = AuthenticationServer()\r\n\tasync with rmc.serve(s, [server], HOST, 12345):\r\n\t\tasync with rmc.connect(s, HOST, 12345) as client:\r\n\t\t\tassert not server.flag\r\n\t\tawait anyio.sleep(.1) # Wait a bit\r\n\t\tassert server.flag\r\n"
  },
  {
    "path": "tests/nex/test_settings.py",
    "content": "\r\nfrom nintendo.nex import settings\r\n\r\n\r\ndef test_constants():\r\n\ts = settings.default()\r\n\tassert s.TRANSPORT_UDP == 0\r\n\tassert s.TRANSPORT_TCP == 1\r\n\tassert s.TRANSPORT_WEBSOCKET == 2\r\n\t\r\n\tassert s.COMPRESSION_NONE == 0\r\n\tassert s.COMPRESSION_ZLIB == 1\r\n\t\r\n\tassert s.ENCRYPTION_NONE == 0\r\n\tassert s.ENCRYPTION_RC4 == 1\r\n\r\n\r\ndef test_basic():\r\n\ts = settings.default()\r\n\tassert s[\"kerberos.key_size\"] == 32\r\n\t\r\n\tcopy = s.copy()\r\n\t\r\n\ts[\"kerberos.key_size\"] = 100\r\n\tassert s[\"kerberos.key_size\"] == 100\r\n\tassert copy[\"kerberos.key_size\"] == 32\r\n\t\r\n\ts.reset()\r\n\tassert s[\"kerberos.key_size\"] == 32\r\n\t\r\n\ts.load(\"friends\")\r\n\tassert s[\"kerberos.key_size\"] == 16\r\n"
  },
  {
    "path": "tests/switch/test_aauth.py",
    "content": "\r\nfrom nintendo.switch import aauth\r\nfrom anynet import http\r\nimport pytest\r\nimport struct\r\n\r\n\r\nTOKEN_REQUEST_1300 = \\\r\n\t\"POST /v3/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.3.0.0; Add-on 13.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 1428\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"Expect: 100-continue\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&\" \\\r\n\t\"device_auth_token=device.token&media_type=DIGITAL&cert=\"\r\n\r\nTOKEN_REQUEST_1500 = \\\r\n\t\"POST /v4/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 134\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&\" \\\r\n\t\"device_auth_token=device.token&media_type=DIGITAL&cert=token.from.dragons\"\r\n\r\nTOKEN_REQUEST_1800 = \\\r\n\t\"POST /v4/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 134\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&\" \\\r\n\t\"device_auth_token=device.token&media_type=DIGITAL&cert=token.from.dragons\"\r\n\r\nTOKEN_REQUEST_1900 = \\\r\n\t\"POST /v5/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 133\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&\" \\\r\n\t\"device_auth_token=device.token&auth_type=DIGITAL&cert=token.from.dragons\"\r\n\r\nCHALLENGE_REQUEST_1300 = \\\r\n\t\"POST /v3/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.3.0.0; Add-on 13.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Length: 31\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"&device_auth_token=device.token\"\r\n\r\nCHALLENGE_REQUEST_1900 = \\\r\n\t\"POST /v5/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"Content-Length: 30\\r\\n\\r\\n\" \\\r\n\t\"device_auth_token=device.token\"\r\n\r\nCHALLENGE_REQUEST_2000 = \\\r\n\t\"POST /v5/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"Content-Length: 30\\r\\n\\r\\n\" \\\r\n\t\"device_auth_token=device.token\"\r\n\r\nGAMECARD_REQUEST_1300 = \\\r\n\t\"POST /v3/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnHttp; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 13.3.0.0; Add-on 13.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 132\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&device_auth_token=device.token&media_type=GAMECARD&gvt=Z3Z0&cert=Y2VydA\"\r\n\r\nGAMECARD_REQUEST_1900 = \\\r\n\t\"POST /v5/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 179\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&device_auth_token=device.token&auth_type=GAMECARD&gvt=Z3Z0&cert=Y2VydA&challenge=challenge&challenge_src=challenge_src\"\r\n\r\nGAMECARD_REQUEST_2000 = \\\r\n\t\"POST /v5/application_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 179\\r\\n\\r\\n\" \\\r\n\t\"application_id=0100123001234000&application_version=00070000&device_auth_token=device.token&auth_type=GAMECARD&gvt=Z3Z0&cert=Y2VydA&challenge=challenge&challenge_src=challenge_src\"\r\n\r\n\r\nCERT = struct.pack(\"<I\", 0x10004) + bytes(0x29C)\r\nCERT += struct.pack(\">Q\", 0x0100123001234000)\r\nCERT += bytes(0x18)\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_aauth_1300():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text.startswith(TOKEN_REQUEST_1300)\r\n\t\tassert text[1375:1385] == \"&cert_key=\"\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1300)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_digital(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", CERT\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_aauth_1500():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == TOKEN_REQUEST_1500\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1500)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_digital(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", \"token.from.dragons\"\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_aauth_1800():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == TOKEN_REQUEST_1800\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1800)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_digital(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", \"token.from.dragons\"\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_aauth_1900():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == TOKEN_REQUEST_1900\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1900)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_digital(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", \"token.from.dragons\"\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_challenge_1300():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text == CHALLENGE_REQUEST_1300\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"seed\": \"seed\",\r\n\t\t\t\"value\": \"value\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1300)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.challenge(\"device.token\")\r\n\t\tassert response[\"seed\"] == \"seed\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_challenge_1900():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text == CHALLENGE_REQUEST_1900\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"challenge\": \"challenge\",\r\n\t\t\t\"challenge_src\": \"challenge_src\",\r\n\t\t\t\"seed\": \"seed\",\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1900)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.challenge(\"device.token\")\r\n\t\tassert response[\"seed\"] == \"seed\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_challenge_2000():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text == CHALLENGE_REQUEST_2000\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"challenge\": \"challenge\",\r\n\t\t\t\"challenge_src\": \"challenge_src\",\r\n\t\t\t\"seed\": \"seed\",\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2000)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.challenge(\"device.token\")\r\n\t\tassert response[\"seed\"] == \"seed\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_gamecard_1300():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text == GAMECARD_REQUEST_1300\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1300)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_gamecard(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", b\"cert\", b\"gvt\"\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_gamecard_1900():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text == GAMECARD_REQUEST_1900\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1900)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_gamecard(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", b\"cert\", b\"gvt\",\r\n\t\t\t\"challenge\", \"challenge_src\"\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_gamecard_2000():\r\n\tasync def handler(client, request):\r\n\t\ttext = request.encode().decode()\r\n\t\tassert text == GAMECARD_REQUEST_2000\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"application_auth_token\": \"application token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2000)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.auth_gamecard(\r\n\t\t\t0x0100123001234000, 0x70000, \"device.token\", b\"cert\", b\"gvt\",\r\n\t\t\t\"challenge\", \"challenge_src\"\r\n\t\t)\r\n\t\tassert response[\"application_auth_token\"] == \"application token\"\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_aauth_error():\r\n\tasync def handler(client, request):\r\n\t\tresponse = http.HTTPResponse(400)\r\n\t\tresponse.json = {\r\n\t\t\t\"errors\": [{\"code\": \"0118\", \"message\": \"Invalid parameter in request.\"}]\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = aauth.AAuthClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1500)\r\n\t\tclient.set_context(None)\r\n\t\twith pytest.raises(aauth.AAuthError):\r\n\t\t\tawait client.auth_nocert(0, 0, \"device.token\")\r\n"
  },
  {
    "path": "tests/switch/test_atumn.py",
    "content": "\nfrom nintendo.switch import atumn\nfrom anynet import http\nimport pytest\n\n\nTEST_DEVICE_ID = 0x6265ca40780b1c0d\nTEST_SYSTEM_UPDATE_TITLE_ID = 0x0100000000000816\nTEST_SYSTEM_UPDATE_TITLE_VERSION = 1140851708\nTEST_TITLE_ID = 0x0100000000000006\nTEST_TITLE_VERSION = 1140851648\nTEST_CONTENT_ID = \"e3a44d36db9756202bef1dcd3bfb65ef\"\n\nSYSTEM_UPDATE_HEAD_REQUEST = \\\n\t\"HEAD /t/s/0100000000000816/1140851708?device_id=6265ca40780b1c0d HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/17.0.0-6.0 (platform:NX; did:6265ca40780b1c0d; eid:lp1)\\r\\n\" \\\n\t\"\\r\\n\"\n\nSYSTEM_UPDATE_GET_REQUEST = \\\n\t\"GET /c/s/170ca33980ff8e9cdad31c6add0f38b6 HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/17.0.0-6.0 (platform:NX; did:6265ca40780b1c0d; eid:lp1)\\r\\n\" \\\n\t\"\\r\\n\"\n\nSYSTEM_TITLE_HEAD_REQUEST = \\\n\t\"HEAD /t/a/0100000000000006/1140851648?device_id=6265ca40780b1c0d HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/17.0.0-6.0 (platform:NX; did:6265ca40780b1c0d; eid:lp1)\\r\\n\" \\\n\t\"\\r\\n\"\n\nSYSTEM_TITLE_GET_REQUEST = \\\n\t\"GET /c/a/aa4c1492ab0ab849fbc1002eb3ecc784 HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/17.0.0-6.0 (platform:NX; did:6265ca40780b1c0d; eid:lp1)\\r\\n\" \\\n\t\"\\r\\n\"\n\nCONTENT_REQUEST = \\\n\t\"GET /c/c/e3a44d36db9756202bef1dcd3bfb65ef HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/17.0.0-6.0 (platform:NX; did:6265ca40780b1c0d; eid:lp1)\\r\\n\" \\\n\t\"\\r\\n\"\n\n\n@pytest.mark.anyio\nasync def test_download_content_metadata_system_update():\n\tasync def handler(client, request):\n\t\tdata = request.encode().decode()\n\t\tif data == SYSTEM_UPDATE_HEAD_REQUEST:\n\t\t\tresponse = http.HTTPResponse(200)\n\t\t\tresponse.headers = {\n\t\t\t\t\"X-Nintendo-Content-ID\": \"170ca33980ff8e9cdad31c6add0f38b6\"\n\t\t\t}\n\t\t\treturn response\n\t\telif data == SYSTEM_UPDATE_GET_REQUEST:\n\t\t\tresponse = http.HTTPResponse(200)\n\t\t\tresponse.body = b\"test data\"\n\t\t\treturn response\n\t\telse:\n\t\t\traise ValueError(\"Incorrect request\")\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = atumn.AtumnClient(TEST_DEVICE_ID)\n\t\tclient.set_host(\"localhost:12345\")\n\t\tclient.set_system_version(1700)\n\t\tclient.set_context(None)\n\t\tresponse = await client.download_content_metadata(\n\t\t\tTEST_SYSTEM_UPDATE_TITLE_ID, TEST_SYSTEM_UPDATE_TITLE_VERSION,\n\t\t\tsystem_update=True\n\t\t)\n\t\tassert response == b\"test data\"\n\n@pytest.mark.anyio\nasync def test_download_content_metadata_normal_title():\n\tasync def handler(client, request):\n\t\tdata = request.encode().decode()\n\t\tif data == SYSTEM_TITLE_HEAD_REQUEST:\n\t\t\tresponse = http.HTTPResponse(200)\n\t\t\tresponse.headers = {\n\t\t\t\t\"X-Nintendo-Content-ID\": \"aa4c1492ab0ab849fbc1002eb3ecc784\"\n\t\t\t}\n\t\t\treturn response\n\t\telif data == SYSTEM_TITLE_GET_REQUEST:\n\t\t\tresponse = http.HTTPResponse(200)\n\t\t\tresponse.body = b\"test data\"\n\t\t\treturn response\n\t\telse:\n\t\t\traise ValueError(\"Incorrect request\")\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = atumn.AtumnClient(TEST_DEVICE_ID)\n\t\tclient.set_host(\"localhost:12345\")\n\t\tclient.set_system_version(1700)\n\t\tclient.set_context(None)\n\t\tresponse = await client.download_content_metadata(\n\t\t\tTEST_TITLE_ID, TEST_TITLE_VERSION\n\t\t)\n\t\tassert response == b\"test data\"\n\n@pytest.mark.anyio\nasync def test_download_content():\n\tasync def handler(client, request):\n\t\tdata = request.encode().decode()\n\t\tassert data == CONTENT_REQUEST\n\n\t\tresponse = http.HTTPResponse(200)\n\t\tresponse.body = b\"test data\"\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = atumn.AtumnClient(TEST_DEVICE_ID)\n\t\tclient.set_host(\"localhost:12345\")\n\t\tclient.set_system_version(1700)\n\t\tclient.set_context(None)\n\t\tresponse = await client.download_content(TEST_CONTENT_ID)\n\t\tassert response == b\"test data\"\n"
  },
  {
    "path": "tests/switch/test_baas.py",
    "content": "\r\nfrom nintendo.switch import baas\r\nfrom anynet import http\r\nimport pytest\r\nimport struct\r\n\r\n\r\nAUTHENTICATE_REQUEST_1200 = \\\r\n\t\"POST /1.0.0/application/token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 46\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"grantType=public_client&assertion=device.token\"\r\n\r\nAUTHENTICATE_REQUEST_1900 = \\\r\n\t\"POST /1.0.0/application/token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 62\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"grantType=public_client&assertion=device.token&penneId=penneId\"\r\n\r\nAUTHENTICATE_REQUEST_2000 = \\\r\n\t\"POST /1.0.0/application/token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 62\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"grantType=public_client&assertion=device.token&penneId=penneId\"\r\n\r\nLOGIN_REQUEST_1200 = \\\r\n\t\"POST /1.0.0/login HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 12.3.0.0; Add-on 12.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 93\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"id=1234567890abcdef&\" \\\r\n\t\"password=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&\" \\\r\n\t\"appAuthNToken=app.token\"\r\n\r\nLOGIN_REQUEST_2000 = \\\r\n\t\"POST /1.0.0/login HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 20.5.4.0; Add-on 20.5.4.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 124\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"id=1234567890abcdef&password=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&appAuthNToken=app.token&naCountry=NL&isPersistent=true\"\r\n\r\nLOGIN_REQUEST_2110 = \\\r\n\t\"POST /1.0.0/login HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 21.4.0.0; Add-on 21.4.0.0)\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 124\\r\\n\\r\\n\" \\\r\n\t\"id=1234567890abcdef&password=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&appAuthNToken=app.token&naCountry=NL&isPersistent=true\"\r\n\r\nREGISTER_REQUEST = \\\r\n\t\"POST /1.0.0/users HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnAccount; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"Content-Length: 0\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"\\r\\n\"\r\n\r\nUPDATE_PRESENCE_REQUEST_1500 = \\\r\n\t\"PATCH /1.0.0/users/aaaaaaaaaaaaaaaa/device_accounts/bbbbbbbbbbbbbbbb HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/json-patch+json\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"Content-Length: 315\\r\\n\" \\\r\n\t\"\\r\\n\" \\\r\n\t'[{\"op\":\"replace\",\"path\":\"/presence/state\",\"value\":\"ONLINE\"},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appField\",\"value\":\"{}\"},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appInfo:appId\",\"value\":\"010040600c5ce000\"},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appInfo:presenceGroupId\",\"value\":\"010040600c5ce000\"}]'\r\n\r\nUPDATE_PRESENCE_REQUEST_1900 = \\\r\n\t\"PATCH /1.0.0/users/aaaaaaaaaaaaaaaa/device_accounts/bbbbbbbbbbbbbbbb HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 19.3.0.0; Add-on 19.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/json-patch+json\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"Content-Length: 389\\r\\n\" \\\r\n\t\"\\r\\n\" \\\r\n\t'[{\"op\":\"replace\",\"path\":\"/presence/state\",\"value\":\"ONLINE\"},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appField\",\"value\":\"{}\"},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appInfo:appId\",\"value\":\"010040600c5ce000\"},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appInfo:acdIndex\",\"value\":0},' \\\r\n\t'{\"op\":\"add\",\"path\":\"/presence/extras/friends/appInfo:presenceGroupId\",\"value\":\"010040600c5ce000\"}]'\r\n\r\nGET_FRIENDS_REQUEST = \\\r\n\t\"GET /2.0.0/users/aaaaaaaaaaaaaaaa/friends?count=300 HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Authorization: Bearer access.token\\r\\n\" \\\r\n\t\"\\r\\n\"\r\n\t\r\n\r\n@pytest.mark.anyio\r\nasync def test_authenticate_1200():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == AUTHENTICATE_REQUEST_1200\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"accessToken\": \"access.token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1200)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.authenticate(\"device.token\")\r\n\t\tassert response[\"accessToken\"] == \"access.token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_authenticate_1900():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == AUTHENTICATE_REQUEST_1900\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"accessToken\": \"access.token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1900)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.authenticate(\"device.token\", \"penneId\")\r\n\t\tassert response[\"accessToken\"] == \"access.token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_authenticate_2000():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == AUTHENTICATE_REQUEST_2000\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"accessToken\": \"access.token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2000)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.authenticate(\"device.token\", \"penneId\")\r\n\t\tassert response[\"accessToken\"] == \"access.token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_login_1200():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == LOGIN_REQUEST_1200\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"idToken\": \"id.token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1200)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.login(\r\n\t\t\t0x1234567890abcdef, \"a\" * 40, \"access.token\", \"app.token\"\r\n\t\t)\r\n\t\tassert response[\"idToken\"] == \"id.token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_login_2000():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == LOGIN_REQUEST_2000\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"idToken\": \"id.token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2000)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.login(\r\n\t\t\t0x1234567890abcdef, \"a\" * 40, \"access.token\", \"app.token\", \"NL\"\r\n\t\t)\r\n\t\tassert response[\"idToken\"] == \"id.token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_login_2110():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == LOGIN_REQUEST_2110\r\n\t\tresponse = http.HTTPResponse(200)\r\n\t\tresponse.json = {\r\n\t\t\t\"idToken\": \"id.token\"\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2110)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.login(\r\n\t\t\t0x1234567890abcdef, \"a\" * 40, \"access.token\", \"app.token\", \"NL\"\r\n\t\t)\r\n\t\tassert response[\"idToken\"] == \"id.token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_register():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == REGISTER_REQUEST\r\n\t\treturn http.HTTPResponse(200)\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1500)\r\n\t\tclient.set_context(None)\r\n\t\tawait client.register(\"access.token\")\r\n\r\n@pytest.mark.anyio\r\nasync def test_update_presence_1500():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == UPDATE_PRESENCE_REQUEST_1500\r\n\t\treturn http.HTTPResponse(200)\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1500)\r\n\t\tclient.set_context(None)\r\n\t\tawait client.update_presence(\r\n\t\t\t0xaaaaaaaaaaaaaaaa, 0xbbbbbbbbbbbbbbbb, \"access.token\",\r\n\t\t\tbaas.PresenceState.ONLINE, 0x010040600c5ce000, 0x010040600c5ce000\r\n\t\t)\r\n\r\n@pytest.mark.anyio\r\nasync def test_update_presence_1900():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == UPDATE_PRESENCE_REQUEST_1900\r\n\t\treturn http.HTTPResponse(200)\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1900)\r\n\t\tclient.set_context(None)\r\n\t\tawait client.update_presence(\r\n\t\t\t0xaaaaaaaaaaaaaaaa, 0xbbbbbbbbbbbbbbbb, \"access.token\",\r\n\t\t\tbaas.PresenceState.ONLINE, 0x010040600c5ce000, 0x010040600c5ce000\r\n\t\t)\r\n\r\n@pytest.mark.anyio\r\nasync def test_get_friends():\r\n\tasync def handler(client, request):\r\n\t\tassert request.encode().decode() == GET_FRIENDS_REQUEST\r\n\t\treturn http.HTTPResponse(200)\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = baas.BAASClient()\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1500)\r\n\t\tclient.set_context(None)\r\n\t\tawait client.get_friends(0xaaaaaaaaaaaaaaaa, \"access.token\")\r\n"
  },
  {
    "path": "tests/switch/test_dauth.py",
    "content": "\r\nfrom nintendo.switch import dauth\r\nfrom anynet import http\r\nimport pytest\r\n\r\n\r\nCHALLENGE_REQUEST_1200 = \\\r\n\t\"POST /v6/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 17\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"key_generation=11\"\r\n\t\r\nCHALLENGE_REQUEST_1300 = \\\r\n\t\"POST /v7/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 13.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 17\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"key_generation=13\"\r\n\r\nCHALLENGE_REQUEST_1800 = \\\r\n\t\"POST /v7/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 17\\r\\n\\r\\n\" \\\r\n\t\"key_generation=17\"\r\n\r\nCHALLENGE_REQUEST_2000 = \\\r\n\t\"POST /v8/challenge HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 17\\r\\n\\r\\n\" \\\r\n\t\"key_generation=20\"\r\n\r\nTOKEN_REQUEST_1200 = \\\r\n\t\"POST /v6/device_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 12.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 211\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"challenge=vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=&\" \\\r\n\t\"client_id=8f849b5d34778d8e&ist=false&key_generation=11&\" \\\r\n\t\"system_version=CusHY#000c0000#C-BynYNPXdQJNBZjx02Hizi8lRUSIKLwPGa5p8EY1uo=&\" \\\r\n\t\"mac=xRB_6mgnNqrnF9DRsEpYMg\"\r\n\t\r\nDEVICE_TOKEN_REQUEST_1300 = \\\r\n\t\"POST /v7/device_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 13.3.0.0)\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 211\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\\r\\n\" \\\r\n\t\"challenge=TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=&\" \\\r\n\t\"client_id=8f849b5d34778d8e&ist=false&key_generation=13&\" \\\r\n\t\"system_version=CusHY#000d0000#r1xneESd4PiTRYIhVIl0bK1ST5L5BUmv_uGPLqc4PPo=&\" \\\r\n\t\"mac=dGMjt0ShsDr-uNrsHtCB1g\"\r\n\r\nDEVICE_TOKEN_REQUEST_1800 = \\\r\n\t\"POST /v7/device_auth_token HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 211\\r\\n\\r\\n\" \\\r\n\t\"challenge=TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=&\" \\\r\n\t\"client_id=8f849b5d34778d8e&ist=false&key_generation=17&\" \\\r\n\t\"system_version=CusHY#00120000#U531L4Si9RbhOVeyVppe18WHkJ0k4_KzrNtygsekMNo=&\" \\\r\n\t\"mac=c4SgqSjdfdNFoRM35ChrLw\"\r\n\r\nDEVICE_TOKEN_REQUEST_2000 = \\\r\n\t\"POST /v8/device_auth_tokens HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\\r\\n\" \\\r\n\t\"Content-Type: application/json\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 293\\r\\n\\r\\n\" \\\r\n\t'{\"system_version\":\"00140000\",\"fw_revision\":\"7147e1386c9b6c15d8f14e6ed68c4b9a7f28fb9b\",\"ist\":false,\"token_requests\":[{\"client_id\":\"8f849b5d34778d8e\"},{\"client_id\":\"dc656ea03b63cf68\"}],\"key_generation\":20,\"challenge\":\"TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=\",\"mac\":\"49YDQDn9UTq6iQGMdW5B8Q\"}'\r\n\r\nEDGE_TOKEN_REQUEST_2000 = \\\r\n\t\"POST /v8/edge_tokens HTTP/1.1\\r\\n\" \\\r\n\t\"Host: localhost:12345\\r\\n\" \\\r\n\t\"Accept: */*\\r\\n\" \\\r\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\\r\\n\" \\\r\n\t\"Content-Type: application/json\\r\\n\" \\\r\n\t\"X-Nintendo-PowerState: FA\\r\\n\" \\\r\n\t\"Content-Length: 335\\r\\n\\r\\n\" \\\r\n\t'{\"system_version\":\"00140000\",\"fw_revision\":\"7147e1386c9b6c15d8f14e6ed68c4b9a7f28fb9b\",\"ist\":false,\"token_requests\":[{\"client_id\":\"93af0acb26258de9\",\"vendor_id\":\"akamai\"},{\"client_id\":\"67bf9945b45248c6\",\"vendor_id\":\"akamai\"}],\"key_generation\":20,\"challenge\":\"TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=\",\"mac\":\"bB8LFaSTRsZtrWQD9Ew1-Q\"}'\r\n\r\n\r\n@pytest.mark.anyio\r\nasync def test_dauth_1200():\r\n\tasync def handler(client, request):\r\n\t\tif request.path == \"/v6/challenge\":\r\n\t\t\tassert request.encode().decode() == CHALLENGE_REQUEST_1200\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"challenge\": \"vaNgVZZH7gUse0y3t8Cksuln-TAVtvBmcD-ow59qp0E=\",\r\n\t\t\t\t\"data\": \"dlL7ZBNSLmYo1hUlKYZiUA==\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\telse:\r\n\t\t\tassert request.encode().decode() == TOKEN_REQUEST_1200\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"device_auth_token\": \"device token\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tkeys = {\r\n\t\t\t\"aes_kek_generation_source\": bytes.fromhex(\"485d45ad27c07c7e538c0183f90ee845\"),\r\n\t\t\t\"master_key_0a\": bytes.fromhex(\"37eed242e0f2ce6f8371e783c1a6a0ae\")\r\n\t\t}\r\n\t\t\r\n\t\tclient = dauth.DAuthClient(keys)\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1200)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.device_token(dauth.CLIENT_ID_BAAS)\r\n\t\ttoken = response[\"device_auth_token\"]\r\n\t\tassert token == \"device token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_dauth_1300():\r\n\tasync def handler(client, request):\r\n\t\tif request.path == \"/v7/challenge\":\r\n\t\t\tassert request.encode().decode() == CHALLENGE_REQUEST_1300\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"challenge\": \"TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=\",\r\n\t\t\t\t\"data\": \"4SxW91vqVg6pz4CXMH2Ouw==\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\telse:\r\n\t\t\tassert request.encode().decode() == DEVICE_TOKEN_REQUEST_1300\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"device_auth_token\": \"device token\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tkeys = {\r\n\t\t\t\"aes_kek_generation_source\": bytes.fromhex(\"cae2728f56af642d5d59dfc23bd314a2\"),\r\n\t\t\t\"master_key_0c\": bytes.fromhex(\"f1642c98bddb5850eb23d0cebab7dc05\")\r\n\t\t}\r\n\t\t\r\n\t\tclient = dauth.DAuthClient(keys)\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1300)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.device_token(dauth.CLIENT_ID_BAAS)\r\n\t\ttoken = response[\"device_auth_token\"]\r\n\t\tassert token == \"device token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_dauth_1800():\r\n\tasync def handler(client, request):\r\n\t\tif request.path == \"/v7/challenge\":\r\n\t\t\tassert request.encode().decode() == CHALLENGE_REQUEST_1800\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"challenge\": \"TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=\",\r\n\t\t\t\t\"data\": \"4SxW91vqVg6pz4CXMH2Ouw==\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\telse:\r\n\t\t\tassert request.encode().decode() == DEVICE_TOKEN_REQUEST_1800\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"device_auth_token\": \"device token\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tkeys = {\r\n\t\t\t\"aes_kek_generation_source\": bytes.fromhex(\"1092ce3d2c208c250ebe248537f2df73\"),\r\n\t\t\t\"master_key_10\": bytes.fromhex(\"2fcb5dd5355a220a12eaeb8069bb75e1\")\r\n\t\t}\r\n\t\t\r\n\t\tclient = dauth.DAuthClient(keys)\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1800)\r\n\t\tclient.set_context(None)\r\n\t\tresponse = await client.device_token(dauth.CLIENT_ID_BAAS)\r\n\t\ttoken = response[\"device_auth_token\"]\r\n\t\tassert token == \"device token\"\r\n\r\n@pytest.mark.anyio\r\nasync def test_dauth_2000():\r\n\tasync def handler(client, request):\r\n\t\tif request.path == \"/v8/challenge\":\r\n\t\t\tassert request.encode().decode() == CHALLENGE_REQUEST_2000\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"challenge\": \"TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=\",\r\n\t\t\t\t\"data\": \"4SxW91vqVg6pz4CXMH2Ouw==\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\telse:\r\n\t\t\tassert request.encode().decode() == DEVICE_TOKEN_REQUEST_2000\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\"results\": []}\r\n\t\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tkeys = {\r\n\t\t\t\"aes_kek_generation_source\": bytes.fromhex(\"1092ce3d2c208c250ebe248537f2df73\"),\r\n\t\t\t\"master_key_13\": bytes.fromhex(\"f09f742cf07cceb584410e13c507e27e\")\r\n\t\t}\r\n\t\t\r\n\t\tclient = dauth.DAuthClient(keys)\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2000)\r\n\t\tclient.set_context(None)\r\n\t\tawait client.device_tokens([\r\n\t\t\tdauth.CLIENT_ID_BAAS,\r\n\t\t\tdauth.CLIENT_ID_PCTL\r\n\t\t])\r\n\r\n@pytest.mark.anyio\r\nasync def test_edge_token_2000():\r\n\tasync def handler(client, request):\r\n\t\tif request.path == \"/v8/challenge\":\r\n\t\t\tassert request.encode().decode() == CHALLENGE_REQUEST_2000\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\r\n\t\t\t\t\"challenge\": \"TzJ0EB3EvsWvQI5aPj15uaNVH9paGdsWB4l-eI5uzW0=\",\r\n\t\t\t\t\"data\": \"4SxW91vqVg6pz4CXMH2Ouw==\"\r\n\t\t\t}\r\n\t\t\treturn response\r\n\t\telse:\r\n\t\t\tassert request.encode().decode() == EDGE_TOKEN_REQUEST_2000\r\n\t\t\tresponse = http.HTTPResponse(200)\r\n\t\t\tresponse.json = {\"results\": []}\r\n\t\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tkeys = {\r\n\t\t\t\"aes_kek_generation_source\": bytes.fromhex(\"1092ce3d2c208c250ebe248537f2df73\"),\r\n\t\t\t\"master_key_13\": bytes.fromhex(\"f09f742cf07cceb584410e13c507e27e\")\r\n\t\t}\r\n\t\t\r\n\t\tclient = dauth.DAuthClient(keys)\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(2000)\r\n\t\tclient.set_context(None)\r\n\t\tawait client.edge_tokens([\r\n\t\t\t(dauth.CLIENT_ID_BEACH, \"akamai\"),\r\n\t\t\t(dauth.CLIENT_ID_BCAT, \"akamai\")\r\n\t\t])\r\n\r\n@pytest.mark.anyio\r\nasync def test_dauth_error():\r\n\tasync def handler(client, request):\r\n\t\tresponse = http.HTTPResponse(400)\r\n\t\tresponse.json = {\r\n\t\t\t\"errors\": [{\"code\": \"0014\", \"message\": \"Invalid parameter in request.\"}]\r\n\t\t}\r\n\t\treturn response\r\n\t\r\n\tasync with http.serve(handler, \"localhost\", 12345):\r\n\t\tclient = dauth.DAuthClient({})\r\n\t\tclient.set_host(\"localhost:12345\")\r\n\t\tclient.set_system_version(1300)\r\n\t\tclient.set_context(None)\r\n\t\ttry:\r\n\t\t\tawait client.challenge()\r\n\t\texcept dauth.DAuthError as e:\r\n\t\t\tassert e.code == dauth.DAuthError.GENERIC\r\n\t\telse:\r\n\t\t\tpytest.fail(\"DAuth client should have raised an exception\")\r\n"
  },
  {
    "path": "tests/switch/test_dragons.py",
    "content": "\nfrom nintendo.switch import dragons\nfrom anynet import http\nimport pytest\n\n\nTEST_DEVICE_ID = 0x12345678\nTEST_DEVICE_TOKEN = \"device.token\"\nTEST_ELICENSE_ID = \"337c8aaef372df9c2c239ebaaf49f723\"\nTEST_ACCOUNT_ID = 0x72b0f0bdb31753d5\nTEST_APPLICATION_ID = 0x010040600C5CE000\n\nPUBLISH_DEVICE_LINKED_ELICENSES_REQUEST = \\\n\t\"POST /v1/rights/publish_device_linked_elicenses HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/15.0.0-4.0 (platform:NX; did:0000000012345678; eid:lp1)\\r\\n\" \\\n\t\"DeviceAuthorization: Bearer device.token\\r\\n\" \\\n\t\"Content-Length: 0\\r\\n\" \\\n\t\"Content-Type: application/x-www-form-urlencoded\\r\\n\" \\\n\t\"\\r\\n\"\n\nEXERCISE_ELICENSE_REQUEST = \\\n\t\"POST /v1/elicenses/exercise HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/15.0.0-4.0 (platform:NX; did:0000000012345678; eid:lp1)\\r\\n\" \\\n\t\"DeviceAuthorization: Bearer device.token\\r\\n\" \\\n\t\"Nintendo-Account-Id: 72b0f0bdb31753d5\\r\\n\" \\\n\t\"Content-Type: application/json\\r\\n\" \\\n\t\"Content-Length: 88\\r\\n\" \\\n\t\"\\r\\n\" \\\n\t'{\"elicense_ids\":[\"337c8aaef372df9c2c239ebaaf49f723\"],\"account_ids\":[\"72b0f0bdb31753d5\"]}'\n\nAAUTH_TOKEN_REQUEST_1500 = \\\n\t\"POST /v1/contents_authorization_token_for_aauth/issue HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 15.3.0.0)\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"Content-Type: application/json\\r\\n\" \\\n\t\"DeviceAuthorization: Bearer device.token\\r\\n\" \\\n\t\"Nintendo-Application-Id: 010040600c5ce000\\r\\n\" \\\n\t\"Content-Length: 77\\r\\n\" \\\n\t\"\\r\\n\" \\\n\t'{\"elicense_id\":\"337c8aaef372df9c2c239ebaaf49f723\",\"na_id\":\"72b0f0bdb31753d5\"}'\n\nAAUTH_TOKEN_REQUEST_1800 = \\\n\t\"POST /v1/contents_authorization_token_for_aauth/issue HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"Content-Type: application/json\\r\\n\" \\\n\t\"DeviceAuthorization: Bearer device.token\\r\\n\" \\\n\t\"Nintendo-Application-Id: 010040600c5ce000\\r\\n\" \\\n\t\"Content-Length: 77\\r\\n\" \\\n\t\"\\r\\n\" \\\n\t'{\"elicense_id\":\"337c8aaef372df9c2c239ebaaf49f723\",\"na_id\":\"72b0f0bdb31753d5\"}'\n\nAAUTH_TOKEN_REQUEST_2000 = \\\n\t\"POST /v2/contents_authorization_token_for_aauth/issue HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"Accept: */*\\r\\n\" \\\n\t\"User-Agent: libcurl (nnDauth; 16f4553f-9eee-4e39-9b61-59bc7c99b7c8; SDK 20.5.4.0)\\r\\n\" \\\n\t\"Content-Type: application/json\\r\\n\" \\\n\t\"DeviceAuthorization: Bearer device.token\\r\\n\" \\\n\t\"Nintendo-Application-Id: 010040600c5ce000\\r\\n\" \\\n\t\"Content-Length: 77\\r\\n\\r\\n\" \\\n\t'{\"elicense_id\":\"337c8aaef372df9c2c239ebaaf49f723\",\"na_id\":\"72b0f0bdb31753d5\"}'\n\n\n@pytest.mark.anyio\nasync def test_publish_device_linked_elicenses():\n\tasync def handler(client, request):\n\t\tassert request.encode().decode() == PUBLISH_DEVICE_LINKED_ELICENSES_REQUEST\n\t\tresponse = http.HTTPResponse(200)\n\t\tresponse.json = {\"elicenses\": []}\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = dragons.DragonsClient(TEST_DEVICE_ID)\n\t\tclient.set_hosts(\"localhost:12345\", None, None)\n\t\tclient.set_system_version(1500)\n\t\tclient.set_context(None)\n\t\tresponse = await client.publish_device_linked_elicenses(TEST_DEVICE_TOKEN)\n\t\tassert \"elicenses\" in response\n\n\n@pytest.mark.anyio\nasync def test_exercise_elicense():\n\tasync def handler(client, request):\n\t\tassert request.encode().decode() == EXERCISE_ELICENSE_REQUEST\n\t\tresponse = http.HTTPResponse(200)\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = dragons.DragonsClient(TEST_DEVICE_ID)\n\t\tclient.set_hosts(\"localhost:12345\", None, None)\n\t\tclient.set_system_version(1500)\n\t\tclient.set_context(None)\n\t\tawait client.exercise_elicense(\n\t\t\tTEST_DEVICE_TOKEN, [TEST_ELICENSE_ID], [TEST_ACCOUNT_ID], TEST_ACCOUNT_ID\n\t\t)\n\n\n@pytest.mark.anyio\nasync def test_contents_authorization_token_for_aauth_1500():\n\tasync def handler(client, request):\n\t\tassert request.encode().decode() == AAUTH_TOKEN_REQUEST_1500\n\t\tresponse = http.HTTPResponse(200)\n\t\tresponse.json = {\n\t\t\t\"contents_authorization_token\": \"auth token\"\n\t\t}\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = dragons.DragonsClient()\n\t\tclient.set_hosts(\"localhost:12345\", None, None)\n\t\tclient.set_system_version(1500)\n\t\tclient.set_context(None)\n\t\tresponse = await client.contents_authorization_token_for_aauth(\n\t\t\tTEST_DEVICE_TOKEN, TEST_ELICENSE_ID, TEST_ACCOUNT_ID, TEST_APPLICATION_ID\n\t\t)\n\t\tassert response[\"contents_authorization_token\"] == \"auth token\"\n\n\n@pytest.mark.anyio\nasync def test_contents_authorization_token_for_aauth_1800():\n\tasync def handler(client, request):\n\t\tassert request.encode().decode() == AAUTH_TOKEN_REQUEST_1800\n\t\tresponse = http.HTTPResponse(200)\n\t\tresponse.json = {\n\t\t\t\"contents_authorization_token\": \"auth token\"\n\t\t}\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = dragons.DragonsClient()\n\t\tclient.set_hosts(\"localhost:12345\", None, None)\n\t\tclient.set_system_version(1800)\n\t\tclient.set_context(None)\n\t\tresponse = await client.contents_authorization_token_for_aauth(\n\t\t\tTEST_DEVICE_TOKEN, TEST_ELICENSE_ID, TEST_ACCOUNT_ID, TEST_APPLICATION_ID\n\t\t)\n\t\tassert response[\"contents_authorization_token\"] == \"auth token\"\n\n\n@pytest.mark.anyio\nasync def test_contents_authorization_token_for_aauth_2000():\n\tasync def handler(client, request):\n\t\tassert request.encode().decode() == AAUTH_TOKEN_REQUEST_2000\n\t\tresponse = http.HTTPResponse(200)\n\t\tresponse.json = {\n\t\t\t\"contents_authorization_token\": \"auth token\"\n\t\t}\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = dragons.DragonsClient()\n\t\tclient.set_hosts(\"localhost:12345\", None, None)\n\t\tclient.set_system_version(2000)\n\t\tclient.set_context(None)\n\t\tresponse = await client.contents_authorization_token_for_aauth(\n\t\t\tTEST_DEVICE_TOKEN, TEST_ELICENSE_ID, TEST_ACCOUNT_ID, TEST_APPLICATION_ID\n\t\t)\n\t\tassert response[\"contents_authorization_token\"] == \"auth token\"\n"
  },
  {
    "path": "tests/switch/test_five.py",
    "content": "\nfrom nintendo.switch import five\nfrom anynet import http\nimport pytest\n\n\nUNREAD_INVITATION_COUNT_REQUEST = \\\n\"\"\"GET /v1/users/aaaaaaaaaaaaaaaa/invitations/inbox?fields=count&read=false HTTP/1.1\nHost: localhost:12345\nUser-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\nAccept: */*\nAuthorization: Bearer access token\n\n\"\"\"\n\nGET_INBOX_REQUEST = \\\n\"\"\"GET /v1/users/aaaaaaaaaaaaaaaa/invitations/inbox HTTP/1.1\nHost: localhost:12345\nUser-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\nAccept: */*\nAuthorization: Bearer access token\n\n\"\"\"\n\nGET_INVITATION_GROUP_REQUEST = \\\n\"\"\"GET /v1/invitation_groups/12345 HTTP/1.1\nHost: localhost:12345\nUser-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\nAccept: */*\nAuthorization: Bearer access token\n\n\"\"\"\n\nMARK_ALL_AS_READ_REQUEST = \\\n\"\"\"PATCH /v1/users/aaaaaaaaaaaaaaaa/invitations/mark_as_read HTTP/1.1\nHost: localhost:12345\nUser-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\nAccept: */*\nAuthorization: Bearer access token\nContent-Length: 0\nContent-Type: application/x-www-form-urlencoded\n\n\"\"\"\n\nSEND_INVITATION_REQUEST = \\\n\"\"\"POST /v1/invitation_groups HTTP/1.1\nHost: localhost:12345\nUser-Agent: libcurl (nnFriends; 789f928b-138e-4b2f-afeb-1acae821d897; SDK 15.3.0.0; Add-on 15.3.0.0)\nAccept: */*\nContent-Type: application/json\nAuthorization: Bearer access token\nContent-Length: 241\n\n{\"receiver_ids\":[\"bbbbbbbbbbbbbbbb\"],\"application_id\":\"010036b0034e4000\",\"application_group_id\":\"010036b0034e4000\",\"application_data\":\"YXBwbGljYXRpb24gZGF0YQ==\",\"messages\":{\"ja\":\"\\u4e00\\u7dd2\\u306b\\u904a\\u3073\\u307e\\u3057\\u3087\\u3046\\uff01\"},\"application_id_match\":false}\"\"\"\n\n\ndef check(handler, version):\n\tdef decorator(callback):\n\t\tasync def function():\n\t\t\tclient = five.FiveClient()\n\t\t\tclient.set_host(\"localhost:12345\")\n\t\t\tclient.set_system_version(version)\n\t\t\tclient.set_context(None)\n\t\t\tasync with http.serve(handler, \"localhost\", 12345):\n\t\t\t\tawait callback(client)\n\t\treturn pytest.mark.anyio(function)\n\treturn decorator\n\ndef check_simple(version):\n\tasync def handler(client, request):\n\t\treturn http.HTTPResponse(200)\n\treturn check(handler, version)\n\ndef check_request(expected_request, version, *, response={}):\n\tasync def handler(client, request):\n\t\trequest.json_options[\"ensure_ascii\"] = False\n\t\t\n\t\tassert request.encode().decode() == expected_request.replace(\"\\n\", \"\\r\\n\")\n\t\tresp = http.HTTPResponse(200)\n\t\tresp.json = response\n\t\treturn resp\n\treturn check(handler, version)\n\n@check_request(UNREAD_INVITATION_COUNT_REQUEST, 1501, response={\"count\": 0})\nasync def test_get_unread_invitation_count(client):\n\tawait client.get_unread_invitation_count(\"access token\", 0xaaaaaaaaaaaaaaaa)\n\n@check_request(GET_INBOX_REQUEST, 1501)\nasync def test_get_inbox(client):\n\tawait client.get_inbox(\"access token\", 0xaaaaaaaaaaaaaaaa)\n\n@check_request(GET_INVITATION_GROUP_REQUEST, 1501)\nasync def test_get_invitation_group(client):\n\tawait client.get_invitation_group(\"access token\", 12345)\n\n@check_simple(1501)\nasync def test_mark_as_read(client):\n\tawait client.mark_as_read(\"access token\", [10000, 10001, 10002])\n\n@check_request(MARK_ALL_AS_READ_REQUEST, 1501)\nasync def test_mark_all_as_read(client):\n\tawait client.mark_all_as_read(\"access token\", 0xaaaaaaaaaaaaaaaa)\n\n@check_request(SEND_INVITATION_REQUEST, 1501)\nasync def test_send_invitation(client):\n\treceivers = [0xbbbbbbbbbbbbbbbb]\n\ttitle_id = 0x010036b0034e4000\n\tmessages = {\n\t\t# Check if UTF-8 is handled correctly\n\t\t\"ja\": \"\\u4e00\\u7dd2\\u306b\\u904a\\u3073\\u307e\\u3057\\u3087\\u3046\\uff01\"\n\t}\n\tawait client.send_invitation(\"access token\", receivers, title_id, title_id, b\"application data\", messages)\n"
  },
  {
    "path": "tests/switch/test_sun.py",
    "content": "\nfrom nintendo.switch import sun\nfrom anynet import http\nimport pytest\n\n\nTEST_DEVICE_ID = 0x6265ca40780b1c0d\n\nSYSTEM_UPDATE_META_REQUEST = \\\n\t\"GET /v1/system_update_meta?device_id=6265ca40780b1c0d HTTP/1.1\\r\\n\" \\\n\t\"Host: localhost:12345\\r\\n\" \\\n\t\"User-Agent: NintendoSDK Firmware/17.0.0-6.0 (platform:NX; did:6265ca40780b1c0d; eid:lp1)\\r\\n\" \\\n\t\"Accept: application/json\\r\\n\" \\\n\t\"\\r\\n\"\n\n\n@pytest.mark.anyio\nasync def test_system_update_meta():\n\tasync def handler(client, request):\n\t\tassert request.encode().decode() == SYSTEM_UPDATE_META_REQUEST\n\t\tresponse = http.HTTPResponse(200)\n\t\tresponse.json = {\"system_update_metas\": []}\n\t\treturn response\n\t\n\tasync with http.serve(handler, \"localhost\", 12345):\n\t\tclient = sun.SunClient(TEST_DEVICE_ID)\n\t\tclient.set_host(\"localhost:12345\")\n\t\tclient.set_system_version(1700)\n\t\tclient.set_context(None)\n\t\tresponse = await client.system_update_meta()\n\t\tassert \"system_update_metas\" in response\n"
  }
]