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... reconnecting = [accent]Reconnecting...
connecting.data = [accent]Loading world data... connecting.data = [accent]Loading world data...
server.port = Port: server.port = Port:
server.addressinuse = Address already in use!
server.invalidport = Invalid port number! 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. server.error = [scarlet]Error hosting server.
save.new = New Save save.new = New Save
save.overwrite = Are you sure you want to overwrite\nthis save slot? 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.gen.*;
import mindustry.ui.*; import mindustry.ui.*;
import java.io.*; import java.util.*;
import static mindustry.Vars.*; import static mindustry.Vars.*;
@@ -90,8 +90,8 @@ public class HostDialog extends BaseDialog{
} }
}catch(IOException e){ }catch(Exception e){
ui.showException("@server.error", 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(); ui.loadfrag.hide();
hide(); hide();