version 1.11 | | version 1.12 |
---|
| | |
/* | | /* |
* static char *rcsid_init_c = | | * static char *rcsid_init_c = |
* "$Id: image.c,v 1.11 2006/05/21 10:35:10 akirschbaum Exp $"; | | * "$Id: image.c,v 1.12 2006/06/05 06:28:57 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
Copyright (C) 2001 Mark Wedel | | Copyright (C) 2006 Mark Wedel & Crossfire Development Team |
Copyright (C) 1992 Frank Tore Johansen | | Copyright (C) 1992 Frank Tore Johansen |
| | |
This program is free software; you can redistribute it and/or modify | | This program is free software; you can redistribute it and/or modify |
| | |
else | | else |
strcpy((char*)sl.buf, "face "); | | strcpy((char*)sl.buf, "face "); |
| | |
sl.len=strlen(sl.buf); | | sl.len=strlen((char*)sl.buf); |
SockList_AddShort(&sl, face_num); | | SockList_AddShort(&sl, face_num); |
if (ns->image2) | | if (ns->image2) |
SockList_AddChar(&sl, fallback); | | SockList_AddChar(&sl, fallback); |
| | |
| | |
sl.buf = malloc(MAXSOCKSENDBUF); | | sl.buf = malloc(MAXSOCKSENDBUF); |
| | |
sprintf(sl.buf,"replyinfo image_info\n%d\n%d\n", nrofpixmaps-1, bmaps_checksum); | | sprintf((char*)sl.buf,"replyinfo image_info\n%d\n%d\n", nrofpixmaps-1, bmaps_checksum); |
for (i=0; i<MAX_FACE_SETS; i++) { | | for (i=0; i<MAX_FACE_SETS; i++) { |
if (facesets[i].prefix) { | | if (facesets[i].prefix) { |
sprintf(sl.buf + strlen(sl.buf), "%d:%s:%s:%d:%s:%s:%s", | | sprintf((char*)sl.buf + strlen((char*)sl.buf), "%d:%s:%s:%d:%s:%s:%s", |
i, facesets[i].prefix, facesets[i].fullname, facesets[i].fallback, | | i, facesets[i].prefix, facesets[i].fullname, facesets[i].fallback, |
facesets[i].size, facesets[i].extension, facesets[i].comment); | | facesets[i].size, facesets[i].extension, facesets[i].comment); |
} | | } |
} | | } |
sl.len = strlen(sl.buf); | | sl.len = strlen((char*)sl.buf); |
Send_With_Handling(ns, &sl); | | Send_With_Handling(ns, &sl); |
free(sl.buf); | | free(sl.buf); |
} | | } |
| | |
cs_write_string(ns, buf, strlen(buf)); | | cs_write_string(ns, buf, strlen(buf)); |
return; | | return; |
} | | } |
sprintf(sl.buf,"replyinfo image_sums %d %d ", start, stop); | | sprintf((char*)sl.buf,"replyinfo image_sums %d %d ", start, stop); |
| | |
sl.len = strlen(sl.buf); | | sl.len = strlen((char*)sl.buf); |
| | |
for (i=start; i<=stop; i++) { | | for (i=start; i<=stop; i++) { |
if (sl.len+2+4+1+1+strlen(new_faces[i].name)+1 > MAXSOCKSENDBUF) { | | if (sl.len+2+4+1+1+strlen(new_faces[i].name)+1 > MAXSOCKSENDBUF) { |
| | |
| | |
qq = strlen(new_faces[i].name); | | qq = strlen(new_faces[i].name); |
SockList_AddChar(&sl, ( char )( qq + 1 )); | | SockList_AddChar(&sl, ( char )( qq + 1 )); |
strcpy(sl.buf + sl.len, new_faces[i].name); | | strcpy((char*)sl.buf + sl.len, new_faces[i].name); |
sl.len += qq; | | sl.len += qq; |
SockList_AddChar(&sl, 0); | | SockList_AddChar(&sl, 0); |
} | | } |