ports/73787: [Maintainer] add extra patch to games/gtetrinet

Miguel Mendez flynn at energyhq.es.eu.org
Wed Nov 10 19:00:53 UTC 2004


>Number:         73787
>Category:       ports
>Synopsis:       [Maintainer] add extra patch to games/gtetrinet
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 10 19:00:50 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Miguel Mendez
>Release:        FreeBSD 5.3-RELEASE i386
>Organization:
>Environment:


System: FreeBSD 5.3-RELEASE #0: Sun Oct 24 16:35:51 CEST 2004
    root at scienide.energyhq.es.eu.org:/usr/obj/usr/src/sys/SCIENIDE



>Description:


 tetrinet.org has changed the protocol slightly, making GTetrinet unusable 
with the most popular tetrinet server out there. Loren Abrams has created 
a patch  which adds minimal support for the protocol additions. 

Import this patch and bump portrevision.


>How-To-Repeat:





>Fix:


--- gtetrinet.diff begins here ---
diff -ruN gtetrinet.old/Makefile gtetrinet/Makefile
--- gtetrinet.old/Makefile	Sun Nov  7 23:36:25 2004
+++ gtetrinet/Makefile	Wed Nov 10 19:48:57 2004
@@ -6,7 +6,7 @@
 
 PORTNAME=	gtetrinet
 PORTVERSION=	0.7.7
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	games gnome
 MASTER_SITES=	${MASTER_SITE_GNOME}
 MASTER_SITE_SUBDIR=	sources/${PORTNAME}/${PORTVERSION:R}
@@ -15,6 +15,7 @@
 MAINTAINER=	flynn at energyhq.es.eu.org
 COMMENT=	A version of the popular TetriNET multiplayer tetris clone
 
+PATCH_STRIP=	-p1
 USE_BZIP2=	yes
 USE_X_PREFIX=	yes
 USE_GNOME=	esound gnomehack gnomeprefix gnometarget libgnomeui
diff -ruN gtetrinet.old/files/patch-protocol-fixes gtetrinet/files/patch-protocol-fixes
--- gtetrinet.old/files/patch-protocol-fixes	Thu Jan  1 01:00:00 1970
+++ gtetrinet/files/patch-protocol-fixes	Wed Nov 10 19:38:40 2004
@@ -0,0 +1,149 @@
+diff -r -u gtetrinet-0.7.7-old/ChangeLog gtetrinet-0.7.7/ChangeLog
+--- gtetrinet-0.7.7-old/ChangeLog	2004-04-18 09:06:38.000000000 -0700
++++ gtetrinet-0.7.7/ChangeLog	2004-10-22 12:50:48.619665808 -0700
+@@ -1,3 +1,14 @@
++2004-10-21  Loren Abrams  <durnew at pacbell.net>
++
++	* NEWS: GTetrinet is now minimally compliant with tetrinet.org's new
++	scoring requirements.
++	* src/tetrinet.c (tetrinet_inmessage): Added support for btrixnewgame.
++	Added support for clientinfo identification.  Both features of the
++	Blocktrix protocol.
++	(tetrinet_nextblock): Added support for a no block delay btrixnewgame.
++	* src/client.c: Added support for transfer of IN_BTRIXNEWGAME and
++	OUT_CLIENTINFO protocol messages.
++
+ 2004-04-18  Jordi Mallach  <jordi at sindominio.net>
+ 
+ 	* automake.in: Back out automake-1.7 requirement.
+diff -r -u gtetrinet-0.7.7-old/src/client.c gtetrinet-0.7.7/src/client.c
+--- gtetrinet-0.7.7-old/src/client.c	2003-06-07 11:27:43.000000000 -0700
++++ gtetrinet-0.7.7/src/client.c	2004-10-22 15:04:28.776416656 -0700
+@@ -96,6 +96,9 @@
+     {IN_SPECLIST, "speclist"},
+     {IN_SMSG, "smsg"},
+     {IN_SACT, "sact"},
++
++    {IN_BTRIXNEWGAME, "btrixnewgame"},
++
+     {0, 0}
+ };
+ 
+@@ -136,6 +139,9 @@
+     {OUT_GMSG, "gmsg"},
+ 
+     {OUT_VERSION, "version"},
++
++    {OUT_CLIENTINFO, "clientinfo"},
++
+     {0, 0}
+ };
+ 
+@@ -380,6 +386,9 @@
+       shutdown (sock, 2);
+       close (sock);
+       connected = 0;
++
++      // Allow for sending the blocktrix init on reconnect.
++      pnumrec = 0;
+     }
+ }
+ 
+diff -r -u gtetrinet-0.7.7-old/src/client.h gtetrinet-0.7.7/src/client.h
+--- gtetrinet-0.7.7-old/src/client.h	2003-02-09 11:32:47.000000000 -0800
++++ gtetrinet-0.7.7/src/client.h	2004-10-22 14:51:58.877418632 -0700
+@@ -13,7 +13,8 @@
+     IN_NEWGAME, IN_INGAME, IN_PAUSE, IN_ENDGAME,
+     IN_F, IN_SB, IN_LVL, IN_GMSG,
+     IN_WINLIST,
+-    IN_SPECJOIN, IN_SPECLEAVE, IN_SPECLIST, IN_SMSG, IN_SACT
++    IN_SPECJOIN, IN_SPECLEAVE, IN_SPECLIST, IN_SMSG, IN_SACT,
++    IN_BTRIXNEWGAME
+ };
+ 
+ /* outmsgs are messages going out to the server */
+@@ -25,7 +26,8 @@
+     OUT_PLAYERLOST,
+     OUT_F, OUT_SB, OUT_LVL, OUT_GMSG,
+     OUT_STARTGAME, OUT_PAUSE,
+-    OUT_VERSION
++    OUT_VERSION,
++    OUT_CLIENTINFO
+ };
+ 
+ /* functions for connecting and disconnecting */
+diff -r -u gtetrinet-0.7.7-old/src/tetrinet.c gtetrinet-0.7.7/src/tetrinet.c
+--- gtetrinet-0.7.7-old/src/tetrinet.c	2003-06-16 16:18:58.000000000 -0700
++++ gtetrinet-0.7.7/src/tetrinet.c	2004-10-22 15:08:00.946161952 -0700
+@@ -57,6 +57,9 @@
+ 
+ #define MAX_PLAYERS 7
+ 
++char pnumrec = 0;
++char btrixgame = 0;
++
+ char playernames[MAX_PLAYERS][128];
+ char teamnames[MAX_PLAYERS][128];
+ int playerlevels[MAX_PLAYERS];
+@@ -237,6 +240,7 @@
+         }
+         break;
+     case IN_PLAYERNUM:
++        pnumrec = 1;
+         tmp_pnum = atoi (data);
+         if (tmp_pnum >= MAX_PLAYERS)
+           break;
+@@ -549,6 +553,9 @@
+             partyline_text (buf);
+         }
+         break;
++    case IN_BTRIXNEWGAME:
++        btrixgame = 1;
++        // Leak through to NEWGAME.
+     case IN_NEWGAME:
+         {
+             int i, j;
+@@ -663,6 +670,9 @@
+         show_start_button ();
+         /* go back to partyline when game ends */
+         show_partyline_page ();
++
++        // Return delay to normal.
++        btrixgame = 0;
+         break;
+     case IN_F:
+         {
+@@ -732,6 +742,10 @@
+             token = strtok (NULL, "");
+             if (token == NULL) break;
+             playerlevels[pnum] = atoi (token);
++            if (!pnum && !playerlevels[pnum] && !pnumrec) {
++                client_outmessage(OUT_CLIENTINFO, APPNAME" "APPVERSION);
++                pnumrec = 1;
++            }
+             if (ingame) tetrinet_updatelevels ();
+         }
+         break;
+@@ -1601,8 +1615,8 @@
+     if (nextblocktimeout) return;
+     tetrinet_removetimeout ();
+     nextblocktimeout =
+-        gtk_timeout_add (NEXTBLOCKDELAY, (GtkFunction)tetrinet_nextblocktimeout,
+-                         NULL);
++        gtk_timeout_add ( (btrixgame ? 0 : NEXTBLOCKDELAY),
++                (GtkFunction)tetrinet_nextblocktimeout, NULL);
+ }
+ 
+ gint tetrinet_nextblocktimeout (void)
+diff -r -u gtetrinet-0.7.7-old/src/tetrinet.h gtetrinet-0.7.7/src/tetrinet.h
+--- gtetrinet-0.7.7-old/src/tetrinet.h	2003-02-14 11:27:08.000000000 -0800
++++ gtetrinet-0.7.7/src/tetrinet.h	2004-10-21 17:48:41.000000000 -0700
+@@ -5,6 +5,8 @@
+ 
+ typedef char FIELD[FIELDHEIGHT][FIELDWIDTH];
+ 
++extern char pnumrec;
++
+ extern int playernum;
+ extern char team[128], nick[128], specpassword[128];
+ extern FIELD fields[7];
--- gtetrinet.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list