Package crow.game.codec
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.
-
ClassDescriptionContext 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 typeInterface 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.