From 640b2bd953326adbf98ba04dd2ad7e59fb6c8193 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 5 Aug 2007 14:19:13 +0000 Subject: made so that you can bind the server to a specific address --- src/engine/network.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/engine/network.cpp') diff --git a/src/engine/network.cpp b/src/engine/network.cpp index 41d0367d..d38b825e 100644 --- a/src/engine/network.cpp +++ b/src/engine/network.cpp @@ -461,11 +461,11 @@ static int check_packet(unsigned char *buffer, int size, NETPACKETDATA *packet) return 0; } -NETSERVER *net_server_open(int port, int max_clients, int flags) +NETSERVER *net_server_open(NETADDR4 bindaddr, int max_clients, int flags) { NETSERVER *server = (NETSERVER *)mem_alloc(sizeof(NETSERVER), 1); mem_zero(server, sizeof(NETSERVER)); - server->socket = net_udp4_create(port); + server->socket = net_udp4_create(bindaddr); for(int i = 0; i < NETWORK_MAX_CLIENTS; i++) conn_init(&server->slots[i].conn, server->socket); @@ -673,11 +673,11 @@ void net_server_stats(NETSERVER *s, NETSTATS *stats) } // -NETCLIENT *net_client_open(int port, int flags) +NETCLIENT *net_client_open(NETADDR4 bindaddr, int flags) { NETCLIENT *client = (NETCLIENT *)mem_alloc(sizeof(NETCLIENT), 1); mem_zero(client, sizeof(NETCLIENT)); - client->socket = net_udp4_create(port); + client->socket = net_udp4_create(bindaddr); conn_init(&client->conn, client->socket); return client; } -- cgit 1.4.1