Power-based ammo / Refactoring / IP kicks / Fixes

This commit is contained in:
Anuken
2020-09-24 13:05:39 -04:00
parent db94acdb83
commit 0a07458186
28 changed files with 322 additions and 126 deletions

View File

@@ -30,6 +30,7 @@ public class JoinDialog extends BaseDialog{
Table global = new Table();
Table hosts = new Table();
int totalHosts;
int refreshes;
public JoinDialog(){
super("@joingame");
@@ -95,6 +96,8 @@ public class JoinDialog extends BaseDialog{
}
void refreshAll(){
refreshes ++;
refreshLocal();
refreshRemote();
refreshGlobal();
@@ -327,12 +330,15 @@ public class JoinDialog extends BaseDialog{
}
void refreshGlobal(){
int cur = refreshes;
global.clear();
global.background(null);
for(String host : defaultServers){
String resaddress = host.contains(":") ? host.split(":")[0] : host;
int resport = host.contains(":") ? Strings.parseInt(host.split(":")[1]) : port;
net.pingHost(resaddress, resport, res -> {
if(refreshes != cur) return;
res.port = resport;
addGlobalHost(res);
}, e -> {});

View File

@@ -93,7 +93,7 @@ public class SettingsMenuDialog extends SettingsDialog{
ObjectMap<String, Object> map = new ObjectMap<>();
for(String value : Core.settings.keys()){
if(value.contains("usid") || value.contains("uuid")){
map.put(value, Core.settings.getString(value));
map.put(value, Core.settings.get(value, null));
}
}
Core.settings.clear();