Spigot -> BungeeCord

Discussion in 'Spigot Plugin Development' started by Minerbeef, Jun 2, 2018.

  1. Hey, i am currently working on an Anti-Cheat that runs on a Spigot server, i have my LiteBans plugin on BungeeCord.

    when executing the Auto-Ban, it uses Vanilla /ban commands instead of using Bungee. Now, i was thinking i could use the following code to execute the bungee litebans command,

    Code (Java):
    ProxyServer proxy = ProxyServer.getInstance();
    proxy.getPluginManager().dispatchCommand(proxy.getConsole(), "ban " + player + ChatColor.translateAlternateColorCodes('&', "&cUnfair Advantage");
    Any thoughts? I can send the entire Auto-Ban class over if needs be.
     
  2. ProxyServer proxy = ProxyServer.getInstance();

    The above will not work when called from a Spigot plugin. What you should do is:
    1. Use bungee plugin messaging channel to send a ban request, and create a bungee plugin that handles the ban request and calls the LiteBans ban command on BungeeCord.

      Spigot server => Plugin message: BAN Minerbeef => BungeeCord execute ban Minerbeef
    2. I believe LiteBans also has a Spigot plugin. I'm not sure whether the Spigot and BungeeCord plugin of LiteBans integrate nicely, but this could allow you to execute the ban command from Spigot directly.
     
  3. LiteBans works on Spigot but i'm currently running a network and that would mean i would have to link all together using a database which is just annoying, and for some reason doesn't work for me.
     
  4. You could also solve this issue with sockets... Even tough that would be a little to much work