Package games.stendhal.server.core.engine

Examples of games.stendhal.server.core.engine.ItemLogger


    String target = "ground";
    if (item.getContainerSlot() != null) {
      slotName = item.getContainerSlot().getName();
      target = "slot";
    }
    new ItemLogger().addLogItemEventCommand(new LogSimpleItemEventCommand(item, p,
            "market-to-" + target, itemName, Integer
                .toString(getQuantity(item)), "remove offer",
            slotName));
  }
View Full Code Here


  public void removeExpiredOffer(Offer offerToRemove) {
    this.getSlot(EXPIRED_OFFERS_SLOT_NAME).remove(offerToRemove.getID());

    Item item = offerToRemove.getItem();
    if (item != null) {
      new ItemLogger().destroy(null, this.getSlot(EXPIRED_OFFERS_SLOT_NAME),
          item, "timeout");
    }

    this.getZone().storeToDatabase();
  }
View Full Code Here

  public void onTurnReached(final int currentTurn) {
    // remove this object from the zone where it's lying on
    // the ground
    if (getZone() != null) {
      getZone().remove(getID());
      new ItemLogger().timeout(this);
    }
  }
View Full Code Here

    RPEntity player = null;
    if (container instanceof RPEntity) {
      player = (RPEntity) container;
    }

    new ItemLogger().destroy(player, slot, ring, "another ring");
    ring.removeFromWorld();
    logger.info("Destroyed a wedding ring: " + ring);
  }
View Full Code Here

//        }
//        String quantity = inspected.get("quantity");
//        if (quantity == null) {
//          quantity = "1";
//        }
        new ItemLogger().destroy(player, inspected.getContainerSlot(), inspected, "admin");
      }

      String slotname = inspected.getContainerSlot().getName();
      int objectID = inspected.getID().getObjectID();
      if (null != inspected.getContainerSlot().remove(inspected.getID())) {
        if (slot instanceof Entity) {
          ((Entity) slot).notifyWorldAboutChanges();
        }
        player.sendPrivateText("Removed contained " + name + " " + clazz + " with ID " + objectID + " from " + slotname);
      } else {
        player.sendPrivateText("could not remove contained " + inspected + " " + clazz + " with ID " + objectID + " from " + slotname);
      }
    } else {
      if (inspected instanceof Player) {
        final String text = "You can't remove players";
        player.sendPrivateText(text);
        return;
      }

      if (inspected instanceof SpeakerNPC) {
        final String text = "You can't remove SpeakerNPCs";
        player.sendPrivateText(text);
        return;
      }

      if (inspected instanceof Portal) {
        final String text = "You can't remove portals. Try blocking it with a few of /script AdminSign.class.";
        player.sendPrivateText(text);
        return;
      }

      final StendhalRPZone zone = inspected.getZone();

      if (inspected instanceof RPEntity) {
        if (inspected instanceof Creature) {
          // *destroyed creatures should not drop items
          ((Creature) inspected).clearDropItemList();
        }
        ((RPEntity) inspected).onDead(player);
      } else if ((inspected instanceof Item) || (inspected instanceof FlowerGrower) || (inspected instanceof Blood) || (inspected instanceof Corpse)) {
        // items should be added to itemlog as well, to help tracing problems
        if (inspected instanceof Item) {
          String quantity = inspected.get("quantity");
          if (quantity == null) {
            quantity = "1";
          }
          new ItemLogger().destroy(player, null, inspected, "admin");
        }
        zone.remove(inspected);
      } else {
        player.sendPrivateText("You can't remove this type of entity");
        return;
View Full Code Here

          final RPObject object = it.next();
          if (object instanceof StackableItem) {
            // found another stackable
            final StackableItem other = (StackableItem) object;
            if (other.isStackable(stackEntity)) {
              new ItemLogger().merge(player, stackEntity, other);

              // other is the same type...merge them
              other.add(stackEntity);
              entity = null;
              // do not process the entity further
View Full Code Here

    final Item entity = removeFromWorld();
    logger.debug("item removed");
    dest.addToWorld(entity, player);
    logger.debug("item readded");

    new ItemLogger().equipAction(player, entity, srcInfo, dest.getLogInfo());

    return true;
  }
View Full Code Here

   * @return Entity to place somewhere else in the world
   */
  public Item removeFromWorld() {
    if (quantity != 0) {
      final StackableItem newItem = ((StackableItem) item).splitOff(quantity);
      new ItemLogger().splitOff(player, item, newItem, quantity);
      return newItem;
    } else {
      item.removeFromWorld();
      return item;
    }
View Full Code Here

                          + " which you left on the floor in the vault "+ Grammar.hashave(item.getQuantity())+" been thrown into "
                          + "the void, because there was no space to fit them into either your "
                          + "bank chest or your bag.";

                // the timeout method enters the zone and coords of item, this is useful we will know it was in vault
                new ItemLogger().timeout(item);
              }
            }

            // tell the player the message
            notifyPlayer(((RPEntity) entity).getName(), message);
          } else {
            // the timeout method enters the zone and coords of item, this is useful, this is useful we will know it was in wastebin
            new ItemLogger().timeout(item);
          }

        }
        // since we are about to destroy the vault, change the player
        // zoneid to semos bank so that if they are relogging,
View Full Code Here

TOP

Related Classes of games.stendhal.server.core.engine.ItemLogger

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.