49 if (len <= 0 || !buff) {
55 faceid = tmpnum&0xffff;
139 unsigned int start, stop;
147 if (params == NULL) {
148 LOG(
llevError,
"send_image_sums: bogus \"requestinfo image_sums\": no range provided.\n");
154 start = atoi(params);
155 for (cp = params; *cp !=
'\0'; cp++)
162 || (stop-start) > 1000
171 for (i = start; i <= stop; i++) {
175 LOG(
llevError,
"send_image_sums: buffer overflow, rejecting range %d..%d\n", start, stop);
void SockList_AddPrintf(SockList *sl, const char *format,...)
Adds a printf like formatted string.
uint8_t faceset
Set the client is using, default 0.
void SockList_Reset(SockList *sl)
Resets the length of the stored data for writing.
#define NS_FACESENT_FACE
Bitmask for the faces_sent[] array - what portion of the face have we sent?
face_info * faces
images in this faceset
void send_image_info(socket_struct *ns)
Sends the number of images, checksum of the face file, and the image_info file information.
void SockList_Init(SockList *sl)
Initializes the SockList instance.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
Defines various flags that both the new client and new server use.
New face structure - this enforces the notion that data is face by face only - you can not change the...
void SockList_AddShort(SockList *sl, uint16_t data)
Adds a 16 bit value.
Socket structure, represents a client-server connection.
int get_face_fallback(int faceset, uint16_t imageno)
This returns the set we will actually use when sending a face.
face_sets * find_faceset(int id)
void SockList_AddInt(SockList *sl, uint32_t data)
Adds a 32 bit value.
Facesets * facesets()
Get facesets.
Global type definitions and header inclusions.
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.
static unsigned checksum(const mtar_raw_header_t *rh)
char * host
Which host it is connected from (ip address).
void send_image_sums(socket_struct *ns, char *params)
Sends requested face information.
AssetsManager * getManager()
uint32_t facecache
If true, client is caching images.
void SockList_AddData(SockList *sl, const void *data, size_t len)
Adds a data block.
Image-related structures.
uint8_t * data
Image data.
void SockList_Term(SockList *sl)
Frees all resources allocated by a SockList instance.
char * prefix
Faceset short name, used in pictures names (base, clsc).
char * extension
Supplementary description.
void SockList_AddString(SockList *sl, const char *data)
Adds a string without length.
Defines various structures and values that are used for the new client server communication method...
char * size
Human-readable set size.
size_t SockList_Avail(const SockList *sl)
Returns the available bytes in a SockList instance.
uint16_t number
This is the image unique identifier.
uint32_t checksum
Checksum of face data.
char * comment
Human-readable comment for this set.
void SockList_AddChar(SockList *sl, unsigned char c)
Adds an 8 bit value.
uint16_t datalen
Length of data.
struct face_sets * fallback
Faceset to use when an image is not found in this faceset.
Only for debugging purposes.
void SockList_AddLen8Data(SockList *sl, const void *data, size_t len)
Adds a data block prepended with an 8 bit length field.
void send_face_cmd(char *buff, int len, socket_struct *ns)
Client has requested pixmap that it somehow missed getting.
char * fullname
Full faceset name.
C function wrappers to interact with assets.
Contains the base information we use to make up a packet we want to send.
Information about one face set.
sstring name
Face name, as used by archetypes and such.
uint8_t * faces_sent
This is a bitmap on sent face status.
const Face * get_face_by_id(uint16_t id)
Get a face from its unique identifier.
void Send_With_Handling(socket_struct *ns, SockList *sl)
Calls Write_To_Socket to send data to the client.
void each(std::function< void(T *)> op)
Apply a function to each asset.