Merge remote-tracking branch 'refs/remotes/origin/develop' into update/moba-cosmetics

This commit is contained in:
Sam 2017-08-18 16:51:51 +01:00
commit 1c86cff6d7
13 changed files with 73 additions and 50 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,10 +109,10 @@ 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(10000)) .put(Timer.class, new ImmediateBanAction(10000))
@ -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

@ -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();
@ -432,8 +436,10 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
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();
} }
@ -454,6 +460,11 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
{ {
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);
if (message.getLastReplied() != null) if (message.getLastReplied() != null)
@ -647,6 +658,6 @@ public class MessageManager extends MiniClientPlugin<ClientMessage>
public PreferencesManager getPreferences() public PreferencesManager getPreferences()
{ {
return this._preferences; return _preferences;
} }
} }

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)
{ {
@ -34,6 +35,11 @@ public class RedisMessageCallback extends ServerCommand
return _staffMessage; return _staffMessage;
} }
public boolean informMuted()
{
return _informMuted;
}
public String getLastReplied() public String getLastReplied()
{ {
return _setLastMessage; return _setLastMessage;

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

@ -26,8 +26,12 @@ 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;
@ -171,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

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

@ -20,6 +20,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.entity.ProjectileHitEvent; import org.bukkit.event.entity.ProjectileHitEvent;
import org.bukkit.event.player.PlayerQuitEvent; 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.Glide;
import com.mineplex.anticheat.checks.move.HeadRoll; import com.mineplex.anticheat.checks.move.HeadRoll;
import com.mineplex.anticheat.checks.move.Speed; import com.mineplex.anticheat.checks.move.Speed;
@ -200,6 +201,7 @@ public class Moba extends TeamGame
antiHack.addIgnoredCheck(Speed.class); antiHack.addIgnoredCheck(Speed.class);
antiHack.addIgnoredCheck(Glide.class); antiHack.addIgnoredCheck(Glide.class);
antiHack.addIgnoredCheck(HeadRoll.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

@ -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");
} }
} }