diff options
author | pawel <pawel@FreeBSD.org> | 2011-11-08 03:12:13 +0800 |
---|---|---|
committer | pawel <pawel@FreeBSD.org> | 2011-11-08 03:12:13 +0800 |
commit | bc60315e6459b265bdb2f3752c2dfa0d194b36d5 (patch) | |
tree | c7cf9a52100c58cf17f769861833f6da5848c55e /games/cube | |
parent | f70c535ed11b0d43d1d7060fe9adf0bb24ad135a (diff) | |
download | freebsd-ports-gnome-bc60315e6459b265bdb2f3752c2dfa0d194b36d5.tar.gz freebsd-ports-gnome-bc60315e6459b265bdb2f3752c2dfa0d194b36d5.tar.zst freebsd-ports-gnome-bc60315e6459b265bdb2f3752c2dfa0d194b36d5.zip |
Fix build after update of net/enet
Reported by: pav
Diffstat (limited to 'games/cube')
-rw-r--r-- | games/cube/files/patch-client.cpp | 29 | ||||
-rw-r--r-- | games/cube/files/patch-server.cpp | 16 |
2 files changed, 39 insertions, 6 deletions
diff --git a/games/cube/files/patch-client.cpp b/games/cube/files/patch-client.cpp index 40a69731638a..7a1f24ef5096 100644 --- a/games/cube/files/patch-client.cpp +++ b/games/cube/files/patch-client.cpp @@ -1,6 +1,27 @@ ---- client.cpp.orig Tue Feb 6 01:24:56 2007 -+++ client.cpp Tue Feb 6 01:26:30 2007 -@@ -86,7 +86,7 @@ +--- client.cpp.orig 2011-11-07 18:39:52.000000000 +0100 ++++ client.cpp 2011-11-07 18:55:26.000000000 +0100 +@@ -63,12 +63,18 @@ + conoutf("could not resolve server %s", servername); + return; + }; +- ++#if ENET_VERSION > 130 ++ clienthost = enet_host_create(NULL, 1, 0, rate, rate); ++#else + clienthost = enet_host_create(NULL, 1, rate, rate); +- ++#endif + if(clienthost) + { ++#if ENET_VERSION > 130 ++ enet_host_connect(clienthost, &address, 1, 0); ++#else + enet_host_connect(clienthost, &address, 1); ++#endif + enet_host_flush(clienthost); + connecting = lastmillis; + connattempts = 0; +@@ -86,7 +92,7 @@ { if(!connecting && !disconnecting) { @@ -9,7 +30,7 @@ enet_host_flush(clienthost); disconnecting = lastmillis; }; -@@ -304,6 +304,9 @@ +@@ -304,6 +310,9 @@ if(disconnecting) disconnect(); else server_err(); return; diff --git a/games/cube/files/patch-server.cpp b/games/cube/files/patch-server.cpp index 777abd25b693..1c4a2e90bb11 100644 --- a/games/cube/files/patch-server.cpp +++ b/games/cube/files/patch-server.cpp @@ -1,5 +1,5 @@ ---- server.cpp.orig 2007-08-03 15:52:35.000000000 +0200 -+++ server.cpp 2007-08-03 15:58:58.000000000 +0200 +--- server.cpp.orig 2011-11-07 18:57:19.000000000 +0100 ++++ server.cpp 2011-11-07 19:01:52.000000000 +0100 @@ -104,7 +104,7 @@ void disconnect_client(int n, char *reason) { @@ -35,3 +35,15 @@ }; if(numplayers>maxclients) +@@ -448,7 +451,11 @@ + { + ENetAddress address = { ENET_HOST_ANY, CUBE_SERVER_PORT }; + if(*ip && enet_address_set_host(&address, ip)<0) printf("WARNING: server ip not resolved"); ++#if ENET_VERSION > 130 ++ serverhost = enet_host_create(&address, MAXCLIENTS, 0, 0, uprate); ++#else + serverhost = enet_host_create(&address, MAXCLIENTS, 0, uprate); ++#endif + if(!serverhost) fatal("could not create server host\n"); + loopi(MAXCLIENTS) serverhost->peers[i].data = (void *)-1; + }; |