kyngs / LibreLogin

Open-source, multiplatform, and highly customizable authentication plugin with outstanding features and API.
Mozilla Public License 2.0
171 stars 56 forks source link

Integration of Limbo Support for Authentication Servers #122

Closed bivashy closed 1 year ago

bivashy commented 1 year ago

Changes:

Detailed change list:

  1. Added into LibreLoginPlugin
    @Nullable
    LimboIntegration<S> getLimboIntegration();
  2. Added LimboIntegration interface into API module. (https://github.com/kyngs/LibreLogin/commit/248b9f9e26e5f59f5aca6b6e8ce2b08b9ef11171)
  3. Added limbo-port-range field into config.conf. (Default value is 30000-40000)
  4. Added NanoLimbo support for BungeeCord and Velocity. (Forwarding will be configured automatically)

How to use?

  1. Install NanoLimboPlugin
  2. Done!

Problems

  1. InfoForwardingFactory uses reflection to build InfoForwarding.
  2. We cannot initialize NanoLimboIntegration before super.enable() or else we would have such exception (package conflict)
    02:42:25 [WARNING] Exception encountered when loading plugin: LibreLogin
    java.lang.NoClassDefFoundError: xyz/kyngs/librelogin/lib/configurate/serialize/SerializationException
    at xyz.kyngs.librelogin.common.config.ConfigurationKeys.<clinit>(ConfigurationKeys.java:24)
    at xyz.kyngs.librelogin.bungeecord.BungeeCordLibreLogin.enable(BungeeCordLibreLogin.java:87)
    at xyz.kyngs.librelogin.bungeecord.BungeeCordBootstrap.onEnable(BungeeCordBootstrap.java:25)
    at net.md_5.bungee.api.plugin.PluginManager.enablePlugins(PluginManager.java:265)
    at net.md_5.bungee.BungeeCord.start(BungeeCord.java:285)
    at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:67)
    at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15)
    Caused by: java.lang.ClassNotFoundException: xyz.kyngs.librelogin.lib.configurate.serialize.SerializationException
    at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:103)
    at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:59)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 7 more

Problems can be fixed just by modifying NanoLimboPlugin.

bivashy commented 1 year ago

Hello, sorry for delay

I am touching internal classes because otherwise we should've create configuration, that would mean that this 'Integration' should be configured. I thought it is better if everything is pre-configured (info forwarding too). About DummyCommandHandler, it is required in LimboServer constructor

kyngs commented 1 year ago

Okay, the code looks good, I will test this soon:tm: and then I'll merge it

kyngs commented 1 year ago

Just tested it and it looks great, thanks!