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

RemotePlay-based Connection #18

Merged
merged 38 commits into from
Mar 31, 2021
Merged

RemotePlay-based Connection #18

merged 38 commits into from
Mar 31, 2021

Conversation

dhleong
Copy link
Owner

@dhleong dhleong commented Mar 28, 2021

This PR sets up the initial support for implementing IDeviceConnection using the RemotePlay protocol. Included is basic login and standby support. Probably will want to try to support login passcode support before merging.

Of note: there was a bug in how we handled login, so the credentials needed to actually login are probably incomplete if you used that method. This situation will be detected and you should be notified of the need to re-authenticate. We don't yet (but probably should) add a flag to ignore existing credentials to force re-auth for this case.

It looks like we can additionally support the on-screen-keyboard with this API, but button presses may be a separate API, and there may not be an equivalent for starting apps/games.

@dhleong dhleong force-pushed the dhleong/remote-play-connection branch from 4829cf1 to e0dcf59 Compare March 29, 2021 04:01
I think we ought to be able to reuse the TcpDeviceSocket logic for
sending and receiving packets...
Probably unnecessary since it *should* be 16 bytes
In particular, this resulted in us getting an incomplete RP-Key, which
was the cause of our consistently failed auth attempts at the ctrl
endpoint
This simplifies some code sharing, and gives us one spot to validate
RP-Key
Not quite sure what's going on...
We have to ref() it to prevent the agent from killing things
Also cleans up RemotePlayDeviceConnection somewhat
Standby now works properly for PS5!
@dhleong dhleong force-pushed the dhleong/remote-play-connection branch from 26e352a to 4c8e375 Compare March 29, 2021 13:49
The BufferPacketProcessor sort of assumes that the whole stream is
encoded, but that's not how the RemotePlay protocol works.
In the RemotePlay protocol, we should *only* increment the counters if
there was actually a payload to encrypt/decrypt. We were *always* trying
to encrypt/decrypt, which incorrectly incremented counters, causing a
desync with the host device.

Passcode auth works now!
@dhleong dhleong merged commit 435482d into main Mar 31, 2021
@dhleong dhleong deleted the dhleong/remote-play-connection branch March 31, 2021 13:55
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant