diff options
| -rw-r--r-- | src/net_client.c | 6 | ||||
| -rw-r--r-- | src/net_server.c | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/net_client.c b/src/net_client.c index 92b699b..531bbd1 100644 --- a/src/net_client.c +++ b/src/net_client.c @@ -132,6 +132,12 @@ static hand* client_recv_deal_cards(int sock, uint8_t data_len) return h; } +/** + * Client side function; generic function for receiving packets + * @param[in] sock Socket on which to receive + * @param[in] wanted Desired packet type + * @return Pointer to desired data + */ void* client_recv(int sock, uint8_t wanted) { void* result = NULL; diff --git a/src/net_server.c b/src/net_server.c index 716cc48..edd572b 100644 --- a/src/net_server.c +++ b/src/net_server.c @@ -111,6 +111,12 @@ int* server_get_players(int serversock, const uint8_t count) return clientsocks; } +/** + * Server side function; notifies players of game start and send list of all players + * @param[in] clients List of sockets with connection to clients + * @param[in] clientcount Number of clients + * @param[in] players List of all players (including self) to send + */ void server_start_game(int* clients, const uint8_t clientcount, const struct player_list* players) { uint8_t* buf; @@ -203,6 +209,11 @@ void* server_recv(int sock, uint8_t wanted) return result; } +/** + * Server side function; deal cards to a client (send hand) + * @param[in] sock Socket to use + * @param[in] h Hand to send + */ void server_deal_cards(int sock, const hand h) { uint8_t buf[2+MAX_HAND_CARDS]; |
