63 int client_run(Settings *settings) { |
63 int client_run(Settings *settings) { |
64 Server server; |
64 Server server; |
65 |
65 |
66 if (client_connect(&server, settings->serverhost, settings->port)) { |
66 if (client_connect(&server, settings->serverhost, settings->port)) { |
67 net_destroy(&server); |
67 net_destroy(&server); |
68 return EXIT_FAILURE; |
68 return 1; |
69 } |
69 } |
70 |
70 |
71 if (client_handshake(&server)) { |
71 if (client_handshake(&server)) { |
72 net_destroy(&server); |
72 net_destroy(&server); |
73 return EXIT_FAILURE; |
73 return 1; |
74 } |
74 } |
75 |
75 |
76 uint8_t code = net_recieve_code(server.fd); |
76 uint8_t code = net_recieve_code(server.fd); |
77 if (code == NETCODE_GAMEINFO) { |
77 if (code == NETCODE_GAMEINFO) { |
78 // Start new game |
78 // Start new game |