Crossfire Server, Trunk
image.c File Reference
#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"
+ Include dependency graph for image.c:

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 SockListugly
 

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

◆ do_faceset()

static void do_faceset ( const face_sets fs)
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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ esrv_send_face()

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.

Parameters
nssocket to send the date to.
faceface to send.
nocacheif 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_face_cmd()

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 44 of file image.c.

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

+ Here is the call graph for this function:

◆ send_image_info()

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 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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ send_image_sums()

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 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, manor::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().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ugly

SockList* ugly
static
Todo:
remove

Definition at line 107 of file image.c.

Referenced by do_faceset(), and send_image_info().