Crossfire Server, Trunk  R20513
Functions
image.c File Reference

Image related communication. More...

#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "image.h"
#include "newserver.h"
#include "shared/newclient.h"
#include "sproto.h"
Include dependency graph for image.c:

Go to the source code of this file.

Functions

void esrv_send_face (socket_struct *ns, uint16_t face_num, int nocache)
 Sends a face to a client if they are in pixmap mode, nothing gets sent in bitmap mode. More...
 
void send_face_cmd (char *buff, int len, socket_struct *ns)
 Client has requested pixmap that it somehow missed getting. More...
 
void send_image_info (socket_struct *ns)
 Sends the number of images, checksum of the face file, and the image_info file information. More...
 
void send_image_sums (socket_struct *ns, char *params)
 Sends requested face information. More...
 

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,
uint16_t  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.

Parameters
nssocket to send the date to.
face_numface number to send.
nocacheif 1 then send a 'image2', else depending on client cache setting.

Definition at line 70 of file image.c.

References socket_struct::facecache, socket_struct::faces_sent, socket_struct::faceset, facesets, get_face_fallback(), llevError, LOG(), 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(), 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().

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.

Parameters
buffdata received from the client.
lenlength of buff, ignored.
nssocket to send data to.

Definition at line 43 of file image.c.

References esrv_send_face(), socket_struct::host, llevDebug, and LOG().

Here is the call graph for this function:

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.

Parameters
nssocket to send data to.

Definition at line 112 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 139 of file image.c.

References socket_struct::faces_sent, socket_struct::faceset, facesets, get_face_fallback(), llevError, LOG(), 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: