2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-23 04:28:01 +00:00

as new config, check if ye wana load legacy commands

This commit is contained in:
mohammed jasem alaajel 2022-07-22 16:10:06 +04:00
parent 5c6cf405fa
commit 2c8c5fc1cf
3 changed files with 27 additions and 26 deletions

View File

@ -7,7 +7,6 @@ import com.google.common.io.ByteArrayDataInput;
import com.google.common.io.ByteArrayDataOutput; import com.google.common.io.ByteArrayDataOutput;
import com.google.common.io.ByteStreams; import com.google.common.io.ByteStreams;
import com.imaginarycode.minecraft.redisbungee.api.AbstractRedisBungeeListener; import com.imaginarycode.minecraft.redisbungee.api.AbstractRedisBungeeListener;
import com.imaginarycode.minecraft.redisbungee.api.AbstractDataManager;
import com.imaginarycode.minecraft.redisbungee.api.GenericPlayerUtils; import com.imaginarycode.minecraft.redisbungee.api.GenericPlayerUtils;
import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin; import com.imaginarycode.minecraft.redisbungee.api.RedisBungeePlugin;
import com.imaginarycode.minecraft.redisbungee.api.tasks.RedisTask; import com.imaginarycode.minecraft.redisbungee.api.tasks.RedisTask;
@ -142,8 +141,6 @@ public class RedisBungeeBungeeListener extends AbstractRedisBungeeListener<Login
@EventHandler @EventHandler
public void onPlayerDisconnect(PlayerDisconnectEvent event) { public void onPlayerDisconnect(PlayerDisconnectEvent event) {
plugin.executeAsync(new RedisTask<Void>(plugin) { plugin.executeAsync(new RedisTask<Void>(plugin) {
@Override @Override
public Void jedisTask(Jedis jedis) { public Void jedisTask(Jedis jedis) {
Pipeline pipeline = jedis.pipelined(); Pipeline pipeline = jedis.pipelined();

View File

@ -742,18 +742,20 @@ public class RedisBungeeBungeePlugin extends Plugin implements RedisBungeePlugin
// register plugin messages channel. // register plugin messages channel.
getProxy().registerChannel("legacy:redisbungee"); getProxy().registerChannel("legacy:redisbungee");
getProxy().registerChannel("RedisBungee"); getProxy().registerChannel("RedisBungee");
// register commands if (configuration.doRegisterLegacyCommands()) {
if (configuration.doOverrideBungeeCommands()) { // register commands
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.GlistCommand(this)); if (configuration.doOverrideBungeeCommands()) {
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.FindCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.GlistCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.LastSeenCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.FindCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.IpCommand(this)); getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.LastSeenCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.IpCommand(this));
}
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.SendToAll(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.ServerId(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.ServerIds(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlayerProxyCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlistCommand(this));
} }
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.SendToAll(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.ServerId(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.ServerIds(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlayerProxyCommand(this));
getProxy().getPluginManager().registerCommand(this, new RedisBungeeCommands.PlistCommand(this));
} }
@Override @Override

View File

@ -765,19 +765,21 @@ public class RedisBungeeVelocityPlugin implements RedisBungeePlugin<Player> {
// register plugin messages // register plugin messages
IDENTIFIERS.forEach(getProxy().getChannelRegistrar()::register); IDENTIFIERS.forEach(getProxy().getChannelRegistrar()::register);
// register commands // register legacy commands
// Override Velocity commands if (configuration.doRegisterLegacyCommands()) {
if (configuration.doOverrideBungeeCommands()) { // Override Velocity commands
getProxy().getCommandManager().register("glist", new RedisBungeeCommands.GlistCommand(this), "redisbungee", "rglist"); if (configuration.doOverrideBungeeCommands()) {
getProxy().getCommandManager().register("glist", new RedisBungeeCommands.GlistCommand(this), "redisbungee", "rglist");
}
getProxy().getCommandManager().register("sendtoall", new RedisBungeeCommands.SendToAll(this), "rsendtoall");
getProxy().getCommandManager().register("serverid", new RedisBungeeCommands.ServerId(this), "rserverid");
getProxy().getCommandManager().register("serverids", new RedisBungeeCommands.ServerIds(this));
getProxy().getCommandManager().register("pproxy", new RedisBungeeCommands.PlayerProxyCommand(this));
getProxy().getCommandManager().register("plist", new RedisBungeeCommands.PlistCommand(this), "rplist");
getProxy().getCommandManager().register("lastseen", new RedisBungeeCommands.LastSeenCommand(this), "rlastseen");
getProxy().getCommandManager().register("ip", new RedisBungeeCommands.IpCommand(this), "playerip", "rip", "rplayerip");
getProxy().getCommandManager().register("find", new RedisBungeeCommands.FindCommand(this), "rfind");
} }
getProxy().getCommandManager().register("sendtoall", new RedisBungeeCommands.SendToAll(this), "rsendtoall");
getProxy().getCommandManager().register("serverid", new RedisBungeeCommands.ServerId(this), "rserverid");
getProxy().getCommandManager().register("serverids", new RedisBungeeCommands.ServerIds(this));
getProxy().getCommandManager().register("pproxy", new RedisBungeeCommands.PlayerProxyCommand(this));
getProxy().getCommandManager().register("plist", new RedisBungeeCommands.PlistCommand(this), "rplist");
getProxy().getCommandManager().register("lastseen", new RedisBungeeCommands.LastSeenCommand(this), "rlastseen");
getProxy().getCommandManager().register("ip", new RedisBungeeCommands.IpCommand(this), "playerip", "rip", "rplayerip");
getProxy().getCommandManager().register("find", new RedisBungeeCommands.FindCommand(this), "rfind");
} }
@Override @Override