Full error localization

This commit is contained in:
Anuken
2018-10-28 23:50:30 -04:00
parent 108e5a2f5e
commit 5b01d923d3
2 changed files with 4 additions and 1 deletions

View File

@@ -266,6 +266,7 @@ text.error.unreachable = Server unreachable.
text.error.invalidaddress = Invalid address. text.error.invalidaddress = Invalid address.
text.error.timedout = Timed out!\nMake sure the host has port forwarding set up, and that the address is correct! text.error.timedout = Timed out!\nMake sure the host has port forwarding set up, and that the address is correct!
text.error.mismatch = Packet error:\npossible client/server version mismatch.\nMake sure you and the host have the latest version of Mindustry! text.error.mismatch = Packet error:\npossible client/server version mismatch.\nMake sure you and the host have the latest version of Mindustry!
text.error.alreadyconnected = Already connected.
text.error.any = Unkown network error. text.error.any = Unkown network error.
text.settings.language = Language text.settings.language = Language

View File

@@ -69,6 +69,8 @@ public class Net{
error = Bundles.get("text.error.unreachable"); error = Bundles.get("text.error.unreachable");
}else if(type.contains("timeout")){ }else if(type.contains("timeout")){
error = Bundles.get("text.error.timeout"); error = Bundles.get("text.error.timeout");
}else if(error.equals("alreadyconnected")){
error = Bundles.get("text.error.alreadyconnected");
}else if(!error.isEmpty()){ }else if(!error.isEmpty()){
error = Bundles.get("text.error.any"); error = Bundles.get("text.error.any");
} }
@@ -112,7 +114,7 @@ public class Net{
active = true; active = true;
server = false; server = false;
}else{ }else{
throw new IOException("Already connected!"); throw new IOException("alreadyconnected");
} }
}catch(IOException e){ }catch(IOException e){
showError(e); showError(e);