diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 8c8498c03f..6c39803bf1 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -568,6 +568,34 @@ public class NetServer implements ApplicationListener{ player.con.hasDisconnected = true; } + //these functions are for debugging only, and will be removed! + + @Remote(targets = Loc.client, variants = Variant.one) + public static void requestDebugStatus(Player player){ + int flags = + (player.con.hasDisconnected ? 1 : 0) | + (player.con.hasConnected ? 2 : 0) | + (player.isAdded() ? 4 : 0) | + (player.con.hasBegunConnecting ? 8 : 0); + + Call.debugStatusClient(player.con, flags); + Call.debugStatusClientUnreliable(player.con, flags); + } + + @Remote(variants = Variant.both, priority = PacketPriority.high) + public static void debugStatusClient(int value){ + Log.info("[RELIABLE] Debug status received. disconnected = @, connected = @, added = @, begunConnecting = @", + (value & 1) != 0, (value & 2) != 0, (value & 4) != 0, (value & 8) != 0 + ); + } + + @Remote(variants = Variant.both, priority = PacketPriority.high, unreliable = true) + public static void debugStatusClientUnreliable(int value){ + Log.info("[UNRELIABLE] Debug status received. disconnected = @, connected = @, added = @, begunConnecting = @", + (value & 1) != 0, (value & 2) != 0, (value & 4) != 0, (value & 8) != 0 + ); + } + @Remote(targets = Loc.client) public static void serverPacketReliable(Player player, String type, String contents){ if(netServer.customPacketHandlers.containsKey(type)){ diff --git a/gradle.properties b/gradle.properties index 611d472faa..c72da51d2f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -24,4 +24,4 @@ android.useAndroidX=true #used for slow jitpack builds; TODO see if this actually works org.gradle.internal.http.socketTimeout=100000 org.gradle.internal.http.connectionTimeout=100000 -archash=00d1f312 +archash=0370ef92e5