#include "../shared/frdi.h"
Go to the source code of this file.
Compounds | |
struct | frdi__server_app |
struct | frdi__server_host |
struct | frdi__server_client |
struct | frdi__server_user |
struct | frdi__server_game |
Functions | |
frdi_server_app * | frdiServerAppNew (frdi_app *app) |
int | frdiServerAppRun (frdi_server_app *self) |
void | frdiServerAppFree (frdi_server_app *self) |
char * | frdiServerAppDisplay (frdi_server_app *self) |
void | frdiServerPV (frdi_server_app *self, char *str) |
void | frdiServerPVF (frdi_server_app *self, char *format, void *arg) |
void * | frdiServerClientListenerSpawner (void *arg) |
void * | frdiServerHostListenerSpawner (void *arg) |
void | frdiServerClientListenerWaitStop (frdi_server_app *self) |
void | frdiServerHostListenerWaitStop (frdi_server_app *self) |
void | frdiServerClientListenerTellStop (frdi_server_app *self) |
void | frdiServerHostListenerTellStop (frdi_server_app *self) |
void | frdiServerClientListenerTellStart (frdi_server_app *self) |
void | frdiServerHostListenerTellStart (frdi_server_app *self) |
frdi_server_client * | frdiServerClientInitialise (frdi_server_app *self, frdi_connection *connection) |
frdi_server_host * | frdiServerHostInitialise (frdi_server_app *self, frdi_connection *connection) |
void | frdiServerClientFinalise (frdi_server_app *self, frdi_server_client *client) |
void | frdiServerHostFinalise (frdi_server_app *self, frdi_server_host *host) |
void | frdiServerClientRecieve (frdi_server_app *self, frdi_connection *connection, frdi_message *message) |
void | frdiServerHostRecieve (frdi_server_app *self, frdi_connection *connection, frdi_message *message) |
void | frdiServerClientMessageSend (frdi_server_app *self, frdi_server_client *client, frdi_message *message) |
void | frdiServerHostMessageSend (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
char * | frdiServerClientDisplay (frdi_server_app *self, frdi_server_client *client) |
char * | frdiServerHostDisplay (frdi_server_app *self, frdi_server_host *host) |
void | frdiServerClientMessageRecieve (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void * | frdiServerHostMessageRecieve (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMsU (frdi_server_app *self, frdi_server_host *host, frdi_message *old_message) |
void | frdiServerClientMsU (frdi_server_app *self, frdi_server_client *client, frdi_message *old_message) |
void | frdiServerTellClientStop (frdi_server_app *self, frdi_server_client *client) |
void | frdiServerTellHostStop (frdi_server_app *self, frdi_server_host *host) |
void | frdiServerTellAllStop (frdi_server_app *self) |
void | frdiServerTellAllStopped (frdi_server_app *self) |
void | frdiServerGameSendClient (frdi_server_app *self, frdi_server_game *game, frdi_server_client *client, char *str) |
void | frdiServerGameSendClients (frdi_server_app *self, frdi_server_game *game, char *str) |
void | frdiServerClientMrD (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrG (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrK (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrL (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrM (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrR (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrU (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrV (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message) |
void | frdiServerClientMrE (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, frdi_message *message, char c) |
void | frdiServerGameSendUsers (frdi_server_app *self, frdi_server_game *game, frdi_list *user_list, char *str) |
frdi_server_host * | frdiServerHostFromGameId (frdi_server_app *self, frdi_server_client *client, char *game_id) |
void | frdiServerGameSendHost (frdi_server_app *self, frdi_server_game *game, char *str) |
void | frdiServerHostMrD (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrF (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrG (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrK (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrL (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrR (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrU (frdi_server_app *self, frdi_server_host *host, frdi_message *message) |
void | frdiServerHostMrE (frdi_server_app *self, frdi_server_host *host, frdi_message *message, char c) |
char * | frdiServerGameReport (frdi_server_app *self, frdi_server_game *game) |
void | frdiServerGameInitialiseSeed (frdi_server_app *self, frdi_server_game *game) |
void | frdiServerGameInitialiseInput (frdi_server_app *self, frdi_server_game *game) |
void | frdiServerGameReceiveClient (frdi_server_app *self, frdi_server_game *game, frdi_server_client *client, char *str) |
void | frdiServerGameReceiveHost (frdi_server_app *self, frdi_server_game *game, char *str) |
frdi_server_game * | frdiServerGameNew (frdi_server_app *self, char *game_id) |
void | frdiServerGameLog (frdi_server_app *self, frdi_server_game *game, char *str) |
void | frdiServerGameFinish (frdi_server_app *self, frdi_server_game *game) |
char * | frdiServerGameDescribe (frdi_server_app *self, frdi_server_game *game) |
void | frdiServerGameRegisterDigest (frdi_server_app *self, frdi_server_game *game, char *user_id, char *digest) |
int | frdiServerGameIsAllowed (frdi_server_app *self, frdi_server_game *game, char *prefix) |
void | frdiServerGameSetGameStage (frdi_server_app *self, frdi_server_game *game, int stage) |
void | frdiServerGameSetUserStatus (frdi_server_app *self, frdi_server_game *game, frdi_server_client *client, int status) |
frdi_server_client * | frdiServerGameClientFromName (frdi_server_app *self, frdi_server_game *game, char *name) |
void | frdiServerGameCheckReadyForOutcome (frdi_server_app *self, frdi_server_game *game) |
char * | frdiServerGameUseridFromClient (frdi_server_app *self, frdi_server_game *game, frdi_server_client *client) |
void | frdiGameAnnounceOutcomeToHost (frdi_server_app *self, frdi_server_game *game) |
frdi_server_user * | frdiServerUserNew (frdi_server_app *self) |
frdi_server_user * | frdiServerUserGetFromId (frdi_server_game *game, char *user_id) |
frdi_server_user * | frdiServerUserGetFromClient (frdi_server_game *game, frdi_server_client *client) |
frdi_list * | frdiServerUserListMatchStatus (frdi_server_game *game, int status) |
char * | frdiServerUserDescribe (frdi_server_app *self, frdi_server_user *user) |
void | frdiServerEncryptionMode (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, char *str) |
void | frdiServerAuthenticationMode (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, char *str) |
void | frdiServerAuthenticationTypePass (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, char *str) |
void | frdiServerAuthenticationType (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, char *str) |
void | frdiServerEncodingMode (frdi_server_app *self, frdi_server_host *host, frdi_server_client *client, char *str) |
|
somewhere to put globals |
|
doesn't exist until app ready to close |
|
release the object |
|
return information about this application as a string |
|
print if verbose |
|
print if verbose using format |
|
called in its own thread when the Client listener receives a connection |
|
called in its own thread when the Host listener receives a connection |
|
wait for the client listener thread to stop |
|
wait for the host listener thread to stop |
|
send a message to the client listener thread to stop |
|
send a message to the host listener thread to stop |
|
launch the thread for the client listener |
|
launch the thread for the host listener |
|
register a client-server connection |
|
register a host-server connection |
|
de-register a client-server connection |
|
de-register a host-server connection |
|
recieve a message from a client-server connection |
|
recieve a message from a host-server connection |
|
send a message along a client-server connection |
|
send a message along a host-server connection |
|
return a description of this client-server connection |
|
return a description of this host-server connection |
|
recieve a message from a server-client connection |
|
recieve a message from a server-host connection D Description F Find G Game K Keepalive L Link R Remote U Unknown |
|
send a U type message along a host-server connection |
|
send a U type message along a client-server connection |
|
tell a client connection that they are closing (inform the host connection if one is relevant) |
|
tell a host connection (and any related client connections) that they are closing |
|
tell all connections (client and host) that they are closing |
|
tell any connections (client and host) that still need telling that they have closed Note: relies on a particular undocumented behaviour of frdiDictValues that removing one item from the dict does not change the order the rest of the values will be returned when it is next called |
|
Send str back to a client as a game message |
|
Send str back to all client as a game message |
|
Fairdice Client-Server connection message receive : Description CHALLENGE : D is <description> RESPONSE : none ACTION : set description of client CHALLENGE : D request RESPONSE : D is <description> or RESPONSE : D null ACTION : none |
|
Fairdice Client-Server connection message receive : Game CHALLENGE : G <gamestr> <seperator> <data> RESPONSE : varies ACTION : parse <gamestr> into a frdi_server_game object. pass on to further method |
|
Fairdice Client-Server connection message receive : Keepalive CHALLENGE : K null RESPONSE : none ACTION : none CHALLENGE : K ping request <integer> RESPONSE : K ping response <integer> ACTION : none CHALLENGE : K ping response <integer> RESPONSE : none ACTION : record ping delay CHALLENGE : K time request RESPONSE : K time response <timestamp> ACTION : none CHALLENGE : K time response <timestamp> RESPONSE : none ACTION : synch time |
|
Fairdice Client-Server connection message receive : Link CHALLENGE : L opening RESPONSE : L opened ACTION : none CHALLENGE : L opened RESPONSE : none ACTION : none CHALLENGE : L closing RESPONSE : L closed ACTION : close this end of link CHALLENGE : L closed RESPONSE : none ACTION : close this end of link |
|
Fairdice Client-Server connection message receive : Mode CHALLENGE : M auth <data> RESPONSE : varies ACTION : pass on to authentication negotiation method CHALLENGE : M encrypt <data> RESPONSE : varies ACTION : pass on to encryption negotiation method CHALLENGE : M encode <data> RESPONSE : varies ACTION : pass on to data encoding negotiation method |
|
Fairdice Client-Server connection message receive : Remote CHALLENGE : R <data> RESPONSE : none ACTION : pass on verbatim along the host (keeping the R prefix) |
|
Fairdice Client-Server connection message receive : Unknown CHALLENGE : U null RESPONSE : none ACTION : report the error CHALLENGE : U <verbatim copy of message client got from us> RESPONSE : none ACTION : report the error |
|
Fairdice Client-Server connection message receive : Version CHALLENGE : V request RESPONSE : V offer <number selection> ACTION : none CHALLENGE : V offer <number selection> RESPONSE : V select <number> or RESPONSE : V unsupported ACTION : none CHALLENGE : V select <number> RESPONSE : none or RESPONSE : V unsupported ACTION : none where <number> is a positive integer identifying a specific version of the server-client link protocol. where <number range> is "<number>-<number>" where <number selection> is a comma seperated list of <number> and or <number range> for example 1,3-5,7 note: implementation incomplete. |
|
Fairdice Client-Server connection message receive : A Mystery CHALLENGE : <unparsable> RESPONSE : U <unparsable> ACTION : report the error |
|
Send str back to all listed users |
|
find a host with a game whose id matches |
|
Send str back to the host as a game message |
|
Fairdice Host-Server connection message receive : Description CHALLENGE : D is <description> RESPONSE : none ACTION : set description of host CHALLENGE : D request RESPONSE : D is <description> or RESPONSE : D null ACTION : none |
|
Fairdice Host-Server connection message receive : Find CHALLENGE : F set host <hoststr> CHALLENGE : F set secret <secret> RESPONSE : none ACTION : register the strings |
|
Fairdice Host-Server connection message receive : Game CHALLENGE : G <gamestr> <seperator> <data> RESPONSE : varies ACTION : parse <gamestr> into a frdi_server_game object. pass on to further method |
|
Fairdice Host-Server connection message receive : Keepalive CHALLENGE : K null RESPONSE : none ACTION : none CHALLENGE : K ping request <integer> RESPONSE : K ping response <integer> ACTION : none CHALLENGE : K ping response <integer> RESPONSE : none ACTION : record ping delay CHALLENGE : K time request RESPONSE : K time response <timestamp> ACTION : none CHALLENGE : K time response <timestamp> RESPONSE : none ACTION : synch time |
|
Fairdice Host-Server connection message receive : Link CHALLENGE : L opening RESPONSE : L opened ACTION : none CHALLENGE : L opened RESPONSE : none ACTION : none CHALLENGE : L closing RESPONSE : L closed ACTION : close this end of link CHALLENGE : L closed RESPONSE : none ACTION : close this end of link |
|
Fairdice Host-Server connection message receive : Remote CHALLENGE : R <data> RESPONSE : none ACTION : pass on verbatim along to the server (keeping the R prefix) |
|
Fairdice Host-Server connection message receive : Unknown CHALLENGE : U null RESPONSE : none ACTION : report the error CHALLENGE : U <verbatim copy of message server got from us> RESPONSE : none ACTION : report the error |
|
Fairdice Host-Server connection message receive : A Mystery CHALLENGE : <unparsable> RESPONSE : U <unparsable> ACTION : report the error |
|
report the outcome of a game to the server in complete terms |
|
sets up properties |
|
sets up the host's input |
|
deal with a game str from the client (Note: of all the GameReceive method, this has an extra argument, because of the two directions on each of the three links, this is the only many:one link
|
|
deal with a game str from the host |
|
create a game object (values get filled in by the create object) |
|
log it |
|
de-register and destroy a game object |
|
describe it |
|
register a digest |
|
check whether a response is allowed at a particular stage |
|
set the games's stage to one of: define FRDI_SERVER_GAME_STAGE_UNSET -1 define FRDI_SERVER_GAME_STAGE_OPENING 1 define FRDI_SERVER_GAME_STAGE_INIT 2 define FRDI_SERVER_GAME_STAGE_RAND 3 define FRDI_SERVER_GAME_STAGE_GENR 4 define FRDI_SERVER_GAME_STAGE_VERI 5 define FRDI_SERVER_GAME_STAGE_CLOSING 6 |
|
set the user's status to one of: not connected define FRDI_SERVER_GAME_USER_UNSET -1 connected but not yet accepted by the host define FRDI_SERVER_GAME_USER_CLIENT 1 accepted by the host, but no user_num yet define FRDI_SERVER_GAME_USER_HOST 2 has a user_num allocated by the server define FRDI_SERVER_GAME_USER_SERVER 3 has revealed their usertext define FRDI_SERVER_GAME_USER_USER 4 has finished their verification define FRDI_SERVER_GAME_USER_CONTENT 5 |
|
return a client object, given the name passed to the host |
|
if all the plaintexts are in, calculate the outcome and tell the host |
|
find the char* user_id from the frdi_server_client *client |
|
let the host know what the result is |
|
create fake user object |
|
return a user obj |
|
return a user obj |
|
return a list of all user_objs that have status X |
|
return a string describing an frdi_server_user object |
|
negotiate which encryption mode to use |
|
negotiate which authentication mode to use |
|
messages specific to the authentication mode "pass" |
|
messages specific to a particular authentication mode |
|
negotiate which encoding mode to use |