diff options
author | hubertf <hubertf> | 2002-01-25 17:47:19 +0000 |
---|---|---|
committer | hubertf <hubertf> | 2002-01-25 17:47:19 +0000 |
commit | 86b06b81b7a8e414ab7ec71afb51a1b73fae426f (patch) | |
tree | 01a480c1a5598140bb16acea0c1c83913a1d3c48 /games/xtris | |
parent | 2ed9ffcc72e3f41a3d336f9b418738499916dec8 (diff) | |
download | pkgsrc-86b06b81b7a8e414ab7ec71afb51a1b73fae426f.tar.gz |
Add xtris-1.15:
xtris is a version of an classical popular game, for any number of
players, for the X Window system.
xtris is a true client/server game (as opposed to a centralized game
managing multiple displays), which makes it particularily responsive and
bandwith-effective.
Submitted by Oliver Paulzen <opp@muffin.org> in private mail.
Diffstat (limited to 'games/xtris')
-rw-r--r-- | games/xtris/patches/patch-ab | 36 | ||||
-rw-r--r-- | games/xtris/patches/patch-ac | 59 | ||||
-rw-r--r-- | games/xtris/patches/patch-ad | 102 |
3 files changed, 197 insertions, 0 deletions
diff --git a/games/xtris/patches/patch-ab b/games/xtris/patches/patch-ab new file mode 100644 index 00000000000..a8f0d2d5364 --- /dev/null +++ b/games/xtris/patches/patch-ab @@ -0,0 +1,36 @@ +$NetBSD: patch-ab,v 1.1.1.1 2002/01/25 17:47:19 hubertf Exp $ + +--- README.v6.orig Fri Jan 25 13:37:05 2002 ++++ README.v6 +@@ -0,0 +1,31 @@ ++IPv6 Patch for xtris-1.15 ++ ++IPv6 patch for xtris is originally developed by H.YOSHIFUJi ++<yoshfuji@ecei.tohoku.ac.jp> in early December 1999. ++ ++IPv6 support is enabled by defining INET6 macro during the ++compilation phase. This switches xtris into the protocol ++independent world (not IPv6 (or IPv4) specific world). ++Thus, if you have getaddrinfo() and getnameinfo() defined ++in RFC2553, you can enable this feature even if you don't ++have IPv6 environment currently. ++ ++The following IPv6 platforms should be supported: ++ GNU/Linux with glibc-2.1.2 ++ FreeBSD {2.2.8,3.3} with KAME package ++ Solaris 7 with IPv6_Prototype_01 package ++ ++Note: On Solaris 7 + IPv6_Prototype_01 systems, you should ++ register the port number in /etc/services file. ++ There is "ad hoc" solution, but I hate it because ++ it looks "dirty"; it discards the pure protocol ++ independent socket programming model. ++ ++** History ** ++xtris-1.15-v6-19991207 H.YOSHIFUJI <yoshfuji@ecei.tohoku.ac.jp> ++ - First patch. ++xtris-1.15-v6-19991209 H.YOSHIFUJI <yoshfuji@ecei.tohoku.ac.jp> ++ - Version number typoes: fixed. ++xtris-1.15-v6-19991218 H.YOSHIFUJI <yoshfuji@ecei.tohoku.ac.jp> ++ - Patch error on Makefile file (cause reject): ++ fixed diff --git a/games/xtris/patches/patch-ac b/games/xtris/patches/patch-ac new file mode 100644 index 00000000000..4a1e116ee82 --- /dev/null +++ b/games/xtris/patches/patch-ac @@ -0,0 +1,59 @@ +$NetBSD: patch-ac,v 1.1.1.1 2002/01/25 17:47:19 hubertf Exp $ + +--- xtbot.c.orig Wed Apr 9 20:01:58 1997 ++++ xtbot.c +@@ -614,11 +614,46 @@ + } + + static void connect2server(char *h) { ++#ifdef INET6 ++ struct addrinfo hints, *res0, *res; ++ struct sockaddr_storage s; ++ char serv_buf[NI_MAXSERV]; ++ char str_buf[512]; ++ int gai; ++#else + struct hostent *hp; + struct sockaddr_in s; ++#endif + struct protoent *tcpproto; + int on = 1; + ++#ifdef INET6 ++ snprintf(serv_buf, sizeof(serv_buf) , "%d", port); ++ serv_buf[sizeof(serv_buf)-1] = '\0'; ++ memset (&hints, 0, sizeof(hints)); ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ gai = getaddrinfo(h, serv_buf, &hints, &res0); ++ if (gai){ ++ snprintf(str_buf, sizeof(str_buf)-1, ++ "getaddrinfo(): %s", gai_strerror(gai)); ++ fatal(str_buf); ++ } ++ for (res=res0; res; res=res->ai_next){ ++ sfd = socket(res->ai_family, res->ai_socktype, 0); ++ if (sfd < 0) continue; ++ if ((tcpproto = getprotobyname("tcp")) != NULL) ++ setsockopt(sfd, tcpproto->p_proto, TCP_NODELAY, (char *)&on, sizeof(int)); ++ if (connect(sfd, res->ai_addr, res->ai_addrlen) < 0){ ++ close(sfd); ++ sfd = -1; ++ continue; ++ } ++ break; ++ } ++ if (sfd < 0) ++ fatal("Can't connect to server"); ++#else + if (h) { + if ((s.sin_addr.s_addr = inet_addr(h)) == -1) { + hp = gethostbyname(h); +@@ -637,6 +672,7 @@ + + if (connect(sfd, (struct sockaddr *)&s, sizeof(s)) < 0) + fatal("Can't connect to server"); ++#endif + + buf[1] = OP_NICK; + memcpy(&buf[2], mynick, strlen(mynick)); diff --git a/games/xtris/patches/patch-ad b/games/xtris/patches/patch-ad new file mode 100644 index 00000000000..32ca82af6b2 --- /dev/null +++ b/games/xtris/patches/patch-ad @@ -0,0 +1,102 @@ +$NetBSD: patch-ad,v 1.1.1.1 2002/01/25 17:47:19 hubertf Exp $ + +--- xtris.c.orig Sun Dec 14 19:40:04 1997 ++++ xtris.c +@@ -1633,10 +1633,11 @@ + fprintf(stderr, "Can't start bot '%s'.\n", + + #ifdef XTRISPATH +- XTRISPATH "/xtbot"); ++ XTRISPATH "/xtbot" + #else +- "xtbot"); ++ "xtbot" + #endif ++ ); + _exit(1); + + case -1: +@@ -2674,11 +2675,11 @@ + + fprintf(stderr, "Can't start server '%s'.\n", + #ifdef XTRISPATH +- XTRISPATH "/xtserv"); ++ XTRISPATH "/xtserv" + #else +- "xtserv"); ++ "xtserv" + #endif +- ++ ); + _exit(1); + + case -1: +@@ -2690,11 +2691,60 @@ + } + + void connect2server(char *h) { ++#ifdef INET6 ++ struct addrinfo hints, *res0, *res; ++ int gai; ++ struct sockaddr_storage s; ++ char serv_buf[NI_MAXSERV]; ++ char str_buf[512]; ++#else + struct hostent *hp; + struct sockaddr_in s; ++#endif + struct protoent *tcpproto; + int on = 1, i; + ++#ifdef INET6 ++ snprintf(serv_buf, sizeof(serv_buf) , "%d", port); ++ serv_buf[sizeof(serv_buf)-1] = '\0'; ++ for (i=0; i<7; i++){ ++ memset (&hints, 0, sizeof(hints)); ++ hints.ai_family = PF_UNSPEC; ++ hints.ai_socktype = SOCK_STREAM; ++ gai = getaddrinfo(h, serv_buf, &hints, &res0); ++ if (gai){ ++ snprintf(str_buf, sizeof(str_buf)-1, ++ "getaddrinfo(): %s", gai_strerror(gai)); ++ fatal(str_buf); ++ } ++ for (res=res0; res; res=res->ai_next){ ++ sfd = socket(res->ai_family, res->ai_socktype, 0); ++ if (sfd < 0) continue; ++ if ((tcpproto = getprotobyname("tcp")) != NULL) ++ setsockopt(sfd, tcpproto->p_proto, TCP_NODELAY, (char *)&on, sizeof(int)); ++ if (connect(sfd, res->ai_addr, res->ai_addrlen) < 0){ ++ close(sfd); ++ sfd = -1; ++ continue; ++ } ++ break; ++ } ++ freeaddrinfo(res0); ++ if (sfd >= 0) break; ++ if (!h){ ++ if (i==0){ ++ printf("No xtris server on localhost - starting up one ...\n"); ++ startserver(); ++ } ++ u_sleep(500000); ++ continue; ++ } ++ else ++ break; ++ } ++ if (sfd < 0) ++ fatal("Can't connect to server"); ++#else + if (h) { + if ((s.sin_addr.s_addr = inet_addr(h)) == -1) { + hp = gethostbyname(h); +@@ -2729,6 +2779,7 @@ + fatal("Can't connect to server"); + } else fatal("Can't connect to server"); + } ++#endif + } + + void sigchld() { |