public interface ProtocolInfo
Modifier and Type | Method and Description |
---|---|
State |
getClientState()
Returns the protocol state the client is currently in.
|
ProtocolPipeline |
getPipeline()
Returns the user's pipeline.
|
int |
getProtocolVersion()
Returns the user's protocol version, or -1 if not set.
|
int |
getServerProtocolVersion()
Returns the server protocol version the user is connected to, or -1 if not set.
|
State |
getServerState()
Returns the protocol state the server is currently in.
|
default State |
getState()
Deprecated.
server and client can be in different states, use
getClientState() or getServerState() |
default State |
getState(Direction direction)
Returns the protocol state for the given direction.
|
UserConnection |
getUser()
Deprecated.
|
@Nullable java.lang.String |
getUsername()
Returns the username associated with this connection.
|
@Nullable java.util.UUID |
getUuid()
Returns the uuid associated with this connection.
|
void |
setClientState(State clientState)
Sets the client protocol state.
|
void |
setPipeline(ProtocolPipeline pipeline) |
void |
setProtocolVersion(int protocolVersion) |
void |
setServerProtocolVersion(int serverProtocolVersion) |
void |
setServerState(State serverState)
Sets the server protocol state.
|
default void |
setState(State state)
Sets both client and server state.
|
void |
setUsername(java.lang.String username) |
void |
setUuid(java.util.UUID uuid) |
@Deprecated default State getState()
getClientState()
or getServerState()
State getClientState()
State getServerState()
default State getState(Direction direction)
direction
- protocol directiondefault void setState(State state)
state
- the new protocol statesetClientState(State)
,
setServerState(State)
void setClientState(State clientState)
clientState
- the new client protocol statevoid setServerState(State serverState)
serverState
- the new server protocol stateint getProtocolVersion()
State.HANDSHAKE
state.void setProtocolVersion(int protocolVersion)
int getServerProtocolVersion()
State.HANDSHAKE
state.void setServerProtocolVersion(int serverProtocolVersion)
@Nullable java.lang.String getUsername()
State.PLAY
state.State.PLAY
statevoid setUsername(java.lang.String username)
@Nullable java.util.UUID getUuid()
State.PLAY
state.State.PLAY
statevoid setUuid(java.util.UUID uuid)
ProtocolPipeline getPipeline()
void setPipeline(ProtocolPipeline pipeline)
@Deprecated UserConnection getUser()