What is a dynamic packet?
A dynamic packet is a packet that varies in size due to unfixed sizes. An example of a dynamic packet is any packet that uses the CNetStringPacker, such as the chat packet.
Why are they a problem?
Back in I believe 2009, or 2010, I introduced to the community the idea of defining packets are structures and accessing fields and writing to them via pointer-logic. While this was amazingly fast and easy to maintain, problems quickly began to arose due to two things:
1. Structure alignment causing fields to have unexpected sizes
2. Dynamic packets
As a result, tedious code would have to be written for these packets to parse fields, and write them. I've noticed even in newer sources, people have gone back to the method of using a writer instead of structures (which I can understand why, many people are "afraid" of pointers) -- but once again, you end up writing tedious code.
Using Reflection.Emit, I have created a way of dynamically creating a writer/reader method for packet-types at run time, and cacheing them so they don't impede performance. They are as efficient as if they were coded and compiled originally -- thus they remove the need to manually ever code parsers again.
Here's the project SVN for those that are interested, there's a sample to see how to use it, and define custom-marshalers as well:

Sample usuage/code:

Comment/feedback is appreciated.






