Class ActionValidation

java.lang.Object
games.stendhal.server.actions.validator.ActionValidation
All Implemented Interfaces:
ActionValidator

public class ActionValidation extends Object implements ActionValidator
validates an RPAction using a list of ActionValidators
Author:
hendrik
  • Constructor Details

    • ActionValidation

      public ActionValidation()
  • Method Details

    • add

      public void add(ActionValidator validator)
      adds an ActionValidator
      Parameters:
      validator - ActionValidator
    • validate

      public String validate(Player player, RPAction action, ActionData data)
      validates an RPAction.
      Specified by:
      validate in interface ActionValidator
      Parameters:
      player - Player
      action - RPAction to validate
      data - data about this action
      Returns:
      null if the action is valid; an error message otherwise
    • validate

      public String validate(Player player, RPAction action)
      validates an RPAction.
      Parameters:
      player - Player
      action - RPAction to validate
      Returns:
      null if the action is valid; an error message otherwise
    • validateAndInformPlayer

      public boolean validateAndInformPlayer(Player player, RPAction action)
      validates an RPAction and tells the player about validation issues.
      Parameters:
      player - Player
      action - RPAction to validate
      Returns:
      true, if the action may continue; false on error
    • validateAndInformPlayer

      public boolean validateAndInformPlayer(Player player, RPAction action, ActionData data)
      validates an RPAction and tells the player about validation issues.
      Parameters:
      player - Player
      action - RPAction to validate
      data - action datra
      Returns:
      true, if the action may continue; false on error