Crossfire Server, Branches 1.12  R18729
image.c File Reference
#include <global.h>
#include <sproto.h>
#include <newclient.h>
#include <newserver.h>
#include <loader.h>
#include <image.h>
+ Include dependency graph for image.c:

Go to the source code of this file.

Functions

void esrv_send_face (socket_struct *ns, short face_num, int nocache)
 
void send_face_cmd (char *buff, int len, socket_struct *ns)
 
void send_image_info (socket_struct *ns, char *params)
 
void send_image_sums (socket_struct *ns, char *params)
 
void set_face_mode_cmd (char *buf, int len, socket_struct *ns)
 

Detailed Description

Image related communication

Date
2006-03-18

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.

Function Documentation

void esrv_send_face ( socket_struct ns,
short  face_num,
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.

Definition at line 96 of file image.c.

References socket_struct::facecache, socket_struct::faces_sent, socket_struct::faceset, facesets, get_face_fallback(), llevError, LOG(), bmappair::name, new_faces, nrofpixmaps, NS_FACESENT_FACE, 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(), map2_add_ob(), send_face_cmd(), and send_smooth().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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.

Definition at line 80 of file image.c.

References esrv_send_face().

+ Here is the call graph for this function:

void send_image_info ( socket_struct ns,
char *  params 
)

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.

Definition at line 138 of file image.c.

References bmaps_checksum, facesets, MAX_FACE_SETS, nrofpixmaps, Send_With_Handling(), SockList_AddPrintf(), SockList_Init(), and SockList_Term().

Referenced by request_info_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void send_image_sums ( socket_struct ns,
char *  params 
)

Sends requested face information.

Parameters
nssocket to send to
paramscontains first and last index of face

For each image in [start..stop] sends

  • checksum
  • name

Definition at line 165 of file image.c.

References socket_struct::faces_sent, socket_struct::faceset, facesets, get_face_fallback(), llevError, LOG(), bmappair::name, new_faces, nrofpixmaps, NS_FACESENT_FACE, Send_With_Handling(), SockList_AddChar(), SockList_AddInt(), SockList_AddLen8Data(), SockList_AddPrintf(), SockList_AddShort(), SockList_Avail(), SockList_Init(), SockList_Reset(), and SockList_Term().

Referenced by request_info_cmd().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void set_face_mode_cmd ( char *  buf,
int  len,
socket_struct ns 
)

Client tells us what type of faces it wants. Also sets the caching attribute.

Definition at line 53 of file image.c.

References CF_FACE_CACHE, CF_FACE_NONE, CF_FACE_PNG, socket_struct::facecache, llevDebug, LOG(), NDI_RED, Send_With_Handling(), SockList_AddPrintf(), SockList_Init(), and SockList_Term().

+ Here is the call graph for this function: