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, groupFields 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.ChannelFuturebind(InetSocketAddress address) Bind the server on the specified address.voidInvalidates all challenge tokens.intgenerateChallengeToken(InetSocketAddress address) Generate a new token.voidonBindFailure(InetSocketAddress address, Throwable t) voidonBindSuccess(InetSocketAddress address) voidshutdown()Shut the query server down.booleanverifyChallengeToken(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:
bindin classGlowDatagramServer- Parameters:
address- The address.- Returns:
- Netty channel future for bind operation.
-
shutdown
public void shutdown()Shut the query server down.- Overrides:
shutdownin 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:
trueif the token is valid.
-
flushChallengeTokens
public void flushChallengeTokens()Invalidates all challenge tokens. -
onBindSuccess
- Overrides:
onBindSuccessin classGlowNetworkServer
-
onBindFailure
- Specified by:
onBindFailurein classGlowNetworkServer
-