Fix typo in BungeeCord message key

This commit is contained in:
games647
2016-06-16 15:10:25 +02:00
parent 2881689f09
commit b009658eea
10 changed files with 15 additions and 12 deletions

View File

@@ -1,3 +1,7 @@
######1.6.1
* Fix message typo in BungeeCord which created a NPE if premium-warning is activated
######1.6 ######1.6
* Add a warning message if the user tries to invoke the premium command * Add a warning message if the user tries to invoke the premium command

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.github.games647</groupId> <groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId> <artifactId>fastlogin</artifactId>
<version>1.6</version> <version>1.6.1</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@@ -83,7 +83,6 @@ public class CrackedCommand implements CommandExecutor {
if (profile.isPremium()) { if (profile.isPremium()) {
sender.sendMessage(plugin.getCore().getMessage("remove-premium")); sender.sendMessage(plugin.getCore().getMessage("remove-premium"));
profile.setPremium(false); profile.setPremium(false);
profile.setUuid(null);
Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() { Bukkit.getScheduler().runTaskAsynchronously(plugin, new Runnable() {
@Override @Override
public void run() { public void run() {

View File

@@ -64,7 +64,7 @@ public class ForceLoginTask implements Runnable {
if (playerProfile != null) { if (playerProfile != null) {
playerProfile.setUuid(session.getUuid()); playerProfile.setUuid(session.getUuid());
//save cracked players too //save cracked players too
playerProfile.setPremium(session.isVerified()); playerProfile.setPremium(true);
storage.save(playerProfile); storage.save(playerProfile);
} }
@@ -87,7 +87,7 @@ public class ForceLoginTask implements Runnable {
String generatedPassword = plugin.generateStringPassword(player); String generatedPassword = plugin.generateStringPassword(player);
boolean success = authPlugin.forceRegister(player, generatedPassword); boolean success = authPlugin.forceRegister(player, generatedPassword);
String message = plugin.getCore().getMessage("auto-register"); String message = plugin.getCore().getMessage("auto-register");
if (message != null) { if (success && message != null) {
message = message.replace("%password", generatedPassword); message = message.replace("%password", generatedPassword);
player.sendMessage(message); player.sendMessage(message);
} }
@@ -100,7 +100,7 @@ public class ForceLoginTask implements Runnable {
boolean success = authPlugin.forceLogin(player); boolean success = authPlugin.forceLogin(player);
String message = plugin.getCore().getMessage("auto-login"); String message = plugin.getCore().getMessage("auto-login");
if (message != null) { if (success && message != null) {
player.sendMessage(message); player.sendMessage(message);
} }

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.github.games647</groupId> <groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId> <artifactId>fastlogin</artifactId>
<version>1.6</version> <version>1.6.1</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@@ -51,7 +51,7 @@ public class PluginMessageListener implements Listener {
if (playerName.equals(fromPlayer.getName()) && plugin.getConfig().getBoolean("premium-warning") if (playerName.equals(fromPlayer.getName()) && plugin.getConfig().getBoolean("premium-warning")
&& !plugin.getPendingConfirms().contains(fromPlayer.getUniqueId())) { && !plugin.getPendingConfirms().contains(fromPlayer.getUniqueId())) {
fromPlayer.sendMessage(TextComponent.fromLegacyText(plugin.getCore().getMessage("premium-warming"))); fromPlayer.sendMessage(TextComponent.fromLegacyText(plugin.getCore().getMessage("premium-warning")));
plugin.getPendingConfirms().add(fromPlayer.getUniqueId()); plugin.getPendingConfirms().add(fromPlayer.getUniqueId());
return; return;
} }

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.github.games647</groupId> <groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId> <artifactId>fastlogin</artifactId>
<version>1.6</version> <version>1.6.1</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@@ -79,7 +79,7 @@ public class Storage {
ResultSet resultSet = null; ResultSet resultSet = null;
try { try {
con = dataSource.getConnection(); con = dataSource.getConnection();
loadStmt = con.prepareStatement("SELECT * FROM " + PREMIUM_TABLE + " WHERE Name=?"); loadStmt = con.prepareStatement("SELECT * FROM " + PREMIUM_TABLE + " WHERE Name=? LIMIT 1");
loadStmt.setString(1, name); loadStmt.setString(1, name);
resultSet = loadStmt.executeQuery(); resultSet = loadStmt.executeQuery();
@@ -120,7 +120,7 @@ public class Storage {
ResultSet resultSet = null; ResultSet resultSet = null;
try { try {
con = dataSource.getConnection(); con = dataSource.getConnection();
loadStmt = con.prepareStatement("SELECT * FROM " + PREMIUM_TABLE + " WHERE UUID=?"); loadStmt = con.prepareStatement("SELECT * FROM " + PREMIUM_TABLE + " WHERE UUID=? LIMIT 1");
loadStmt.setString(1, uuid.toString().replace("-", "")); loadStmt.setString(1, uuid.toString().replace("-", ""));
resultSet = loadStmt.executeQuery(); resultSet = loadStmt.executeQuery();

View File

@@ -8,7 +8,7 @@
<packaging>pom</packaging> <packaging>pom</packaging>
<name>FastLogin</name> <name>FastLogin</name>
<version>1.6</version> <version>1.6.1</version>
<inceptionYear>2015</inceptionYear> <inceptionYear>2015</inceptionYear>
<url>https://www.spigotmc.org/resources/fastlogin.14153/</url> <url>https://www.spigotmc.org/resources/fastlogin.14153/</url>
<description> <description>

View File

@@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.github.games647</groupId> <groupId>com.github.games647</groupId>
<artifactId>fastlogin</artifactId> <artifactId>fastlogin</artifactId>
<version>1.6</version> <version>1.6.1</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>