Implemented different heuristics for different difficulties

This commit is contained in:
Anuken
2018-01-12 14:50:29 -05:00
parent 597a883275
commit 1156ead143
5 changed files with 40 additions and 37 deletions
@@ -117,6 +117,7 @@ public class JoinDialog extends FloatingDialog {
while(t.getCause() != null){
t = t.getCause();
}
//TODO localize
String error = t.getMessage() == null ? "" : t.getMessage().toLowerCase();
if(error.contains("connection refused")) {
error = "connection refused";
@@ -125,7 +126,7 @@ public class JoinDialog extends FloatingDialog {
}else if(error.contains("invalid argument")) {
error = "invalid IP or port!";
}else if(t.getClass().toString().toLowerCase().contains("sockettimeout")){
error = "timed out!";
error = "timed out!\nmake sure the host has port forwarding set up,\nand that the address is correct!";
}else{
error = Strings.parseException(e, false);
}