Package net.minecraft.server.rcon.thread
Class QueryThreadGs4
java.lang.Object
net.minecraft.server.rcon.thread.GenericThread
net.minecraft.server.rcon.thread.QueryThreadGs4
- All Implemented Interfaces:
Runnable
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final byte[]
private static final long
private static final String
private static final String
private String
private long
private long
private static final org.slf4j.Logger
private final int
private final int
private static final long
private final NetworkDataOutputStream
private final ServerInterface
private String
private final String
private final int
private DatagramSocket
private final Map
<SocketAddress, QueryThreadGs4.RequestChallenge> private final String
Fields inherited from class net.minecraft.server.rcon.thread.GenericThread
name, running, thread
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate byte[]
buildRuleResponse
(DatagramPacket requestPacket) Creates a query response as a byte array for the specified query DatagramPacketstatic QueryThreadGs4
create
(ServerInterface serverInterface) private byte[]
getIdentBytes
(SocketAddress address) Returns the request ID provided by the authorized clientprivate boolean
private boolean
processPacket
(DatagramPacket requestPacket) Parses an incoming DatagramPacket, returning true if the packet was validprivate void
private void
recoverSocketError
(Exception exception) Stops the query server and reports the given Exceptionvoid
run()
private void
sendChallenge
(DatagramPacket requestPacket) Sends an auth challenge DatagramPacket to the client and adds the client to the queryClients mapprivate void
sendTo
(byte[] data, DatagramPacket requestPacket) Sends a byte array as a DatagramPacket response to the client who sent the given DatagramPacketboolean
start()
private Boolean
validChallenge
(DatagramPacket requestPacket) Returnstrue
if the client has a valid auth, otherwisefalse
.Methods inherited from class net.minecraft.server.rcon.thread.GenericThread
isRunning, stop
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
GAME_TYPE
- See Also:
-
GAME_ID
- See Also:
-
CHALLENGE_CHECK_INTERVAL
private static final long CHALLENGE_CHECK_INTERVAL- See Also:
-
RESPONSE_CACHE_TIME
private static final long RESPONSE_CACHE_TIME- See Also:
-
lastChallengeCheck
private long lastChallengeCheck -
port
private final int port -
serverPort
private final int serverPort -
maxPlayers
private final int maxPlayers -
serverName
-
worldName
-
socket
-
buffer
private final byte[] buffer -
hostIp
-
serverIp
-
validChallenges
-
rulesResponse
-
lastRulesResponse
private long lastRulesResponse -
serverInterface
-
-
Constructor Details
-
QueryThreadGs4
-
-
Method Details
-
create
-
sendTo
Sends a byte array as a DatagramPacket response to the client who sent the given DatagramPacket- Throws:
IOException
-
processPacket
Parses an incoming DatagramPacket, returning true if the packet was valid- Throws:
IOException
-
buildRuleResponse
Creates a query response as a byte array for the specified query DatagramPacket- Throws:
IOException
-
getIdentBytes
Returns the request ID provided by the authorized client -
validChallenge
Returnstrue
if the client has a valid auth, otherwisefalse
. -
sendChallenge
Sends an auth challenge DatagramPacket to the client and adds the client to the queryClients map- Throws:
IOException
-
pruneChallenges
private void pruneChallenges() -
run
public void run() -
start
public boolean start()- Overrides:
start
in classGenericThread
-
recoverSocketError
Stops the query server and reports the given Exception -
initSocket
private boolean initSocket()
-