1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 03:26:46 +02:00

Add networking to game engine / add multiplayer chess

This commit is contained in:
jfreegman
2021-01-17 13:29:13 -05:00
parent 97cb43a218
commit 787d081e74
18 changed files with 1186 additions and 234 deletions

View File

@ -43,6 +43,13 @@
#define TOP_BAR_HEIGHT 1
#define WINDOW_BAR_HEIGHT 1
typedef enum CustomPacket {
CUSTOM_PACKET_GAME_INVITE = 160,
CUSTOM_PACKET_GAME_DATA = 161,
} CustomPacket;
/* ncurses colour pairs as FOREGROUND_BACKGROUND. No background defaults to black. */
typedef enum {
WHITE,
@ -160,6 +167,10 @@ struct ToxWindow {
void(*onTypingChange)(ToxWindow *, Tox *, uint32_t, bool);
void(*onReadReceipt)(ToxWindow *, Tox *, uint32_t, uint32_t);
/* custom packets/games */
void(*onGameInvite)(ToxWindow *, Tox *, uint32_t, const uint8_t *, size_t);
void(*onGameData)(ToxWindow *, Tox *, uint32_t, const uint8_t *, size_t);
#ifdef AUDIO
void(*onInvite)(ToxWindow *, ToxAV *, uint32_t, int);