diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index fbd1ab4b42..6535ec4b0b 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -946,11 +946,11 @@ unit.eradicator.name = Eradicator unit.lich.name = Lich unit.reaper.name = Reaper tutorial.next = [lightgray] -tutorial.intro = You have entered the[scarlet] Mindustry Tutorial.[]\nBegin by[accent] mining copper[]. Use [[WASD] to move, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper -tutorial.drill = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nClick the drill tab in the bottom right.\nSelect the[accent] mechanical drill[]. Place it on a copper vein by clicking.\n[accent]Right-click[] to stop building, and[accent] Hold Ctrl while scrolling[] to zoom in and out. +tutorial.intro = You have entered the[scarlet] Mindustry Tutorial.[]\nUse [[WASD] to move.\n[accent] Hold [[Ctrl] while scrolling[] to zoom in and out.\nBegin by[accent] mining copper[]. Move close to it, then tap a copper ore vein near your core to do this.\n\n[accent]{0}/{1} copper +tutorial.drill = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nClick the drill tab in the bottom right.\nSelect the[accent] mechanical drill[]. Place it on a copper vein by clicking.\n[accent]Right-click[] to stop building. tutorial.drill.mobile = Mining manually is inefficient.\n[accent]Drills []can mine automatically.\nTap the drill tab in the bottom right.\nSelect the[accent] mechanical drill[].\nPlace it on a copper vein by tapping, then press the[accent] checkmark[] below to confirm your selection.\nPress the[accent] X button[] to cancel placement. tutorial.blockinfo = Each block has different stats. Each drill can only mine certain ores.\nTo check a block's info and stats,[accent] tap the "?" button while selecting it in the build menu.[]\n\n[accent]Access the Mechanical Drill's stats now.[] -tutorial.conveyor = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent]Hold down the mouse to place in a line.[]\nHold[accent] CTRL[] while selecting a line to place diagonally.\n\n[accent]Place 2 conveyors with the line tool, then deliver an item into the core. +tutorial.conveyor = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent]Hold down the mouse to place in a line.[]\nHold[accent] CTRL[] while selecting a line to place diagonally.\nUse the scrollwheel to rotate blocks before placing them.\n[accent]Place 2 conveyors with the line tool, then deliver an item into the core. tutorial.conveyor.mobile = [accent]Conveyors[] are used to transport items to the core.\nMake a line of conveyors from the drill to the core.\n[accent] Place in a line by holding down your finger for a few seconds[] and dragging in a direction.\n\n[accent]Place 2 conveyors with the line tool, then deliver an item into the core. tutorial.turret = Once an item enters your core, it can be used for building.\nKeep in mind that not all items can be used for building.\nItems that are not used for building, such as[accent] coal[] or[accent] scrap[], cannot be put into the core.\nDefensive structures must be built to repel the[lightgray] enemy[].\nBuild a[accent] duo turret[] near your base. tutorial.drillturret = Duo turrets require[accent] copper ammo []to shoot.\nPlace a drill near the turret.\nLead conveyors into the turret to supply it with copper.\n\n[accent]Ammo delivered: 0/1 diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index e3a45b10b6..2501ea3d01 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -76,6 +76,7 @@ public class NetClient implements ApplicationListener{ ConnectPacket c = new ConnectPacket(); c.name = player.name; + c.mods = mods.getModStrings(); c.mobile = mobile; c.versionType = Version.type; c.color = Color.rgba8888(player.color); diff --git a/core/src/io/anuke/mindustry/mod/Mods.java b/core/src/io/anuke/mindustry/mod/Mods.java index e784333376..aa8bd9a5e9 100644 --- a/core/src/io/anuke/mindustry/mod/Mods.java +++ b/core/src/io/anuke/mindustry/mod/Mods.java @@ -216,6 +216,11 @@ public class Mods implements Loadable{ return loaded; } + /** @return a list of mods and versions, in the format name:version. */ + public Array getModStrings(){ + return loaded.select(l -> !l.meta.hidden).map(l -> l.name + ":" + l.meta.version); + } + /** Iterates through each mod with a main class.*/ public void each(Consumer cons){ loaded.each(p -> p.mod != null, p -> cons.accept(p.mod)); diff --git a/core/src/io/anuke/mindustry/net/Packets.java b/core/src/io/anuke/mindustry/net/Packets.java index e7e92a9a2b..1c488183c1 100644 --- a/core/src/io/anuke/mindustry/net/Packets.java +++ b/core/src/io/anuke/mindustry/net/Packets.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.net; import io.anuke.arc.Core; +import io.anuke.arc.collection.*; import io.anuke.arc.util.serialization.Base64Coder; import io.anuke.mindustry.game.Version; import io.anuke.mindustry.io.TypeIO; @@ -65,7 +66,7 @@ public class Packets{ public static class ConnectPacket implements Packet{ public int version; public String versionType; - public String mods; + public Array mods = new Array<>(); public String name, uuid, usid; public boolean mobile; public int color; @@ -74,12 +75,15 @@ public class Packets{ public void write(ByteBuffer buffer){ buffer.putInt(Version.build); TypeIO.writeString(buffer, versionType); - TypeIO.writeString(buffer, mods); TypeIO.writeString(buffer, name); TypeIO.writeString(buffer, usid); buffer.put(mobile ? (byte)1 : 0); buffer.putInt(color); buffer.put(Base64Coder.decode(uuid)); + buffer.putInt(mods.size); + for(int i = 0; i < mods.size; i++){ + TypeIO.writeString(buffer, mods.get(i)); + } } @Override @@ -88,12 +92,15 @@ public class Packets{ versionType = TypeIO.readString(buffer); name = TypeIO.readString(buffer); usid = TypeIO.readString(buffer); - mods = TypeIO.readString(buffer); mobile = buffer.get() == 1; color = buffer.getInt(); byte[] idbytes = new byte[8]; buffer.get(idbytes); uuid = new String(Base64Coder.encode(idbytes)); + int totalMods = buffer.getInt(); + for(int i = 0; i < totalMods; i++){ + mods.add(TypeIO.readString(buffer)); + } } } diff --git a/gradle.properties b/gradle.properties index 227bb4e6fa..d707230c05 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=678237e0fd2a2e0c26de1ea562960d1effe5ab97 +archash=840b75daba69d93a5c493e740a573463e03f9ada