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

Comparing deliantra/server/socket/image.C (file contents):
Revision 1.7 by root, Thu Dec 14 01:12:35 2006 UTC vs.
Revision 1.8 by root, Thu Dec 14 01:21:58 2006 UTC

320 320
321 if (mode == CF_FACE_NONE) 321 if (mode == CF_FACE_NONE)
322 ns->facecache = 1; 322 ns->facecache = 1;
323 else if (mode != CF_FACE_PNG) 323 else if (mode != CF_FACE_PNG)
324 { 324 {
325 SockList sl (MAXSOCKBUF); 325 packet sl;
326 sl.printf ("drawinfo %d %s", NDI_RED, "Warning - send unsupported face mode. Will use Png"); 326 sl.printf ("drawinfo %d %s", NDI_RED, "Warning - send unsupported face mode. Will use Png");
327 ns->send_packet (sl); 327 ns->send_packet (sl);
328 } 328 }
329 329
330 if (mask) 330 if (mask)
365 { 365 {
366 LOG (llevError, "esrv_send_face (%d) out of bounds??\n", face_num); 366 LOG (llevError, "esrv_send_face (%d) out of bounds??\n", face_num);
367 return; 367 return;
368 } 368 }
369 369
370 SockList sl (MAXSOCKBUF); 370 packet sl;
371 fallback = get_face_fallback (ns->faceset, face_num); 371 fallback = get_face_fallback (ns->faceset, face_num);
372 372
373 if (facesets[fallback].faces[face_num].data == NULL) 373 if (facesets[fallback].faces[face_num].data == NULL)
374 { 374 {
375 LOG (llevError, "esrv_send_face: faces[%d].data == NULL\n", face_num); 375 LOG (llevError, "esrv_send_face: faces[%d].data == NULL\n", face_num);
402 402
403 Send_With_Handling (ns, &sl); 403 Send_With_Handling (ns, &sl);
404 } 404 }
405 405
406 ns->faces_sent[face_num] |= NS_FACESENT_FACE; 406 ns->faces_sent[face_num] |= NS_FACESENT_FACE;
407 sl.free ();
408} 407}
409 408
410/** 409/**
411 * Sends the number of images, checksum of the face file, 410 * Sends the number of images, checksum of the face file,
412 * and the image_info file information. See the doc/Developers/protocol 411 * and the image_info file information. See the doc/Developers/protocol
414 */ 413 */
415 414
416void 415void
417send_image_info (NewSocket * ns, char *params) 416send_image_info (NewSocket * ns, char *params)
418{ 417{
419 SockList sl (MAXSOCKBUF); 418 packet sl;
420 419
421 sl.printf ("replyinfo image_info\n%d\n%d\n", nrofpixmaps - 1, bmaps_checksum); 420 sl.printf ("replyinfo image_info\n%d\n%d\n", nrofpixmaps - 1, bmaps_checksum);
422 421
423 for (int i = 0; i < MAX_FACE_SETS; i++) 422 for (int i = 0; i < MAX_FACE_SETS; i++)
424 if (facesets[i].prefix) 423 if (facesets[i].prefix)
425 sl.printf ("%d:%s:%s:%d:%s:%s:%s", 424 sl.printf ("%d:%s:%s:%d:%s:%s:%s",
426 i, facesets[i].prefix, facesets[i].fullname, facesets[i].fallback, 425 i, facesets[i].prefix, facesets[i].fullname, facesets[i].fallback,
427 facesets[i].size, facesets[i].extension, facesets[i].comment); 426 facesets[i].size, facesets[i].extension, facesets[i].comment);
428 427
429 Send_With_Handling (ns, &sl); 428 Send_With_Handling (ns, &sl);
430 sl.free ();
431} 429}
432 430
433/** 431/**
434 * Sends requested face information. 432 * Sends requested face information.
435 * \param ns socket to send to 433 * \param ns socket to send to
443send_image_sums (NewSocket * ns, char *params) 441send_image_sums (NewSocket * ns, char *params)
444{ 442{
445 int start, stop; 443 int start, stop;
446 char *cp, buf[MAX_BUF]; 444 char *cp, buf[MAX_BUF];
447 445
448 SockList sl (MAXSOCKBUF); 446 packet sl;
449 447
450 start = atoi (params); 448 start = atoi (params);
451 for (cp = params; *cp != '\0'; cp++) 449 for (cp = params; *cp != '\0'; cp++)
452 if (*cp == ' ') 450 if (*cp == ' ')
453 break; 451 break;
485 LOG (llevError, "send_image_send: buffer overrun, %d > %d\n", sl.len, MAXSOCKBUF); 483 LOG (llevError, "send_image_send: buffer overrun, %d > %d\n", sl.len, MAXSOCKBUF);
486 abort (); 484 abort ();
487 } 485 }
488 486
489 Send_With_Handling (ns, &sl); 487 Send_With_Handling (ns, &sl);
490 sl.free ();
491} 488}
492 489

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines