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.19 by root, Thu Dec 14 04:30:33 2006 UTC vs.
Revision 1.20 by root, Thu Dec 14 20:39:54 2006 UTC

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.length () >= (MAXSOCKBUF - MAXITEMLEN)) 297 if (sl.length () >= (MAXSOCKBUF - MAXITEMLEN))
298 { 298 {
299 Send_With_Handling (pl->contr->socket, &sl); 299 pl->contr->socket->send_packet (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);
303 sl << uint32 (0); 303 sl << uint32 (0);
304 got_one = 0; 304 got_one = 0;
305 } 305 }
306 } /* If LOOK_OBJ() */ 306 } /* If LOOK_OBJ() */
307 } 307 }
308 308
309 if (got_one) 309 if (got_one)
310 Send_With_Handling (pl->contr->socket, &sl); 310 pl->contr->socket->send_packet (sl);
311 311
312} 312}
313 313
314/** 314/**
315 * Sends whole inventory. 315 * Sends whole inventory.
321 int got_one = 0; 321 int got_one = 0;
322 322
323 packet sl; 323 packet sl;
324 324
325 sl.printf ("delinv %d", op->count); 325 sl.printf ("delinv %d", op->count);
326 Send_With_Handling (pl->contr->socket, &sl); 326 pl->contr->socket->send_packet (sl);
327 327
328 sl.reset (); 328 sl.reset ();
329 sl.printf ("item%d ", pl->contr->socket->itemcmd); 329 sl.printf ("item%d ", pl->contr->socket->itemcmd);
330 330
331 sl << uint32 (op->count); 331 sl << uint32 (op->count);
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.length () >= (MAXSOCKBUF - MAXITEMLEN)) 352 if (sl.length () >= (MAXSOCKBUF - MAXITEMLEN))
353 { 353 {
354 Send_With_Handling (pl->contr->socket, &sl); 354 pl->contr->socket->send_packet (sl);
355 355
356 sl.reset (); 356 sl.reset ();
357 sl.printf ("item%d ", pl->contr->socket->itemcmd); 357 sl.printf ("item%d ", pl->contr->socket->itemcmd);
358 sl << uint32 (op->count); 358 sl << uint32 (op->count);
359 got_one = 0; 359 got_one = 0;
360 } 360 }
361 } /* If LOOK_OBJ() */ 361 } /* If LOOK_OBJ() */
362 } 362 }
363 363
364 if (got_one) 364 if (got_one)
365 Send_With_Handling (pl->contr->socket, &sl); 365 pl->contr->socket->send_packet (sl);
366 366
367} 367}
368 368
369/** 369/**
370 * Updates object *op for player *pl. 370 * Updates object *op for player *pl.
488 } 488 }
489 489
490 if (flags & UPD_NROF) 490 if (flags & UPD_NROF)
491 sl << uint32 (op->nrof); 491 sl << uint32 (op->nrof);
492 492
493 Send_With_Handling (pl->contr->socket, &sl); 493 pl->contr->socket->send_packet (sl);
494} 494}
495 495
496/** 496/**
497 * Sends item's info to player. 497 * Sends item's info to player.
498 */ 498 */
524 524
525 sl << uint32 (op->env ? op->env->count : 0); 525 sl << uint32 (op->env ? op->env->count : 0);
526 526
527 add_object_to_socklist (*pl->contr->socket, sl, op); 527 add_object_to_socklist (*pl->contr->socket, sl, op);
528 528
529 Send_With_Handling (pl->contr->socket, &sl); 529 pl->contr->socket->send_packet (sl);
530 SET_FLAG (op, FLAG_CLIENT_SENT); 530 SET_FLAG (op, FLAG_CLIENT_SENT);
531 531
532} 532}
533 533
534/** 534/**
542 packet sl; 542 packet sl;
543 543
544 sl << "delitem " 544 sl << "delitem "
545 << uint32 (tag); 545 << uint32 (tag);
546 546
547 Send_With_Handling (pl->socket, &sl); 547 pl->socket->send_packet (sl);
548} 548}
549 549
550 550
551/******************************************************************************* 551/*******************************************************************************
552 * 552 *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines