Skip to content

Commit 05af998

Browse files
authored
fix(network): Move TransportMessageHeader to before it is used in NetworkDefs.h (TheSuperHackers#2382)
1 parent c7bf8e9 commit 05af998

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

Core/GameEngine/Include/GameNetwork/NetworkDefs.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,16 @@ enum ConnectionNumbers CPP_11(: Int)
4747
MAX_PLAYER = 7, // The index of the highest possible player number. This is 0 based, so the most players allowed in a game is MAX_PLAYER+1.
4848
};
4949

50+
#pragma pack(push, 1)
51+
struct TransportMessageHeader
52+
{
53+
UnsignedInt crc; ///< packet-level CRC (must be first in packet)
54+
UnsignedShort magic; ///< Magic number identifying Generals packets
55+
// Int id;
56+
// NetMessageFlags flags;
57+
};
58+
#pragma pack(pop)
59+
5060
static constexpr const Int MAX_SLOTS = MAX_PLAYER+1;
5161

5262
// TheSuperHackers @info As we are not detecting for network fragmentation and dynamically adjusting payload sizes, we set an 1100 bytes UDP payload as a safe upper limit for various networks
@@ -87,16 +97,6 @@ struct CommandPacket
8797

8898
#define MAX_TRANSPORT_STATISTICS_SECONDS 30
8999

90-
#pragma pack(push, 1)
91-
struct TransportMessageHeader
92-
{
93-
UnsignedInt crc; ///< packet-level CRC (must be first in packet)
94-
UnsignedShort magic; ///< Magic number identifying Generals packets
95-
// Int id;
96-
// NetMessageFlags flags;
97-
};
98-
#pragma pack(pop)
99-
100100
/**
101101
* Transport message - encapsulating info kept by the transport layer about each
102102
* packet. These structs make up the in/out buffers at the transport layer.

0 commit comments

Comments
 (0)