diff --git a/core/assets-raw/fontgen/config.json b/core/assets-raw/fontgen/config.json index b0e68d3757..7d79a71094 100644 --- a/core/assets-raw/fontgen/config.json +++ b/core/assets-raw/fontgen/config.json @@ -140,12 +140,6 @@ "code": 62208, "src": "fontawesome" }, - { - "uid": "bbfb51903f40597f0b70fd75bc7b5cac", - "css": "trash", - "code": 61944, - "src": "fontawesome" - }, { "uid": "3c961c1a8d874815856fc6637dc5a13c", "css": "file-image", @@ -454,12 +448,6 @@ "code": 59462, "src": "typicons" }, - { - "uid": "d5fabfa46384953ae055fceacb2229a7", - "css": "refresh", - "code": 59463, - "src": "elusive" - }, { "uid": "9e33d50c92e84bd26d83d1f37d6f0d57", "css": "admin", @@ -720,12 +708,6 @@ "fill" ] }, - { - "uid": "667b873c8422e4cab006df8422cb51c5", - "css": "pencil", - "code": 59413, - "src": "iconic" - }, { "uid": "d9d4c18716c0d8b23485258e35d9e3a9", "css": "paste", @@ -795,6 +777,48 @@ "search": [ "terrain" ] + }, + { + "uid": "c97c45befeea2eaee193c77fc6c6fd64", + "css": "trash", + "code": 59413, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M260.4 52.1Q270.8 20.8 302.1 10.4 333.3 0 375 0 416.7 0 458.3 0 500 0 531.3 10.4 562.5 20.8 572.9 52.1 583.3 83.3 593.8 114.6 604.2 145.8 635.4 156.3 666.7 166.7 708.3 166.7 750 166.7 781.3 177.1 812.5 187.5 822.9 218.8 833.3 250 833.3 291.7 833.3 333.3 833.3 375 833.3 416.7 822.9 447.9 812.5 479.2 791.7 500 770.8 520.8 760.4 552.1 750 583.3 750 625 750 666.7 750 708.3 750 750 750 791.7 750 833.3 750 875 750 916.7 739.6 947.9 729.2 979.2 697.9 989.6 666.7 1000 625 1000 583.3 1000 541.7 1000 500 1000 458.3 1000 416.7 1000 375 1000 333.3 1000 291.7 1000 250 1000 208.3 1000 166.7 1000 135.4 989.6 104.2 979.2 93.8 947.9 83.3 916.7 83.3 875 83.3 833.3 83.3 791.7 83.3 750 83.3 708.3 83.3 666.7 83.3 625 83.3 583.3 72.9 552.1 62.5 520.8 41.7 500 20.8 479.2 10.4 447.9 0 416.7 0 375 0 333.3 0 291.7 0 250 10.4 218.8 20.8 187.5 52.1 177.1 83.3 166.7 125 166.7 166.7 166.7 197.9 156.3 229.2 145.8 239.6 114.6 250 83.3 260.4 52.1M177.1 864.6Q187.5 895.8 208.3 895.8 229.2 895.8 239.6 864.6 250 833.3 250 791.7 250 750 250 708.3 250 666.7 250 625 250 583.3 239.6 552.1 229.2 520.8 208.3 520.8 187.5 520.8 177.1 552.1 166.7 583.3 166.7 625 166.7 666.7 166.7 708.3 166.7 750 166.7 791.7 166.7 833.3 177.1 864.6M385.4 906.3Q416.7 916.7 447.9 906.3 479.2 895.8 489.6 864.6 500 833.3 500 791.7 500 750 500 708.3 500 666.7 500 625 500 583.3 489.6 552.1 479.2 520.8 447.9 510.4 416.7 500 385.4 510.4 354.2 520.8 343.8 552.1 333.3 583.3 333.3 625 333.3 666.7 333.3 708.3 333.3 750 333.3 791.7 333.3 833.3 343.8 864.6 354.2 895.8 385.4 906.3M593.8 864.6Q604.2 895.8 625 895.8 645.8 895.8 656.3 864.6 666.7 833.3 666.7 791.7 666.7 750 666.7 708.3 666.7 666.7 666.7 625 666.7 583.3 656.3 552.1 645.8 520.8 625 520.8 604.2 520.8 593.8 552.1 583.3 583.3 583.3 625 583.3 666.7 583.3 708.3 583.3 750 583.3 791.7 583.3 833.3 593.8 864.6M625 416.7Q666.7 416.7 697.9 406.3 729.2 395.8 739.6 364.6 750 333.3 739.6 302.1 729.2 270.8 697.9 260.4 666.7 250 625 250 583.3 250 541.7 250 500 250 458.3 250 416.7 250 375 250 333.3 250 291.7 250 250 250 208.3 250 166.7 250 135.4 260.4 104.2 270.8 93.8 302.1 83.3 333.3 93.8 364.6 104.2 395.8 135.4 406.3 166.7 416.7 208.3 416.7 250 416.7 291.7 416.7 333.3 416.7 375 416.7 416.7 416.7 458.3 416.7 500 416.7 541.7 416.7 583.3 416.7 625 416.7M385.4 156.3Q416.7 166.7 447.9 156.3 479.2 145.8 479.2 125 479.2 104.2 447.9 93.8 416.7 83.3 385.4 93.8 354.2 104.2 354.2 125 354.2 145.8 385.4 156.3", + "width": 833 + }, + "search": [ + "trash" + ] + }, + { + "uid": "7e5b51e48fad210964d9b2ef40e120ca", + "css": "refresh", + "code": 59463, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M178.6 0C154.8 0 133.9 3 116.1 8.9 98.2 14.9 83.3 23.8 71.4 35.7L35.7 71.4C23.8 83.3 14.9 98.2 8.9 116.1 3 133.9 0 154.8 0 178.6V250 321.4 392.9 464.3C0 488.1 3 508.9 8.9 526.8 14.9 544.6 26.8 556.5 44.6 562.5 62.5 568.5 80.4 568.5 98.2 562.5 116.1 556.5 128 544.6 133.9 526.8 139.9 508.9 142.9 488.1 142.9 464.3V392.9 321.4 250C142.9 226.2 145.8 205.4 151.8 187.5 157.7 169.6 169.6 157.7 187.5 151.8 205.4 145.8 226.2 142.9 250 142.9H321.4 392.9 464.3 535.7 607.1C631 142.9 651.8 145.8 669.6 151.8 687.5 157.7 696.4 166.7 696.4 178.6 696.4 190.5 690.5 202.4 678.6 214.3 666.7 226.2 660.7 238.1 660.7 250 660.7 261.9 669.6 270.8 687.5 276.8 705.4 282.7 726.2 285.7 750 285.7H821.4C845.2 285.7 866.1 282.7 883.9 276.8 901.8 270.8 913.7 258.9 919.6 241.1 925.6 223.2 928.6 202.4 928.6 178.6V107.1C928.6 83.3 925.6 62.5 919.6 44.6 913.7 26.8 904.8 17.9 892.9 17.9 881 17.9 869 23.8 857.1 35.7 845.2 47.6 833.3 53.6 821.4 53.6 809.5 53.6 797.6 47.6 785.7 35.7 773.8 23.8 758.9 14.9 741.1 8.9 723.2 3 702.4 0 678.6 0H607.1 535.7 464.3 392.9 321.4 250ZM928.6 433C919.6 433 910.7 434.5 901.8 437.5 883.9 443.5 872 455.4 866.1 473.2 860.1 491.1 857.1 511.9 857.1 535.7V607.1 678.6 750C857.1 773.8 854.2 794.6 848.2 812.5 842.3 830.4 830.4 842.3 812.5 848.2 794.6 854.2 773.8 857.1 750 857.1H678.6 607.1 535.7 464.3 392.9C369 857.1 348.2 854.2 330.4 848.2 312.5 842.3 303.6 833.3 303.6 821.4 303.6 809.5 309.5 797.6 321.4 785.7 333.3 773.8 339.3 761.9 339.3 750 339.3 738.1 330.4 729.2 312.5 723.2 294.6 717.3 273.8 714.3 250 714.3H178.6C154.8 714.3 133.9 717.3 116.1 723.2 98.2 729.2 86.3 741.1 80.4 758.9 74.4 776.8 71.4 797.6 71.4 821.4V892.9C71.4 916.7 74.4 937.5 80.4 955.4 86.3 973.2 95.2 982.1 107.1 982.1 119 982.1 131 976.2 142.9 964.3 154.8 952.4 166.7 946.4 178.6 946.4 190.5 946.4 202.4 952.4 214.3 964.3 226.2 976.2 241.1 985.1 258.9 991.1 276.8 997 297.6 1000 321.4 1000H392.9 464.3 535.7 607.1 678.6 750 821.4C845.2 1000 866.1 997 883.9 991.1 901.8 985.1 916.7 976.2 928.6 964.3L964.3 928.6C976.2 916.7 985.1 901.8 991.1 883.9 997 866.1 1000 845.2 1000 821.4V750 678.6 607.1 535.7C1000 511.9 997 491.1 991.1 473.2 985.1 455.4 973.2 443.5 955.4 437.5 946.4 434.5 937.5 433 928.6 433Z", + "width": 1000 + }, + "search": [ + "refresh" + ] + }, + { + "uid": "59925475e7cc98ccd821771cff586bb6", + "css": "pencil_", + "code": 59476, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M836.4 0C824.2 0 812.1 6.1 800 18.2L763.6 54.5 727.3 90.9 690.9 127.3C678.8 139.4 672.7 151.5 672.7 163.6 672.7 175.8 678.8 187.9 690.9 200L727.3 236.4 763.6 272.7 800 309.1C812.1 321.2 824.2 327.3 836.4 327.3 848.5 327.3 860.6 321.2 872.7 309.1L909.1 272.7 945.5 236.4 981.8 200C993.9 187.9 1000 175.8 1000 163.6 1000 151.5 993.9 139.4 981.8 127.3L945.5 90.9 909.1 54.5 872.7 18.2C860.6 6.1 848.5 0 836.4 0ZM545.5 290.9C533.3 290.9 521.2 297 509.1 309.1L472.7 345.5 436.4 381.8 400 418.2 363.6 454.5 327.3 490.9 290.9 527.3 254.5 563.6 218.2 600 181.8 636.4 145.5 672.7 109.1 709.1 72.7 745.5 36.4 781.8C24.2 793.9 15.2 809.1 9.1 827.3 3 845.5 0 866.7 0 890.9 0 915.2 3 936.4 9.1 954.5 15.2 972.7 27.3 984.8 45.5 990.9 63.6 997 84.8 1000 109.1 1000 133.3 1000 154.5 997 172.7 990.9 190.9 984.8 206.1 975.8 218.2 963.6L254.5 927.3 290.9 890.9 327.3 854.5 363.6 818.2 400 781.8 436.4 745.5 472.7 709.1 509.1 672.7 545.5 636.4 581.8 600 618.2 563.6 654.5 527.3 690.9 490.9C703 478.8 709.1 466.7 709.1 454.5 709.1 442.4 703 430.3 690.9 418.2L654.5 381.8 618.2 345.5 581.8 309.1C569.7 297 557.6 290.9 545.5 290.9ZM254.5 654.5C266.7 654.5 278.8 660.6 290.9 672.7L327.3 709.1C339.4 721.2 345.5 733.3 345.5 745.5 345.5 757.6 339.4 769.7 327.3 781.8L290.9 818.2 254.5 854.5 218.2 890.9C206.1 903 190.9 912.1 172.7 918.2 154.5 924.2 136.4 924.2 118.2 918.2 100 912.1 87.9 900 81.8 881.8 75.8 863.6 75.8 845.5 81.8 827.3 87.9 809.1 97 793.9 109.1 781.8L145.5 745.5 181.8 709.1 218.2 672.7C230.3 660.6 242.4 654.5 254.5 654.5Z", + "width": 1000 + }, + "search": [ + "pencil" + ] } ] -} \ No newline at end of file +} diff --git a/core/assets-raw/fontgen/icons/pencil.svg b/core/assets-raw/fontgen/icons/pencil.svg new file mode 100644 index 0000000000..f2bfa70403 --- /dev/null +++ b/core/assets-raw/fontgen/icons/pencil.svg @@ -0,0 +1,62 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/core/assets-raw/fontgen/icons/refresh.svg b/core/assets-raw/fontgen/icons/refresh.svg new file mode 100644 index 0000000000..1cde3c7e11 --- /dev/null +++ b/core/assets-raw/fontgen/icons/refresh.svg @@ -0,0 +1,62 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/core/assets-raw/fontgen/icons/trash.svg b/core/assets-raw/fontgen/icons/trash.svg new file mode 100644 index 0000000000..22ed1dee35 --- /dev/null +++ b/core/assets-raw/fontgen/icons/trash.svg @@ -0,0 +1,63 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/core/assets/fonts/font.ttf b/core/assets/fonts/font.ttf index 06002ee2ab..6280981559 100644 Binary files a/core/assets/fonts/font.ttf and b/core/assets/fonts/font.ttf differ diff --git a/core/assets/fonts/icon.ttf b/core/assets/fonts/icon.ttf index f29f1b60fe..ac50ebe006 100644 Binary files a/core/assets/fonts/icon.ttf and b/core/assets/fonts/icon.ttf differ diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index 65f28f7497..ca5a30f5c4 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -411,6 +411,7 @@ public class Administration{ /** Server configuration definition. Each config value can be a string, boolean or number. */ public enum Config{ name("The server name as displayed on clients.", "Server", "servername"), + desc("The server description, displayed under the name. Max 100 characters.", "off"), port("The port to host on.", Vars.port), autoUpdate("Whether to auto-update and exit when a new bleeding-edge update arrives.", false), showConnectMessages("Whether to display connect/disconnect messages.", true), diff --git a/core/src/mindustry/net/ArcNetProvider.java b/core/src/mindustry/net/ArcNetProvider.java index 68fc3a08a4..ccfdafb94f 100644 --- a/core/src/mindustry/net/ArcNetProvider.java +++ b/core/src/mindustry/net/ArcNetProvider.java @@ -21,7 +21,7 @@ import static mindustry.Vars.*; public class ArcNetProvider implements NetProvider{ final Client client; - final Prov packetSupplier = () -> new DatagramPacket(new byte[256], 256); + final Prov packetSupplier = () -> new DatagramPacket(new byte[512], 512); final Server server; final CopyOnWriteArrayList connections = new CopyOnWriteArrayList<>(); diff --git a/core/src/mindustry/net/Host.java b/core/src/mindustry/net/Host.java index 5c3b010c45..c2319bc2b7 100644 --- a/core/src/mindustry/net/Host.java +++ b/core/src/mindustry/net/Host.java @@ -6,7 +6,7 @@ import mindustry.game.*; public class Host{ public final String name; public final String address; - public final String mapname; + public final String mapname, description; public final int wave; public final int players, playerLimit; public final int version; @@ -14,7 +14,7 @@ public class Host{ public final Gamemode mode; public int ping, port = Vars.port; - public Host(String name, String address, String mapname, int wave, int players, int version, String versionType, Gamemode mode, int playerLimit){ + public Host(String name, String address, String mapname, int wave, int players, int version, String versionType, Gamemode mode, int playerLimit, String description){ this.name = name; this.address = address; this.players = players; @@ -24,5 +24,6 @@ public class Host{ this.versionType = versionType; this.playerLimit = playerLimit; this.mode = mode; + this.description = description; } } diff --git a/core/src/mindustry/net/NetworkIO.java b/core/src/mindustry/net/NetworkIO.java index 1c6e1acba2..27811fed9f 100644 --- a/core/src/mindustry/net/NetworkIO.java +++ b/core/src/mindustry/net/NetworkIO.java @@ -63,9 +63,10 @@ public class NetworkIO{ public static ByteBuffer writeServerData(){ String name = (headless ? Config.name.string() : player.name); + String description = headless && !Config.desc.string().equals("off") ? Config.desc.string() : ""; String map = world.getMap() == null ? "None" : world.getMap().name(); - ByteBuffer buffer = ByteBuffer.allocate(256); + ByteBuffer buffer = ByteBuffer.allocate(512); writeString(buffer, name, 100); writeString(buffer, map); @@ -77,6 +78,8 @@ public class NetworkIO{ buffer.put((byte)Gamemode.bestFit(state.rules).ordinal()); buffer.putInt(netServer.admins.getPlayerLimit()); + + writeString(buffer, description, 100); return buffer; } @@ -89,8 +92,9 @@ public class NetworkIO{ String vertype = readString(buffer); Gamemode gamemode = Gamemode.all[buffer.get()]; int limit = buffer.getInt(); + String description = readString(buffer); - return new Host(host, hostAddress, map, wave, players, version, vertype, gamemode, limit); + return new Host(host, hostAddress, map, wave, players, version, vertype, gamemode, limit, description); } private static void writeString(ByteBuffer buffer, String string, int maxlen){ diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index a6a69abd08..397fee4f64 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -139,16 +139,16 @@ public class JoinDialog extends FloatingDialog{ } } - }).margin(3f).padTop(6f).top().right(); + }).margin(3f).pad(2).padTop(6f).top().right(); inner.addImageButton(Icon.refresh, Styles.emptyi, () -> { refreshServer(server); - }).margin(3f).padTop(6f).top().right(); + }).margin(3f).pad(2).padTop(6f).top().right(); inner.addImageButton(Icon.pencil, Styles.emptyi, () -> { renaming = server; add.show(); - }).margin(3f).padTop(6f).top().right(); + }).margin(3f).pad(2).padTop(6f).top().right(); inner.addImageButton(Icon.trash, Styles.emptyi, () -> { ui.showConfirm("$confirm", "$server.delete", () -> { @@ -157,7 +157,7 @@ public class JoinDialog extends FloatingDialog{ setupRemote(); refreshRemote(); }); - }).margin(3f).pad(6).top().right(); + }).margin(3f).pad(2).pad(6).top().right(); button.row(); @@ -179,7 +179,7 @@ public class JoinDialog extends FloatingDialog{ net.pingHost(server.ip, server.port, host -> setupServer(server, host), e -> { server.content.clear(); - server.content.add("$host.invalid"); + server.content.add("$host.invalid").padBottom(4); }); } @@ -212,6 +212,10 @@ public class JoinDialog extends FloatingDialog{ content.table(t -> { t.add("[lightgray]" + host.name + " " + versionString).width(targetWidth() - 10f).left().get().setEllipsis(true); t.row(); + if(!host.description.isEmpty()){ + t.add("[gray]" + host.description).width(targetWidth() - 10f).left().wrap(); + t.row(); + } t.add("[lightgray]" + (Core.bundle.format("players" + (host.players == 1 && host.playerLimit <= 0 ? ".single" : ""), (host.players == 0 ? "[lightgray]" : "[accent]") + host.players + (host.playerLimit > 0 ? "[lightgray]/[accent]" + host.playerLimit : "")+ "[lightgray]"))).left(); t.row(); t.add("[lightgray]" + Core.bundle.format("save.map", host.mapname) + "[lightgray] / " + host.mode.toString()).width(targetWidth() - 10f).left().get().setEllipsis(true); diff --git a/desktop/src/mindustry/desktop/steam/SNet.java b/desktop/src/mindustry/desktop/steam/SNet.java index e27a9d8c52..579b2b39c6 100644 --- a/desktop/src/mindustry/desktop/steam/SNet.java +++ b/desktop/src/mindustry/desktop/steam/SNet.java @@ -315,7 +315,8 @@ public class SNet implements SteamNetworkingCallback, SteamMatchmakingCallback, Strings.parseInt(smat.getLobbyData(lobby, "version"), -1), smat.getLobbyData(lobby, "versionType"), Gamemode.valueOf(smat.getLobbyData(lobby, "gamemode")), - smat.getLobbyMemberLimit(lobby) + smat.getLobbyMemberLimit(lobby), + "" ); hosts.add(out); }catch(Exception e){