diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index fc3770df49..a7d860ee9b 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -125,6 +125,7 @@ server.version = [gray]v{0} {1} server.custombuild = [accent]Custom Build confirmban = Are you sure you want to ban this player? confirmkick = Are you sure you want to kick this player? +confirmvotekick = Are you sure you want to vote-kick this player? confirmunban = Are you sure you want to unban this player? confirmadmin = Are you sure you want to make this player an admin? confirmunadmin = Are you sure you want to remove admin status from this player? diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index c2048b9837..a5c89e6305 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -254,14 +254,13 @@ public class NetServer implements ApplicationListener{ Call.sendMessage(Strings.format("[orange]{0}[lightgray] has voted to kick[orange] {1}[].[accent] ({2}/{3})\n[lightgray]Type[orange] /vote [] to agree.", player.name, target.name, votes, votesRequired())); - //checkPass(); } boolean checkPass(){ if(votes >= votesRequired() && target.isAdded() && target.con.isConnected()){ - Call.sendMessage(Strings.format("[orange]Vote passed.[scarlet] {0}[orange] will be kicked from the server.", target.name)); - admins.getInfo(target.uuid).lastKicked = Time.millis() + kickDuration*1000; - target.con.kick(KickReason.vote); + Call.sendMessage(Strings.format("[orange]Vote passed.[scarlet] {0}[orange] will be banned from the server for {1} minutes.", target.name, (int)(kickDuration/60))); + target.getInfo().lastKicked = Time.millis() + kickDuration*1000; + playerGroup.all().each(p -> p.uuid != null && p.uuid.equals(target.uuid), p -> p.con.kick(KickReason.vote)); map[0] = null; task.cancel(); return true; diff --git a/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java b/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java index 0857661274..b9fd089a1c 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/PlayerListFragment.java @@ -129,6 +129,11 @@ public class PlayerListFragment extends Fragment{ t.addImageButton(Icon.zoomSmall, Styles.clearPartiali, () -> Call.onAdminRequest(user, AdminAction.trace)); }).padRight(12).size(bs + 10f, bs); + }else if((!user.isLocal && !user.isAdmin) && net.client() && playerGroup.size() >= 3){ //votekick + button.add().growY(); + + button.addImageButton(Icon.banSmall, Styles.clearPartiali, + () -> ui.showConfirm("$confirm", "$confirmvotekick", () -> Call.sendChatMessage("/votekick " + user.name))).size(h); } content.add(button).padBottom(-6).width(350f).maxHeight(h + 14);