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.90 by root, Sat Apr 3 17:15:19 2010 UTC vs.
Revision 1.91 by root, Thu Apr 8 04:49:02 2010 UTC

120 120
121 if (QUERY_FLAG (head, FLAG_NO_PICK)) 121 if (QUERY_FLAG (head, FLAG_NO_PICK))
122 flags |= F_NOPICK; 122 flags |= F_NOPICK;
123 123
124 ns.send_face (head->face, -50); 124 ns.send_face (head->face, -50);
125 ns.flush_fx ();
126 125
127 if (QUERY_FLAG (head, FLAG_ANIMATE) && !ns.anims_sent[head->animation_id]) 126 if (QUERY_FLAG (head, FLAG_ANIMATE) && !ns.anims_sent[head->animation_id])
128 ns.send_animation (head->animation_id); 127 ns.send_animation (head->animation_id);
129 128
130 sl << uint32 (head->count) 129 sl << uint32 (head->count)
279 dirty = true; 278 dirty = true;
280 279
281 // if packet got too large, send it and begin a new one 280 // if packet got too large, send it and begin a new one
282 if (sl.length () > MAXSOCKBUF - MAXITEMLEN) 281 if (sl.length () > MAXSOCKBUF - MAXITEMLEN)
283 { 282 {
283 pl->ns->flush_fx ();
284 pl->ns->send_packet (sl); 284 pl->ns->send_packet (sl);
285 285
286 sl.reset (); 286 sl.reset ();
287 sl.printf ("item%d ", pl->ns->itemcmd); 287 sl.printf ("item%d ", pl->ns->itemcmd);
288 sl << uint32 (0); 288 sl << uint32 (0);
307 307
308 dirty = true; 308 dirty = true;
309 } 309 }
310 310
311 if (dirty) 311 if (dirty)
312 {
313 pl->ns->flush_fx ();
312 pl->ns->send_packet (sl); 314 pl->ns->send_packet (sl);
315 }
313} 316}
314 317
315/** 318/**
316 * Sends whole inventory. 319 * Sends whole inventory.
317 */ 320 */
349 * items (especially with some of the bags out there) to 352 * items (especially with some of the bags out there) to
350 * overflow the buffer. IF so, send multiple item commands. 353 * overflow the buffer. IF so, send multiple item commands.
351 */ 354 */
352 if (sl.length () > MAXSOCKBUF - MAXITEMLEN) 355 if (sl.length () > MAXSOCKBUF - MAXITEMLEN)
353 { 356 {
357 pl->contr->ns->flush_fx ();
354 pl->contr->ns->send_packet (sl); 358 pl->contr->ns->send_packet (sl);
355 359
356 sl.reset (); 360 sl.reset ();
357 sl.printf ("item%d ", pl->contr->ns->itemcmd); 361 sl.printf ("item%d ", pl->contr->ns->itemcmd);
358 sl << uint32 (op->count); 362 sl << uint32 (op->count);
360 } 364 }
361 } 365 }
362 } 366 }
363 367
364 if (got_one) 368 if (got_one)
369 {
370 pl->contr->ns->flush_fx ();
365 pl->contr->ns->send_packet (sl); 371 pl->contr->ns->send_packet (sl);
372 }
366} 373}
367 374
368/** 375/**
369 * Updates object *op for player *pl. 376 * Updates object *op for player *pl.
370 * 377 *
491 498
492 sl << uint32 (op->env ? op->env->count : 0); 499 sl << uint32 (op->env ? op->env->count : 0);
493 500
494 add_object_to_socklist (*pl->contr->ns, sl, op); 501 add_object_to_socklist (*pl->contr->ns, sl, op);
495 502
503 pl->contr->ns->flush_fx ();
496 pl->contr->ns->send_packet (sl); 504 pl->contr->ns->send_packet (sl);
497} 505}
498 506
499/** 507/**
500 * Tells the client to delete an item. 508 * Tells the client to delete an item.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines