hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.25k stars 2.17k forks source link

Suggestion: Ping the selected IP-address, check for connectivity #9795

Open tywald opened 7 years ago

tywald commented 7 years ago

Currently you can type whatever you want, it would be nice to have some checks to see if it's valid or not.

A very overlooked issue when the IP isn't working is if it the user accidently added a space at the beginning or at the end of the address, making it hard to spot right away. Usually caused by not paying attention during copy-paste: i.e copy-paste " 192.168.1.2" or "192.168.1.2 " (without quotes).

If the user copy-pastes the address or typing it manually, the emulator should tell the user if the IP is valid or not so they can correct it.

Might be a bit complicated when it comes to domain names though like coldbird.net

A lazy fix would be just to check for spaces and prevent them from being typed and remove them during copy-paste. At least in that case you can see more easily if there is a typo somewhere.

hrydgard commented 7 years ago

Yeah we should strip spaces as a very minimum.

tilkinsc commented 7 years ago

Would it be safe to check if a connection can be made to the server the ip points to? (invalid ip addresses) The only way I know is to connect to it (will actually connect and drop a client from the server).

hrydgard commented 7 years ago

Since DNS can be used, I don't think syntax checks makes sense, and you might maybe want to be able to change the address while offline so I don't like the idea of such checks either, but I'm adding whitespace stripping.

tilkinsc commented 7 years ago

I think you misunderstood what I was trying to say. A green bubble next to the ip you entered would signal that the server could be reached. A red bubble next to the ip you entered would signal connection failed.