Interface PacketInterface

All Known Subinterfaces:
ConnectionPacket
All Known Implementing Classes:
GsonConnectionPacket, GSONPacket, GsonPingPacket, Packet, RawConnectionPacket, RawPacket, RawPingPacket

public interface PacketInterface
The common methods across all packets
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the byte buffer of the packet to send to client
    Returns the server that the packet was sent too
    void
    receive​(Client client)
    Method called when the packet is received by the server and information is loaded
  • Method Details

    • getServer

      ConnectionServer getServer()
      Returns the server that the packet was sent too
      Returns:
      server the packet was sent too
    • getBuffer

      ByteBuffer getBuffer()
      Gets the byte buffer of the packet to send to client

      includes header at the beginning

      Returns:
      buffer
    • receive

      void receive(Client client)
      Method called when the packet is received by the server and information is loaded
      Parameters:
      client - the client that sent the packet