diff options
| author | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-11 23:01:16 +0100 |
|---|---|---|
| committer | Aldrik Ramaekers <aldrik@amftech.nl> | 2022-12-11 23:01:16 +0100 |
| commit | 95c24b38b934f48f7f5cde37182c51857e77eac0 (patch) | |
| tree | 3e5fbe2d3641e11e2bb8dc986ae79388c6b6b1b8 | |
| parent | f29d35faf7cc574a1a8c109f2f609db9d3d4b5ef (diff) | |
networking
| -rw-r--r-- | build/zombies.exe | bin | 1691324 -> 1697824 bytes | |||
| -rw-r--r-- | main.c | 10 | ||||
| -rw-r--r-- | pathfinding.c | 2 |
3 files changed, 9 insertions, 3 deletions
diff --git a/build/zombies.exe b/build/zombies.exe Binary files differindex 0c77b32..dc8678b 100644 --- a/build/zombies.exe +++ b/build/zombies.exe @@ -56,11 +56,14 @@ int main(int argc, char **argv) pathfinding_init(); - //networking_create_server(); - + network_server *server = networking_create_server(); + thread t = thread_start(pathfinding_thread, 0); thread_detach(&t); + network_client *client = network_connect_to_server("127.0.0.1", "27015"); + network_client_send(client, "Bing Bong"); + while(platform_keep_running(window)) { platform_handle_events(); } @@ -69,6 +72,9 @@ int main(int argc, char **argv) platform_destroy(); pathfinding_destroy(); + network_client_close(client); + networking_destroy_server(server); + memory_print_leaks(); return 0; diff --git a/pathfinding.c b/pathfinding.c index 7196b2c..bb209b0 100644 --- a/pathfinding.c +++ b/pathfinding.c @@ -88,7 +88,7 @@ bool find_path_to(vec2f start_pos, vec2f end_pos, array *to_fill, pathfinding_re if (to_fill) { array_remove_at(to_fill, to_fill->length-1); - printf("PATHFINDING TOOK: %fms\n", (platform_get_time(TIME_PROCESS, TIME_MS)-timestamp)/1000.0f); + //printf("PATHFINDING TOOK: %fms\n", (platform_get_time(TIME_PROCESS, TIME_MS)-timestamp)/1000.0f); } mutex_unlock(&request->mutex); |
