Module: nintendo.nasc
Provides a client for nasc.nintendowifi.net.
class NASCError(Exception)
Raised when the server returns an error code.
class NASCClient
The NASC client.
Global Constants
MEDIA_TYPE_SYSTEM = 0
MEDIA_TYPE_DIGITAL = 1
MEDIA_TYPE_CARTRIDGE = 2
NASCError
This exception is raised when the server returns an error code.
status_code: int
return_code: int | None
retry: bool
datetime: datetime.datetime
NASCClient
def __init__()
Creates a new NASC client.
def set_context(context: TLSContext) -> None
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.
def set_url(url: str) -> None
Changes the server to which requests are sent. The default is nasc.nintendowifi.net.
def set_environment(environment: str) -> None
Changes the servertype parameter. The default is "L1" (production).
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
Configures the current title. The rom_id is required only for cartridges. This is required for calls to login.
def set_device(serial_number: str, mac_address: str, fcd_cert: bytes, name: str = "", unit_code: str = "2") -> None
Configures the device. This is required for calls to login.
def set_network(bss_id: str, ap_info: str) -> None
Changes the bssid and ap_info parameters. By default, the bssid is random and ap_info is 01:0000000000.
def set_locale(region: int, language: int) -> None
Changes the region and language parameters.
def set_user(pid: int, pid_hmac: str) -> None
Configures the user for logging in. Either set_user or set_password must be called before login.
def set_password(password: str) -> None
Configures the passwd parameter. Either set_user or set_password must be called before login.
def set_sdk_version(major_version: int, minor_version: int) -> None
Changes the content of the sdkver parameter. The default is 000000.
def set_fpd_version(version: int) -> None
Changes the content of the fpdver parameter and user agent. The default is 15.
async def login(game_server_id: int, nickname: str = "") -> LoginResponse
Calls the LOGIN action on the server and returns the response or raises an exception.
LoginResponse
host: str
port: int
token: str
datetime: datetime.datetime