TShock
TShock copied to clipboard
Natively implement better support for BitFlags
In PlayerUpdateEventArgs
and other arg types for packets, we just pass off a byte for a couple BitFlag operations.
If Terraria doesn't natively have enums for these, we should move to creating enums for the different options according to the MP packet structure and then deriving what we do based on interpreting these enums. Right now, we just do a lot of checking magic numbers, which is unclear to developers what's actually going on.
Just FYI:
Neither the receiving or sending methods have enums for BitFlag operations.
Do you have an example of how you'd like this implemented @hakusaro ?
@QuiCM http://www.cplusplus.com/forum/general/1590/#msg5591
This will result in the creation of a number of different enums to support the different 'options' cases we get with these packets. Should plan out how we'll structure this (file-wise)
- All
{Type}Options
in one file (yuck) - One
{Type}Options
per file (also yuck)
This is my implementation. Idk if it's good.