More descriptive address in use error

This commit is contained in:
Anuken 2024-10-12 11:06:11 -04:00
parent 9f8f5a5279
commit 3545ed100c
2 changed files with 4 additions and 4 deletions

View file

@ -305,8 +305,8 @@ connecting = [accent]Connecting...
reconnecting = [accent]Reconnecting...
connecting.data = [accent]Loading world data...
server.port = Port:
server.addressinuse = Address already in use!
server.invalidport = Invalid port number!
server.error.addressinuse = [scarlet]Failed to open server on port 6567.[]\n\nMake sure no other Mindustry servers are running on your device or network!
server.error = [scarlet]Error hosting server.
save.new = New Save
save.overwrite = Are you sure you want to overwrite\nthis save slot?

View file

@ -9,7 +9,7 @@ import mindustry.game.EventType.*;
import mindustry.gen.*;
import mindustry.ui.*;
import java.io.*;
import java.util.*;
import static mindustry.Vars.*;
@ -90,8 +90,8 @@ public class HostDialog extends BaseDialog{
}
}catch(IOException e){
ui.showException("@server.error", e);
}catch(Exception e){
ui.showException(e.getMessage() != null && e.getMessage().toLowerCase(Locale.ROOT).contains("address already in use") ? "@server.error.addressinuse" : "@server.error", e);
}
ui.loadfrag.hide();
hide();