diff options
| author | Mario Kilies <MarioKilies@GMX.net> | 2011-01-24 19:06:43 +0100 |
|---|---|---|
| committer | Mario Kilies <MarioKilies@GMX.net> | 2011-01-24 19:06:43 +0100 |
| commit | 8f0ca3b0b915dcd8d188766c239ad63e399c0868 (patch) | |
| tree | 45c8b40998abf75e72546bddeb11c6374ee46c2c /src | |
| parent | a24153f14dcc95332b91e70e39028228e9b6c4dc (diff) | |
Added game loop termination. Commented out debug messages.
Diffstat (limited to 'src')
| -rw-r--r-- | src/game.c | 8 | ||||
| -rw-r--r-- | src/net/comm.c | 4 |
2 files changed, 6 insertions, 6 deletions
@@ -57,9 +57,8 @@ static void main_loop_client(int sock) net_recv(sock, msg_type_deal_hand); ui_display_wnd_hand_cards(&data->hand, false, 0); - //state = STATE_CLIENT_SELECT_OPEN_CARD; - sleep(1); - exit(0); + state = STATE_CLIENT_SELECT_OPEN_CARD; + running = false; break; #if 0 case STATE_CLIENT_SELECT_OPEN_CARD: @@ -154,7 +153,8 @@ static void main_loop_server(socket_list_t* client_socks) net_send(client_socks->sockets[i], msg_type_deal_hand, &data->hand); } - //state = STATE_SERVER_WAIT_FOR_OPEN_CARDS; + state = STATE_SERVER_WAIT_FOR_OPEN_CARDS; + running = false; break; #if 0 case STATE_SERVER_WAIT_FOR_OPEN_CARDS: diff --git a/src/net/comm.c b/src/net/comm.c index 7f9c6c4..042cb00 100644 --- a/src/net/comm.c +++ b/src/net/comm.c @@ -25,7 +25,7 @@ bool net_recv(const int sock, const msg_type_t type) recv(sock, &m.hdr, sizeof(msg_header_t), 0); // Remove message header from socket recv(sock, m.payload, m.hdr.payload_length, 0);// And then receive the payload - printf("net_recv: received msg type %d with payload length %d\n", m.hdr.type, m.hdr.payload_length); + //printf("net_recv: received msg type %d with payload length %d\n", m.hdr.type, m.hdr.payload_length); switch(type) { @@ -97,7 +97,7 @@ bool net_send(const int sock, const msg_type_t type, const void *data) break; } - printf("net_send: sending msg type %d with payload length %d\n", m.hdr.type, m.hdr.payload_length); + //printf("net_send: sending msg type %d with payload length %d\n", m.hdr.type, m.hdr.payload_length); send(sock, &m, sizeof(msg_header_t), 0); // Send message header first send(sock, m.payload, m.hdr.payload_length, 0); // Then send payload |
