Crossfire Server, Trunk
|
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "image.h"
#include "newserver.h"
#include "shared/newclient.h"
#include "sproto.h"
#include "assets.h"
Go to the source code of this file.
Functions | |
static void | do_faceset (const face_sets *fs) |
void | esrv_send_face (socket_struct *ns, const Face *face, int nocache) |
void | send_face_cmd (char *buff, int len, socket_struct *ns) |
void | send_image_info (socket_struct *ns) |
void | send_image_sums (socket_struct *ns, char *params) |
Variables | |
static SockList * | ugly |
Image related communication
This file deals with the image related communication to the client. I've located all the functions in this file - this localizes it more, and means that we don't need to declare things like all the structures as globals.
Definition in file image.c.
|
static |
Definition at line 108 of file image.c.
References face_sets::comment, face_sets::extension, face_sets::fallback, face_sets::fullname, face_sets::id, face_sets::prefix, face_sets::size, SockList_AddPrintf(), and ugly.
Referenced by send_image_info().
void esrv_send_face | ( | socket_struct * | ns, |
const Face * | face, | ||
int | nocache | ||
) |
Sends a face to a client if they are in pixmap mode, nothing gets sent in bitmap mode. If nocache is true (nonzero), ignore the cache setting from the client - this is needed for the askface, in which we really do want to send the face (and askface is the only place that should be setting it). Otherwise, we look at the facecache, and if set, send the image name.
ns | socket to send the date to. |
face | face to send. |
nocache | if 1 then send a 'image2', else depending on client cache setting. |
Definition at line 71 of file image.c.
References face_info::checksum, face_info::data, face_info::datalen, socket_struct::facecache, face_sets::faces, socket_struct::faces_sent, socket_struct::faceset, find_faceset(), get_face_fallback(), face_sets::id, llevError, LOG(), Face::name, NS_FACESENT_FACE, Face::number, Send_With_Handling(), SockList_AddChar(), SockList_AddData(), SockList_AddInt(), SockList_AddShort(), SockList_AddString(), SockList_Init(), and SockList_Term().
Referenced by add_object_to_socklist(), append_spell(), esrv_draw_look(), esrv_new_player(), esrv_send_animation(), esrv_update_item(), knowledge_process_incremental(), knowledge_send_info(), map2_add_ob(), quest_send_initial_states(), quest_set_state(), send_account_players(), send_face_cmd(), send_skill_info(), and send_smooth().
void send_face_cmd | ( | char * | buff, |
int | len, | ||
socket_struct * | ns | ||
) |
Client has requested pixmap that it somehow missed getting. This will be called often if the client is caching images.
buff | data received from the client. |
len | length of buff, ignored. |
ns | socket to send data to. |
Definition at line 44 of file image.c.
References esrv_send_face(), get_face_by_id(), socket_struct::host, llevDebug, and LOG().
void send_image_info | ( | socket_struct * | ns | ) |
Sends the number of images, checksum of the face file, and the image_info file information. See the doc/Developers/protocol if you want further detail.
ns | socket to send data to. |
Definition at line 121 of file image.c.
References do_faceset(), facesets_for_each(), get_bitmap_checksum(), get_faces_count(), Send_With_Handling(), SockList_AddPrintf(), SockList_Init(), SockList_Term(), and ugly.
Referenced by request_info_cmd().
void send_image_sums | ( | socket_struct * | ns, |
char * | params | ||
) |
Sends requested face information.
ns | socket to send to |
params | contains first and last index of face |
For each image in [start..stop] sends
Definition at line 142 of file image.c.
References face_info::checksum, face_sets::faces, socket_struct::faces_sent, socket_struct::faceset, find_faceset(), get_face_by_id(), get_face_fallback(), get_faces_count(), face_sets::id, llevError, LOG(), Face::name, NS_FACESENT_FACE, Face::number, roll-o-matic::params, Send_With_Handling(), SockList_AddChar(), SockList_AddInt(), SockList_AddLen8Data(), SockList_AddPrintf(), SockList_AddShort(), SockList_Avail(), SockList_Init(), SockList_Reset(), SockList_Term(), and roll-o-matic::stop().
Referenced by request_info_cmd().
|
static |
Definition at line 107 of file image.c.
Referenced by do_faceset(), and send_image_info().