Improved LAN discovery-- fixed #55

This commit is contained in:
Anuken
2018-01-13 11:10:49 -05:00
parent 5e2173fc54
commit 7c014de2c5
8 changed files with 64 additions and 18 deletions

View File

@@ -3,9 +3,11 @@ package io.anuke.mindustry.net;
public class Address {
public final String name;
public final String address;
public final int players;
public Address(String name, String address){
public Address(String name, String address, int players){
this.name = name;
this.address = address;
this.players = players;
}
}

View File

@@ -28,6 +28,7 @@ public class Net{
private static IntMap<StreamBuilder> streams = new IntMap<>();
private static AsyncExecutor executor = new AsyncExecutor(4);
/**Sets the client loaded status, or whether it will recieve normal packets from the server.*/
public static void setClientLoaded(boolean loaded){
clientLoaded = loaded;
}

View File

@@ -96,6 +96,9 @@ public class JoinDialog extends FloatingDialog {
}).width(w).height(80f).pad(4f).get();
button.left();
button.row();
button.add("[lightgray]" + (a.players != 1 ? Bundles.format("text.players", a.players) :
Bundles.format("text.players.single", a.players)));
button.row();
button.add("[lightgray]" + a.address + " / " + Vars.port).pad(4).left();
hosts.row();

View File

@@ -102,7 +102,7 @@ public class WeaponBlocks{
shootsound = "bigshot";
rotatespeed = 0.2f;
range = 120;
reload = 70f;
reload = 55f;
bullet = BulletType.flak;
shots = 3;
inaccuracy = 9f;