Interface ProtocolInfo
public interface ProtocolInfo
-
Method Summary
Modifier and TypeMethodDescriptionReturns the protocol state the client is currently in.Returns the user's pipeline.default intDeprecated.default intDeprecated.Returns the protocol state the server is currently in.default StateReturns the protocol state for the given direction.@Nullable StringReturns the username associated with this connection.@Nullable UUIDgetUuid()Returns the uuid associated with this connection.Returns the user's protocol version, or null if not set.Returns the server protocol version the user is connected to.voidsetClientState(State clientState) Sets the client protocol state.voidsetPipeline(ProtocolPipeline pipeline) voidsetProtocolVersion(ProtocolVersion protocolVersion) voidsetServerProtocolVersion(ProtocolVersion protocolVersion) voidsetServerState(State serverState) Sets the server protocol state.default voidSets both client and server state.voidsetUsername(String username) void
-
Method Details
-
getClientState
State getClientState()Returns the protocol state the client is currently in.- Returns:
- the client protocol state
-
getServerState
State getServerState()Returns the protocol state the server is currently in.- Returns:
- the server protocol state
-
getState
Returns the protocol state for the given direction.- Parameters:
direction- protocol direction- Returns:
- state for the given direction
-
setState
Sets both client and server state.- Parameters:
state- the new protocol state- See Also:
-
setClientState
Sets the client protocol state.- Parameters:
clientState- the new client protocol state
-
setServerState
Sets the server protocol state.- Parameters:
serverState- the new server protocol state
-
protocolVersion
ProtocolVersion protocolVersion()Returns the user's protocol version, or null if not set. This is set during theState.HANDSHAKEstate.- Returns:
- protocol version, may be unknown
- See Also:
-
setProtocolVersion
-
serverProtocolVersion
ProtocolVersion serverProtocolVersion()Returns the server protocol version the user is connected to. This is set during theState.HANDSHAKEstate.- Returns:
- the server protocol version the user is connected to, may be unknown
- See Also:
-
setServerProtocolVersion
-
getProtocolVersion
Deprecated. -
getServerProtocolVersion
Deprecated. -
getUsername
@Nullable String getUsername()Returns the username associated with this connection. This is set once the connection enters theState.PLAYstate.- Returns:
- username, set when entering the
State.PLAYstate
-
setUsername
-
getUuid
@Nullable UUID getUuid()Returns the uuid associated with this connection. This is set once the connection enters theState.PLAYstate.- Returns:
- uuid, set when entering the
State.PLAYstate
-
setUuid
-
getPipeline
ProtocolPipeline getPipeline()Returns the user's pipeline.- Returns:
- protocol pipeline
-
setPipeline
-