From 68f61bbb201e6f06de40f1248f8c6d362f998056 Mon Sep 17 00:00:00 2001 From: cnr Date: Fri, 24 Feb 2017 03:33:26 -0600 Subject: [PATCH] Send players to beta hubs; add 2fa and anticheat --- .../src/mineplex/core/portal/Commands/SendCommand.java | 2 +- .../src/mineplex/core/portal/Commands/ServerCommand.java | 2 +- .../src/mineplex/core/portal/GenericServer.java | 7 ++++++- Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java | 4 ++-- Plugins/mineplex-game-gemhunters/plugin.yml | 2 +- .../src/mineplex/gemhunters/GemHunters.java | 7 ++++++- .../src/mineplex/gemhunters/economy/CashOutModule.java | 6 ++++-- .../src/mineplex/gemhunters/spawn/SpawnModule.java | 3 ++- 8 files changed, 23 insertions(+), 10 deletions(-) diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java index f0c7c59bf..40bfe8476 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/SendCommand.java @@ -1,4 +1,4 @@ -package mineplex.core.portal.commands; +package mineplex.core.portal.Commands; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java index 5511e0105..56ba7b9e7 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Commands/ServerCommand.java @@ -1,4 +1,4 @@ -package mineplex.core.portal.commands; +package mineplex.core.portal.Commands; import org.bukkit.entity.Player; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/GenericServer.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/GenericServer.java index 02cb2da42..94059bbb3 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/GenericServer.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/GenericServer.java @@ -12,7 +12,12 @@ public enum GenericServer /** * The Clans Hubs, such as ClansHub-1 */ - CLANS_HUB("ClansHub"); + CLANS_HUB("ClansHub"), + /** + * The Beta Hubs, such as BetaHub-1 + */ + BETA_HUB("BetaHub"), + ; private final String _name; diff --git a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java index 5d0d5eb88..26cdcf0bd 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/portal/Portal.java @@ -24,8 +24,8 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTabTitle; -import mineplex.core.portal.commands.SendCommand; -import mineplex.core.portal.commands.ServerCommand; +import mineplex.core.portal.Commands.SendCommand; +import mineplex.core.portal.Commands.ServerCommand; import mineplex.core.portal.events.GenericServerTransferEvent; import mineplex.core.portal.events.ServerTransferEvent; import mineplex.serverdata.Region; diff --git a/Plugins/mineplex-game-gemhunters/plugin.yml b/Plugins/mineplex-game-gemhunters/plugin.yml index a0a9f1660..4f013d203 100644 --- a/Plugins/mineplex-game-gemhunters/plugin.yml +++ b/Plugins/mineplex-game-gemhunters/plugin.yml @@ -1,4 +1,4 @@ -name: Gem-Hunters +name: GemHunters main: mineplex.gemhunters.GemHunters version: 0.1 commands: diff --git a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/GemHunters.java b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/GemHunters.java index 9bd47124d..f52cbaa5a 100644 --- a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/GemHunters.java +++ b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/GemHunters.java @@ -12,6 +12,7 @@ import mineplex.core.FoodDupeFix; import mineplex.core.TimingsFix; import mineplex.core.account.CoreClientManager; import mineplex.core.achievement.AchievementManager; +import mineplex.core.antihack.AntiHack; import mineplex.core.beta.BetaWhitelist; import mineplex.core.blockrestore.BlockRestore; import mineplex.core.boosters.BoosterManager; @@ -55,6 +56,7 @@ import mineplex.core.stats.StatsManager; import mineplex.core.status.ServerStatusManager; import mineplex.core.teleport.Teleport; import mineplex.core.thank.ThankManager; +import mineplex.core.twofactor.TwoFactorAuth; import mineplex.core.updater.FileUpdater; import mineplex.core.updater.Updater; import mineplex.core.visibility.VisibilityManager; @@ -173,7 +175,7 @@ public class GemHunters extends JavaPlugin new DamageManager(this, new CombatManager(this), new NpcManager(this, creature), disguiseManager, new ConditionManager(this)); // GWEN - // require(AntiHack.class); + require(AntiHack.class); // Block Restore BlockRestore blockRestore = require(BlockRestore.class); @@ -287,6 +289,9 @@ public class GemHunters extends JavaPlugin MinecraftServer.getServer().getPropertyManager().setProperty("debug", false); SpigotConfig.debug = false; + // Two-factor auth + require(TwoFactorAuth.class); + // beta whitelist new BetaWhitelist(clientManager, new PowerPlayClubRepository(this, clientManager, donationManager)); } diff --git a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/economy/CashOutModule.java b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/economy/CashOutModule.java index adf39923a..e355c7298 100644 --- a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/economy/CashOutModule.java +++ b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/economy/CashOutModule.java @@ -30,6 +30,9 @@ import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTextMiddle; import mineplex.core.donation.DonationManager; import mineplex.core.itemstack.ItemBuilder; +import mineplex.core.portal.GenericServer; +import mineplex.core.portal.Intent; +import mineplex.core.portal.Portal; import mineplex.core.recharge.Recharge; import mineplex.core.updater.UpdateType; import mineplex.core.updater.event.UpdateEvent; @@ -166,8 +169,7 @@ public class CashOutModule extends MiniPlugin session.endSession(); iterator.remove(); - player.kickPlayer(C.cGreen + "Imagine you are being sent to the Lobby."); - // Portal.getInstance().sendToHub(player, null); + Portal.getInstance().sendPlayerToGenericServer(player, GenericServer.BETA_HUB, Intent.PLAYER_REQUEST); } } } diff --git a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/spawn/SpawnModule.java b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/spawn/SpawnModule.java index 200761968..61b10eaea 100644 --- a/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/spawn/SpawnModule.java +++ b/Plugins/mineplex-game-gemhunters/src/mineplex/gemhunters/spawn/SpawnModule.java @@ -21,6 +21,7 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilServer; +import mineplex.core.portal.GenericServer; import mineplex.core.portal.Intent; import mineplex.core.portal.Portal; import mineplex.gemhunters.death.npc.CombatLogNPC; @@ -146,7 +147,7 @@ public class SpawnModule extends MiniPlugin new SimpleNPC(_plugin, location, Villager.class, C.cGoldB + "Return To Hub", clicker -> { - Portal.getInstance().sendToHub(clicker, null, Intent.PLAYER_REQUEST); + Portal.getInstance().sendPlayerToGenericServer(clicker, GenericServer.BETA_HUB, Intent.PLAYER_REQUEST); }); }