Package simpleserver.config.xml

Examples of simpleserver.config.xml.Event


    if (player.getServer().config.events.contains(args[0])) {
      player.addTMessage(Color.RED, "This event name is already taken!");
      return;
    }

    Event e = new Event(args[0],
                        new Coordinate((int) player.x(), (int) player.y(), (int) player.z(), player.getDimension()));
    player.getServer().config.events.add(e);
    player.getServer().saveConfig();

    player.addTMessage(Color.GRAY, "Event created!");
View Full Code Here


      c = q.position.coordinate();
    }

    // Try to find such an event
    if (c == null && dest.length() > 0 && dest.charAt(0) == GLOBALSCOPE) {
      Event evdest = eventHost.findEvent(dest.substring(1));
      if (evdest != null) {
        c = evdest.coordinate;
      }
    }
View Full Code Here

    if (eventHost.npcs.get(name) != null) {
      notifyError("An NPC with this name still exists!");
      return;
    }

    Event event = eventHost.findEvent(tokens.remove(0));
    if (event == null) {
      notifyError("Event associated with NPC not found!");
      return;
    }
View Full Code Here

    if (tokens.size() < 1) {
      notifyError("Wrong number of arguments!");
      return;
    }

    Event e = eventHost.findEvent(tokens.remove(0));

    if (e == null) {
      notifyError("Event to run not found!");
      return;
    }
View Full Code Here

    events = new ConcurrentHashMap<Event, Long>();
    globals = new ConcurrentHashMap<String, String>();

    Iterator<Event> it = server.config.events.iterator();
    while (it.hasNext()) {
      Event ev = it.next();
      events.put(ev, (long) 0);
      globals.put(ev.name, ev.value);
    }
  }
View Full Code Here

      }
    }

    try {
      if (server.options.getBoolean("enableEvents") && config.event != null) {
        Event e = server.eventhost.findEvent(config.event);
        if (e != null) {
          ArrayList<String> arguments = new ArrayList<String>();
          if (!args.equals("")) {
            arguments = new ArrayList<String>(java.util.Arrays.asList(args.split("\\s+")));
          }
View Full Code Here

    for (Area a : areasCopy) { // run area onenter events
      if (a.event == null) {
        continue;
      }
      Event e = server.eventhost.findEvent(a.event);
      if (e != null) {
        ArrayList<String> args = new ArrayList<String>();
        args.add("enter");
        args.add(a.name);
        server.eventhost.execute(e, this, true, args);
      } else {
        System.out.println("Error in area " + a.name + "/event: Event " + a.event + " not found!");
      }
    }

    for (Area a : oldAreas) { // run area onleave events
      if (a.event == null) {
        continue;
      }
      Event e = server.eventhost.findEvent(a.event);
      if (e != null) {
        ArrayList<String> args = new ArrayList<String>();
        args.add("leave");
        args.add(a.name);
        server.eventhost.execute(e, this, true, args);
View Full Code Here

      return;
    }

    Iterator<Event> it = server.eventhost.events.keySet().iterator();
    while (it.hasNext()) {
      Event ev = it.next();
      if (!ev.type.equals("plate") || ev.coordinate == null) {
        continue;
      }
      if (position.coordinate().equals(ev.coordinate)) { // matching -> execute
        server.eventhost.execute(ev, this, false, null);
View Full Code Here

  }

  public void saveGlobalVars() {
    Iterator<Event> it = server.config.events.iterator();
    while (it.hasNext()) {
      Event ev = it.next();
      ev.value = globals.get(ev.name);
    }
  }
View Full Code Here

      return;
    }

    Iterator<Event> it = server.eventhost.events.keySet().iterator();
    while (it.hasNext()) {
      Event ev = it.next();
      if (!ev.type.equals("button") || ev.coordinate == null) {
        continue;
      }
      if ((new Coordinate(c.x(), c.y(), c.z(), position.dimension())).equals(ev.coordinate)) { // matching
                                                                                               // ->
View Full Code Here

TOP

Related Classes of simpleserver.config.xml.Event

Copyright © 2018 www.massapicom. 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.