Package dev.forbit.server.interfaces
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 TypeMethodDescriptionGets the byte buffer of the packet to send to clientReturns the server that the packet was sent toovoid
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 clientincludes header at the beginning
- Returns:
- buffer
-
receive
Method called when the packet is received by the server and information is loaded- Parameters:
client
- the client that sent the packet
-