Added Steam player limit + reduced votekick cooldown

This commit is contained in:
Anuken
2020-01-23 17:49:53 -05:00
parent 235142c869
commit d031efe1f2
4 changed files with 21 additions and 10 deletions

View File

@@ -284,7 +284,11 @@ public class NetServer implements ApplicationListener{
});
//duration of a a kick in seconds
int kickDuration = 15 * 60;
int kickDuration = 20 * 60;
//voting round duration in seconds
float voteDuration = 0.5f * 60;
//cooldown between votes
int voteCooldown = 60 * 2;
class VoteSession{
Player target;
@@ -302,7 +306,7 @@ public class NetServer implements ApplicationListener{
map[0] = null;
task.cancel();
}
}, 60 * 1);
}, voteDuration);
}
void vote(Player player, int d){
@@ -326,9 +330,7 @@ public class NetServer implements ApplicationListener{
}
}
//cooldown between votes
int voteTime = 60 * 3;
Timekeeper vtime = new Timekeeper(voteTime);
Timekeeper vtime = new Timekeeper(voteCooldown);
//current kick sessions
VoteSession[] currentlyKicking = {null};
@@ -375,7 +377,7 @@ public class NetServer implements ApplicationListener{
player.sendMessage("[scarlet]Only players on your team can be kicked.");
}else{
if(!vtime.get()){
player.sendMessage("[scarlet]You must wait " + voteTime/60 + " minutes between votekicks.");
player.sendMessage("[scarlet]You must wait " + voteCooldown/60 + " minutes between votekicks.");
return;
}

View File

@@ -1,7 +1,6 @@
package mindustry.ui.dialogs;
import arc.*;
import arc.struct.*;
import arc.files.*;
import arc.graphics.*;
import arc.graphics.Texture.*;
@@ -12,6 +11,7 @@ import arc.scene.ui.*;
import arc.scene.ui.SettingsDialog.SettingsTable.*;
import arc.scene.ui.TextButton.*;
import arc.scene.ui.layout.*;
import arc.struct.*;
import arc.util.*;
import mindustry.core.GameState.*;
import mindustry.core.*;
@@ -240,10 +240,17 @@ public class SettingsMenuDialog extends SettingsDialog{
game.checkPref("buildautopause", false);
}
if(steam && !Version.modifier.contains("beta")){
game.checkPref("publichost", false, i -> {
if(steam){
game.sliderPref("playerlimit", 16, 2, 32, i -> {
platform.updateLobby();
return i + "";
});
if(!Version.modifier.contains("beta")){
game.checkPref("publichost", false, i -> {
platform.updateLobby();
});
}
}
game.pref(new Setting(){