= Fixed the SpamJoin check

= Fixed the issue with the AutoSign check and empty content
= Updated dependency
This commit is contained in:
NeatMonster 2012-04-12 22:02:42 +02:00
parent f1e5481583
commit 9aa5536fe4
3 changed files with 9 additions and 24 deletions

View File

@ -4,7 +4,7 @@
<!-- Informations -->
<name>NoCheatPlus</name>
<version>3.5.5_2</version>
<version>3.5.5_3</version>
<description>Detect and fight the exploitation of various flaws/bugs in Minecraft.</description>
<url>http://dev.bukkit.org/server-mods/nocheatplus</url>
@ -42,7 +42,7 @@
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.2.5-R1.0</version>
<version>1.2.5-R1.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>

View File

@ -171,6 +171,11 @@ public class BlockPlaceCheckListener implements Listener, EventManager {
final NoCheatPlusPlayer player = plugin.getPlayer(event.getPlayer());
final BlockPlaceData data = BlockPlaceCheck.getData(player);
// Check if the sign's content is empty
if (event.getLine(0).length() + event.getLine(1).length() + event.getLine(2).length()
+ event.getLine(3).length() == 0)
return;
// Check if the text is the same
if (!event.getPlayer().hasPermission(Permissions.BLOCKPLACE_AUTOSIGN)
&& event.getLine(0).equals(data.lastSignText[0]) && event.getLine(1).equals(data.lastSignText[1])

View File

@ -153,8 +153,8 @@ public class ChatCheckListener implements Listener, EventManager {
ignoreCancelled = true, priority = EventPriority.LOWEST)
public void login(final PlayerLoginEvent event) {
// Only check new players (who has joined less than 10 minutes ago)
if (System.currentTimeMillis() - event.getPlayer().getFirstPlayed() > 600000L)
// Only check players who haven't played before
if (event.getPlayer().hasPlayedBefore())
return;
final NoCheatPlusPlayer player = plugin.getPlayer(event.getPlayer());
@ -165,24 +165,4 @@ public class ChatCheckListener implements Listener, EventManager {
// If the player failed the check, disallow the login
event.disallow(Result.KICK_OTHER, cc.spamJoinsKickMessage);
}
/*@EventHandler(
priority = EventPriority.MONITOR)
public void join(final PlayerJoinEvent event) {
// Only check new players (who has joined less than 10 minutes ago)
if (System.currentTimeMillis() - event.getPlayer().getFirstPlayed() > 600000L)
return;
final NoCheatPlusPlayer player = plugin.getPlayer(event.getPlayer());
final ChatData data = ChatCheck.getData(player);
// Get the question (and it's answer)
String[] question = data.getQuestion();
if (question == null)
return;
player.getPlayer().sendMessage(ChatColor.YELLOW + "Please answer the following question:");
player.getPlayer().sendMessage(ChatColor.YELLOW + "\"" + ChatColor.RED + question[0] + ChatColor.YELLOW + "\"");
}*/
}