#1442 Don't send bungee messages if the plugin is disabled

+ fix unit test on windows env
This commit is contained in:
Gabriele C
2017-12-05 00:30:08 +01:00
parent 058ac22462
commit 8fd402add3
2 changed files with 10 additions and 2 deletions
@@ -3,6 +3,7 @@ package fr.xephi.authme.service.bungeecord;
import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.initialization.SettingsDependent;
import fr.xephi.authme.service.BukkitService;
import fr.xephi.authme.settings.Settings;
@@ -11,6 +12,7 @@ import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.Messenger;
import javax.inject.Inject;
import java.io.Console;
public class BungeeSender implements SettingsDependent {
@@ -76,6 +78,10 @@ public class BungeeSender implements SettingsDependent {
*/
public void sendAuthMeBungeecordMessage(String type, String playerName) {
if (isEnabled) {
if(!plugin.isEnabled()) {
ConsoleLogger.debug("Tried to send a " + type + " bungeecord message but the plugin was disabled!");
return;
}
sendBungeecordMessage("AuthMe", type, playerName.toLowerCase());
}
}