Merge remote-tracking branch 'refs/remotes/origin/develop' into feature/leveling

This commit is contained in:
Sam 2017-08-22 22:43:33 +01:00
commit 5b77b099b2
16 changed files with 117 additions and 72 deletions

View File

@ -1,5 +1,6 @@
package mineplex.core.antihack; package mineplex.core.antihack;
import javax.xml.bind.DatatypeConverter;
import java.util.Collections; import java.util.Collections;
import java.util.HashSet; import java.util.HashSet;
import java.util.Map; import java.util.Map;
@ -9,7 +10,11 @@ import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.function.Consumer; import java.util.function.Consumer;
import javax.xml.bind.DatatypeConverter; import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -81,11 +86,6 @@ import mineplex.core.punish.PunishClient;
import mineplex.core.punish.Punishment; import mineplex.core.punish.Punishment;
import mineplex.core.punish.PunishmentResponse; import mineplex.core.punish.PunishmentResponse;
import mineplex.serverdata.commands.ServerCommandManager; import mineplex.serverdata.commands.ServerCommandManager;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.chat.BaseComponent;
import net.md_5.bungee.api.chat.ClickEvent;
import net.md_5.bungee.api.chat.ComponentBuilder;
import net.md_5.bungee.api.chat.HoverEvent;
@ReflectivelyCreateMiniPlugin @ReflectivelyCreateMiniPlugin
public class AntiHack extends MiniPlugin public class AntiHack extends MiniPlugin
@ -109,13 +109,13 @@ public class AntiHack extends MiniPlugin
public static final Map<Class<? extends Check>, AntiHackAction> ACTIONS = ImmutableMap.<Class<? extends Check>, AntiHackAction>builder() public static final Map<Class<? extends Check>, AntiHackAction> ACTIONS = ImmutableMap.<Class<? extends Check>, AntiHackAction>builder()
.put(KillauraTypeA.class, new ImmediateBanAction(200)) .put(KillauraTypeA.class, new ImmediateBanAction(200))
//.put(KillauraTypeD.class, new BanwaveAction(1500)) .put(KillauraTypeD.class, new BanwaveAction(1500))
.put(KillauraTypeF.class, new BanwaveAction(600)) .put(KillauraTypeF.class, new BanwaveAction(600))
.put(Glide.class, new ImmediateBanAction(10000)) .put(Glide.class, new ImmediateBanAction(7500))
.put(Speed.class, new ImmediateBanAction(10000)) .put(Speed.class, new ImmediateBanAction(7500))
.put(HeadRoll.class, new ImmediateBanAction(2000)) .put(HeadRoll.class, new ImmediateBanAction(2000))
.put(Toggle.class, new ImmediateBanAction(500)) .put(Toggle.class, new ImmediateBanAction(500))
.put(Timer.class, new ImmediateBanAction(15000)) .put(Timer.class, new ImmediateBanAction(10000))
.put(BadPackets.class, new GEPBanAction(300)) .put(BadPackets.class, new GEPBanAction(300))
.put(KillauraTypeB.class, new GEPBanAction(100)) .put(KillauraTypeB.class, new GEPBanAction(100))
.build(); .build();
@ -435,11 +435,6 @@ public class AntiHack extends MiniPlugin
@EventHandler @EventHandler
public void onHack(PlayerViolationEvent event) public void onHack(PlayerViolationEvent event)
{ {
if (event.getCheckClass() == Toggle.class)
{
return;
}
if (_ignoredChecks.contains(event.getCheckClass())) if (_ignoredChecks.contains(event.getCheckClass()))
{ {
return; return;

View File

@ -6,4 +6,4 @@ public class ClientMessage
public String LastAdminTo; public String LastAdminTo;
public long LastToTime; public long LastToTime;
public int SpamCounter; public int SpamCounter;
} }

View File

@ -1,5 +1,17 @@
package mineplex.core.message; package mineplex.core.message;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import mineplex.core.MiniClientPlugin; import mineplex.core.MiniClientPlugin;
import mineplex.core.account.CoreClientManager; import mineplex.core.account.CoreClientManager;
import mineplex.core.chat.Chat; import mineplex.core.chat.Chat;
@ -33,18 +45,6 @@ import mineplex.core.punish.Punishment;
import mineplex.core.punish.PunishmentSentence; import mineplex.core.punish.PunishmentSentence;
import mineplex.serverdata.commands.AnnouncementCommand; import mineplex.serverdata.commands.AnnouncementCommand;
import mineplex.serverdata.commands.ServerCommandManager; import mineplex.serverdata.commands.ServerCommandManager;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
public class MessageManager extends MiniClientPlugin<ClientMessage> public class MessageManager extends MiniClientPlugin<ClientMessage>
{ {
@ -263,6 +263,10 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
// Send // Send
UtilPlayer.message(to, C.cGold + "§l" + from.getName() + " > " + to.getName() + C.cYellow + " §l" + message); UtilPlayer.message(to, C.cGold + "§l" + from.getName() + " > " + to.getName() + C.cYellow + " §l" + message);
if (_punish.GetClient(to.getName()).IsMuted() && _preferences.get(to).isActive(Preference.INFORM_MUTED))
{
UtilPlayer.message(from, F.main(getName(), F.elem(to.getName()) + " is currently muted and cannot reply to you!"));
}
} }
public void DoMessageAdmin(Player from, Player to, String message) public void DoMessageAdmin(Player from, Player to, String message)
@ -345,7 +349,8 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
"Mmm...Steak!", "Mmm...Steak!",
"Poop! Poop everywhere!", "Poop! Poop everywhere!",
"I'm so forgetful. Like I was going to say somethin...wait what were we talking about?", "I'm so forgetful. Like I was going to say somethin...wait what were we talking about?",
"Mmm...Steak!" "Mmm...Steak!",
"#BlameAlex"
); );
} }
@ -359,7 +364,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
if (_randomMessage.isEmpty()) if (_randomMessage.isEmpty())
return "meow"; return "meow";
return _randomMessage.get(UtilMath.r(_randomMessage.size())); return UtilMath.randomElement(_randomMessage);
} }
public void Help(Player caller) public void Help(Player caller)
@ -392,7 +397,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
// Message the sender // Message the sender
RedisMessageCallback message = new RedisMessageCallback(globalMessage, true, to.getName(), RedisMessageCallback message = new RedisMessageCallback(globalMessage, true, to.getName(),
C.cPurple + "-> " + toRank + " " + to.getName() + " " + C.cPurple + globalMessage.getMessage()); C.cPurple + "-> " + toRank + " " + to.getName() + " " + C.cPurple + globalMessage.getMessage(), false);
// Inform Admins // Inform Admins
for (Player staff : UtilServer.getPlayers()) for (Player staff : UtilServer.getPlayers())
@ -416,8 +421,7 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
if (canMessage != null) if (canMessage != null)
{ {
RedisMessageCallback message = new RedisMessageCallback(globalMessage, false, null, canMessage, false);
RedisMessageCallback message = new RedisMessageCallback(globalMessage, false, null, canMessage);
message.publish(); message.publish();
@ -431,9 +435,11 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
UtilPlayer.message(to, message); UtilPlayer.message(to, message);
to.playSound(to.getLocation(), Sound.NOTE_PIANO, 2f, 2f); to.playSound(to.getLocation(), Sound.NOTE_PIANO, 2f, 2f);
boolean informMuted = _punish.GetClient(to.getName()).IsMuted() && _preferences.get(to).isActive(Preference.INFORM_MUTED);
// Message the sender // Message the sender
RedisMessageCallback redisMessage = new RedisMessageCallback(globalMessage, false, to.getName(), message); RedisMessageCallback redisMessage = new RedisMessageCallback(globalMessage, false, to.getName(), message, informMuted);
redisMessage.publish(); redisMessage.publish();
} }
@ -453,6 +459,11 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
if (target != null) if (target != null)
{ {
target.sendMessage(message.getMessage()); target.sendMessage(message.getMessage());
if (message.informMuted())
{
UtilPlayer.message(target, F.main(getName(), F.elem(message.getLastReplied()) + " is currently muted and cannot reply to you!"));
}
target.playSound(target.getLocation(), Sound.NOTE_PIANO, 2f, 2f); target.playSound(target.getLocation(), Sound.NOTE_PIANO, 2f, 2f);
@ -647,6 +658,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
public PreferencesManager getPreferences() public PreferencesManager getPreferences()
{ {
return this._preferences; return _preferences;
} }
} }

View File

@ -70,4 +70,4 @@ public class RedisMessage extends ServerCommand
{ {
// Utilitizes a callback functionality to seperate dependencies // Utilitizes a callback functionality to seperate dependencies
} }
} }

View File

@ -12,16 +12,17 @@ public class RedisMessageCallback extends ServerCommand
private String _message; private String _message;
private String _setLastMessage; private String _setLastMessage;
private String _target; private String _target;
private boolean _staffMessage; private boolean _staffMessage, _informMuted;
private UUID _uuid; private UUID _uuid;
public RedisMessageCallback(RedisMessage globalMessage, boolean staffMessage, String receivedPlayer, String message) public RedisMessageCallback(RedisMessage globalMessage, boolean staffMessage, String receivedPlayer, String message, boolean informMuted)
{ {
_target = globalMessage.getSender(); _target = globalMessage.getSender();
_message = message; _message = message;
_setLastMessage = receivedPlayer; _setLastMessage = receivedPlayer;
_uuid = globalMessage.getUUID(); _uuid = globalMessage.getUUID();
_staffMessage = staffMessage; _staffMessage = staffMessage;
_informMuted = informMuted;
if (globalMessage.getSendingServer() != null) if (globalMessage.getSendingServer() != null)
{ {
@ -33,6 +34,11 @@ public class RedisMessageCallback extends ServerCommand
{ {
return _staffMessage; return _staffMessage;
} }
public boolean informMuted()
{
return _informMuted;
}
public String getLastReplied() public String getLastReplied()
{ {
@ -59,4 +65,4 @@ public class RedisMessageCallback extends ServerCommand
{ {
// Utilitizes a callback functionality to seperate dependencies // Utilitizes a callback functionality to seperate dependencies
} }
} }

View File

@ -48,7 +48,9 @@ public enum Preference
PARTY_DISPLAY_INVENTORY_UI(true, PreferenceCategory.SOCIAL, Material.CHEST, "Display Parties GUI"), PARTY_DISPLAY_INVENTORY_UI(true, PreferenceCategory.SOCIAL, Material.CHEST, "Display Parties GUI"),
RANDOM_MESSAGES(true, PreferenceCategory.USER, Material.COMMAND, "Send random messages", "Got nothing to say? We got you covered!") RANDOM_MESSAGES(true, PreferenceCategory.USER, Material.COMMAND, "Send Random Messages", "Got nothing to say? We got you covered!"),
INFORM_MUTED(false, PreferenceCategory.USER, Material.BARRIER, "Inform When Muted", "Inform people who message you if you are muted!")
; ;
private static final Map<Integer, Preference> PREFERENCE_MAP = Maps.newHashMap(); private static final Map<Integer, Preference> PREFERENCE_MAP = Maps.newHashMap();
@ -118,6 +120,4 @@ public enum Preference
{ {
return PREFERENCE_MAP.get(id); return PREFERENCE_MAP.get(id);
} }
}
}

View File

@ -178,7 +178,7 @@ public class ServerGameMenu extends ShopPageBase<ServerManager, QuickShop>
{ {
(_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATES", (_extraValue ? C.cAquaB : C.cWhiteB) + "NEW UPDATES",
C.Reset + "", C.Reset + "",
C.Reset + "Defenders must protect King Sparklez", C.Reset + "Defenders must protect King Chiss",
C.Reset + "from the endless waves of Undead", C.Reset + "from the endless waves of Undead",
C.Reset + "until the sun rises!", C.Reset + "until the sun rises!",
}, "CS", "Castle_Siege", new SelectCSButton(this)); }, "CS", "Castle_Siege", new SelectCSButton(this));

View File

@ -66,7 +66,7 @@ public class CastleSiegeHorseManager implements Listener
@EventHandler @EventHandler
public void horseInteract(PlayerInteractEntityEvent event) public void horseInteract(PlayerInteractEntityEvent event)
{ {
if (!(event.getRightClicked() instanceof Horse)) if (!(event.getRightClicked() instanceof Horse) || !_host.IsLive())
{ {
return; return;
} }

View File

@ -22,11 +22,16 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.ItemSpawnEvent; import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerPickupItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType; import org.bukkit.potion.PotionEffectType;
import com.mineplex.anticheat.checks.combat.KillauraTypeD;
import mineplex.core.Managers;
import mineplex.core.achievement.Achievement; import mineplex.core.achievement.Achievement;
import mineplex.core.achievement.AchievementCategory; import mineplex.core.achievement.AchievementCategory;
import mineplex.core.antihack.AntiHack;
import mineplex.core.common.util.C; import mineplex.core.common.util.C;
import mineplex.core.common.util.UtilAlg; import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEnt;
@ -170,6 +175,10 @@ public class CastleSiegeNew extends TeamGame
new CompassModule() new CompassModule()
.register(this); .register(this);
// Disable specific GWEN checks for this game
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(KillauraTypeD.class);
} }
@Override @Override
@ -371,6 +380,12 @@ public class CastleSiegeNew extends TeamGame
} }
} }
@EventHandler
public void playerQuit(PlayerQuitEvent event)
{
_wolves.remove(event.getPlayer());
}
@Override @Override
public void EndCheck() public void EndCheck()
{ {

View File

@ -76,6 +76,6 @@ public class KitUndeadZombie extends KitCastleSiege
int level = getUpgradeLevel(player.getUniqueId()); int level = getUpgradeLevel(player.getUniqueId());
player.setMaxHealth(player.getMaxHealth() + level * 2); player.setMaxHealth(20 + level * 2);
} }
} }

View File

@ -24,6 +24,11 @@ public class DragonEscapeWinQuestTracker extends QuestTracker<DragonEscape>
public void increment(Player player) public void increment(Player player)
{ {
if (!player.isOnline())
{
return;
}
incrementQuests(player, 1, ((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(), getGame().GetKit(player).GetName() + "Kit", "Parkour"); incrementQuests(player, 1, ((Arcade) UtilServer.getPlugin()).getServerConfig().getServerGroup().getPrefix(), getGame().GetKit(player).GetName() + "Kit", "Parkour");
} }

View File

@ -1,6 +1,32 @@
package nautilus.game.arcade.game.games.moba; package nautilus.game.arcade.game.games.moba;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import com.mineplex.anticheat.checks.combat.KillauraTypeD;
import com.mineplex.anticheat.checks.move.Glide;
import com.mineplex.anticheat.checks.move.HeadRoll;
import com.mineplex.anticheat.checks.move.Speed;
import mineplex.core.Managers; import mineplex.core.Managers;
import mineplex.core.antihack.AntiHack;
import mineplex.core.common.Pair; import mineplex.core.common.Pair;
import mineplex.core.common.Rank; import mineplex.core.common.Rank;
import mineplex.core.common.util.F; import mineplex.core.common.util.F;
@ -16,6 +42,7 @@ import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager; import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType; import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
import mineplex.minecraft.game.core.combat.DeathMessageType; import mineplex.minecraft.game.core.combat.DeathMessageType;
import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.ArcadeManager;
import nautilus.game.arcade.GameType; import nautilus.game.arcade.GameType;
import nautilus.game.arcade.events.GameStateChangeEvent; import nautilus.game.arcade.events.GameStateChangeEvent;
@ -56,25 +83,6 @@ import nautilus.game.arcade.game.modules.CustomScoreboardModule;
import nautilus.game.arcade.game.modules.compass.CompassModule; import nautilus.game.arcade.game.modules.compass.CompassModule;
import nautilus.game.arcade.kit.Kit; import nautilus.game.arcade.kit.Kit;
import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager; import nautilus.game.arcade.managers.lobby.current.NewGameLobbyManager;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Arrow;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
public class Moba extends TeamGame public class Moba extends TeamGame
{ {
@ -186,6 +194,13 @@ public class Moba extends TeamGame
caller.sendMessage(F.main("Kit", "Sorry that is not a kit!")); caller.sendMessage(F.main("Kit", "Sorry that is not a kit!"));
} }
}); });
// Disable specific GWEN checks for this game
AntiHack antiHack = Managers.get(AntiHack.class);
antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class);
antiHack.addIgnoredCheck(HeadRoll.class);
antiHack.addIgnoredCheck(KillauraTypeD.class);
} }
protected <T extends Listener> T registerManager(T listener) protected <T extends Listener> T registerManager(T listener)

View File

@ -114,7 +114,7 @@ public class GamePlayerManager implements Listener
if (kit instanceof ProgressingKit) if (kit instanceof ProgressingKit)
{ {
ProgressingKit progressingKit = (ProgressingKit) kit; ProgressingKit progressingKit = (ProgressingKit) kit;
if (progressingKit.isDefault(player.getUniqueId())) if (progressingKit.canEquipKit(player) && progressingKit.isDefault(player.getUniqueId()))
{ {
progressingKit.onSelected(player.getUniqueId()); progressingKit.onSelected(player.getUniqueId());
return; return;

View File

@ -302,13 +302,15 @@ public class ProgressingKitManager implements Listener
{ {
UtilServer.getPlayersCollection().forEach(player -> UtilServer.getPlayersCollection().forEach(player ->
{ {
UUID id = player.getUniqueId();
for (Kit kit : _manager.GetGame().GetKits()) for (Kit kit : _manager.GetGame().GetKits())
{ {
//Set default kit //Set default kit
if (kit instanceof ProgressingKit) if (kit instanceof ProgressingKit)
{ {
ProgressingKit progressingKit = (ProgressingKit) kit; ProgressingKit progressingKit = (ProgressingKit) kit;
if (progressingKit.isDefault(player.getUniqueId())) if (progressingKit.canEquipKit(player) && progressingKit.isDefault(id))
{ {
progressingKit.onSelected(player.getUniqueId()); progressingKit.onSelected(player.getUniqueId());
break; break;

View File

@ -1,12 +1,10 @@
package nautilus.game.arcade.quest; package nautilus.game.arcade.quest;
import java.awt.dnd.DragSourceDropEvent;
import java.util.ArrayList; import java.util.ArrayList;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Chest; import org.bukkit.block.Chest;
import org.bukkit.block.DoubleChest; import org.bukkit.block.DoubleChest;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;

View File

@ -51,8 +51,6 @@ public class HitQuestTracker extends QuestTracker<Game>
if (!event.GetReason().contains("Axe Thrower")) if (!event.GetReason().contains("Axe Thrower"))
return; return;
System.out.println("Test2");
incrementQuests(event.GetDamagerPlayer(true), 1, "Player", "Axe", getGame().GetKit(event.GetDamagerPlayer(true)).GetName() + "Kit"); incrementQuests(event.GetDamagerPlayer(true), 1, "Player", "Axe", getGame().GetKit(event.GetDamagerPlayer(true)).GetName() + "Kit");
} }
} }