Convert DontAllowOverfill to a server group value
This commit is contained in:
parent
a448eb2889
commit
2644066dcb
@ -150,7 +150,7 @@ public class PersonalServerManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
final ServerGroup serverGroup = new ServerGroup("COM-" + community.getId(), "COM-" + community.getName(), "COM-" + community.getId(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, "", true, "Lobby_MCS.zip", "Arcade.jar", "plugins/Arcade/", 15, 20,
|
final ServerGroup serverGroup = new ServerGroup("COM-" + community.getId(), "COM-" + community.getName(), "COM-" + community.getId(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, "", true, "Lobby_MCS.zip", "Arcade.jar", "plugins/Arcade/", 15, 20,
|
||||||
true, false, false, community.getFavoriteGame().name(), "", "", "Community", true, false, false, true, false, false, true, false, false, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
true, false, false, community.getFavoriteGame().name(), "", "", "Community", true, false, false, true, false, false, true, false, false, false, false, false, false, true, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
||||||
|
|
||||||
_repository.updateServerGroup(serverGroup);
|
_repository.updateServerGroup(serverGroup);
|
||||||
runSync(() ->
|
runSync(() ->
|
||||||
@ -183,7 +183,7 @@ public class PersonalServerManager extends MiniPlugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, "", true, "Lobby_MPS.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
final ServerGroup serverGroup = new ServerGroup(serverName, serverName, host.getName(), ram, cpu, 1, 0, UtilMath.random.nextInt(250) + 19999, "", true, "Lobby_MPS.zip", "Arcade.jar", "plugins/Arcade/", minPlayers, maxPlayers,
|
||||||
true, false, false, games, "", "", "Player", true, event, false, true, false, true, true, false, false, false, false, false, false, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
true, false, false, games, "", "", "Player", true, event, false, true, false, true, true, false, false, false, false, false, false, true, true, true, true, false, false, "", _us ? Region.US : Region.EU, "", "", "", "");
|
||||||
|
|
||||||
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), () ->
|
getPlugin().getServer().getScheduler().runTaskAsynchronously(getPlugin(), () ->
|
||||||
{
|
{
|
||||||
|
@ -50,7 +50,7 @@ public class ServerGroup
|
|||||||
private boolean _hotbarInventory;
|
private boolean _hotbarInventory;
|
||||||
private boolean _hotbarHubClock;
|
private boolean _hotbarHubClock;
|
||||||
private boolean _playerKickIdle;
|
private boolean _playerKickIdle;
|
||||||
private boolean _generateFreeVersions;
|
private boolean _hardMaxPlayerCap;
|
||||||
|
|
||||||
private String _games;
|
private String _games;
|
||||||
private String _modes;
|
private String _modes;
|
||||||
@ -91,7 +91,7 @@ public class ServerGroup
|
|||||||
_pvp = Boolean.valueOf(data.get("pvp"));
|
_pvp = Boolean.valueOf(data.get("pvp"));
|
||||||
_tournament = Boolean.valueOf(data.get("tournament"));
|
_tournament = Boolean.valueOf(data.get("tournament"));
|
||||||
_tournamentPoints = Boolean.valueOf(data.get("tournamentPoints"));
|
_tournamentPoints = Boolean.valueOf(data.get("tournamentPoints"));
|
||||||
_generateFreeVersions = Boolean.valueOf(data.get("generateFreeVersions"));
|
_hardMaxPlayerCap = Boolean.valueOf(data.get("allowOverflow"));
|
||||||
_games = data.get("games");
|
_games = data.get("games");
|
||||||
_modes = data.get("modes");
|
_modes = data.get("modes");
|
||||||
_boosterGroup = data.get("boosterGroup");
|
_boosterGroup = data.get("boosterGroup");
|
||||||
@ -129,7 +129,7 @@ public class ServerGroup
|
|||||||
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, String uptimes, boolean arcade, String worldZip, String plugin, String configPath
|
public ServerGroup(String name, String prefix, String host, int ram, int cpu, int totalServers, int joinable, int portSection, String uptimes, boolean arcade, String worldZip, String plugin, String configPath
|
||||||
, int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String modes, String boosterGroup, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin
|
, int minPlayers, int maxPlayers, boolean pvp, boolean tournament, boolean tournamentPoints, String games, String modes, String boosterGroup, String serverType, boolean noCheat, boolean worldEdit, boolean teamRejoin
|
||||||
, boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean gameVoting, boolean mapVoting, boolean rewardGems, boolean rewardItems, boolean rewardStats
|
, boolean teamAutoJoin, boolean teamForceBalance, boolean gameAutoStart, boolean gameTimeout, boolean gameVoting, boolean mapVoting, boolean rewardGems, boolean rewardItems, boolean rewardStats
|
||||||
, boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean staffOnly, boolean whitelist, String resourcePack, Region region
|
, boolean rewardAchievements, boolean hotbarInventory, boolean hotbarHubClock, boolean playerKickIdle, boolean hardMaxPlayerCap, boolean staffOnly, boolean whitelist, String resourcePack, Region region
|
||||||
, String teamServerKey, String portalBottomCornerLocation, String portalTopCornerLocation, String npcName)
|
, String teamServerKey, String portalBottomCornerLocation, String portalTopCornerLocation, String npcName)
|
||||||
{
|
{
|
||||||
_name = name;
|
_name = name;
|
||||||
@ -170,6 +170,7 @@ public class ServerGroup
|
|||||||
_hotbarInventory = hotbarInventory;
|
_hotbarInventory = hotbarInventory;
|
||||||
_hotbarHubClock = hotbarHubClock;
|
_hotbarHubClock = hotbarHubClock;
|
||||||
_playerKickIdle = playerKickIdle;
|
_playerKickIdle = playerKickIdle;
|
||||||
|
_hardMaxPlayerCap = hardMaxPlayerCap;
|
||||||
_staffOnly = staffOnly;
|
_staffOnly = staffOnly;
|
||||||
_whitelist = whitelist;
|
_whitelist = whitelist;
|
||||||
_resourcePack = resourcePack;
|
_resourcePack = resourcePack;
|
||||||
@ -224,7 +225,7 @@ public class ServerGroup
|
|||||||
public boolean getHotbarInventory() { return _hotbarInventory; }
|
public boolean getHotbarInventory() { return _hotbarInventory; }
|
||||||
public boolean getHotbarHubClock() { return _hotbarHubClock; }
|
public boolean getHotbarHubClock() { return _hotbarHubClock; }
|
||||||
public boolean getPlayerKickIdle() { return _playerKickIdle; }
|
public boolean getPlayerKickIdle() { return _playerKickIdle; }
|
||||||
public boolean getGenerateFreeVersions() { return _generateFreeVersions; }
|
public boolean getHardMaxPlayerCap() { return _hardMaxPlayerCap; }
|
||||||
|
|
||||||
public String getGames() { return _games; }
|
public String getGames() { return _games; }
|
||||||
public String getModes() { return _modes; }
|
public String getModes() { return _modes; }
|
||||||
|
@ -263,6 +263,7 @@ public class Arcade extends JavaPlugin
|
|||||||
config.HotbarInventory = _serverConfiguration.getServerGroup().getHotbarInventory();
|
config.HotbarInventory = _serverConfiguration.getServerGroup().getHotbarInventory();
|
||||||
config.HotbarHubClock = _serverConfiguration.getServerGroup().getHotbarHubClock();
|
config.HotbarHubClock = _serverConfiguration.getServerGroup().getHotbarHubClock();
|
||||||
config.PlayerKickIdle = _serverConfiguration.getServerGroup().getPlayerKickIdle();
|
config.PlayerKickIdle = _serverConfiguration.getServerGroup().getPlayerKickIdle();
|
||||||
|
config.HardMaxPlayerCap = _serverConfiguration.getServerGroup().getHardMaxPlayerCap();
|
||||||
config.GameVoting = _serverConfiguration.getServerGroup().getGameVoting();
|
config.GameVoting = _serverConfiguration.getServerGroup().getGameVoting();
|
||||||
config.MapVoting = _serverConfiguration.getServerGroup().getMapVoting();
|
config.MapVoting = _serverConfiguration.getServerGroup().getMapVoting();
|
||||||
|
|
||||||
|
@ -1191,7 +1191,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
{
|
{
|
||||||
String reason = C.Bold + "Server has reached max capacity for gameplay purposes.";
|
String reason = C.Bold + "Server has reached max capacity for gameplay purposes.";
|
||||||
|
|
||||||
if (GetGame() == null || GetGame().DontAllowOverfill)
|
if (_serverConfig.HardMaxPlayerCap)
|
||||||
{
|
{
|
||||||
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, reason);
|
event.disallow(PlayerLoginEvent.Result.KICK_OTHER, reason);
|
||||||
return;
|
return;
|
||||||
@ -1232,10 +1232,7 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
|
|
||||||
public boolean IsAlive(Player player)
|
public boolean IsAlive(Player player)
|
||||||
{
|
{
|
||||||
if (_game == null)
|
return _game != null && _game.IsAlive(player);
|
||||||
return false;
|
|
||||||
|
|
||||||
return _game.IsAlive(player);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1247,7 +1244,6 @@ public class ArcadeManager extends MiniPlugin implements IRelation
|
|||||||
public boolean hasBeenPlaying(Player player)
|
public boolean hasBeenPlaying(Player player)
|
||||||
{
|
{
|
||||||
return _game != null && _game.GetTeam(player) != null;
|
return _game != null && _game.GetTeam(player) != null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Clear(Player player)
|
public void Clear(Player player)
|
||||||
|
@ -298,8 +298,6 @@ public abstract class Game extends ListenerComponent implements Lifetimed
|
|||||||
|
|
||||||
public boolean TeleportsDisqualify = true;
|
public boolean TeleportsDisqualify = true;
|
||||||
|
|
||||||
public boolean DontAllowOverfill = false;
|
|
||||||
|
|
||||||
public GameMode PlayerGameMode = GameMode.SURVIVAL;
|
public GameMode PlayerGameMode = GameMode.SURVIVAL;
|
||||||
|
|
||||||
// Addons
|
// Addons
|
||||||
|
@ -43,6 +43,7 @@ public class GameServerConfig
|
|||||||
public boolean HotbarHubClock = true;
|
public boolean HotbarHubClock = true;
|
||||||
|
|
||||||
public boolean PlayerKickIdle = true;
|
public boolean PlayerKickIdle = true;
|
||||||
|
public boolean HardMaxPlayerCap = false;
|
||||||
|
|
||||||
public boolean PublicServer = true;
|
public boolean PublicServer = true;
|
||||||
|
|
||||||
|
@ -225,8 +225,6 @@ public class Build extends Game
|
|||||||
this.WorldFireSpread = true;
|
this.WorldFireSpread = true;
|
||||||
this.WorldBoneMeal = true;
|
this.WorldBoneMeal = true;
|
||||||
|
|
||||||
this.DontAllowOverfill = true;
|
|
||||||
|
|
||||||
this.AnticheatDisabled = true;
|
this.AnticheatDisabled = true;
|
||||||
|
|
||||||
this.PlayerGameMode = GameMode.CREATIVE;
|
this.PlayerGameMode = GameMode.CREATIVE;
|
||||||
|
@ -163,7 +163,6 @@ public class CakeWars extends TeamGame
|
|||||||
ItemPickup = true;
|
ItemPickup = true;
|
||||||
GameTimeout = TimeUnit.HOURS.toMillis(1);
|
GameTimeout = TimeUnit.HOURS.toMillis(1);
|
||||||
WorldBoundary = false;
|
WorldBoundary = false;
|
||||||
DontAllowOverfill = true;
|
|
||||||
_help = TIPS;
|
_help = TIPS;
|
||||||
|
|
||||||
registerStatTrackers(
|
registerStatTrackers(
|
||||||
|
@ -64,8 +64,6 @@ public class ChampionsCTF extends CaptureTheFlag
|
|||||||
|
|
||||||
EloStart = 1000;
|
EloStart = 1000;
|
||||||
|
|
||||||
this.DontAllowOverfill = true;
|
|
||||||
|
|
||||||
this.DisableKillCommand = false;
|
this.DisableKillCommand = false;
|
||||||
|
|
||||||
AllowParticles = false;
|
AllowParticles = false;
|
||||||
|
@ -58,8 +58,6 @@ public class ChampionsDominate extends Domination
|
|||||||
|
|
||||||
EloStart = 1000;
|
EloStart = 1000;
|
||||||
|
|
||||||
this.DontAllowOverfill = true;
|
|
||||||
|
|
||||||
this.DisableKillCommand = false;
|
this.DisableKillCommand = false;
|
||||||
|
|
||||||
registerStatTrackers(
|
registerStatTrackers(
|
||||||
|
@ -56,8 +56,6 @@ public class ChampionsTDM extends TeamDeathmatch
|
|||||||
InventoryOpenChest = true;
|
InventoryOpenChest = true;
|
||||||
this.DisableKillCommand = false;
|
this.DisableKillCommand = false;
|
||||||
|
|
||||||
this.DontAllowOverfill = true;
|
|
||||||
|
|
||||||
registerStatTrackers(
|
registerStatTrackers(
|
||||||
new KillReasonStatTracker(this, "Backstab", "Assassination", false),
|
new KillReasonStatTracker(this, "Backstab", "Assassination", false),
|
||||||
new ElectrocutionStatTracker(this),
|
new ElectrocutionStatTracker(this),
|
||||||
|
@ -134,7 +134,6 @@ public class Gladiators extends SoloGame
|
|||||||
DamageSelf = true;
|
DamageSelf = true;
|
||||||
DamageTeamSelf = true;
|
DamageTeamSelf = true;
|
||||||
HungerSet = 20;
|
HungerSet = 20;
|
||||||
DontAllowOverfill = true;
|
|
||||||
EnableTutorials = false;
|
EnableTutorials = false;
|
||||||
|
|
||||||
BlockBreakAllow.add(Material.SUGAR_CANE_BLOCK.getId());
|
BlockBreakAllow.add(Material.SUGAR_CANE_BLOCK.getId());
|
||||||
|
@ -158,8 +158,6 @@ public class Halloween extends SoloGame
|
|||||||
|
|
||||||
this.WorldBoundaryKill = false;
|
this.WorldBoundaryKill = false;
|
||||||
|
|
||||||
this.DontAllowOverfill = true;
|
|
||||||
|
|
||||||
registerChatStats(
|
registerChatStats(
|
||||||
DamageDealt,
|
DamageDealt,
|
||||||
DamageTaken,
|
DamageTaken,
|
||||||
|
@ -155,8 +155,6 @@ public class Minestrike extends TeamGame
|
|||||||
|
|
||||||
this.JoinInProgress = true;
|
this.JoinInProgress = true;
|
||||||
|
|
||||||
this.DontAllowOverfill = true;
|
|
||||||
|
|
||||||
this.AllowEntitySpectate = false;
|
this.AllowEntitySpectate = false;
|
||||||
|
|
||||||
this.AllowParticles = false;
|
this.AllowParticles = false;
|
||||||
|
@ -34,7 +34,6 @@ public class MobaClassic extends Moba
|
|||||||
{
|
{
|
||||||
super(manager, GameType.MOBA, DESCRIPTION);
|
super(manager, GameType.MOBA, DESCRIPTION);
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
PrepareAutoAnnounce = false;
|
PrepareAutoAnnounce = false;
|
||||||
PrepareFreeze = false;
|
PrepareFreeze = false;
|
||||||
PrepareTime = PREPARE_TIME;
|
PrepareTime = PREPARE_TIME;
|
||||||
|
@ -38,7 +38,6 @@ public class TeamSkyfall extends Skyfall
|
|||||||
|
|
||||||
DamageTeamSelf = false;
|
DamageTeamSelf = false;
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
ShowTeammateMessage = true;
|
ShowTeammateMessage = true;
|
||||||
|
|
||||||
HideTeamSheep = true;
|
HideTeamSheep = true;
|
||||||
|
@ -123,8 +123,6 @@ public abstract class Skywars extends Game
|
|||||||
PlaySoundGameStart = true;
|
PlaySoundGameStart = true;
|
||||||
PrepareTime = TimeUnit.SECONDS.toMillis(10);
|
PrepareTime = TimeUnit.SECONDS.toMillis(10);
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
|
|
||||||
StrictAntiHack = true;
|
StrictAntiHack = true;
|
||||||
|
|
||||||
_oreHider = new OreHider();
|
_oreHider = new OreHider();
|
||||||
|
@ -63,8 +63,6 @@ public class TeamSkywars extends Skywars
|
|||||||
|
|
||||||
DamageTeamSelf = false;
|
DamageTeamSelf = false;
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
|
|
||||||
ShowTeammateMessage = true;
|
ShowTeammateMessage = true;
|
||||||
|
|
||||||
_teamSelector = new FillToSelector(this, 2);
|
_teamSelector = new FillToSelector(this, 2);
|
||||||
|
@ -37,8 +37,6 @@ public class TeamSuperSmash extends SuperSmash
|
|||||||
SpawnNearAllies = true;
|
SpawnNearAllies = true;
|
||||||
DamageTeamSelf = false;
|
DamageTeamSelf = false;
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
|
|
||||||
ShowTeammateMessage = true;
|
ShowTeammateMessage = true;
|
||||||
|
|
||||||
_teamSelector = new FillToSelector(this, 2);
|
_teamSelector = new FillToSelector(this, 2);
|
||||||
|
@ -182,8 +182,6 @@ public class SpeedBuilders extends SoloGame
|
|||||||
HungerSet = 20;
|
HungerSet = 20;
|
||||||
HealthSet = 20;
|
HealthSet = 20;
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
|
|
||||||
DeathMessages = false;
|
DeathMessages = false;
|
||||||
|
|
||||||
FixSpawnFacing = false;
|
FixSpawnFacing = false;
|
||||||
|
@ -34,8 +34,6 @@ public class SurvivalGamesNewTeams extends SurvivalGamesNew
|
|||||||
|
|
||||||
DamageTeamSelf = false;
|
DamageTeamSelf = false;
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
|
|
||||||
_teamSelector = new FillToSelector(this, 2);
|
_teamSelector = new FillToSelector(this, 2);
|
||||||
|
|
||||||
new NamedTeamsModule()
|
new NamedTeamsModule()
|
||||||
|
@ -264,8 +264,6 @@ public abstract class UHC extends Game
|
|||||||
|
|
||||||
WorldBoneMeal = true;
|
WorldBoneMeal = true;
|
||||||
|
|
||||||
DontAllowOverfill = true;
|
|
||||||
|
|
||||||
GadgetsDisabled = true;
|
GadgetsDisabled = true;
|
||||||
AllowParticles = false;
|
AllowParticles = false;
|
||||||
|
|
||||||
|
@ -32,7 +32,6 @@ public class UHCTeams extends UHC
|
|||||||
super(manager, type, speedMode);
|
super(manager, type, speedMode);
|
||||||
|
|
||||||
DamageTeamSelf = false;
|
DamageTeamSelf = false;
|
||||||
DontAllowOverfill = true;
|
|
||||||
ShowTeammateMessage = true;
|
ShowTeammateMessage = true;
|
||||||
TeamMode = true;
|
TeamMode = true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user