use of com.github.games647.fastlogin.core.AsyncScheduler in project FastLogin by games647.
the class FastLoginBungee method onEnable.
@Override
public void onEnable() {
logger = CommonUtil.initializeLoggerService(getLogger());
scheduler = new AsyncScheduler(logger, task -> getProxy().getScheduler().runAsync(this, task));
core = new FastLoginCore<>(this);
core.load();
if (!core.setupDatabase()) {
return;
}
if (isPluginInstalled("floodgate")) {
floodgateService = new FloodgateService(FloodgateApi.getInstance(), core);
}
if (isPluginInstalled("Geyser-BungeeCord")) {
geyserService = new GeyserService(GeyserImpl.getInstance(), core);
}
// events
PluginManager pluginManager = getProxy().getPluginManager();
ConnectListener connectListener = new ConnectListener(this, core.getRateLimiter());
pluginManager.registerListener(this, connectListener);
pluginManager.registerListener(this, new PluginMessageListener(this));
// this is required to listen to incoming messages from the server
getProxy().registerChannel(NamespaceKey.getCombined(getName(), ChangePremiumMessage.CHANGE_CHANNEL));
getProxy().registerChannel(NamespaceKey.getCombined(getName(), SuccessMessage.SUCCESS_CHANNEL));
registerHook();
}
use of com.github.games647.fastlogin.core.AsyncScheduler in project FastLogin by games647.
the class FastLoginVelocity method onProxyInitialization.
@Subscribe
public void onProxyInitialization(ProxyInitializeEvent event) {
scheduler = new AsyncScheduler(logger, task -> server.getScheduler().buildTask(this, task).schedule());
core = new FastLoginCore<>(this);
core.load();
loadOrGenerateProxyId();
if (!core.setupDatabase() || proxyId == null) {
return;
}
server.getEventManager().register(this, new ConnectListener(this, core.getRateLimiter()));
server.getEventManager().register(this, new PluginMessageListener(this));
server.getChannelRegistrar().register(MinecraftChannelIdentifier.create(getName(), ChangePremiumMessage.CHANGE_CHANNEL));
server.getChannelRegistrar().register(MinecraftChannelIdentifier.create(getName(), SuccessMessage.SUCCESS_CHANNEL));
}
Aggregations