Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server usage examples #124

Open
BurAndBY opened this issue Jan 28, 2024 · 17 comments
Open

Server usage examples #124

BurAndBY opened this issue Jan 28, 2024 · 17 comments
Labels

Comments

@BurAndBY
Copy link

I found this package very useful, however there are no examples on how to use things like nintendo.nex.matchmaking. MatchMakingServer. Are there any examples (other than the SMB35 repo) for those server classes?

@jonbarrow
Copy link
Contributor

This repo has an example server found in the examples folder

https://github.com/kinnay/NintendoClients/blob/master/examples/custom/server.py

You would use the other protocol classes the same way. As for the actual logic behind them, that's an implementation detail and really up to you how you implement it. Also some NEX versions have slightly different requirements especially with matchmaking, so your implementation would also vary by game

We've had instances like this several times over at Pretendo, where one game may expect a matchmaking notification and another may not (as an example)

@kinnay
Copy link
Owner

kinnay commented Jan 28, 2024

@jonbarrow is right. No other examples unfortunately. If you have a specific question about the match making protocol, feel free to ask and we can try to help.

@BurAndBY
Copy link
Author

This repo has an example server found in the examples folder

https://github.com/kinnay/NintendoClients/blob/master/examples/custom/server.py

You would use the other protocol classes the same way. As for the actual logic behind them, that's an implementation detail and really up to you how you implement it. Also some NEX versions have slightly different requirements especially with matchmaking, so your implementation would also vary by game

We've had instances like this several times over at Pretendo, where one game may expect a matchmaking notification and another may not (as an example)

This is very useful, thanks! I was looking at the matchmaking_mk8d code to try serve it, since it has the full server code and as far as I understand I need to run the servers mk8d uses

@BurAndBY
Copy link
Author

@jonbarrow is right. No other examples unfortunately. If you have a specific question about the match making protocol, feel free to ask and we can try to help.

This example is good enough and it tells what parts are coded specifically for SMB35 and which ones are the base code needed

@jonbarrow
Copy link
Contributor

This is very useful, thanks! I was looking at the matchmaking_mk8d code to try serve it, since it has the full server code and as far as I understand I need to run the servers mk8d uses

It has the skeleton of the protocol but you'll still need to implement all the actual functionality by hand. You'll also probably need to run your own account server, unless there's some other way to force the game to connect? I haven't looked much into the Switch's architecture myself yet, to be honest. I assume it gets the NEX servers location from the account server much like the WiiU/3DS do

@BurAndBY
Copy link
Author

This is very useful, thanks! I was looking at the matchmaking_mk8d code to try serve it, since it has the full server code and as far as I understand I need to run the servers mk8d uses

It has the skeleton of the protocol but you'll still need to implement all the actual functionality by hand. You'll also probably need to run your own account server, unless there's some other way to force the game to connect? I haven't looked much into the Switch's architecture myself yet, to be honest. I assume it gets the NEX servers location from the account server much like the WiiU/3DS do

Oh, that makes a lot of sense, thanks!

@kinnay
Copy link
Owner

kinnay commented Jan 28, 2024

You'll also probably need to run your own account server, unless there's some other way to force the game to connect? I haven't looked much into the Switch's architecture myself yet, to be honest. I assume it gets the NEX servers location from the account server much like the WiiU/3DS do

No, the Switch finds the game servers by DNS lookup. The easiest way to connect with a custom server is to write an IPS patch that replaces the game server URL. This is what I did with SMB35 as well.

@jonbarrow
Copy link
Contributor

No, the Switch finds the game servers by DNS lookup. The easiest way to connect with a custom server is to write an IPS patch that replaces the game server URL. This is what I did with SMB35 as well.

That's right, my bad. I remember that from your wiki now, ignore me

@BurAndBY
Copy link
Author

You'll also probably need to run your own account server, unless there's some other way to force the game to connect? I haven't looked much into the Switch's architecture myself yet, to be honest. I assume it gets the NEX servers location from the account server much like the WiiU/3DS do

No, the Switch finds the game servers by DNS lookup. The easiest way to connect with a custom server is to write an IPS patch that replaces the game server URL. This is what I did with SMB35 as well.

And what about the dauth/nso check switch does on connection, how to bypass that? I presume a patch too?

@kinnay
Copy link
Owner

kinnay commented Jan 28, 2024

Yes. It depends on the game, but you probably want to look for the following functions:

  • nn::account::EnsureNetworkServiceAccountAvailable
  • nn::account::EnsureNetworkServiceAccountIdTokenCacheAsync
  • nn::account::GetNetworkServiceAccountId
  • nn::account::LoadNetworkServiceAccountIdTokenCache

@BurAndBY
Copy link
Author

And does F-Zero 99 use libeagle too? It seems so, but it's not mentioned in the wiki.

@kinnay
Copy link
Owner

kinnay commented Jan 29, 2024

Yes it does, I just checked and updated the wiki. Its version string is 2.5.5, so the protocol is probably the same as in SMB 35 and Pac-Man 99.

@BurAndBY
Copy link
Author

Yes it does, I just checked and updated the wiki. Its version string is 2.5.5, so the protocol is probably the same as in SMB 35 and Pac-Man 99.

Great to know, thanks!

@damartcode
Copy link

You'll also probably need to run your own account server, unless there's some other way to force the game to connect? I haven't looked much into the Switch's architecture myself yet, to be honest. I assume it gets the NEX servers location from the account server much like the WiiU/3DS do

No, the Switch finds the game servers by DNS lookup. The easiest way to connect with a custom server is to write an IPS patch that replaces the game server URL. This is what I did with SMB35 as well.

And what about the dauth/nso check switch does on connection, how to bypass that? I presume a patch too?

I have a question on this. Instead of the patch for the game server url, couldn't you disable certificate check and custom DNS to point into your game/authentication server?.

Same logic could go on dauth/nso checks?, I could run my own dauth/nso servers with certificate check and custom DNS, correct?

@kinnay
Copy link
Owner

kinnay commented Apr 30, 2024

Correct. Here's a repo that disables certificate checks: https://github.com/misson20000/exefs_patches.

@damartcode
Copy link

Kinnay, would you appreciate implementations for the dauth/nso servers in the repo?

@kinnay
Copy link
Owner

kinnay commented May 2, 2024

Not here, but I have a server implementation elsewhere: https://github.com/nintendo-playground/.

It currently implements dauth and aauth up to system version 14.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants