Examples of Spawner


Examples of lineage2.gameserver.model.Spawner

    }
    SpawnExObject object = event.getFirstObject(FortressSiegeEvent.OUT_POWER_UNITS);
    boolean allPowerDisabled = true;
    for (int i = 0; i < 4; i++)
    {
      Spawner spawn = object.getSpawns().get(i);
      if (spawn.getFirstSpawned() != null)
      {
        allPowerDisabled = false;
      }
    }
    if (allPowerDisabled)
View Full Code Here

Examples of lineage2.gameserver.model.Spawner

        message.setFile("residence2/fortress/fortress_inner_controller002.htm");
        FortressSiegeEvent event = getEvent(FortressSiegeEvent.class);
        if (event != null)
        {
          SpawnExObject exObject = event.getFirstObject(FortressSiegeEvent.SIEGE_COMMANDERS);
          Spawner spawn = exObject.getSpawns().get(3);
          MainMachineInstance machineInstance = (MainMachineInstance) spawn.getFirstSpawned();
          machineInstance.powerOff(this);
          onDecay();
        }
        break;
      case COND_TIMEOUT:
View Full Code Here

Examples of lineage2.gameserver.model.Spawner

        GameObject obj = wordList.length == 1 ? activeChar.getTarget() : GameObjectsStorage.getNpc(NumberUtils.toInt(wordList[1]));
        if ((obj != null) && obj.isNpc())
        {
          NpcInstance target = (NpcInstance) obj;
          target.deleteMe();
          Spawner spawn = target.getSpawn();
          if (spawn != null)
          {
            spawn.stopRespawn();
          }
          CustomSpawnTable.getInstance().deleteSpawn(target);
        }
        else
        {
View Full Code Here

Examples of lineage2.gameserver.model.Spawner

    {
      return false;
    }
    StringTokenizer st;
    NpcInstance target;
    Spawner spawn;
    NpcInstance npc;
    switch (command)
    {
      case admin_show_spawns:
        activeChar.sendPacket(new NpcHtmlMessage(5).setFile("admin/spawns.htm"));
View Full Code Here

Examples of net.itscrafted.entity.Spawner

    for(int i = 0; i < 6; i++) {
      bouncers.add(new Bouncer(40 + 80 * i, 240, 80, 80));
    }
    bouncerList.put(LEVEL6_1, bouncers);
    spawners = new ArrayList<Spawner>();
    spawners.add(new Spawner(320, 240, 100, 100, 120, 1.8));
    spawnerList.put(LEVEL6_1, spawners);
   
    // foe 2
    playerList.put(LEVEL6_2, new Point(80, 240));
    goalList.put(LEVEL6_2, new Point(560, 240));
    limitList.put(LEVEL6_2, 10);
    spawners = new ArrayList<Spawner>();
    spawners.add(new Spawner(320, 50, 80, 80, 120, 1.8));
    spawners.add(new Spawner(320, 430, 80, 80, 120, 1.8));
    spawnerList.put(LEVEL6_2, spawners);
    bouncers = new ArrayList<Bouncer>();
    bouncers.add(new Bouncer(320, 50, 100, 100));
    bouncers.add(new Bouncer(320, 430, 100, 100));
    bouncers.add(new Bouncer(320, 240, 30, 30));
    bouncerList.put(LEVEL6_2, bouncers);
    holes = new ArrayList<Hole>();
    holeList.put(LEVEL6_2, holes);
   
    // foe 3
    playerList.put(LEVEL6_3, new Point(80, 240));
    goalList.put(LEVEL6_3, new Point(560, 240));
    limitList.put(LEVEL6_3, 12);
    spawners = new ArrayList<Spawner>();
    spawners.add(new Spawner(320, 240, 80, 80, 90, 2));
    spawnerList.put(LEVEL6_3, spawners);
    bouncers = new ArrayList<Bouncer>();
    bouncers.add(new Bouncer(320, 240, 100, 100));
    bouncers.add(new Bouncer(320, 160, 30, 30, 2, 0));
    bouncers.add(new Bouncer(320, 320, 30, 30, -2, 0));
    bouncers.add(new Bouncer(213, 240, 30, 30, 0, 2));
    bouncers.add(new Bouncer(416, 240, 30, 30, 0, -2));
    bouncers.add(new Bouncer(320, 120, 30, 30));
    bouncers.add(new Bouncer(320, 360, 30, 30));
    bouncerList.put(LEVEL6_3, bouncers);
   
    // foe 4
    playerList.put(LEVEL6_4, new Point(80, 240));
    goalList.put(LEVEL6_4, new Point(560, 240));
    limitList.put(LEVEL6_4, 20);
    spawners = new ArrayList<Spawner>();
    bouncers = new ArrayList<Bouncer>();
    bouncers.add(new Bouncer(320, 240, 100, 100));
    bouncerList.put(LEVEL6_4, bouncers);
    spawners.add(new Spawner(80, 80, 80, 80, 60, 2));
    spawners.add(new Spawner(80, 400, 80, 80, 60, 2));
    spawners.add(new Spawner(560, 80, 80, 80, 60, 2));
    spawners.add(new Spawner(560, 400, 80, 80, 60, 2));
    spawnerList.put(LEVEL6_4, spawners);
   
    // force 1
    playerList.put(LEVEL7_1, new Point(80, 400));
    goalList.put(LEVEL7_1, new Point(560, 80));
    limitList.put(LEVEL7_1, 14);
    descriptions = new String[1];
    descriptions[0] = "- pull down";
    levelDescriptions.put(LEVEL7_1, descriptions);
    bouncers = new ArrayList<Bouncer>();
    bouncers.add(new Bouncer(320, 240, 120, 120));
    bouncers.add(new Bouncer(220, 390, 100, 100));
    bouncers.add(new Bouncer(90, 80, 100, 100));
    bouncers.add(new Bouncer(340, 50, 100, 100));
    bouncers.add(new Bouncer(540, 380, 100, 100));
    bouncers.add(new Bouncer(500, 210, 100, 100));
    bouncers.add(new Bouncer(80, 270, 100, 100));
    bouncerList.put(LEVEL7_1, bouncers);
   
    // force 2
    playerList.put(LEVEL7_2, new Point(80, 80));
    goalList.put(LEVEL7_2, new Point(560, 400));
    limitList.put(LEVEL7_2, 20);
    descriptions = new String[2];
    descriptions[0] = "- pull down";
    descriptions[1] = "- timed: 30 sec";
    levelDescriptions.put(LEVEL7_2, descriptions);
    bouncers = new ArrayList<Bouncer>();
    for(int i = 1; i < 6; i++) {
      for(int j = 0; j < 8; j++) {
        if((i + j) % 2 == 0) continue;
        bouncers.add(new Bouncer(80 * j, 80 * i, 30, 30));
      }
    }
    bouncerList.put(LEVEL7_2, bouncers);
    holes = new ArrayList<Hole>();
    for(int i = 0; i < 3; i++) {
      holes.add(new Hole(80 + 160 * i, 400, 130, 130));
    }
    holeList.put(LEVEL7_2, holes);
   
    // force 3
    playerList.put(LEVEL7_3, new Point(80, 400));
    goalList.put(LEVEL7_3, new Point(560, 100));
    limitList.put(LEVEL7_3, 10);
    descriptions = new String[1];
    descriptions[0] = "- pull up";
    levelDescriptions.put(LEVEL7_3, descriptions);
    bouncers = new ArrayList<Bouncer>();
    for(int i = 0; i < 7; i++) {
      bouncers.add(new Bouncer(120 + 80 * i, 0, 100, 100));
    }
    bouncerList.put(LEVEL7_3, bouncers);
    holes = new ArrayList<Hole>();
    for(int i = 0; i < 7; i++) {
      holes.add(new Hole(120 + 80 * i, 140, 100, 100));
    }
    holeList.put(LEVEL7_3, holes);
   
    // force 4
    playerList.put(LEVEL7_4, new Point(80, 240));
    goalList.put(LEVEL7_4, new Point(560, 240));
    limitList.put(LEVEL7_4, 20);
    descriptions = new String[1];
    descriptions[0] = "- pull left";
    levelDescriptions.put(LEVEL7_4, descriptions);
    spawners = new ArrayList<Spawner>();
    spawners.add(new Spawner(560, 120, 100, 100, 120, 2));
    spawners.add(new Spawner(560, 360, 100, 100, 120, 2));
    spawnerList.put(LEVEL7_4, spawners);
   
  }
View Full Code Here

Examples of net.xeoh.plugins.base.impl.Spawner

        // Obtain some shared objects
        //final JARCache jarCache = this.pluginManager.getJARCache();
        final ClassPathManager classPathManager = this.pluginManager.getClassPathManager();
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final PluginConfigurationUtil pcu = new PluginConfigurationUtil(this.pluginManager.getPluginConfiguration());
        final Spawner spawner = this.pluginManager.getSpawner();

        // Obtain information
        //final JARInformation jarInformation = jarCache.getJARInformation(name);
        //final String file = jarCache.classTofile(name);

        try {
            // Get class of the candidate
            final Class<?> possiblePlugin = classPathManager.loadClass(location, name);

            // Don't load plugins already spawned.
            if (name.startsWith("net.xeoh.plugins.base")) return;

            // Get the plugin's annotation
            final PluginImplementation annotation = possiblePlugin.getAnnotation(PluginImplementation.class);

            // Nothing to load here if no annotation is present
            if (annotation == null) { return; }

            // Don't load classes already loaded from this location
            final PluggableClassMetaInformation preexistingMeta = pluginRegistry.getMetaInformationFor((Class<? extends Plugin>) possiblePlugin);
            if (preexistingMeta != null) {
                System.err.println("SKIPPING BECAUSE DOUBLE");
                return;
            }

            // Register class at registry
            final PluggableClassMetaInformation metaInformation = new PluggableClassMetaInformation();
            metaInformation.pluginClassStatus = PluginClassStatus.ACCEPTED;
            if (location != null) {
                metaInformation.pluginOrigin = location.getLocation();
            } else {
                metaInformation.pluginOrigin = new URI("classpath://UNDEFINED");
            }
            pluginRegistry.registerPluginClass((Class<? extends Plugin>) possiblePlugin, metaInformation);

            // Update the class information of the corresponding cache entry
            this.logger.finer("Updating cache information");

            /*
            jarInformation.lastAccess = System.currentTimeMillis();
            jarInformation.usageCount++;
            if (!jarInformation.contents.contains(name)) {
                this.logger.finer("Adding " + name + " to cache of " + file);
                jarInformation.contents.add(name);
            }
            */

            // Avoid loading if annotation request it.
            if (pcu.getBoolean(possiblePlugin, "disabled", false) || possiblePlugin.getAnnotation(IsDisabled.class) != null) {
                metaInformation.pluginClassStatus = PluginClassStatus.DISABLED;
                this.logger.fine("Ignoring " + name + " due to request.");
                return;
            }

            // Up from here we know we will (eventually) use the plugin. So load
            // its configuration.           
            final String properties = (possiblePlugin.getAnnotation(ConfigurationFile.class) != null) ? possiblePlugin.getAnnotation(ConfigurationFile.class).configurationFile() : null;
            if (properties != null && properties.length() > 0) {
                final String resourcePath = name.replaceAll("\\.", "/").replaceAll(possiblePlugin.getSimpleName(), "") + properties;
                this.logger.fine("Adding configuration from " + resourcePath + " for plugin " + name);

                final Properties p = new Properties();

                // Try to load resource by special classloader
                try {
                    p.load(classPathManager.getResourceAsStream(location, resourcePath));
                    final Set<Object> keys = p.keySet();

                    // Add every string that is not already in the configuration.
                    for (final Object object : keys) {
                        if (pcu.getString(null, (String) object) == null) {
                            this.pluginManager.getPluginConfiguration().setConfiguration(null, (String) object, p.getProperty((String) object));
                        }
                    }
                } catch (final IOException e) {
                    this.logger.warning("Unable to load properties " + resourcePath + " although requested");
                } catch (final NullPointerException e) {
                    this.logger.warning("Unable to load properties " + resourcePath + " although requested. Probably not in package.");
                }
            }

            // Obtain dependencies
            metaInformation.dependencies = spawner.getDependencies((Class<? extends Plugin>) possiblePlugin);

            // If the class has unfulfilled dependencies, add it to our list.
            if (metaInformation.dependencies.size() == 0) {
                metaInformation.pluginClassStatus = PluginClassStatus.SPAWNABLE;
            } else {
View Full Code Here

Examples of net.xeoh.plugins.base.impl.Spawner

    @SuppressWarnings("unchecked")
    protected void processPending() {

        // Obtain shared objects
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final Spawner spawner = this.pluginManager.getSpawner();

        // All classes we want to spawn
        final Collection<Class<? extends Plugin>> toSpawn = new ArrayList<Class<? extends Plugin>>();
        toSpawn.addAll(pluginRegistry.getPluginClassesWithStatus(PluginClassStatus.CONTAINS_UNRESOLVED_DEPENDENCIES));
        toSpawn.addAll(pluginRegistry.getPluginClassesWithStatus(PluginClassStatus.SPAWNABLE));

        // Check if there is work to do.
        if (toSpawn.size() == 0) return;

        boolean loopAgain;

        do {
            // Classes we want to spawn
            final Collection<Class<? extends Plugin>> spawned = new ArrayList<Class<? extends Plugin>>();

            // Reset hasLoaded flag
            loopAgain = false;

            // Check all known classes ...
            for (final Class c : toSpawn) {
                this.logger.fine("Trying to load pending " + c);

                final PluggableClassMetaInformation metaInformation = pluginRegistry.getMetaInformationFor(c);

                // If the class is spawnable, spawn it ...
                if (metaInformation.pluginClassStatus == PluginClassStatus.SPAWNABLE) {
                    this.logger.fine("Class found as SPAWNABLE. Trying to spawn it now " + c);

                    //
                    // The magic line: spawn it.
                    //
                    final SpawnResult p = spawner.spawnPlugin(c);

                    // In case we were successful ...
                    if (p != null) {

                        // Link the parent class meta information
View Full Code Here

Examples of net.xeoh.plugins.base.impl.spawning.Spawner

     *
     * @param initialProperties
     */
    protected PluginManagerImpl(final Properties initialProperties) {
        // Create helper classes and config (needed early)
        this.spawner = new Spawner(this);
        this.classPathManager = new ClassPathManager(this);
        this.configuration = new PluginConfigurationImpl(initialProperties);

        // Hook fundamental plugins
        hookPlugin(new SpawnResult(this));
View Full Code Here

Examples of net.xeoh.plugins.base.impl.spawning.Spawner

        // Obtain some shared objects
        // final JARCache jarCache = this.pluginManager.getJARCache();
        final ClassPathManager classPathManager = this.pluginManager.getClassPathManager();
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final PluginConfigurationUtil pcu = new PluginConfigurationUtil(this.pluginManager.getPluginConfiguration());
        final Spawner spawner = this.pluginManager.getSpawner();

        // Obtain information
        // final JARInformation jarInformation = jarCache.getJARInformation(name);
        // final String file = jarCache.classTofile(name);

        try {
            // Get class of the candidate
            final Class<?> possiblePlugin = classPathManager.loadClass(location, name);

            // Don't load plugins already spawned.
            if (name.startsWith("net.xeoh.plugins.base") ||
                name.startsWith("net.xeoh.plugins.diagnosis.") ||
                name.startsWith("net.xeoh.plugins.informationbroker.")) return;
           
            // Get the plugin's annotation
            final PluginImplementation annotation = possiblePlugin.getAnnotation(PluginImplementation.class);

            // Nothing to load here if no annotation is present
            if (annotation == null) { return; }


           
            // Don't load classes already loaded from this location
            final PluginClassMetaInformation preexistingMeta = pluginRegistry.getMetaInformationFor((Class<? extends Plugin>) possiblePlugin);
            if (preexistingMeta != null) {
                this.logger.info("Skipping plugin " + possiblePlugin + " because we already have it ");
                return;
            }

           
            // Register class at registry
            final PluginClassMetaInformation metaInformation = new PluginClassMetaInformation();
            metaInformation.pluginClassStatus = PluginClassStatus.ACCEPTED;
            if (location != null) {
                metaInformation.pluginOrigin = location.getToplevelLocation();
            } else {
                metaInformation.pluginOrigin = new URI("classpath://UNDEFINED");
            }
            pluginRegistry.registerPluginClass((Class<? extends Plugin>) possiblePlugin, metaInformation);

            // Update the class information of the corresponding cache entry
            this.logger.finer("Updating cache information");

            // Avoid loading if annotation request it.
            if (pcu.getBoolean(possiblePlugin, "plugin.disabled", false) || possiblePlugin.getAnnotation(IsDisabled.class) != null) {
                metaInformation.pluginClassStatus = PluginClassStatus.DISABLED;
                this.logger.fine("Ignoring " + name + " due to request.");
                return;
            }
           
            // Up from here we know we will (eventually) use the plugin. So load its
            // configuration.
            final String properties = (possiblePlugin.getAnnotation(ConfigurationFile.class) != null) ? possiblePlugin.getAnnotation(ConfigurationFile.class).file() : null;
            if (properties != null && properties.length() > 0) {
                final String resourcePath = name.replaceAll("\\.", "/").replaceAll(possiblePlugin.getSimpleName(), "") + properties;
                this.logger.fine("Adding configuration from " + resourcePath + " for plugin " + name);

                final Properties p = new Properties();

                // Try to load resource by special classloader
                try {
                    p.load(classPathManager.getResourceAsStream(location, resourcePath));

                    final Set<Object> keys = p.keySet();

                    // Add every string that is not already in the configuration.
                    for (final Object object : keys) {
                        if (pcu.getString(null, (String) object) != null) {
                            this.pluginManager.getPluginConfiguration().setConfiguration(null, (String) object, p.getProperty((String) object));
                        }
                    }
                } catch (final IOException e) {
                    this.logger.warning("Unable to load properties " + resourcePath + " although requested");
                } catch (final NullPointerException e) {
                    this.logger.warning("Unable to load properties " + resourcePath + " although requested. Probably not in package.");
                }
            }

            // Obtain dependencies
            metaInformation.dependencies = spawner.getDependencies((Class<? extends Plugin>) possiblePlugin);

            // If the class has unfulfilled dependencies, add it to our list.
            if (metaInformation.dependencies.size() == 0) {
                metaInformation.pluginClassStatus = PluginClassStatus.SPAWNABLE;
            } else {
View Full Code Here

Examples of net.xeoh.plugins.base.impl.spawning.Spawner

    @SuppressWarnings({ "unchecked", "rawtypes" })
    protected void processPending() {

        // Obtain shared objects
        final PluginRegistry pluginRegistry = this.pluginManager.getPluginRegistry();
        final Spawner spawner = this.pluginManager.getSpawner();

        // All classes we want to spawn
        final Collection<Class<? extends Plugin>> toSpawn = new ArrayList<Class<? extends Plugin>>();
        toSpawn.addAll(pluginRegistry.getPluginClassesWithStatus(PluginClassStatus.CONTAINS_UNRESOLVED_DEPENDENCIES));
        toSpawn.addAll(pluginRegistry.getPluginClassesWithStatus(PluginClassStatus.SPAWNABLE));

        // Check if there is work to do.
        if (toSpawn.size() == 0) return;

        boolean loopAgain;

        do {
            // Classes we want to spawn
            final Collection<Class<? extends Plugin>> spawned = new ArrayList<Class<? extends Plugin>>();

            // Reset hasLoaded flag
            loopAgain = false;

            // Check all known classes ...
            for (final Class c : toSpawn) {
                this.logger.fine("Trying to load pending " + c);

                final PluginClassMetaInformation metaInformation = pluginRegistry.getMetaInformationFor(c);

                // If the class is spawnable, spawn it ...
                if (metaInformation.pluginClassStatus == PluginClassStatus.SPAWNABLE) {
                    this.logger.fine("Class found as SPAWNABLE. Trying to spawn it now " + c);

                    //
                    // The magic line: spawn it.
                    //
                    final SpawnResult p = spawner.spawnPlugin(c);

                    // In case we were successful ...
                    if (p != null && p.metaInformation.pluginStatus != PluginStatus.FAILED) {

                        // Link the parent class meta information
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.