Massively improved thread safety
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package io.anuke.mindustry.ui.dialogs;
|
||||
|
||||
import io.anuke.mindustry.entities.Player;
|
||||
import io.anuke.mindustry.net.Administration.PlayerInfo;
|
||||
import io.anuke.ucore.scene.ui.ScrollPane;
|
||||
import io.anuke.ucore.scene.ui.layout.Table;
|
||||
@@ -43,12 +42,18 @@ public class AdminsDialog extends FloatingDialog{
|
||||
res.addImageButton("icon-cancel", 14 * 3, () -> {
|
||||
ui.showConfirm("$text.confirm", "$text.confirmunadmin", () -> {
|
||||
netServer.admins.unAdminPlayer(info.id);
|
||||
playerGroup.forEach(player -> {
|
||||
if(player.uuid.equals(info.id)){
|
||||
player.isAdmin = false;
|
||||
}
|
||||
});
|
||||
/*
|
||||
for(Player player : playerGroup.all()){
|
||||
if(player.con != null){
|
||||
player.isAdmin = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
setup();
|
||||
});
|
||||
}).size(h).pad(-14f);
|
||||
|
||||
@@ -66,10 +66,10 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
float h = 74f;
|
||||
|
||||
for(Player player : playerGroup.all()){
|
||||
playerGroup.forEach(player -> {
|
||||
NetConnection connection = gwt ? null : player.con;
|
||||
|
||||
if(connection == null && Net.server() && !player.isLocal) continue;
|
||||
if(connection == null && Net.server() && !player.isLocal) return;
|
||||
|
||||
Table button = new Table("button");
|
||||
button.left();
|
||||
@@ -134,7 +134,7 @@ public class PlayerListFragment extends Fragment{
|
||||
|
||||
content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);
|
||||
content.row();
|
||||
}
|
||||
});
|
||||
|
||||
content.marginBottom(5);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user