Closed EpicUsername12 closed 1 year ago
I added "Five" endpoint basic functionality
The only function supported is this one:
app.lp1.five.nintendo.net/v1/invitation_groups
It can be used like this:
from nintendo.five import FiveClient
# Copied from Portal 2 (24 bytes)
invite_data = streams.StreamOut(s)
invite_data.u64(MY_OWN_PID)
invite_data.u64(MY_OWN_PID)
invite_data.u32(msess.id) # Gathering ID
invite_data.pad(4)
invite_data.u8(0x04) # Unk
invite_data.pad(3)
invite_data.u8(16) # Unk
invite_data.pad(3)
invite_data.write(b"none") # lol
fc = FiveClient()
fc.set_system_version(SYSTEM_VERSION) # Not mandatory, defaults to the latest version
await fc.send_invitation_to_group(response["accessToken"], 0x0100abd01785c000, "Invite text that will appear in the invite list!", invite_data.data, [TARGET_PID])
Proof it works:
Hi, there are a few problems with this PR:
22306D00
is definitely not the game server id of Portal 2. This is the game server id of SMM2. I'm also quite sure that the access key is not hNWPC8B1
. An access key always contains 8 hex digits. The only exception is AC:NH, but even AC:NH does not use uppercase.Content-Type
header first. In my Charles dump it appears between the Accept
and Authorization
headers instead. I also think that the user agent for five should contain nnFriends
?send_invitation_to_group
is indented too much.Personally, I've been writing tests for most Switch endpoints, which validate the raw HTTP request. These requests are copied directly from a Charles dump and only modified to remove my personal data. This should catch errors such as wrong user agents / header ordering. See test_dragons.py for example.
I will probably try to implement these features myself, but I do appreciate the effort.
Also sorry that I didn't reply earlier. I wasn't sure if I wanted to implement this functionality in NintendoClients at all because it's not really related to NEX, but by now I've decided that I want to implement other services as well.
The game server ID is in fact 2EDB3700
, but the access key is (i must be stupid)hNWPC8B1
But i agree on the rest, will be waiting for your implementation
Here: https://github.com/kinnay/NintendoClients/blob/master/nintendo/five.py
I hope that this is good.
I added the Nintendo Switch presence endpoints
The code supports everything the Nintendo Switch 'friends' service can do to the "friend presence"
You can use the code this way: