Search in sources :

Example 1 with PlayerInitListener

use of de.dytanic.cloudnetcore.permissions.listener.PlayerInitListener in project CloudNet by Dytanic.

the class PermissionModule method onBootstrap.

@Override
public void onBootstrap() {
    try {
        configPermission = new ConfigPermissions();
    } catch (Exception e) {
        e.printStackTrace();
    }
    permissionPool = new PermissionPool();
    permissionPool.setAvailable(configPermission.isEnabled0());
    NetworkUtils.addAll(permissionPool.getGroups(), configPermission.loadAll0());
    getCloud().getNetworkManager().getModuleProperties().append("permissionPool", permissionPool);
    getCloud().getEventManager().registerListener(this, new PlayerInitListener());
    getCloud().getEventManager().registerListener(this, new UpdateAllListener());
    getCloud().getCommandManager().registerCommand(new CommandPermissions());
    getCloud().getPacketManager().registerHandler(PacketRC.CN_CORE + 1, PacketInUpdatePermissionGroup.class);
}
Also used : UpdateAllListener(de.dytanic.cloudnetcore.permissions.listener.UpdateAllListener) PermissionPool(de.dytanic.cloudnet.lib.player.permission.PermissionPool) ConfigPermissions(de.dytanic.cloudnetcore.permissions.config.ConfigPermissions) PlayerInitListener(de.dytanic.cloudnetcore.permissions.listener.PlayerInitListener) CommandPermissions(de.dytanic.cloudnetcore.permissions.command.CommandPermissions)

Aggregations

PermissionPool (de.dytanic.cloudnet.lib.player.permission.PermissionPool)1 CommandPermissions (de.dytanic.cloudnetcore.permissions.command.CommandPermissions)1 ConfigPermissions (de.dytanic.cloudnetcore.permissions.config.ConfigPermissions)1 PlayerInitListener (de.dytanic.cloudnetcore.permissions.listener.PlayerInitListener)1 UpdateAllListener (de.dytanic.cloudnetcore.permissions.listener.UpdateAllListener)1