about summary refs log tree commit diff
path: root/src/engine/network.cpp
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2007-08-05 14:19:13 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2007-08-05 14:19:13 +0000
commit640b2bd953326adbf98ba04dd2ad7e59fb6c8193 (patch)
tree7e3b954333071f364df74a6c468050487246d725 /src/engine/network.cpp
parentfc4d7eef92679652278a562da07cef0fa316d358 (diff)
downloadzcatch-640b2bd953326adbf98ba04dd2ad7e59fb6c8193.tar.gz
zcatch-640b2bd953326adbf98ba04dd2ad7e59fb6c8193.zip
made so that you can bind the server to a specific address
Diffstat (limited to 'src/engine/network.cpp')
-rw-r--r--src/engine/network.cpp8
1 files changed, 4 insertions, 4 deletions
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;
 }