This commit is contained in:
MarcEricMartel 2023-11-01 10:13:10 -04:00
parent 88acc268b8
commit 6e47bdc8a4

View File

@ -7,8 +7,6 @@
/* Protocole Particulier de Partie a Plusieurs Personnes (PPPPP) */ /* Protocole Particulier de Partie a Plusieurs Personnes (PPPPP) */
// Packet: packet[0] = PacketType, packet[1..n-1] = {packet}
namespace netprot { namespace netprot {
enum class PACKET_TYPE: uint8_t { enum class PACKET_TYPE: uint8_t {
ERR, INPUT, OUTPUT, SYNC, ERR, INPUT, OUTPUT, SYNC,
@ -31,7 +29,7 @@ namespace netprot {
PACKET_TYPE type = PACKET_TYPE::ERR; PACKET_TYPE type = PACKET_TYPE::ERR;
}; };
inline const char Footer[sizeof(uint32_t)] = { '\0', '\r', '\0', '\n' }; inline const char Footer[sizeof(uint32_t)] = { '\0', '\r', '\0', '\n' }; // constante de footer qui est ajoutée à chaque paquet envoyé.
struct Keys { struct Keys {
bool forward, bool forward,
@ -69,7 +67,7 @@ namespace netprot {
States states; // 0bJSH_____ bit-packing de bool. States states; // 0bJSH_____ bit-packing de bool.
}; };
struct Sync { // srv -> cli TCP ~second struct Sync { // srv -> cli TCP ~second - un premier sync démarre la partie.
Timestamp timestamp; Timestamp timestamp;
uint64_t sid = 0; uint64_t sid = 0;
uint32_t timer = 0; uint32_t timer = 0;
@ -202,6 +200,5 @@ namespace netprot {
buf->rstLen(); buf->rstLen();
} }
}; };
#endif #endif