ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/socket/item.C
(Generate patch)

Comparing deliantra/server/socket/item.C (file contents):
Revision 1.16 by root, Thu Dec 14 01:21:58 2006 UTC vs.
Revision 1.18 by root, Thu Dec 14 02:37:37 2006 UTC

114/* Used in the send_look to put object head into packet 114/* Used in the send_look to put object head into packet
115 * sl for socket ns. Need socket to know if we need to send 115 * sl for socket ns. Need socket to know if we need to send
116 * animation of face to the client. 116 * animation of face to the client.
117 */ 117 */
118static void 118static void
119add_object_to_socklist (NewSocket &ns, packet &sl, object *head) 119add_object_to_socklist (client_socket &ns, packet &sl, object *head)
120{ 120{
121 int flags, len, anim_speed; 121 int flags, len, anim_speed;
122 char item_n[MAX_BUF]; 122 char item_n[MAX_BUF];
123 const char *item_p; 123 const char *item_p;
124 124
292 head = tmp; 292 head = tmp;
293 293
294 add_object_to_socklist (pl->contr->socket, sl, head); 294 add_object_to_socklist (pl->contr->socket, sl, head);
295 got_one++; 295 got_one++;
296 296
297 if (sl.len >= (MAXSOCKBUF - MAXITEMLEN)) 297 if (sl.length () >= (MAXSOCKBUF - MAXITEMLEN))
298 { 298 {
299 Send_With_Handling (&pl->contr->socket, &sl); 299 Send_With_Handling (&pl->contr->socket, &sl);
300 300
301 sl.reset (); 301 sl.reset ();
302 sl.printf ("item%d ", pl->contr->socket.itemcmd); 302 sl.printf ("item%d ", pl->contr->socket.itemcmd);
347 347
348 /* IT is possible for players to accumulate a huge amount of 348 /* IT is possible for players to accumulate a huge amount of
349 * items (especially with some of the bags out there) to 349 * items (especially with some of the bags out there) to
350 * overflow the buffer. IF so, send multiple item commands. 350 * overflow the buffer. IF so, send multiple item commands.
351 */ 351 */
352 if (sl.len >= (MAXSOCKBUF - MAXITEMLEN)) 352 if (sl.length () >= (MAXSOCKBUF - MAXITEMLEN))
353 { 353 {
354 Send_With_Handling (&pl->contr->socket, &sl); 354 Send_With_Handling (&pl->contr->socket, &sl);
355
356 sl.reset ();
355 sprintf ((char *) sl.buf, "item%d ", pl->contr->socket.itemcmd); 357 sl.printf ("item%d ", pl->contr->socket.itemcmd);
356 sl.len = strlen ((char *) sl.buf);
357 sl << uint32 (op->count); 358 sl << uint32 (op->count);
358 got_one = 0; 359 got_one = 0;
359 } 360 }
360 } /* If LOOK_OBJ() */ 361 } /* If LOOK_OBJ() */
361 } 362 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines