Class PongPacketHandler
java.lang.Object
crow.game.examples.pingpong.proto.PongPacketHandler
- All Implemented Interfaces:
PacketHandler<Pong>
This is the packet handler for the Pong message. It, ironically, is empty since Pong is a 0-byte
message (ignoring packet id) so this handler is only responsible for constructing and defining
the packet details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromPacket(Context ctx, PacketReader buffer) Convert the given buffer to the type.voidWrites the object of type T to the byte buffer.
-
Constructor Details
-
PongPacketHandler
public PongPacketHandler()
-
-
Method Details
-
fromPacket
Description copied from interface:PacketHandlerConvert the given buffer to the type.- Specified by:
fromPacketin interfacePacketHandler<Pong>- Parameters:
ctx- The calling context.buffer- The input buffer stream reader.- Returns:
- The POJO object
-
toPacket
Description copied from interface:PacketHandlerWrites the object of type T to the byte buffer.- Specified by:
toPacketin interfacePacketHandler<Pong>- Parameters:
ctx- The calling context.buffer- The destination buffer.src- The source object we are converting.
-
rule
- Specified by:
rulein interfacePacketHandler<Pong>- Parameters:
ctx- The calling context.- Returns:
- The packet rule object which specifies when this packet handler should be called.
- See Also:
-