Module: nintendo.nex.settings
Defines settings for nex classes.
class Settings
Holds the settings.
def default() -> Settings
Creates a settings object with default settings.
def load(name: str) -> Settings
Loads the settings from the given configuration file. The following files are provided:
- 3ds: provides reasonable defaults for 3DS applications.
- default: provides reasonable defaults for Wii U applications.
- friends: provides reasonable defaults for the 3DS / Wii U friend server.
- switch: provides reasonable defaults for Switch applications.
Settings
TRANSPORT_UDP (0)
TRANSPORT_TCP (1)
TRANSPORT_WEBSOCKET (2)
COMPRESSION_NONE (0)
COMPRESSION_ZLIB (1)
ENCRYPTION_NONE (0)
ENCRYPTION_RC4 (1)
def __getitem__(name: str) -> object
Returns the value of a specific setting.
def __setitem__(name: str, value: object) -> None
Changes the value of a specific setting. The value is automatically converted to the appropriate type.
def configure(access_key: str, nex_version: int, client_version: int = None) -> None
Configures the prudp.access_key, nex.version and nex.client_version settings.
def reset() -> None
Resets all fields back to their defaults.
def copy() -> Settings
Returns a copy of the settings object.
def load(name: str) -> None
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.
Fields
The following fields are currently defined:
nex.version: int = 0
The version of the nex library.
nex.client_version: int = 0
The client version sent to the server in ValidateAndRequestTicketWithParam.
nex.struct_header: int = 0
Enables structure headers.
nex.pid_size: int = 4
The size of a user id in bytes (4 or 8).
prudp.access_key: str = ""
The access key of the game server.
prudp.version: int = 2
The major version of the prudp protocol with UDP transport:
- 0: both client and server use only prudp v0
- 1: both client and server use only prudp v1
- 2: client uses only prudp v1, server supports both v0 and v1.
If the transport is different from UDP, the lite encoding is always used.
prudp.minor_version: int = 4
The minor version of the prudp protocol.
This is only relevant for prudp v1 and lite.
prudp.transport: int = TRANSPORT_UDP
The underlying transport protocol for prudp.
prudp.compression: int = COMPRESSION_NONE
The compression algorithm used for data packets.
prudp.encryption: int = ENCRYPTION_RC4
The encryption algorithm used for data packets.
prudp.resend_timeout: float = 1
Time after which a packet is resent if no acknowledgement is received (in seconds).
prudp.resend_limit: int = 2
Number of retransmissions after which the connection is considered dead.
prudp.ping_timeout: float = 5
Time after which a ping packet is sent to keep the connection alive (in seconds).
prudp.fragment_size: int = 1300
The maximum size of a packet payload before it is split up into fragments.
prudp.max_substream_id: int = 0
The maximum substream id in prudp v1.
prudp_v0.signature_version: int = 0
The version of the packet signature in the prudp v0 protocol.
prudp_v0.flags_version: int = 1
The version of the flags field in the prudp v0 protocol.
prudp_v0.checksum_version: int = 1
The version of the checksum algorithm in the prudp v0 protocol.
kerberos.key_size: int = 32
The size of the session key in bytes.
kerberos.key_derivation: int = 0
The version of the key derivation algorithm for kerberos tickets.
kerberos.ticket_version: int = 1
The version of the internal data in kerberos tickets.