Update of /cvsroot/playerstage/code/player/utils/playernav
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4552/utils/playernav

Modified Files:
      Tag: release-2-0-patches
        parse.c playernav.c 
Log Message:
backported lots of stuff from HEAD

Index: playernav.c
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/playernav/playernav.c,v
retrieving revision 1.47
retrieving revision 1.47.2.1
diff -C2 -d -r1.47 -r1.47.2.1
*** playernav.c 1 Mar 2006 02:58:17 -0000       1.47
--- playernav.c 7 Jun 2006 16:12:55 -0000       1.47.2.1
***************
*** 172,177 ****
    if(playerc_mclient_read(gui_data->mclient,-1) <= 0)
    {
!     fprintf(stderr, "Error on read\n");
!     gtk_main_quit();
    }
    for(i=0;i<gui_data->num_robots;i++)
--- 172,178 ----
    if(playerc_mclient_read(gui_data->mclient,-1) <= 0)
    {
!     //fprintf(stderr, "Error on read\n");
!     //gtk_main_quit();
!     return(TRUE);
    }
    for(i=0;i<gui_data->num_robots;i++)

Index: parse.c
===================================================================
RCS file: /cvsroot/playerstage/code/player/utils/playernav/parse.c,v
retrieving revision 1.10
retrieving revision 1.10.4.1
diff -C2 -d -r1.10 -r1.10.4.1
*** parse.c     21 Sep 2005 21:10:25 -0000      1.10
--- parse.c     7 Jun 2006 16:12:55 -0000       1.10.4.1
***************
*** 10,14 ****
  /* Parse command line arguments, of the form host:port */
  int
! parse_args(int argc, char** argv, size_t* num_bots, char** hostnames, 
             int* ports, double* zoom, int* aa, int* map_idx, int* planner_idx)
  {
--- 10,14 ----
  /* Parse command line arguments, of the form host:port */
  int
! parse_args(int argc, char** argv, size_t* num_bots, char** hostnames,
             int* ports, double* zoom, int* aa, int* map_idx, int* planner_idx)
  {
***************
*** 67,96 ****
    }
  
!   if(i>=argc)
!     return(-1);
  
    *num_bots=0;
!   while(i<argc)
    {
!     // Look for ':' (colon), and extract the trailing port number.  If not
!     // given, then use the default Player port (6665)
!     if((idx = strchr(argv[i],':')) && (strlen(idx) > 1))
!     {
!       port = atoi(idx+1);
!       hostlen = idx - argv[i];
!     }
!     else
      {
!       port = 6665;
!       hostlen = strlen(argv[i]);
!     }
  
!     // Store the hostnames and port numbers
!     assert((hostlen > 0) && (hostlen < (MAX_HOSTNAME_LEN - 1)));
!     argv[i][hostlen] = '\0';
!     hostnames[*num_bots] = strdup(argv[i]);
!     ports[*num_bots] = port;
!     (*num_bots)++;
!     i++;
    }
  
--- 67,106 ----
    }
  
! //  if(i>=argc)
! //    return(-1);
  
    *num_bots=0;
! 
!   if (i< argc)
    {
!     while(i<argc)
      {
!       // Look for ':' (colon), and extract the trailing port number.  If not
!       // given, then use the default Player port (6665)
!       if((idx = strchr(argv[i],':')) && (strlen(idx) > 1))
!       {
!         port = atoi(idx+1);
!         hostlen = idx - argv[i];
!       }
!       else
!       {
!         port = 6665;
!         hostlen = strlen(argv[i]);
!       }
  
!       // Store the hostnames and port numbers
!       assert((hostlen > 0) && (hostlen < (MAX_HOSTNAME_LEN - 1)));
!       argv[i][hostlen] = '\0';
!       hostnames[*num_bots] = strdup(argv[i]);
!       ports[*num_bots] = port;
!       (*num_bots)++;
!       i++;
!     }
!   }
!   else
!   {
!     hostnames[*num_bots] = strdup("localhost");
!     ports[*num_bots] = 6665;
!     *num_bots=1;
    }
  



_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to