Project Fairdice
[Home] [Docs] [Users] [Gaming] [Crypto] [Devel] [Download] [Help]

The Code : Files

Shared - Includes

The include files get included by frdi.h in the following order:
/// eg
/// #include <stdio.h>
/// #include <gmp.h>
#include "frdi_external.h"

/// eg
/// #define FRDI_ERR_MEMORY     101
/// #define frdiDebug(frdi_debug_arg) frdiExceptionDebug(frdi_debug_arg)
#include "frdi_defines.h"

/// eg
/// struct frdi__application { char *machine_name; int port_number; };
/// typedef struct frdi__application frdi_application;
#include "frdi_struct.h"

/// eg
/// frdi_message *frdiMessageNew(int size, void *data);
/// frdi_log *frdiLogInitialise(frdi_config *config);
#include "frdi_headers.h"

/// unused
///
#include "frdi_globals.h"
This has the advantage that all methods can use all structures. It has the disadvantage of slowing down compiling.

Shared - Source

Main grouping and important files:
frdi_game_*
objects embodying game concepts
frdi_game.c
some game specific utility functions
frdi_net_*
tcp/ip, thread and message handling
frdi_app.c frdi_conf.c frdi_log.c frdi_exception.c
basic objects dealing with logs, configuration files and errors
frdi_list.c frdi_dict.c frdi_lib.c frdi_util.c
utility methods and basic data structures
frdi_shuffle_deck.c
not currently used

Server

There are similar files in user, client and host
frdi_server_main.c
The thread entry point. Creates an app then calls connections
frdi_server_app.c
An application-specific wrapper around variable to avoid globals
frdi_server_connections.c
starts listening on tcp/ip port. handles threads and connections
frdi_server_storage.c
translates between connections and app-specific objects (eg "host", "client") which it passes to messages
frdi_server_messages.c
the switching station. processes text and decides what should handle it
frdi_server_cmr.c frdi_server_hmr.c
Message Recieve functions, one for each key letter. eg MrK for "message receive Keepalive"
frdi_server_link.c
handles the "M" key letter (link encryption and authentication)
frdi_server_game.c
handles the "G" and "P" key letters (playing the actual game)


(TOP)(UP)