Package org.geysermc.geyser.network
Class QueryPacketHandler
java.lang.Object
org.geysermc.geyser.network.QueryPacketHandler
-
Field Summary
-
Constructor Summary
ConstructorDescriptionQueryPacketHandler(GeyserImpl geyser, InetSocketAddress sender, io.netty.buffer.ByteBuf buffer)
The Query packet handler instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]
getTokenString(byte[] token, InetAddress address)
Gets an MD5 token for the current IP/Port.static boolean
isQueryPacket(io.netty.buffer.ByteBuf buffer)
Checks the packet is in fact a query packetvoid
Regenerates a token
-
Field Details
-
HANDSHAKE
public static final byte HANDSHAKE- See Also:
- Constant Field Values
-
STATISTICS
public static final byte STATISTICS- See Also:
- Constant Field Values
-
-
Constructor Details
-
QueryPacketHandler
public QueryPacketHandler(GeyserImpl geyser, InetSocketAddress sender, io.netty.buffer.ByteBuf buffer)The Query packet handler instance. The unsigned short magic handshake should already be read at this point, and the packet should be verified to have enough buffer space to be a qualified query packet.- Parameters:
geyser
- Geysersender
- The Sender IP/Port for the Querybuffer
- The Query data
-
-
Method Details
-
isQueryPacket
public static boolean isQueryPacket(io.netty.buffer.ByteBuf buffer)Checks the packet is in fact a query packet- Parameters:
buffer
- Query data- Returns:
- if the packet is a query packet
-
regenerateToken
public void regenerateToken()Regenerates a token -
getTokenString
Gets an MD5 token for the current IP/Port. This should reset every 30 seconds but a new one is generated per instance Seems wasteful to code something in to clear it when it has no use.- Parameters:
token
- the tokenaddress
- the address- Returns:
- an MD5 token for the current IP/Port
-