use of com.github.games647.fastlogin.velocity.listener.ConnectListener in project ChangeSkin by games647.
the class ChangeSkinBungee method onEnable.
@Override
public void onEnable() {
logger = CommonUtil.createLoggerFromJDK(getLogger());
core = new ChangeSkinCore(this);
try {
core.load(true);
} catch (Exception ioExc) {
logger.error("Error initializing plugin. Disabling...", ioExc);
return;
}
PluginManager pluginManager = getProxy().getPluginManager();
pluginManager.registerListener(this, new ConnectListener(this));
pluginManager.registerListener(this, new ServerSwitchListener(this));
// this is required to listen to incoming messages from the server
getProxy().registerChannel(new NamespaceKey(getName(), PERMISSION_RESULT_CHANNEL).getCombinedName());
getProxy().registerChannel(new NamespaceKey(getName(), FORWARD_COMMAND_CHANNEL).getCombinedName());
pluginManager.registerListener(this, new PluginMessageListener(this));
// register commands
pluginManager.registerCommand(this, new SetCommand(this));
pluginManager.registerCommand(this, new InvalidateCommand(this));
pluginManager.registerCommand(this, new UploadCommand(this));
pluginManager.registerCommand(this, new SelectCommand(this));
pluginManager.registerCommand(this, new InfoCommand(this));
}
use of com.github.games647.fastlogin.velocity.listener.ConnectListener 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.velocity.listener.ConnectListener 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