Main Page   File List   File Members   Related Pages  

frdi_client_game.c File Reference

interpret the game protocol More...

#include "frdi_client.h"

Functions

int frdiClientGameIsAllowed (frdi_client_app *self, frdi_client_game *game, char *prefix)
void frdiClientGameRevealUsertext (frdi_client_app *self, frdi_client_game *game)
void frdiClientGameRegisterDigest (frdi_client_app *self, frdi_client_game *game, char *response)
void frdiClientGameVerifyDigest (frdi_client_app *self, frdi_client_game *game, char *response)
int frdiClientGameCountUsertexts (frdi_client_app *self, frdi_client_game *game)
int frdiClientGameCountDigests (frdi_client_app *self, frdi_client_game *game)
char * frdiClientGameCalculateRange (frdi_client_app *self, frdi_client_game *game)
void frdiClientGameVerifyOutput (frdi_client_app *self, frdi_client_game *game)
void frdiClientGameReceiveServer (frdi_client_app *self, frdi_client_game *game, char *str)
void frdiClientGameReceiveUser (frdi_client_app *self, frdi_client_game *game, char *str)
frdi_client_game * frdiClientGameNew (frdi_client_app *self, char *game_id)
void frdiClientGameLog (frdi_client_app *self, frdi_client_game *game, char *str)
void frdiClientGameFinish (frdi_client_app *self, frdi_client_game *game)
char * frdiClientGameReport (frdi_client_app *self, frdi_client_game *game)
char * frdiClientGameDescribe (frdi_client_app *self, frdi_client_game *game)


Detailed Description

interpret the game protocol

Author:
Douglas Reay <douglas-legal@reay.org>
Warning:

Function Documentation

int frdiClientGameIsAllowed frdi_client_app *    self,
frdi_client_game *    game,
char *    prefix
 

check whether a response is allowed at a particular stage

void frdiClientGameRevealUsertext frdi_client_app *    self,
frdi_client_game *    game
 

reveal our input

void frdiClientGameRegisterDigest frdi_client_app *    self,
frdi_client_game *    game,
char *    response
 

register a digest response is of the form "<integer> <string>"

void frdiClientGameVerifyDigest frdi_client_app *    self,
frdi_client_game *    game,
char *    response
 

verify a digest response is of the form "<user_id> <user_text>"

int frdiClientGameCountUsertexts frdi_client_app *    self,
frdi_client_game *    game
 

have we received all the usertexts we requested? (there should be one for every player + 1 for the host - 1 for ourselves

int frdiClientGameCountDigests frdi_client_app *    self,
frdi_client_game *    game
 

have we received all the digests we requested? (there should be one for every player + 1 for the host - 1 for ourselves

char* frdiClientGameCalculateRange frdi_client_app *    self,
frdi_client_game *    game
 

return a range like "0-5,7-10" where we are user_id 6 and there are 10 players in the game

void frdiClientGameVerifyOutput frdi_client_app *    self,
frdi_client_game *    game
 

verify the output

void frdiClientGameReceiveServer frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

deal with a game str from the server

void frdiClientGameReceiveUser frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

deal with a game str from the user

frdi_client_game* frdiClientGameNew frdi_client_app *    self,
char *    game_id
 

create a game object (values get filled in by the create object)

void frdiClientGameLog frdi_client_app *    self,
frdi_client_game *    game,
char *    str
 

log it

void frdiClientGameFinish frdi_client_app *    self,
frdi_client_game *    game
 

de-register and destroy a game object

char* frdiClientGameReport frdi_client_app *    self,
frdi_client_game *    game
 

report the outcome of a game to the server in complete terms

char* frdiClientGameDescribe frdi_client_app *    self,
frdi_client_game *    game
 

describe it


Generated on Wed Aug 18 13:23:50 2004 for Project Fairdice by doxygen1.2.18