Package crow.game.codec


package crow.game.codec
Package containing the base API objects for the protocol implementation. It requires netty bytebuf, but it's slowly being phased out for PacketReader/PacketWriter interfaces which only support the subset of needed methods.

There are multiple hooks for handling differing packet versions in this API:

You can define your POJO as "MyPacket20NN0101" alongside PacketHandler "MyPacketHandler20NN0101" that returns a PacketRule with the version specifiers enabled.

Then you would have a second POJO that maps to everything that the previous packet did not.

OR

You can define a standard packet "MyPacket" and PacketHandler "MyPacketHandle" that, when you receive calls into your handler, you can look at the current packet version via Context.supportedProtocolVersion and act accordingly via branching logic.

Implementors note: It's a long shot, but maybe it will be possible to support multiple protocol versions in the same running server, via client version identification and pinning, then Context may contain additional account and client info attached.

  • Class
    Description
    Context wraps the calling context when performing packet logic.
    Source determines where the context was constructed and called into.
    Utility object for pairing the ip address and port together.
    The packet object pairs the byte stream with the matched rule.
    Interface responsible for converting to and from Packet objects to a POJO type
    Interface for decoding packets into data.
    Represents a specification for which packet ID (labeled 'prefix' here) is of what type (STATIC or DYNAMIC), what name and Java class POJO, and what kRO packet version the POJO maps to.
    The type of packet, currently only 2.