Class PublicEffectPayload

java.lang.Object
live.crowdcontrol.cc4j.websocket.payload.PublicEffectPayload

public class PublicEffectPayload extends Object
A payload denoting information about a requested effect.
  • Field Details

    • requestID

      @NotNull protected final @NotNull UUID requestID
    • timestamp

      protected final long timestamp
    • effect

      @NotNull protected final @NotNull CCEffectDescription effect
    • target

      @NotNull protected final @NotNull CCUserRecord target
    • origin

      @Nullable protected final @Nullable CCUserRecord origin
    • requester

      @Nullable protected final @Nullable CCUserRecord requester
    • anonymous

      protected final boolean anonymous
    • quantity

      protected final int quantity
    • localTimestamp

      protected final long localTimestamp
  • Constructor Details

    • PublicEffectPayload

      public PublicEffectPayload(@NotNull @NotNull UUID requestID, long timestamp, @NotNull @NotNull CCEffectDescription effect, @NotNull @NotNull CCUserRecord target, @Nullable @Nullable CCUserRecord origin, @Nullable @Nullable CCUserRecord requester, boolean anonymous, int quantity)
  • Method Details

    • getRequestId

      @NotNull public @NotNull UUID getRequestId()
      Gets the ID of the request.
      Returns:
      requestID
    • getTimestamp

      public long getTimestamp()
      Gets the time at which the request was generated in Unix epoch milliseconds.
      Returns:
      unix epoch milliseconds
    • getEffect

      @NotNull public @NotNull CCEffectDescription getEffect()
      Gets the description of the requested effect.
      Returns:
      effect
    • getTarget

      @NotNull public @NotNull CCUserRecord getTarget()
      Gets the player who should be targeted by this effect.
      Returns:
      targeted player
    • getOrigin

      @Nullable public @Nullable CCUserRecord getOrigin()
      Gets the channel this effect was purchased on. Used to determine what channel a relayed lobby effect came from.
      Returns:
      origin channel
    • getRequester

      @Nullable public @Nullable CCUserRecord getRequester()
      Gets the viewer who purchased this effect.
      Returns:
      effect requester
    • isAnonymous

      public boolean isAnonymous()
      Gets whether the viewer asked to be anonymous.
      Returns:
      is anonymous
    • getQuantity

      public int getQuantity()
      Gets how many of the effect were requested. 0 indicates no amount was specified.
      Returns:
      quantity
    • getLocalTimestamp

      public long getLocalTimestamp()
      A local timestamp denoting when the effect came in. Used to correct for de-synced clocks.
      Returns:
      local timestamp
    • toString

      public String toString()
      Overrides:
      toString in class Object