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

Rewrite PKSM Bridge protocol to support dynamic file size. #1327

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrhappyasthma
Copy link
Contributor

This commit introduces the PKSM Bridge Protocol (v1), which is a simple protocol on top of the TCP connection to allow for future changes through versioning and transmitting dynamic file sizes.

NOTE: This commit adds new strings. I just put them all in english for now. I'll need assistance from the community to translate them all into the respective languages.

This logic will also need to be brought to Checkpoint, which will be proposed separately.

The pksmbridge_api and pksmbridge_tcp files are generic and could benefit from being pulled into their own dependency repo. Otherwise similar logic needs to be implemented across any clients that want to send/receive files using the same protocol.

TESTED: Tested using this build of PKSM and a build of Checkpoint (for Switch) using the same protocol files. Sent across Pokemon Sword, modified the boxes and sent it back. Then I confirmed that the pokemon were updated at both ends of the round-trip.

This commit introduces the PKSM Bridge Protocol (v1), which is a simple protocol on top of the TCP connection to allow for future changes through versioning and transmitting dynamic file sizes.

NOTE: This commit adds new strings. I just put them all in english for
now. I'll need assistance from the community to translate them all into
the respective languages.
@mrhappyasthma
Copy link
Contributor Author

Finally revived this after the long disruption that as COVID.

Please let me know what feedback and thoughts people have. I'm open to changes and suggestions.

Thanks!

@piepie62
Copy link
Member

Hi! I really like the way this seems to work, abstracting all of that away. I have one major follow-up question: would you happen to have a way to make this interruptible from the receiving end? The way it currently works is by completely blocking on the PKSM side, which isn't very user-friendly. If not, this is still a great upgrade from the previous version, and thank you so much for it. Also, don't worry about the conflicts, I should be able to handle that myself

@mrhappyasthma
Copy link
Contributor Author

I haven't looked into it, but I don't see why it wouldn't be possible. (I think a nice progress bar would also go a long way. Right now you're just locked up until it either fails or completes after some time.)

I'm still fairly new to 3DS programming, but I'm happy to look into it.

Would you prefer to roll that up in to this PR? Or to handle that as a subsequent improvement?

@piepie62
Copy link
Member

The 3DS side can be easily handled; I'm thinking providing a "should cancel" and a "report progress" callback should be sufficient? I just have no idea how to do non-blocking socket reads

@SNBeast
Copy link
Contributor

SNBeast commented Sep 16, 2022

If I understand correctly, select allows for checking if there's data to read and setting a timeout. I haven't tried it, so I might be wrong in that it can't do that or that it's not available on 3DS.

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.

Feature Request - Implement dynamic file sizes and protocol versioning in PKSM bridge
3 participants