Enum Class Destination
- All Implemented Interfaces:
Serializable,Comparable<Destination>,Constable
Determines where the packet will be resolved.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDescribes a situation where the packet can originate from and be handled by a client or a server.Describes a situation where the client has a payload that will be sent to a server.Describes a situation where the server has a payload that will be sent to a client. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the payload can be handled on a client.booleanChecks if the payload can be handled on a server.static DestinationReturns the enum constant of this class with the specified name.static Destination[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SERVER_TO_CLIENT
Describes a situation where the server has a payload that will be sent to a client. The payload will be handled on the client and can use code that is only available on a dedicated client. -
CLIENT_TO_SERVER
Describes a situation where the client has a payload that will be sent to a server. The payload will be handled by the server and can access the game state. Please keep in mind that payloads originating on the client can be forged and should not be trusted without an appropriate level of validation on the server. -
BIDIRECTIONAL
Describes a situation where the packet can originate from and be handled by a client or a server. These packets have the limitations of both SERVER_TOL_CLIENT and CLIENT_TO_SERVER packets.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
handledByServer
public boolean handledByServer()Checks if the payload can be handled on a server.- Returns:
- If the payload can be handled by a server.
-
handledByClient
public boolean handledByClient()Checks if the payload can be handled on a client.- Returns:
- If the payload can be handled by a client.
-