summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main.c b/src/main.c
index 6e68d35..9f0bb65 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,7 @@
#include <stdlib.h>
#include <curses.h>
+#include <string.h>
+#include <unistd.h>
#include "ui.h"
#include "game.h"
#include "net.h"
@@ -22,9 +24,9 @@ int main(int argc, char **argv)
int ssock;
int* csocks;
player_list players;
- int opponents = 3;
+ int opponents = 1;
const char* nickname = "deki";
- const hand testhand = { 12, 23, 35, 42, 55, 57, 70, 81, 103, 0 };
+ const hand_t testhand = { { 12, 23, 35, 42, 55, 57, 70, 81, 103, 0 } };
servermode = true;
port = argv[1];
@@ -51,7 +53,7 @@ int main(int argc, char **argv)
// send test hand
for(int i=0; i<opponents; i++)
- server_deal_cards(csocks[i], testhand);
+ server_deal_cards(csocks[i], &testhand);
// cleanup
for(int i=0; i<players.count; i++)
@@ -64,7 +66,7 @@ int main(int argc, char **argv)
int sock;
player_list* players;
const char* nickname = "schnippi";
- hand* testhand;
+ hand_t *testhand;
addr = argv[1];
port = argv[2];
@@ -83,7 +85,7 @@ int main(int argc, char **argv)
testhand = net_recv(sock, msg_type_deal_cards);
printf("received cards: ");
for(int i=0; i<MAX_HAND_CARDS; i++)
- printf("%d, ", *testhand[i]);
+ printf("%d, ", testhand->cards[i]);
printf("\n");
// cleanup