diff options
| author | Reiner Herrmann <reiner@reiner-h.de> | 2011-01-20 18:32:39 +0100 |
|---|---|---|
| committer | Reiner Herrmann <reiner@reiner-h.de> | 2011-01-20 18:32:39 +0100 |
| commit | c88a524298aa46157638a74416e8c6e968772758 (patch) | |
| tree | fd199a53a8a58bbb89d89490dc7cacb6cbd38797 /src/net.h | |
| parent | 246e1678c54bedc7d0d0276654e5205647ff5360 (diff) | |
implemented functions for notifying server of selected tablestack and for broadcasting the selection results to all clients
Diffstat (limited to 'src/net.h')
| -rw-r--r-- | src/net.h | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -4,6 +4,7 @@ #include <stdint.h> #include "player.h" #include "hand.h" +#include "table_stacks.h" // Offsets within the receive buffer to easily access the data fields of the received message #define NET_MSG_OFFSET_TYPE 0 @@ -13,10 +14,12 @@ typedef enum { // Specify message type identifiers here - msg_type_hello = 0x0, - msg_type_start_game = 0x1, - msg_type_deal_cards = 0x2, - msg_type_selected_card = 0x3 + msg_type_hello = 0x0, + msg_type_start_game = 0x1, + msg_type_deal_cards = 0x2, + msg_type_selected_card = 0x3, + msg_type_selected_stack_c = 0x4, + msg_type_selected_stack_s = 0x5 } msg_type_t; // Header format @@ -43,12 +46,16 @@ void server_start_game(int* clients, const uint8_t clientcount, const player_lis void server_deal_cards(int sock, const hand_t *h); char* server_recv_hello(const uint8_t* payload, const uint8_t payload_len); card* server_recv_selected_card(const uint8_t* payload, const uint8_t payload_len); +uint8_t* server_recv_selected_stack(const uint8_t* payload, const uint8_t payload_len); +void server_send_selected_stack(int* clients, const uint8_t clientcount, const uint8_t stackindex); // Client side functions int client_connect_server(const char* host, const char* port); void client_hello(int sock, const char* username); void client_selected_card(int sock, const card c); +void client_send_selected_stack(int sock, const uint8_t stackindex); player_list* client_recv_player_list(const uint8_t* payload, const uint8_t data_len); hand_t *client_recv_deal_cards(const uint8_t* payload, const uint8_t payload_len); +uint8_t* client_recv_selected_stack(const uint8_t* payload, const uint8_t payload_len); #endif // OXEN_NET_H |
