Enum Class UnitOwnershipRules.OwnershipVerdict

java.lang.Object
java.lang.Enum<UnitOwnershipRules.OwnershipVerdict>
megamek.server.UnitOwnershipRules.OwnershipVerdict
All Implemented Interfaces:
Serializable, Comparable<UnitOwnershipRules.OwnershipVerdict>, Constable
Enclosing class:
UnitOwnershipRules

public static enum UnitOwnershipRules.OwnershipVerdict extends Enum<UnitOwnershipRules.OwnershipVerdict>
The reason a hand-off was allowed or refused. Kept as distinct values rather than a boolean so the log says which clause applied, which is what makes a permitted path auditable.
  • Enum Constant Details

    • SENDER_OWNS_THEM

      public static final UnitOwnershipRules.OwnershipVerdict SENDER_OWNS_THEM
      The ordinary case: a player acting on their own units.
    • SENDER_IS_GAMEMASTER

      public static final UnitOwnershipRules.OwnershipVerdict SENDER_IS_GAMEMASTER
      A gamemaster is meant to be able to set anybody up.
    • RECIPIENT_IS_A_BOT

      public static final UnitOwnershipRules.OwnershipVerdict RECIPIENT_IS_A_BOT
      The known weak point, kept deliberately. Since #8808 a unit for your own Princess travels over your connection carrying the bot's owner id, and the server holds no record of which human runs which bot, so it cannot tell your bot from anyone else's.
    • NO_SUCH_SENDER

      public static final UnitOwnershipRules.OwnershipVerdict NO_SUCH_SENDER
      The packet arrived on a connection that belongs to no player.
    • NO_SUCH_RECIPIENT

      public static final UnitOwnershipRules.OwnershipVerdict NO_SUCH_RECIPIENT
      The claimed recipient is not in the game.
    • NOT_PERMITTED

      public static final UnitOwnershipRules.OwnershipVerdict NOT_PERMITTED
      A player trying to hand units to another human who is not theirs to act for.
  • Method Details

    • values

      public static UnitOwnershipRules.OwnershipVerdict[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static UnitOwnershipRules.OwnershipVerdict valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • isAllowed

      public boolean isAllowed()