]> hydra-www.ietfng.org Git - gtetrinet/commitdiff
fixed the bug with the channel list in tetrinet.org
authorDaniel Carbonell Fraj <bocata@src.gnome.org>
Mon, 24 Feb 2003 21:59:36 +0000 (21:59 +0000)
committerDaniel Carbonell Fraj <bocata@src.gnome.org>
Mon, 24 Feb 2003 21:59:36 +0000 (21:59 +0000)
ChangeLog
src/partyline.c
src/tetrinet.c

index 9a172ebdc27ba0d405eddc6128099d29294b4420..b0c32a805e28dba18c15acfc8f5ff71595881711 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-02-24  Dani Carbonell  <bocata@panete.net>
+
+       * 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 <chipx86@chipx86.com>
 
        * gtetrinet.schemas.in: Add schema info. for timestamp pref.
index 3807379dee07fe3323b68f905acaf9cf2c475260..1f8ade6b3526a257b15f2db1abf162522b5f835d 100644 (file)
@@ -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;
 }
index 4f726dcb848304e5fc2585957088138ee36d7489..59942c1ba129219f8fc69fdad6412e8db4c5f8ba 100644 (file)
@@ -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;
                       }