rjwut / ArtClientLib

NOTE: This library is being superseded by IAN: https://github.com/rjwut/ian
14 stars 3 forks source link

Create custom packet handler mechanism #13

Closed rjwut closed 10 years ago

rjwut commented 10 years ago

Create a mechanism for registering packet matchers. A packet matcher registers itself under one or more packet keys (consisting of the packet type int and, optionally a subtype). When a connection receives a packet, it extracts the type and subtype ints and checks to see if any packet matcher is registered against that key. If so, that matcher is responsible for creating the packet object of the appropriate type. If no matcher is registered to that type, the library creates a basic packet object for packets of unknown types. A standard packet matcher is always included for handling canonical Artemis 2 packets. Packet matchers may themselves contain packet matchers and delegate to them.