From 9e53f3d86bf78718a249b9ac37d6ae5baf41da6f Mon Sep 17 00:00:00 2001 From: RebornTrack970 <62565267+RebornTrack970@users.noreply.github.com> Date: Tue, 15 Mar 2022 17:48:12 +0300 Subject: [PATCH 1/9] that one omega server is back. (#6639) --- servers_v7.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers_v7.json b/servers_v7.json index c0b95b8cf9..23befc68db 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -17,7 +17,7 @@ }, { "name": "Omega", - "address": ["omegam.mindustry.me:25577", "omegam.mindustry.me"] + "address": ["omegam.mindustry.me:25577", "omegam.mindustry.me", "omegam.mindustry.me:25586"] }, { "name": "MeowLand", From 7ca1663d8988627a283f581ba2227714cf84bc1c Mon Sep 17 00:00:00 2001 From: Darklord2996 <58330738+mick-2006@users.noreply.github.com> Date: Wed, 16 Mar 2022 11:25:56 +1000 Subject: [PATCH 2/9] Update to servers_v6.json - Update Domain (#6640) * Update to servers_v6.json - Update Domain Im stupid and did not format it correctly i've removed the screwed branches on my fork here's the fixed one im so stupid *pain* This is to change the port of surrealment as the previous ip was redirected to v7 ill be adding it to that list shortly (it is using the same plugins everything just a version split) * Update servers_v6.json --- servers_v6.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servers_v6.json b/servers_v6.json index c602957336..8bcdc35e4e 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -48,8 +48,8 @@ "address": ["mindustry.ddns.net", "mindustry.ddns.net:1000", "mindustry.ddns.net:2000", "mindustry.ddns.net:3000", "mindustry.ddns.net:4000"] }, { - "name": "Surrealment", - "address": ["md.surrealment.com"] + "name": "Surrealment v6", + "address": ["md.surrealment.com:6566"] }, { "name": "ALEX", From 5271edf9ebedbe4040899ccc0f4702f9ffe455db Mon Sep 17 00:00:00 2001 From: Darklord2996 <58330738+mick-2006@users.noreply.github.com> Date: Wed, 16 Mar 2022 11:26:11 +1000 Subject: [PATCH 3/9] Update to servers_v7.json - New Domain (#6641) * Update to servers_v7 - New Domain Updating server list to include New surrealment ip address as read other pull rq for surrealment v6 domain update * Update servers_v7.json --- servers_v7.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/servers_v7.json b/servers_v7.json index 23befc68db..59bfb6356d 100644 --- a/servers_v7.json +++ b/servers_v7.json @@ -82,5 +82,9 @@ { "name": "M-DE", "address": ["mindustry.inc.li:6569", "mindustry.inc.li:6560"] + }, + { + "name": "Surrealment v7", + "address": ["md.surrealment.com:6567"] } ] From 8ec2e406108012be7801a8f773d091c3ea325eb6 Mon Sep 17 00:00:00 2001 From: BalaM314 <71201189+BalaM314@users.noreply.github.com> Date: Thu, 24 Mar 2022 20:12:44 +0530 Subject: [PATCH 4/9] Add "Exiting to reload mods." logger message (#6662) To allow for the game to be automatically restarted --- core/src/mindustry/ui/dialogs/ModsDialog.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/ui/dialogs/ModsDialog.java b/core/src/mindustry/ui/dialogs/ModsDialog.java index 5a7bf4d692..45699b0d00 100644 --- a/core/src/mindustry/ui/dialogs/ModsDialog.java +++ b/core/src/mindustry/ui/dialogs/ModsDialog.java @@ -323,7 +323,10 @@ public class ModsDialog extends BaseDialog{ } private void reload(){ - ui.showInfoOnHidden("@mods.reloadexit", () -> Core.app.exit()); + ui.showInfoOnHidden("@mods.reloadexit", () -> { + Log.info("Exiting to reload mods."); + Core.app.exit(); + }); } private void showMod(LoadedMod mod){ From 580fcd1fbce48e6e06300ff0386ecbf98072955a Mon Sep 17 00:00:00 2001 From: TranquillyUnpleasant <62061444+TranquillyUnpleasant@users.noreply.github.com> Date: Mon, 28 Mar 2022 16:09:01 +0200 Subject: [PATCH 5/9] Apply color stripping to player names in console wherever applicable. (#6672) * utility method * plainName for all console outputs * plainLastName for all console outputs * some formats * slightly reformat trace output * Slightly nicer admin indicator * A space --- core/src/mindustry/core/NetClient.java | 4 +-- core/src/mindustry/core/NetServer.java | 24 ++++++++-------- .../mindustry/entities/comp/PlayerComp.java | 4 +++ core/src/mindustry/net/Administration.java | 4 +++ .../src/mindustry/server/ServerControl.java | 28 +++++++++---------- 5 files changed, 36 insertions(+), 28 deletions(-) diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 359cee22f0..3aef985afa 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -233,7 +233,7 @@ public class NetClient implements ApplicationListener{ //log commands before they are handled if(message.startsWith(netServer.clientCommands.getPrefix())){ //log with brackets - Log.info("<&fi@: @&fr>", "&lk" + player.name, "&lw" + message); + Log.info("<&fi@: @&fr>", "&lk" + player.plainName(), "&lw" + message); } //check if it's a command @@ -251,7 +251,7 @@ public class NetClient implements ApplicationListener{ } //server console logging - Log.info("&fi@: @", "&lc" + player.name, "&lw" + message); + Log.info("&fi@: @", "&lc" + player.plainName(), "&lw" + message); //invoke event for all clients but also locally //this is required so other clients get the correct name even if they don't know who's sending it yet diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 2a5e73b1a3..794ededd26 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -481,7 +481,7 @@ public class NetServer implements ApplicationListener{ } int sign = switch(arg[0].toLowerCase()){ - case "y", "yes" -> 1; + case "y", "yes" -> 1; case "n", "no" -> -1; default -> 0; }; @@ -560,7 +560,7 @@ public class NetServer implements ApplicationListener{ Call.playerDisconnect(player.id()); } - String message = Strings.format("&lb@&fi&lk has disconnected. &fi&lk[&lb@&fi&lk] (@)", player.name, player.uuid(), reason); + String message = Strings.format("&lb@&fi&lk has disconnected. [&lb@&fi&lk] (@)", player.plainName(), player.uuid(), reason); if(Config.showConnectMessages.bool()) info(message); } @@ -773,12 +773,12 @@ public class NetServer implements ApplicationListener{ public static void adminRequest(Player player, Player other, AdminAction action){ if(!player.admin && !player.isLocal()){ warn("ACCESS DENIED: Player @ / @ attempted to perform admin action '@' on '@' without proper security access.", - player.name, player.con == null ? "null" : player.con.address, action.name(), other == null ? null : other.name); + player.plainName(), player.con == null ? "null" : player.con.address, action.name(), other == null ? null : other.plainName()); return; } if(other == null || ((other.admin && !player.isLocal()) && other != player)){ - warn("@ attempted to perform admin action on nonexistant or admin player.", player.name); + warn("@ &fi&lk[&lb@&fi&lk]&fb attempted to perform admin action on nonexistant or admin player.", player.plainName(), player.uuid()); return; } @@ -788,15 +788,15 @@ public class NetServer implements ApplicationListener{ //no verification is done, so admins can hypothetically spam waves //not a real issue, because server owners may want to do just that logic.skipWave(); - info("&lc@ has skipped the wave.", player.name); + info("&lc@ &fi&lk[&lb@&fi&lk]&fb has skipped the wave.", player.plainName(), player.uuid()); }else if(action == AdminAction.ban){ netServer.admins.banPlayerID(other.con.uuid); netServer.admins.banPlayerIP(other.con.address); other.kick(KickReason.banned); - info("&lc@ has banned @.", player.name, other.name); + info("&lc@ &fi&lk[&lb@&fi&lk]&fb has banned @ &fi&lk[&lb@&fi&lk]&fb.", player.plainName(), player.uuid(), other.plainName(), other.uuid()); }else if(action == AdminAction.kick){ other.kick(KickReason.kick); - info("&lc@ has kicked @.", player.name, other.name); + info("&lc@ &fi&lk[&lb@&fi&lk]&fb has kicked @ &fi&lk[&lb@&fi&lk]&fb.", player.plainName(), player.uuid(), other.plainName(), other.uuid()); }else if(action == AdminAction.trace){ PlayerInfo stats = netServer.admins.getInfo(other.uuid()); TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.con.modclient, other.con.mobile, stats.timesJoined, stats.timesKicked); @@ -805,7 +805,7 @@ public class NetServer implements ApplicationListener{ }else{ NetClient.traceInfo(other, info); } - info("&lc@ has requested trace info of @.", player.name, other.name); + info("&lc@ &fi&lk[&lb@&fi&lk]&fb has requested trace info of @ &fi&lk[&lb@&fi&lk]&fb.", player.plainName(), player.uuid(), other.plainName(), other.uuid()); } } @@ -823,7 +823,7 @@ public class NetServer implements ApplicationListener{ if(Config.showConnectMessages.bool()){ Call.sendMessage("[accent]" + player.name + "[accent] has connected."); - String message = Strings.format("&lb@&fi&lk has connected. &fi&lk[&lb@&fi&lk]", player.name, player.uuid()); + String message = Strings.format("&lb@&fi&lk has connected. &fi&lk[&lb@&fi&lk]", player.plainName(), player.uuid()); info(message); } @@ -895,7 +895,7 @@ public class NetServer implements ApplicationListener{ short sent = 0; for(Building entity : Groups.build){ if(!entity.block.sync) continue; - sent ++; + sent++; dataStream.writeInt(entity.pos()); dataStream.writeShort(entity.block.id); @@ -935,7 +935,7 @@ public class NetServer implements ApplicationListener{ //write basic state data. Call.stateSnapshot(player.con, state.wavetime, state.wave, state.enemies, state.serverPaused, state.gameOver, - universe.seconds(), tps, GlobalConstants.rand.seed0, GlobalConstants.rand.seed1, syncStream.toByteArray()); + universe.seconds(), tps, GlobalConstants.rand.seed0, GlobalConstants.rand.seed1, syncStream.toByteArray()); syncStream.reset(); @@ -963,7 +963,7 @@ public class NetServer implements ApplicationListener{ Call.entitySnapshot(player.con, (short)sent, syncStream.toByteArray()); } - player.con.snapshotsSent ++; + player.con.snapshotsSent++; } String fixName(String name){ diff --git a/core/src/mindustry/entities/comp/PlayerComp.java b/core/src/mindustry/entities/comp/PlayerComp.java index 38a43cae87..5ef593fc25 100644 --- a/core/src/mindustry/entities/comp/PlayerComp.java +++ b/core/src/mindustry/entities/comp/PlayerComp.java @@ -314,6 +314,10 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra return "[#" + color.toString().toUpperCase() + "]" + name; } + String plainName(){ + return Strings.stripColors(name); + } + void sendMessage(String text){ if(isLocal()){ if(ui != null){ diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index 68736ffd37..2052d74290 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -568,6 +568,10 @@ public class Administration{ public PlayerInfo(){ } + + public String plainLastName(){ + return Strings.stripColors(lastName); + } } /** Handles chat messages from players and changes their contents. */ diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index e54abd1e92..f532991806 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -416,7 +416,7 @@ public class ServerControl implements ApplicationListener{ if(Groups.player.size() > 0){ info(" Players: @", Groups.player.size()); for(Player p : Groups.player){ - info(" @ / @", p.name, p.uuid()); + info(" @ @ / @", p.admin() ? "&r[A]&c" : "&b[P]&c", p.plainName(), p.uuid()); } }else{ info(" No players connected."); @@ -584,7 +584,7 @@ public class ServerControl implements ApplicationListener{ if(arg.length == 1){ info("'@' is currently @.", c.name(), c.get()); }else{ - if (arg[1].equals("default")){ + if(arg[1].equals("default")){ c.set(c.defaultValue); }else if(c.isBool()){ c.set(arg[1].equals("on") || arg[1].equals("true")); @@ -646,7 +646,7 @@ public class ServerControl implements ApplicationListener{ info("No whitelisted players found."); }else{ info("Whitelist:"); - whitelist.each(p -> info("- Name: @ / UUID: @", p.lastName, p.id)); + whitelist.each(p -> info("- Name: @ / UUID: @", p.plainLastName(), p.id)); } }else{ if(arg.length == 2){ @@ -657,10 +657,10 @@ public class ServerControl implements ApplicationListener{ }else{ if(arg[0].equals("add")){ netServer.admins.whitelist(arg[1]); - info("Player '@' has been whitelisted.", info.lastName); + info("Player '@' has been whitelisted.", info.plainLastName()); }else if(arg[0].equals("remove")){ netServer.admins.unwhitelist(arg[1]); - info("Player '@' has been un-whitelisted.", info.lastName); + info("Player '@' has been un-whitelisted.", info.plainLastName()); }else{ err("Incorrect usage. Provide add/remove as the second argument."); } @@ -749,7 +749,7 @@ public class ServerControl implements ApplicationListener{ }else{ info("Banned players [ID]:"); for(PlayerInfo info : bans){ - info(" @ / Last known name: '@'", info.id, info.lastName); + info(" @ / Last known name: '@'", info.id, info.plainLastName()); } } @@ -762,7 +762,7 @@ public class ServerControl implements ApplicationListener{ for(String string : ipbans){ PlayerInfo info = netServer.admins.findByIP(string); if(info != null){ - info(" '@' / Last known name: '@' / ID: '@'", string, info.lastName, info.id); + info(" '@' / Last known name: '@' / ID: '@'", string, info.plainLastName(), info.id); }else{ info(" '@' (No known name or info)", string); } @@ -783,7 +783,7 @@ public class ServerControl implements ApplicationListener{ if(info != null){ info.lastKicked = 0; - info("Pardoned player: @", info.lastName); + info("Pardoned player: @", info.plainLastName()); }else{ err("That ID can't be found."); } @@ -803,7 +803,7 @@ public class ServerControl implements ApplicationListener{ boolean add = arg[0].equals("add"); PlayerInfo target; - Player playert = Groups.player.find(p -> p.name.equalsIgnoreCase(arg[1])); + Player playert = Groups.player.find(p -> p.plainName().equalsIgnoreCase(Strings.stripColors(arg[1]))); if(playert != null){ target = playert.getInfo(); }else{ @@ -818,7 +818,7 @@ public class ServerControl implements ApplicationListener{ netServer.admins.unAdminPlayer(target.id); } if(playert != null) playert.admin = add; - info("Changed admin status of player: @", target.lastName); + info("Changed admin status of player: @", target.plainLastName()); }else{ err("Nobody with that name or ID could be found. If adding an admin by name, make sure they're online; otherwise, use their UUID."); } @@ -832,7 +832,7 @@ public class ServerControl implements ApplicationListener{ }else{ info("Admins:"); for(PlayerInfo info : admins){ - info(" &lm @ / ID: '@' / IP: '@'", info.lastName, info.id, info.lastIP); + info(" &lm @ / ID: '@' / IP: '@'", info.plainLastName(), info.id, info.lastIP); } } }); @@ -844,7 +844,7 @@ public class ServerControl implements ApplicationListener{ info("Players: @", Groups.player.size()); for(Player user : Groups.player){ PlayerInfo userInfo = user.getInfo(); - info(" &lm @ / ID: @ / IP: @ / Admin: @", userInfo.lastName, userInfo.id, userInfo.lastIP, userInfo.admin); + info(" @&lm @ / ID: @ / IP: @", userInfo.admin ? "&r[A]&c" : "&b[P]&c", userInfo.plainLastName(), userInfo.id, userInfo.lastIP, userInfo.admin); } } }); @@ -926,7 +926,7 @@ public class ServerControl implements ApplicationListener{ int i = 0; for(PlayerInfo info : infos){ - info("[@] Trace info for player '@' / UUID @", i++, info.lastName, info.id); + info("[@] Trace info for player '@' / UUID @ / RAW @", i++, info.plainLastName(), info.id, info.lastName); info(" all names used: @", info.names); info(" IP: @", info.lastIP); info(" all IPs used: @", info.ips); @@ -946,7 +946,7 @@ public class ServerControl implements ApplicationListener{ int i = 0; for(PlayerInfo info : infos){ - info("- [@] '@' / @", i++, info.lastName, info.id); + info("- [@] '@' / @", i++, info.plainLastName(), info.id); } }else{ info("Nobody with that name could be found."); From 3d507ae473cbfb7696925f56a298a01ac84f6932 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 28 Mar 2022 11:33:15 -0400 Subject: [PATCH 6/9] Update pr.yml --- .github/workflows/pr.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5888db4507..cb26450637 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,10 +8,12 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 16 + - name: Set up JDK 17 uses: actions/setup-java@v1 with: - java-version: 16 + java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 - name: Run unit tests and build JAR run: ./gradlew test desktop:dist - name: Upload desktop JAR for testing From fdc942cc6c2dad7f51de4778ff0266b9eb23520d Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 28 Mar 2022 11:33:27 -0400 Subject: [PATCH 7/9] Update push.yml --- .github/workflows/push.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0c6bd217c6..903cf7435e 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -21,6 +21,8 @@ jobs: uses: actions/setup-java@v1 with: java-version: 17 + - name: Setup Gradle + uses: gradle/gradle-build-action@v2 - name: Update bundles if: ${{ github.repository == 'Anuken/Mindustry' }} run: | From 12e1f328e87fa8ebe8d4eb7c36f339ba877d26e9 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 28 Mar 2022 11:56:45 -0400 Subject: [PATCH 8/9] testing compile times with gradle action --- gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle.properties b/gradle.properties index af4d58e5dd..0a6bb5628c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,6 +21,7 @@ kapt.include.compile.classpath=false kotlin.stdlib.default.dependency=false #needed for android compilation android.useAndroidX=true +org.gradle.caching=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 From 2bfc23c216eed2f2294171d34304b63ed284bacb Mon Sep 17 00:00:00 2001 From: buthed010203 Date: Mon, 28 Mar 2022 14:32:36 -0400 Subject: [PATCH 9/9] Cease node dumbness (#6670) * Cease. * Mobile players are second rate citizens * Undo config on ratelimit, revert PowerNode for loop * Fix being unable to drop items into core vaults when there are over 1k of the item already --- core/src/mindustry/input/InputHandler.java | 9 ++++++++- core/src/mindustry/world/blocks/power/PowerNode.java | 8 ++++---- .../src/mindustry/world/blocks/storage/StorageBlock.java | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index c283e516f3..2286a2999d 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -344,7 +344,14 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ public static void tileConfig(@Nullable Player player, Building build, @Nullable Object value){ if(build == null) return; if(net.server() && (!Units.canInteract(player, build) || - !netServer.admins.allowAction(player, ActionType.configure, build.tile, action -> action.config = value))) throw new ValidateException(player, "Player cannot configure a tile."); + !netServer.admins.allowAction(player, ActionType.configure, build.tile, action -> action.config = value))){ + var packet = new TileConfigCallPacket(); //undo the config on the client + packet.player = player; + packet.build = build; + packet.value = build.config(); + player.con.send(packet, true); + throw new ValidateException(player, "Player cannot configure a tile."); + } build.configured(player == null || player.dead() ? null : player.unit(), value); Core.app.post(() -> Events.fire(new ConfigEvent(build, player, value))); } diff --git a/core/src/mindustry/world/blocks/power/PowerNode.java b/core/src/mindustry/world/blocks/power/PowerNode.java index 2e89a47fca..10ffdfc425 100644 --- a/core/src/mindustry/world/blocks/power/PowerNode.java +++ b/core/src/mindustry/world/blocks/power/PowerNode.java @@ -355,7 +355,7 @@ public class PowerNode extends PowerBlock{ @Override public void placed(){ - if(net.client()) return; + if(net.client() || power.links.size > 0) return; getPotentialLinks(tile, team, other -> { if(!power.links.contains(other.pos())){ @@ -384,15 +384,15 @@ public class PowerNode extends PowerBlock{ return false; } - if(this == other){ - if(other.power.links.size == 0){ + if(this == other){ //double tapped + if(other.power.links.size == 0 || Core.input.shift()){ //find links int[] total = {0}; getPotentialLinks(tile, team, link -> { if(!insulated(this, link) && total[0]++ < maxNodes){ configure(link.pos()); } }); - }else{ + }else{ //clear links while(power.links.size > 0){ configure(power.links.get(0)); } diff --git a/core/src/mindustry/world/blocks/storage/StorageBlock.java b/core/src/mindustry/world/blocks/storage/StorageBlock.java index 9b0d482153..1fff319aee 100644 --- a/core/src/mindustry/world/blocks/storage/StorageBlock.java +++ b/core/src/mindustry/world/blocks/storage/StorageBlock.java @@ -84,7 +84,7 @@ public class StorageBlock extends Block{ @Override public int getMaximumAccepted(Item item){ - return itemCapacity; + return linkedCore != null ? linkedCore.getMaximumAccepted(item) : itemCapacity; } @Override