Atrinik Server  4.0
Functions | Variables
resources.c File Reference
#include <global.h>
#include <toolkit/string.h>
#include <toolkit/packet.h>
#include <resources.h>

Go to the source code of this file.

Functions

static void resources_traverse (DIR *dir, const char *path)
 
void resources_init (void)
 
void resources_deinit (void)
 
resource_tresources_find (const char *name)
 
void resources_send (resource_t *resource, socket_struct *ns)
 

Variables

static resource_tresources = NULL
 

Detailed Description

Resource files.

Author
Alex Tokar

Definition in file resources.c.

Function Documentation

void resources_deinit ( void  )

Deinitialize the resource files database.

Definition at line 143 of file resources.c.

resource_t* resources_find ( const char *  name)

Find a resource identified by its name.

Parameters
nameThe name identifier.
Returns
Resource if found, NULL otherwise.

Definition at line 162 of file resources.c.

void resources_init ( void  )

Initialize the resource files database.

Definition at line 126 of file resources.c.

void resources_send ( resource_t resource,
socket_struct ns 
)

Send information about the specified resource to a game client.

Parameters
resourceResource to send information about.
nsClient to send to.

Definition at line 182 of file resources.c.

static void resources_traverse ( DIR *  dir,
const char *  path 
)
static

Traverse the specified directory looking for resource files.

Parameters
dirDirectory.
pathPath to the directory.

Definition at line 51 of file resources.c.

Variable Documentation

resource_t* resources = NULL
static

Hash table containing the resources IDs and SHA512 sums.

Definition at line 40 of file resources.c.