View | Details | Raw Unified | Return to bug 73787
Collapse All | Expand All

(-)gtetrinet/Makefile (-1 / +2 lines)
Lines 6-12 Link Here
6
6
7
PORTNAME=	gtetrinet
7
PORTNAME=	gtetrinet
8
PORTVERSION=	0.7.7
8
PORTVERSION=	0.7.7
9
PORTREVISION=	1
9
PORTREVISION=	2
10
CATEGORIES=	games gnome
10
CATEGORIES=	games gnome
11
MASTER_SITES=	${MASTER_SITE_GNOME}
11
MASTER_SITES=	${MASTER_SITE_GNOME}
12
MASTER_SITE_SUBDIR=	sources/${PORTNAME}/${PORTVERSION:R}
12
MASTER_SITE_SUBDIR=	sources/${PORTNAME}/${PORTVERSION:R}
Lines 15-20 Link Here
15
MAINTAINER=	flynn@energyhq.es.eu.org
15
MAINTAINER=	flynn@energyhq.es.eu.org
16
COMMENT=	A version of the popular TetriNET multiplayer tetris clone
16
COMMENT=	A version of the popular TetriNET multiplayer tetris clone
17
17
18
PATCH_STRIP=	-p1
18
USE_BZIP2=	yes
19
USE_BZIP2=	yes
19
USE_X_PREFIX=	yes
20
USE_X_PREFIX=	yes
20
USE_GNOME=	esound gnomehack gnomeprefix gnometarget libgnomeui
21
USE_GNOME=	esound gnomehack gnomeprefix gnometarget libgnomeui
(-)gtetrinet/files/patch-protocol-fixes (+149 lines)
Line 0 Link Here
1
diff -r -u gtetrinet-0.7.7-old/ChangeLog gtetrinet-0.7.7/ChangeLog
2
--- gtetrinet-0.7.7-old/ChangeLog	2004-04-18 09:06:38.000000000 -0700
3
+++ gtetrinet-0.7.7/ChangeLog	2004-10-22 12:50:48.619665808 -0700
4
@@ -1,3 +1,14 @@
5
+2004-10-21  Loren Abrams  <durnew@pacbell.net>
6
+
7
+	* NEWS: GTetrinet is now minimally compliant with tetrinet.org's new
8
+	scoring requirements.
9
+	* src/tetrinet.c (tetrinet_inmessage): Added support for btrixnewgame.
10
+	Added support for clientinfo identification.  Both features of the
11
+	Blocktrix protocol.
12
+	(tetrinet_nextblock): Added support for a no block delay btrixnewgame.
13
+	* src/client.c: Added support for transfer of IN_BTRIXNEWGAME and
14
+	OUT_CLIENTINFO protocol messages.
15
+
16
 2004-04-18  Jordi Mallach  <jordi@sindominio.net>
17
 
18
 	* automake.in: Back out automake-1.7 requirement.
19
diff -r -u gtetrinet-0.7.7-old/src/client.c gtetrinet-0.7.7/src/client.c
20
--- gtetrinet-0.7.7-old/src/client.c	2003-06-07 11:27:43.000000000 -0700
21
+++ gtetrinet-0.7.7/src/client.c	2004-10-22 15:04:28.776416656 -0700
22
@@ -96,6 +96,9 @@
23
     {IN_SPECLIST, "speclist"},
24
     {IN_SMSG, "smsg"},
25
     {IN_SACT, "sact"},
26
+
27
+    {IN_BTRIXNEWGAME, "btrixnewgame"},
28
+
29
     {0, 0}
30
 };
31
 
32
@@ -136,6 +139,9 @@
33
     {OUT_GMSG, "gmsg"},
34
 
35
     {OUT_VERSION, "version"},
36
+
37
+    {OUT_CLIENTINFO, "clientinfo"},
38
+
39
     {0, 0}
40
 };
41
 
42
@@ -380,6 +386,9 @@
43
       shutdown (sock, 2);
44
       close (sock);
45
       connected = 0;
46
+
47
+      // Allow for sending the blocktrix init on reconnect.
48
+      pnumrec = 0;
49
     }
50
 }
51
 
52
diff -r -u gtetrinet-0.7.7-old/src/client.h gtetrinet-0.7.7/src/client.h
53
--- gtetrinet-0.7.7-old/src/client.h	2003-02-09 11:32:47.000000000 -0800
54
+++ gtetrinet-0.7.7/src/client.h	2004-10-22 14:51:58.877418632 -0700
55
@@ -13,7 +13,8 @@
56
     IN_NEWGAME, IN_INGAME, IN_PAUSE, IN_ENDGAME,
57
     IN_F, IN_SB, IN_LVL, IN_GMSG,
58
     IN_WINLIST,
59
-    IN_SPECJOIN, IN_SPECLEAVE, IN_SPECLIST, IN_SMSG, IN_SACT
60
+    IN_SPECJOIN, IN_SPECLEAVE, IN_SPECLIST, IN_SMSG, IN_SACT,
61
+    IN_BTRIXNEWGAME
62
 };
63
 
64
 /* outmsgs are messages going out to the server */
65
@@ -25,7 +26,8 @@
66
     OUT_PLAYERLOST,
67
     OUT_F, OUT_SB, OUT_LVL, OUT_GMSG,
68
     OUT_STARTGAME, OUT_PAUSE,
69
-    OUT_VERSION
70
+    OUT_VERSION,
71
+    OUT_CLIENTINFO
72
 };
73
 
74
 /* functions for connecting and disconnecting */
75
diff -r -u gtetrinet-0.7.7-old/src/tetrinet.c gtetrinet-0.7.7/src/tetrinet.c
76
--- gtetrinet-0.7.7-old/src/tetrinet.c	2003-06-16 16:18:58.000000000 -0700
77
+++ gtetrinet-0.7.7/src/tetrinet.c	2004-10-22 15:08:00.946161952 -0700
78
@@ -57,6 +57,9 @@
79
 
80
 #define MAX_PLAYERS 7
81
 
82
+char pnumrec = 0;
83
+char btrixgame = 0;
84
+
85
 char playernames[MAX_PLAYERS][128];
86
 char teamnames[MAX_PLAYERS][128];
87
 int playerlevels[MAX_PLAYERS];
88
@@ -237,6 +240,7 @@
89
         }
90
         break;
91
     case IN_PLAYERNUM:
92
+        pnumrec = 1;
93
         tmp_pnum = atoi (data);
94
         if (tmp_pnum >= MAX_PLAYERS)
95
           break;
96
@@ -549,6 +553,9 @@
97
             partyline_text (buf);
98
         }
99
         break;
100
+    case IN_BTRIXNEWGAME:
101
+        btrixgame = 1;
102
+        // Leak through to NEWGAME.
103
     case IN_NEWGAME:
104
         {
105
             int i, j;
106
@@ -663,6 +670,9 @@
107
         show_start_button ();
108
         /* go back to partyline when game ends */
109
         show_partyline_page ();
110
+
111
+        // Return delay to normal.
112
+        btrixgame = 0;
113
         break;
114
     case IN_F:
115
         {
116
@@ -732,6 +742,10 @@
117
             token = strtok (NULL, "");
118
             if (token == NULL) break;
119
             playerlevels[pnum] = atoi (token);
120
+            if (!pnum && !playerlevels[pnum] && !pnumrec) {
121
+                client_outmessage(OUT_CLIENTINFO, APPNAME" "APPVERSION);
122
+                pnumrec = 1;
123
+            }
124
             if (ingame) tetrinet_updatelevels ();
125
         }
126
         break;
127
@@ -1601,8 +1615,8 @@
128
     if (nextblocktimeout) return;
129
     tetrinet_removetimeout ();
130
     nextblocktimeout =
131
-        gtk_timeout_add (NEXTBLOCKDELAY, (GtkFunction)tetrinet_nextblocktimeout,
132
-                         NULL);
133
+        gtk_timeout_add ( (btrixgame ? 0 : NEXTBLOCKDELAY),
134
+                (GtkFunction)tetrinet_nextblocktimeout, NULL);
135
 }
136
 
137
 gint tetrinet_nextblocktimeout (void)
138
diff -r -u gtetrinet-0.7.7-old/src/tetrinet.h gtetrinet-0.7.7/src/tetrinet.h
139
--- gtetrinet-0.7.7-old/src/tetrinet.h	2003-02-14 11:27:08.000000000 -0800
140
+++ gtetrinet-0.7.7/src/tetrinet.h	2004-10-21 17:48:41.000000000 -0700
141
@@ -5,6 +5,8 @@
142
 
143
 typedef char FIELD[FIELDHEIGHT][FIELDWIDTH];
144
 
145
+extern char pnumrec;
146
+
147
 extern int playernum;
148
 extern char team[128], nick[128], specpassword[128];
149
 extern FIELD fields[7];

Return to bug 73787