Fixed message removal

This commit is contained in:
games647
2016-06-10 09:22:21 +02:00
parent 7733135ce4
commit 0b899f61a8
5 changed files with 25 additions and 6 deletions

View File

@ -21,6 +21,7 @@ So they don't need to enter passwords. This is also called auto login (auto-logi
* Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib * Plugin: ProtocolSupport is supported and can be used as an alternative to ProtocolLib
* No client modifications needed * No client modifications needed
* Good performance by using async non blocking operations * Good performance by using async non blocking operations
* Locale messages
* Free * Free
* Open source * Open source

View File

@ -101,6 +101,7 @@
<dependency> <dependency>
<groupId>com.github.lenis0012</groupId> <groupId>com.github.lenis0012</groupId>
<artifactId>LoginSecurity-2</artifactId> <artifactId>LoginSecurity-2</artifactId>
<!--Old version 2.0-->
<version>-9c09e73b7f-1</version> <version>-9c09e73b7f-1</version>
<exclusions> <exclusions>
<exclusion> <exclusion>

View File

@ -31,7 +31,10 @@ public class CrackedCommand implements CommandExecutor {
if (plugin.isBungeeCord()) { if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, sender.getName()); notifiyBungeeCord(sender, sender.getName());
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy")); String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else { } else {
//todo: load async if it's not in the cache anymore //todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
@ -59,7 +62,10 @@ public class CrackedCommand implements CommandExecutor {
if (plugin.isBungeeCord()) { if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, args[0]); notifiyBungeeCord(sender, args[0]);
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy")); String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else { } else {
//todo: load async if it's not in the cache anymore //todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);

View File

@ -36,7 +36,10 @@ public class PremiumCommand implements CommandExecutor {
if (plugin.isBungeeCord()) { if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, sender.getName()); notifiyBungeeCord(sender, sender.getName());
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy")); String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else { } else {
// //todo: load async if it's not in the cache anymore // //todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName()); final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(sender.getName());
@ -65,7 +68,10 @@ public class PremiumCommand implements CommandExecutor {
if (plugin.isBungeeCord()) { if (plugin.isBungeeCord()) {
notifiyBungeeCord(sender, args[0]); notifiyBungeeCord(sender, args[0]);
sender.sendMessage(plugin.getCore().getMessage("wait-on-proxy")); String message = plugin.getCore().getMessage("wait-on-proxy");
if (message != null) {
sender.sendMessage(message);
}
} else { } else {
//todo: load async if it's not in the cache anymore //todo: load async if it's not in the cache anymore
final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]); final PlayerProfile profile = plugin.getCore().getStorage().loadProfile(args[0]);

View File

@ -89,16 +89,21 @@ public class ForceLoginTask implements Runnable {
String message = plugin.getCore().getMessage("auto-register"); String message = plugin.getCore().getMessage("auto-register");
if (message != null) { if (message != null) {
message = message.replace("%password", generatedPassword); message = message.replace("%password", generatedPassword);
player.sendMessage(message);
} }
player.sendMessage(message);
return success; return success;
} }
private boolean forceLogin(BukkitAuthPlugin authPlugin, Player player) { private boolean forceLogin(BukkitAuthPlugin authPlugin, Player player) {
plugin.getLogger().log(Level.FINE, "Logging player {0} in", player.getName()); plugin.getLogger().log(Level.FINE, "Logging player {0} in", player.getName());
boolean success = authPlugin.forceLogin(player); boolean success = authPlugin.forceLogin(player);
player.sendMessage(plugin.getCore().getMessage("auto-login"));
String message = plugin.getCore().getMessage("auto-login");
if (message != null) {
player.sendMessage(message);
}
return success; return success;
} }