2023-05-31 19:48:40 +00:00
|
|
|
#ifndef CSPT_MESSAGE_H
|
|
|
|
#define CSPT_MESSAGE_H
|
|
|
|
#include <stdint.h>
|
|
|
|
const char * messageStrings[] = {"HELLO", "GOODBYE", "PING", "PONG"};
|
2023-07-02 12:23:07 +00:00
|
|
|
|
|
|
|
struct CsptMessage
|
2023-05-31 19:48:40 +00:00
|
|
|
{
|
|
|
|
uint8_t type;
|
|
|
|
uint8_t content;
|
2023-07-02 12:23:07 +00:00
|
|
|
};
|
2023-05-31 19:48:40 +00:00
|
|
|
|
|
|
|
/* Message Types:
|
|
|
|
0 - HELLO: Contents sent to client indicate a given player number.
|
|
|
|
1 - GOODBYE: No contents, end the connection.
|
|
|
|
2 - PING: Contents indicate the missed amount of pongs.
|
|
|
|
3 - PONG: No contents.
|
|
|
|
*/
|
2023-07-02 12:23:07 +00:00
|
|
|
|
2023-05-31 19:48:40 +00:00
|
|
|
#endif
|