From: Daniel Carbonell Fraj Date: Mon, 24 Feb 2003 21:59:36 +0000 (+0000) Subject: fixed the bug with the channel list in tetrinet.org X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=43d46be97e14b0fb422395331a1a9cd51125dc44;p=gtetrinet fixed the bug with the channel list in tetrinet.org --- diff --git a/ChangeLog b/ChangeLog index 9a172eb..b0c32a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2003-02-24 Dani Carbonell + + * src/partyline.c (stop_list): list_issued is a integer, changed + accordingly. + (partyline_update_channel_list): if there is another channel list + update in progress, do nothing. This will prevent us from being + kicked from the server because of flood. + + * src/tetrinet.c (tetrinet_inmessage): fixed the stupid bug that + prevented the channel list from working in tetrinet.org. + 2003-02-22 ChipX86 * gtetrinet.schemas.in: Add schema info. for timestamp pref. diff --git a/src/partyline.c b/src/partyline.c index 3807379..1f8ade6 100644 --- a/src/partyline.c +++ b/src/partyline.c @@ -495,7 +495,7 @@ gboolean copy_item (GtkTreeModel *model, void stop_list (void) { - list_issued = FALSE; + list_issued = 0; /* update the channel list widget, with some sort of "double buffering" */ gtk_tree_view_set_model (GTK_TREE_VIEW (channel_box), GTK_TREE_MODEL (work_model)); @@ -508,13 +508,17 @@ gboolean partyline_update_channel_list (void) { gchar cad[1024]; - list_issued++; - gtk_list_store_clear (work_model); - tetrinet_playerline ("/list"); + /* if there is another update in progress, just go away silently */ + if (list_issued == 0) + { + list_issued++; + gtk_list_store_clear (work_model); + tetrinet_playerline ("/list"); - /* send the mark */ - g_snprintf (cad, 1024, "/msg %d --- MARK ---", playernum); - tetrinet_playerline (cad); + /* send the mark */ + g_snprintf (cad, 1024, "/msg %d --- MARK ---", playernum); + tetrinet_playerline (cad); + } return TRUE; } diff --git a/src/tetrinet.c b/src/tetrinet.c index 4f726dc..59942c1 100644 --- a/src/tetrinet.c +++ b/src/tetrinet.c @@ -277,7 +277,6 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) checkmoderatorstatus (); partylineupdate_join (nick); partylineupdate_team (nick, team); - partyline_update_channel_list (); } } /* show partyline on successful connect */ @@ -305,6 +304,8 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) partylineupdate_join (playernames[pnum]); /* check moderator status */ checkmoderatorstatus (); + /* update channel list */ + partyline_update_channel_list (); /* send out our field */ /* if (!spectating) tetrinet_resendfield (); */ } @@ -406,7 +407,7 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) else if (tetrix) { gchar *line = nocolor (token); - if (list_issued) + if (list_issued > 0) { if (*line == '(') { @@ -426,7 +427,9 @@ void tetrinet_inmessage (enum inmsg_type msgtype, char *data) if (!strncmp ("You", line, 3)) { /* we will use the error message as list stopper */ - stop_list(); + list_issued--; + if (list_issued <= 0) + stop_list(); break; }