Enum ServerId

All Implemented Interfaces:
Serializable, Comparable<ServerId>, java.lang.constant.Constable

public enum ServerId extends Enum<ServerId>
The live server a plugin runs on, as the unified API names it.

Read it with ctx.server(). Compare constants, never display names: a launcher may spell a server "Roat Pkz", "roatpkz" or "ROAT_PKZ", and all of them are ROAT_PKZ.

UNKNOWN means PrivBot could not tell which server this is (or it is a server the SDK does not publish). Treat it as "no capability is known", never as "Orion".

  • Enum Constant Details

    • IMPACT

      public static final ServerId IMPACT
    • ELORIN

      public static final ServerId ELORIN
    • ORION

      public static final ServerId ORION
    • SPAWNPK

      public static final ServerId SPAWNPK
    • ROAT_PKZ

      public static final ServerId ROAT_PKZ
    • RAGNAR

      public static final ServerId RAGNAR
    • UNKNOWN

      public static final ServerId UNKNOWN
  • Method Details

    • values

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

      public static ServerId valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • displayName

      public String displayName()
      The canonical name: Impact, Elorin, Orion, SpawnPK, Roat Pkz.
    • isKnown

      public boolean isKnown()
      True for every published server, false for UNKNOWN.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ServerId>
    • fromName

      public static ServerId fromName(String name)
      Lenient lookup by name: case and punctuation do not matter ("roat_pkz", "Roat-Pkz" and "ROAT PKZ" are all ROAT_PKZ), the enum name works too, and a longer launcher name that contains exactly one canonical name ("Orion RSPS") resolves to it. Null, blank, unpublished servers (Near Reality, OSPS, Ferox, Echo) and anything ambiguous are UNKNOWN.