Difference for socket/item.c from version 1.39 to 1.40


version 1.39 version 1.40
Line 1
 
Line 1
   
 /*  /*
  * static char *rcsid_item_c =   * static char *rcsid_item_c =
  *    "$Id: item.c,v 1.39 2006/05/05 09:41:15 ryo_saeba Exp $";   *    "$Id: item.c,v 1.40 2006/05/21 10:35:11 akirschbaum Exp $";
  */   */
   
 /*  /*
Line 227
 
Line 227
     else      else
  for (tmp=get_map_ob(pl->map,pl->x,pl->y); tmp && tmp->above;tmp=tmp->above) ;   for (tmp=get_map_ob(pl->map,pl->x,pl->y); tmp && tmp->above;tmp=tmp->above) ;
   
     sl.buf=malloc(MAXSOCKBUF);      sl.buf=malloc(MAXSOCKSENDBUF);
   
     Write_String_To_Socket(&pl->contr->socket, "delinv 0", strlen("delinv 0"));      Write_String_To_Socket(&pl->contr->socket, "delinv 0", strlen("delinv 0"));
     sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);      sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);
Line 291
 
Line 291
      add_object_to_socklist(&pl->contr->socket, &sl, head);       add_object_to_socklist(&pl->contr->socket, &sl, head);
      got_one++;       got_one++;
   
      if (sl.len > (MAXSOCKBUF-MAXITEMLEN)) {       if (sl.len > (MAXSOCKSENDBUF-MAXITEMLEN)) {
  Send_With_Handling(&pl->contr->socket, &sl);   Send_With_Handling(&pl->contr->socket, &sl);
  sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);   sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);
  sl.len=strlen((char*)sl.buf);   sl.len=strlen((char*)sl.buf);
Line 315
 
Line 315
     int got_one=0;      int got_one=0;
     SockList sl;      SockList sl;
          
     sl.buf=malloc(MAXSOCKBUF);      sl.buf=malloc(MAXSOCKSENDBUF);
   
     sprintf((char*)sl.buf,"delinv %d", op->count);      sprintf((char*)sl.buf,"delinv %d", op->count);
     sl.len=strlen((char*)sl.buf);      sl.len=strlen((char*)sl.buf);
Line 341
 
Line 341
       * items (especially with some of the bags out there) to        * items (especially with some of the bags out there) to
       * overflow the buffer.  IF so, send multiple item commands.        * overflow the buffer.  IF so, send multiple item commands.
       */        */
      if (sl.len > (MAXSOCKBUF-MAXITEMLEN)) {       if (sl.len > (MAXSOCKSENDBUF-MAXITEMLEN)) {
  Send_With_Handling(&pl->contr->socket, &sl);   Send_With_Handling(&pl->contr->socket, &sl);
  sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);   sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);
  sl.len=strlen((char*)sl.buf);   sl.len=strlen((char*)sl.buf);
Line 383
 
Line 383
  */   */
  LOG(llevDebug,"We have not sent item %s (%d)\n", op->name, op->count);   LOG(llevDebug,"We have not sent item %s (%d)\n", op->name, op->count);
     }      }
     sl.buf=malloc(MAXSOCKBUF);      sl.buf=malloc(MAXSOCKSENDBUF);
   
     strcpy((char*)sl.buf,"upditem ");      strcpy((char*)sl.buf,"upditem ");
     sl.len=strlen((char*)sl.buf);      sl.len=strlen((char*)sl.buf);
Line 488
 
Line 488
  }   }
     }      }
   
     sl.buf=malloc(MAXSOCKBUF);      sl.buf=malloc(MAXSOCKSENDBUF);
   
     sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);      sprintf((char*)sl.buf,"item%d ", pl->contr->socket.itemcmd);
     sl.len=strlen((char*)sl.buf);      sl.len=strlen((char*)sl.buf);
Line 513
 
Line 513
 {  {
     SockList sl;      SockList sl;
   
     sl.buf=malloc(MAXSOCKBUF);      sl.buf=malloc(MAXSOCKSENDBUF);
   
     strcpy((char*)sl.buf,"delitem ");      strcpy((char*)sl.buf,"delitem ");
     sl.len=strlen((char*)sl.buf);      sl.len=strlen((char*)sl.buf);


Legend:
line(s) removed in v.1.39 
line(s) changed
 line(s) added in v.1.40

File made using version 1.98 of cvs2html by leaf at 2011-07-21 19:35