kinnay / NintendoClients

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

Improve smm2 methods and structures #11

Closed tenda-gumi closed 5 years ago

tenda-gumi commented 5 years ago

For country, the code appears to always be two letter codes: "US", "UK", etc.

For endless mode difficulty, 0 = easy, 1 = normal, presumably 2 and 3 are expert and super expert.

kinnay commented 5 years ago

Hi,

You probably found this by analyzing packets, right? While that's a good way to figure out the meaning of fields, you can't really accurately figure out the types this way. For example, method 95 and 143 actually return a list. And the fields in GetNewNotificationResult are all bools.

I can figure out the types of the fields quite easily with a disassembler, so I'll probably start documenting more methods today.

Another minor thing: you indented method 79 with spaces. This looks weird for people that don't use 4-space tabs.

tenda-gumi commented 5 years ago

Thanks for the feedback.

Another minor thing: you indented method 79 with spaces. This looks weird for people that don't use 4-space tabs.

Oops. I was having some editor trouble; it kept defaulting back to spaces. I'll fix that.

For example, method 95 and 143 actually return a list. And the fields in GetNewNotificationResult are all bools.

Yeah, I was actually coming back to comment that they might be lists of size 0 and just found your comments :). I'll rework this pull request to only have the fields and structures I'm sure about.

tenda-gumi commented 5 years ago

Okay, I've updated the pull request based on your comments. I'm reasonably confident everything left is accurate. I named one additional field in UserInfo: region. it looks like it's 0 for JP, 1 for US/Canada, 2 for Europe, 3 for Australia.

This matches the region areas defined in smm1.

kinnay commented 5 years ago

Looks good, thanks. I'll add your discoveries to the wiki page as well.