Fix test / use new DataSource method / add space before keywords
This commit is contained in:
@@ -5,7 +5,6 @@ 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.datasource.CacheDataSource;
|
||||
import fr.xephi.authme.datasource.DataSource;
|
||||
import fr.xephi.authme.initialization.SettingsDependent;
|
||||
import fr.xephi.authme.service.BukkitService;
|
||||
@@ -22,13 +21,13 @@ import javax.inject.Inject;
|
||||
*/
|
||||
public class BungeeService implements SettingsDependent, PluginMessageListener {
|
||||
|
||||
private AuthMe plugin;
|
||||
private BukkitService service;
|
||||
private final AuthMe plugin;
|
||||
private final BukkitService service;
|
||||
private final DataSource dataSource;
|
||||
|
||||
private boolean isEnabled;
|
||||
private String destinationServerOnLogin;
|
||||
|
||||
private DataSource dataSource;
|
||||
|
||||
/*
|
||||
* Constructor.
|
||||
@@ -59,7 +58,7 @@ public class BungeeService implements SettingsDependent, PluginMessageListener {
|
||||
|
||||
private void sendBungeecordMessage(String... data) {
|
||||
ByteArrayDataOutput out = ByteStreams.newDataOutput();
|
||||
for(String element : data) {
|
||||
for (String element : data) {
|
||||
out.writeUTF(element);
|
||||
}
|
||||
service.sendPluginMessage("BungeeCord", out.toByteArray());
|
||||
@@ -81,7 +80,7 @@ public class BungeeService implements SettingsDependent, PluginMessageListener {
|
||||
}
|
||||
|
||||
public void sendAuthMeBungeecordMessage(String type, String playerName) {
|
||||
if(!isEnabled) {
|
||||
if (isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -90,13 +89,13 @@ public class BungeeService implements SettingsDependent, PluginMessageListener {
|
||||
|
||||
@Override
|
||||
public void onPluginMessageReceived(String channel, Player player, byte[] data) {
|
||||
if(!isEnabled) {
|
||||
if (!isEnabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayDataInput in = ByteStreams.newDataInput(data);
|
||||
String subchannel = in.readUTF();
|
||||
if(!"Authme".equals(subchannel)) {
|
||||
if (!"Authme".equals(subchannel)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -113,7 +112,7 @@ public class BungeeService implements SettingsDependent, PluginMessageListener {
|
||||
dataSource.refreshCache(name);
|
||||
break;
|
||||
default:
|
||||
ConsoleLogger.debug("Received unsupported bungeecord message type! (" + type + ")");
|
||||
ConsoleLogger.debug("Received unsupported bungeecord message type! ({0})", type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user