File tree Expand file tree Collapse file tree 2 files changed +16
-12
lines changed
GeneralsMD/Code/GameEngine/Source/GameNetwork
Generals/Code/GameEngine/Source/GameNetwork Expand file tree Collapse file tree 2 files changed +16
-12
lines changed Original file line number Diff line number Diff line change 3434#include < Utility/CppMacros.h>
3535
3636// TheSuperHackers @refactor BobTista 10/06/2025 Extract magic character literals into named constants for improved readability
37+ typedef UnsignedByte NetPacketFieldType;
38+
3739namespace NetPacketFieldTypes {
38- constexpr const char CommandType = ' T' ; // NetCommandType field
39- constexpr const char Relay = ' R' ; // Relay field
40- constexpr const char PlayerId = ' P' ; // Player ID field
41- constexpr const char CommandId = ' C' ; // Command ID field
42- constexpr const char Frame = ' F' ; // Frame field
43- constexpr const char Data = ' D' ; // Data payload field
40+ constexpr const NetPacketFieldType CommandType = ' T' ; // NetCommandType field
41+ constexpr const NetPacketFieldType Relay = ' R' ; // Relay field
42+ constexpr const NetPacketFieldType PlayerId = ' P' ; // Player ID field
43+ constexpr const NetPacketFieldType CommandId = ' C' ; // Command ID field
44+ constexpr const NetPacketFieldType Frame = ' F' ; // Frame field
45+ constexpr const NetPacketFieldType Data = ' D' ; // Data payload field
4446}
4547
4648// This function assumes that all of the fields are either of default value or are
Original file line number Diff line number Diff line change 3434#include < Utility/CppMacros.h>
3535
3636// TheSuperHackers @refactor BobTista 10/06/2025 Extract magic character literals into named constants for improved readability
37+ typedef UnsignedByte NetPacketFieldType;
38+
3739namespace NetPacketFieldTypes {
38- constexpr const char CommandType = ' T' ; // NetCommandType field
39- constexpr const char Relay = ' R' ; // Relay field
40- constexpr const char PlayerId = ' P' ; // Player ID field
41- constexpr const char CommandId = ' C' ; // Command ID field
42- constexpr const char Frame = ' F' ; // Frame field
43- constexpr const char Data = ' D' ; // Data payload field
40+ constexpr const NetPacketFieldType CommandType = ' T' ; // NetCommandType field
41+ constexpr const NetPacketFieldType Relay = ' R' ; // Relay field
42+ constexpr const NetPacketFieldType PlayerId = ' P' ; // Player ID field
43+ constexpr const NetPacketFieldType CommandId = ' C' ; // Command ID field
44+ constexpr const NetPacketFieldType Frame = ' F' ; // Frame field
45+ constexpr const NetPacketFieldType Data = ' D' ; // Data payload field
4446}
4547
4648// This function assumes that all of the fields are either of default value or are
You can’t perform that action at this time.
0 commit comments