1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-04 16:46: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 60bdcf0ba5
commit 7aeb1a0aac
18 changed files with 1186 additions and 234 deletions

View File

@ -25,6 +25,20 @@
#include "game_base.h"
int chess_initialize(GameData *game);
/*
* Initializes chess game state.
*
* If `init_data` is non-null, this indicates that we were invited to the game.
*
* If we're the inviter, we send an invite packet after initialization. If we're the
* invitee, we send a handshake response packet to the inviter.
*
* Return 0 on success.
* Return -1 if window is too small.
* Return -2 on network related error.
* Return -3 on other error.
*/
int chess_initialize(GameData *game, const uint8_t *init_data, size_t length);
#endif // GAME_CHESS