From e08eec42ac1fd81178a6300be7af95e04a0338e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=ED=82=A4=EC=97=90=EB=A5=B4?= <44261958+Kieaer@users.noreply.github.com> Date: Wed, 23 Oct 2019 06:17:36 +0900 Subject: [PATCH] Server to server (#855) * Update NetClient.java * Update NetClient.java * Update NetClient.java --- core/src/io/anuke/mindustry/core/NetClient.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 +}