Package net.glowstone.net.query
Class QueryServer
java.lang.Object
net.glowstone.net.GlowNetworkServer
net.glowstone.net.GlowDatagramServer
net.glowstone.net.query.QueryServer
Implementation of a server for the minecraft server query protocol.
- See Also:
-
Field Summary
Fields inherited from class net.glowstone.net.GlowDatagramServer
bootstrap, group
Fields inherited from class net.glowstone.net.GlowNetworkServer
latch
-
Constructor Summary
ConstructorsConstructorDescriptionQueryServer
(GlowServer server, ProtocolProvider protocolProvider, CountDownLatch latch, boolean showPlugins) Creates an instance for the specified server. -
Method Summary
Modifier and TypeMethodDescriptionio.netty.channel.ChannelFuture
bind
(InetSocketAddress address) Bind the server on the specified address.void
Invalidates all challenge tokens.int
generateChallengeToken
(InetSocketAddress address) Generate a new token.void
onBindFailure
(InetSocketAddress address, Throwable t) void
onBindSuccess
(InetSocketAddress address) void
shutdown()
Shut the query server down.boolean
verifyChallengeToken
(InetSocketAddress address, int token) Verify that the request is using the correct challenge token.Methods inherited from class net.glowstone.net.GlowNetworkServer
getProtocolProvider, getServer
-
Constructor Details
-
QueryServer
public QueryServer(GlowServer server, ProtocolProvider protocolProvider, CountDownLatch latch, boolean showPlugins) Creates an instance for the specified server.- Parameters:
server
- the associated GlowServerlatch
- The countdown latch used during server startup to wait for network server binding.showPlugins
- whether the plugin list should be included in responses
-
-
Method Details
-
bind
Bind the server on the specified address.- Overrides:
bind
in classGlowDatagramServer
- Parameters:
address
- The address.- Returns:
- Netty channel future for bind operation.
-
shutdown
public void shutdown()Shut the query server down.- Overrides:
shutdown
in classGlowDatagramServer
-
generateChallengeToken
Generate a new token.- Parameters:
address
- The sender address.- Returns:
- The generated valid token.
-
verifyChallengeToken
Verify that the request is using the correct challenge token.- Parameters:
address
- The sender address.token
- The token.- Returns:
true
if the token is valid.
-
flushChallengeTokens
public void flushChallengeTokens()Invalidates all challenge tokens. -
onBindSuccess
- Overrides:
onBindSuccess
in classGlowNetworkServer
-
onBindFailure
- Specified by:
onBindFailure
in classGlowNetworkServer
-