Class PublicEffectPayload
java.lang.Object
live.crowdcontrol.cc4j.websocket.payload.PublicEffectPayload
A payload denoting information about a requested effect.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final @NotNull CCEffectDescriptionprotected final longprotected final @Nullable CCUserRecordprotected final intprotected final @Nullable CCUserRecordprotected final @NotNull UUIDprotected final @NotNull CCUserRecordprotected final long -
Constructor Summary
ConstructorsConstructorDescriptionPublicEffectPayload(@NotNull UUID requestID, long timestamp, @NotNull CCEffectDescription effect, @NotNull CCUserRecord target, @Nullable CCUserRecord origin, @Nullable CCUserRecord requester, boolean anonymous, int quantity) -
Method Summary
Modifier and TypeMethodDescription@NotNull CCEffectDescriptionGets the description of the requested effect.longA local timestamp denoting when the effect came in.@Nullable CCUserRecordGets the channel this effect was purchased on.intGets how many of the effect were requested.@Nullable CCUserRecordGets the viewer who purchased this effect.@NotNull UUIDGets the ID of the request.@NotNull CCUserRecordGets the player who should be targeted by this effect.longGets the time at which the request was generated in Unix epoch milliseconds.booleanGets whether the viewer asked to be anonymous.toString()
-
Field Details
-
requestID
-
timestamp
protected final long timestamp -
effect
-
target
-
origin
-
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
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
Gets the description of the requested effect.- Returns:
- effect
-
getTarget
Gets the player who should be targeted by this effect.- Returns:
- targeted player
-
getOrigin
Gets the channel this effect was purchased on. Used to determine what channel a relayed lobby effect came from.- Returns:
- origin channel
-
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
-