Class QueryPacketHandler

java.lang.Object
org.geysermc.geyser.network.QueryPacketHandler

public class QueryPacketHandler extends Object
  • Field Details

  • 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 - Geyser
      sender - The Sender IP/Port for the Query
      buffer - 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

      public static byte[] getTokenString(byte[] token, InetAddress address)
      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 token
      address - the address
      Returns:
      an MD5 token for the current IP/Port