diff --git a/core/src/io/anuke/mindustry/core/NetClient.java b/core/src/io/anuke/mindustry/core/NetClient.java index 65f4700699..7e959ad010 100644 --- a/core/src/io/anuke/mindustry/core/NetClient.java +++ b/core/src/io/anuke/mindustry/core/NetClient.java @@ -198,6 +198,16 @@ public class NetClient implements ApplicationListener{ return "[#" + player.color.toString().toUpperCase() + "]" + name; } + @Remote(called = Loc.client, variants = Variant.one) + public static void onConnect(String ip, int port){ + netClient.disconnectQuietly(); + state.set(State.menu); + logic.reset(); + + Vars.netClient.beginConnecting(); + net.connect(ip, port, () -> {}); + } + @Remote(targets = Loc.client) public static void onPing(Player player, long time){ Call.onPingResponse(player.con, time); @@ -479,4 +489,4 @@ public class NetClient implements ApplicationListener{ return result; } } -} \ No newline at end of file +}