Bugfixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.net;
|
package mindustry.net;
|
||||||
|
|
||||||
|
import mindustry.*;
|
||||||
import mindustry.game.*;
|
import mindustry.game.*;
|
||||||
|
|
||||||
public class Host{
|
public class Host{
|
||||||
@@ -11,7 +12,7 @@ public class Host{
|
|||||||
public final int version;
|
public final int version;
|
||||||
public final String versionType;
|
public final String versionType;
|
||||||
public final Gamemode mode;
|
public final Gamemode mode;
|
||||||
public int ping;
|
public int ping, port = Vars.port;
|
||||||
|
|
||||||
public Host(String name, String address, String mapname, int wave, int players, int version, String versionType, Gamemode mode, int playerLimit){
|
public Host(String name, String address, String mapname, int wave, int players, int version, String versionType, Gamemode mode, int playerLimit){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
|||||||
@@ -288,13 +288,12 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
local.table(Tex.button, t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering.any") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
|
local.table(Tex.button, t -> t.label(() -> "[accent]" + Core.bundle.get("hosts.discovering.any") + Strings.animated(Time.time(), 4, 10f, ".")).pad(10f)).growX();
|
||||||
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
net.discoverServers(this::addLocalHost, this::finishLocalHosts);
|
||||||
for(String host : defaultServers){
|
for(String host : defaultServers){
|
||||||
String address = host;
|
String resaddress = host.contains(":") ? host.split(":")[0] : host;
|
||||||
int p = port;
|
int resport = host.contains(":") ? Strings.parseInt(host.split(":")[1]) : port;
|
||||||
if(host.contains(":")){
|
net.pingHost(resaddress, resport, res -> {
|
||||||
address = host.split(":")[0];
|
res.port = resport;
|
||||||
p = Strings.parseInt(host.split(":")[1]);
|
addLocalHost(res);
|
||||||
}
|
}, e -> {});
|
||||||
net.pingHost(address, p, this::addLocalHost, e -> {});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -320,7 +319,7 @@ public class JoinDialog extends FloatingDialog{
|
|||||||
|
|
||||||
local.row();
|
local.row();
|
||||||
|
|
||||||
TextButton button = local.addButton("", Styles.cleart, () -> safeConnect(host.address, port, host.version))
|
TextButton button = local.addButton("", Styles.cleart, () -> safeConnect(host.address, host.port, host.version))
|
||||||
.width(w).pad(5f).get();
|
.width(w).pad(5f).get();
|
||||||
button.clearChildren();
|
button.clearChildren();
|
||||||
buildServer(host, button);
|
buildServer(host, button);
|
||||||
|
|||||||
@@ -461,7 +461,7 @@ public class ServerControl implements ApplicationListener{
|
|||||||
try{
|
try{
|
||||||
Config c = Config.valueOf(arg[0]);
|
Config c = Config.valueOf(arg[0]);
|
||||||
if(arg.length == 1){
|
if(arg.length == 1){
|
||||||
Log.info("&lc'{0}'&lg is currently &lc{0}.", c.name(), c.get());
|
Log.info("&lc'{0}'&lg is currently &lc{1}.", c.name(), c.get());
|
||||||
}else{
|
}else{
|
||||||
if(c.isBool()){
|
if(c.isBool()){
|
||||||
c.set(arg[1].equals("on") || arg[1].equals("true"));
|
c.set(arg[1].equals("on") || arg[1].equals("true"));
|
||||||
|
|||||||
Reference in New Issue
Block a user