From 9e46ae820909420af6f694155efca48ef6cd2cb5 Mon Sep 17 00:00:00 2001 From: Jordi Mallach Date: Tue, 26 Oct 2004 07:33:28 +0000 Subject: [PATCH] Update for new translations. 2004-10-26 Jordi Mallach * NEWS: Update for new translations. 2004-10-21 Loren Abrams * 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. --- ChangeLog | 19 +++++++++++++++++-- NEWS | 8 ++++++-- src/client.c | 9 +++++++++ src/client.h | 6 ++++-- src/tetrinet.c | 18 ++++++++++++++++-- src/tetrinet.h | 2 ++ 6 files changed, 54 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5594967..51d079b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,21 @@ -2004-10-5 Amanpreet Singh Alam +2004-10-26 Jordi Mallach + + * NEWS: Update for new translations. + +2004-10-21 Loren Abrams + + * 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-10-05 Amanpreet Singh Alam - * configure.in (ALL_LINGUAS) -> add "pa" Punjabi Language + * configure.in (ALL_LINGUAS): Add "pa" Punjabi language. 2004-08-31 Jordi Mallach diff --git a/NEWS b/NEWS index fad48e7..7b8a481 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ -GTetrinet 0.7.8 - 2004-09-xx +GTetrinet 0.7.8 - 2004-11-xx +- Added minimal support for the Blocktrix protocol, now in use at + tetrinet.org (Loren Abrams). - New and updated translations: Italian (Riccardo Bozzo), - German (Gerfried Fuchs), Korean (Michael Kim). + German (Gerfried Fuchs), Korean (Michael Kim), + Canadian English (Adam Weinberger), Serbian (Danilo Å egan), + Punjabi (Amanpreet Singh Alam). GTetrinet 0.7.7 - 2004-04-18 - Regenerated tarball using automake 1.4 to workaround diff --git a/src/client.c b/src/client.c index cbf6c8a..3cf8f54 100644 --- a/src/client.c +++ b/src/client.c @@ -96,6 +96,9 @@ struct inmsgt inmsgtable[] = { {IN_SPECLIST, "speclist"}, {IN_SMSG, "smsg"}, {IN_SACT, "sact"}, + + {IN_BTRIXNEWGAME, "btrixnewgame"}, + {0, 0} }; @@ -136,6 +139,9 @@ struct outmsgt outmsgtable[] = { {OUT_GMSG, "gmsg"}, {OUT_VERSION, "version"}, + + {OUT_CLIENTINFO, "clientinfo"}, + {0, 0} }; @@ -380,6 +386,9 @@ void client_disconnect (void) shutdown (sock, 2); close (sock); connected = 0; + + // Allow for sending the blocktrix init on reconnect. + pnumrec = 0; } } diff --git a/src/client.h b/src/client.h index 28f99af..3de1e99 100644 --- a/src/client.h +++ b/src/client.h @@ -13,7 +13,8 @@ enum inmsg_type { 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 @@ enum outmsg_type { 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 --git a/src/tetrinet.c b/src/tetrinet.c index 48c1384..827b801 100644 --- a/src/tetrinet.c +++ b/src/tetrinet.c @@ -57,6 +57,9 @@ char team[128], nick[128], specpassword[128]; #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 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) } break; case IN_PLAYERNUM: + pnumrec = 1; tmp_pnum = atoi (data); if (tmp_pnum >= MAX_PLAYERS) break; @@ -549,6 +553,9 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) partyline_text (buf); } break; + case IN_BTRIXNEWGAME: + btrixgame = 1; + // Leak through to NEWGAME. case IN_NEWGAME: { int i, j; @@ -663,6 +670,9 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) 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 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) 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 @@ void tetrinet_nextblock (void) 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 --git a/src/tetrinet.h b/src/tetrinet.h index 5faa5fa..af162b5 100644 --- a/src/tetrinet.h +++ b/src/tetrinet.h @@ -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]; -- 2.50.1