Add check for if you're actually connected to a network for net installs

This commit is contained in:
Huntereb 2019-11-01 15:46:10 -04:00
parent 24395270ba
commit 63fa7aea77

View File

@ -150,6 +150,11 @@ namespace netInstStuff{
struct in_addr addr = {(in_addr_t) gethostid()};
std::string ourIPAddr(inet_ntoa(addr));
// If our IP is 127.0.0.1, cancel because we aren't connected to a network
if (ourIPAddr == "1.0.0.127") {
inst::ui::mainApp->CreateShowDialog("Network connection not available", "Check that airplane mode is disabled and you're connected to a local network.", {"OK"}, true);
return {};
}
inst::ui::setNetInfoText("Waiting for a connection... Your Switch's IP Address is: " + ourIPAddr);
printf("%s %s\n", "Switch IP is ", inet_ntoa(addr));