Merge branch 'master' of https://github.com/AuthMe-Team/AuthMeReloaded into 358-encryptn-mthd-refactor

This commit is contained in:
ljacqu 2015-12-29 10:54:09 +01:00
commit 571cb6d36b
5 changed files with 45828 additions and 7 deletions

View File

@ -7,3 +7,7 @@ general:
test:
override:
- mvn clean install -B
notify:
webhooks:
- url: https://webhooks.gitter.im/e/7b92ac1a1741748b26bf

21
pom.xml
View File

@ -2,7 +2,7 @@
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.xephi</groupId>
<artifactId>authme</artifactId>
<version>5.2-SNAPSHOT</version>
@ -229,6 +229,25 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>4.1.0</version>
<!-- Token is provided by mvn command -->
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -222,7 +222,7 @@ public class AuthMePlayerListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST)
public void onPreLogin(AsyncPlayerPreLoginEvent event) {
PlayerAuth auth = plugin.database.getAuth(event.getName());
if (auth != null && !auth.getRealName().equals("Player") && !auth.getRealName().equals(event.getName())) {
if (auth != null && auth.getRealName() != null && !auth.getRealName().isEmpty() && !auth.getRealName().equals("Player") && !auth.getRealName().equals(event.getName())) {
event.setLoginResult(AsyncPlayerPreLoginEvent.Result.KICK_OTHER);
event.setKickMessage("You should join using username: " + ChatColor.AQUA + auth.getRealName() +
ChatColor.RESET + "\nnot: " + ChatColor.RED + event.getName()); // TODO: write a better message

View File

@ -24,7 +24,6 @@ public final class ListenerConsistencyTest {
AuthMePlayerListener.class, AuthMePlayerListener16.class, AuthMePlayerListener18.class,
AuthMeServerListener.class };
// TODO #368: Ensure that these exceptions are really intentional, if not fix them and remove them here
private static final Set<String> CANCELED_EXCEPTIONS = Sets.newHashSet("AuthMePlayerListener#onPlayerJoin",
"AuthMePlayerListener#onPreLogin", "AuthMePlayerListener#onPlayerLogin",
"AuthMePlayerListener#onPlayerQuit", "AuthMeServerListener#onPluginDisable",
@ -57,7 +56,7 @@ public final class ListenerConsistencyTest {
Set<String> events = new HashSet<>();
for (Class<?> listener : LISTENERS) {
for (Method method : listener.getDeclaredMethods()) {
if (events.contains(method.getName())) {
if (isTestableMethod(method) && events.contains(method.getName())) {
fail("More than one method '" + method.getName() + "' exists (e.g. class: " + listener + ")");
}
events.add(method.getName());
@ -103,9 +102,10 @@ public final class ListenerConsistencyTest {
}
private static boolean isTestableMethod(Method method) {
// A method like "access$000" is created by the compiler when a private member is being accessed by an inner
// class, so we need to ignore such methods
return !Modifier.isPrivate(method.getModifiers()) && !method.getName().startsWith("access$");
// Exclude any methods with "$" in it: jacoco creates a "$jacocoInit" method we want to ignore, and
// methods like "access$000" are created by the compiler when a private member is being accessed by an inner
// class, which is not of interest for us
return !Modifier.isPrivate(method.getModifiers()) && !method.getName().contains("$");
}
}

45798
xenforo.sql Normal file

File diff suppressed because one or more lines are too long