jakibaki / In-Home-Switching

Allows you to stream your PC display to your Nintendo Switch!
GNU General Public License v3.0
440 stars 41 forks source link

Convert the desktop app into a server #18

Closed CodeMooseUS closed 5 years ago

CodeMooseUS commented 5 years ago

This pull request started out as a learning exercise for me to figure out how switch homebrew works. I saw this app and thought it was great. The problem was, I kept having to go upstairs to my PC in order to connect back to the switch whenever I changed app. So I began looking into how to reverse the connection so that the desktop app acted as the server and the switch a client.

Once I figured out how to build it, I added the steps to the readme (at least the ones I took- they might not be optimal). Then from there I updated the desktop app to listen for client connections so you can just keep it running all the time. After that I needed a way to enter my desktop app ip address from the switch. That led me to add SDL2 (which I saw you also recently added) and re-purpose some code from NX-Shell to render an on screen keyboard (it uses the same license so I figured that was ok).

From there things just kept going because it was a fun project. I added an icon that I drew in inkscape and recently merged with your overclocking changes, etc.

There are still a couple of issues around closing the homebrew app, and disconnecting from the server, but I figured it was in a good enough state to see if you want to merge it and help fix the bugs. Sorry that it's so many changes in one go.

Features in this PR include:

Screenshot of updated switch app UI: switch

jakibaki commented 5 years ago

First of all many thanks for the PR! Those features looks very interesting.

However there are some issues that prevent this from being merged in its current stage:

The PC doesn't seem to actually be the server for everything in your PR.
For example the switch still seems to be the server for the ffmpeg stuff making half of the point of wanting the PC to be the server vanish.
Also if we want the PC to be the server there needs to be some auth making sure that people can't simply scan the net for devices with ports 2222 and 2223 open and take over their computers.

There is a lot of stuff in the main that should've been in different files.

You seem to have changed a lot of things without explaining your changes (mainly the moving of sdl-stuff out of the context into a seperate global context).

Your changes also broke the input_linux.go application.


In any case this should be split up into multiple PRs and please restrict your changes to a reasonable level, as it stands this is way too big to be properly reviewed.
Please try to preserve the code-style of the project.

CodeMooseUS commented 5 years ago

That's fair. I realised I had done too much in one go, but it was a fun learning experience for me.

I'll abandon this PR for now, but feel free to use any pieces from the branch that look interesting.

Thanks.