kinnay / NintendoClients

Python package to communicate with Switch, Wii U and 3DS servers
MIT License
547 stars 66 forks source link

Question about PIA Protocol (NEX Game Server) #81

Closed mathias-tavernier-roux closed 1 year ago

mathias-tavernier-roux commented 2 years ago

Hello, I have just read your repo on super mario 35 and the research you have done regarding how our consoles communicate with nintendo servers (and I would like to have your opinion on the pia (pear 2 pear) protocol ( when used for a connection to the NSO (Nintendo Switch Online))

if I understood correctly when our console connects to online on a game using the PIA protocol to play online

the console contacts the NEX server (Game Server) to request the available pools and attempt to connect to them

do you think it would be possible to recreate this protocol based on the research of the eagle server (an ips patch for change game server adress) to allow hacked consoles to communicate as if it were on the NSO without going through the nintendo servers

if possible this would be a major step forward especially if it does not depend on external hardware (compared to lan play)

Thank you in advance for your reply

jonbarrow commented 2 years ago

If all you’re asking is if it’s possible to make custom NEX servers (because you don’t need to do anything with PIA, just make a NEX server and setup the PIA matches) then yes it is. Several already exist for the WiiU and 3DS, which also use NEX and PIA. And this repo even has functions to make such servers of your own

mathias-tavernier-roux commented 1 year ago

Hello and thanks for the answer, i have two more questions : first : do one NEX server can host different game servers, or one NEX server is dedicated to one game ?, second : do you think we can replace the patch of a specific game by an sysmodule who redirect all request to a custom NEX server regardless of the game ?

kinnay commented 1 year ago

There is one NEX server per game, but the implementation is usually the same.

The server address is hardcoded into each game, but if you want to redirect all games to your custom server you could for example disable CA verification and use a custom DNS server.