#include <stdarg.h>
#include <sys/types.h>
#include <ggz_common.h>
Go to the source code of this file.
Data Structures | |
| struct | _GGZOptions |
| struct | GGZErrorEventData |
| The data describing an error. More... | |
| struct | GGZMotdEventData |
| The data associated with a GGZ_MOTD_LOADED server event. More... | |
| struct | GGZChatEventData |
| The data associated with a GGZ_CHAT_EVENT room event. More... | |
| struct | GGZTableLeaveEventData |
| The data associated with a GGZ_TABLE_LEFT room event. More... | |
| struct | GGZRoomChangeEventData |
| The data associated with GGZ_ROOM_ENTER/GGZ_ROOM_LEAVE events. More... | |
Defines | |
| #define | GGZCORE_VERSION_MAJOR 0 |
| #define | GGZCORE_VERSION_MINOR 0 |
| #define | GGZCORE_VERSION_MICRO 14 |
| #define | GGZCORE_VERSION_IFACE "9:0:0" |
| #define | GGZCORE_DBG_CONF "GGZCORE:CONF" |
| ggz_debug debugging type for configuration system. | |
| #define | GGZCORE_DBG_GAME "GGZCORE:GAME" |
| ggz_debug debugging type for game communication. | |
| #define | GGZCORE_DBG_HOOK "GGZCORE:HOOK" |
| ggz_debug debugging type for hook system. | |
| #define | GGZCORE_DBG_MODULE "GGZCORE:MODULE" |
| ggz_debug debugging type for accessing modules. | |
| #define | GGZCORE_DBG_NET "GGZCORE:NET" |
| ggz_debug debugging type for network interaction. | |
| #define | GGZCORE_DBG_POLL "GGZCORE:POLL" |
| ggz_debug debugging type for debugging while polling. | |
| #define | GGZCORE_DBG_ROOM "GGZCORE:ROOM" |
| ggz_debug debugging type for room events and data. | |
| #define | GGZCORE_DBG_SERVER "GGZCORE:SERVER" |
| ggz_debug debugging type for server events and data. | |
| #define | GGZCORE_DBG_STATE "GGZCORE:STATE" |
| ggz_debug debugging type for state changes. | |
| #define | GGZCORE_DBG_TABLE "GGZCORE:TABLE" |
| ggz_debug debugging type for table data. | |
| #define | GGZCORE_DBG_XML "GGZCORE:XML" |
| ggz_debug debugging type for XML processing. | |
Typedefs | |
| typedef _GGZOptions | GGZOptions |
| typedef _GGZServer | GGZServer |
| A server object containing all information about a connection. | |
| typedef _GGZRoom | GGZRoom |
| Contains information about a single room on a server. | |
| typedef _GGZPlayer | GGZPlayer |
| Contains information about a single player. | |
| typedef _GGZTable | GGZTable |
| Contains information about a single table. | |
| typedef _GGZGameType | GGZGameType |
| Contains information about a _game type_. | |
| typedef _GGZModule | GGZModule |
| Contains information about a single module. A game module, on the client, is an executable designed to play a game. Each game type may have many modules that play it. | |
| typedef _GGZGame | GGZGame |
| Contains information about a single game table. This contains information about a table we are present at or are about to launch. It is thus associated with both a GGZTable and a GGZModule. | |
| typedef GGZHookReturn(*) | GGZHookFunc (unsigned int id, const void *event_data, const void *user_data) |
| typedef void(*) | GGZDestroyFunc (void *data) |
| GGZ object destroy function type. | |
Enumerations | |
| enum | GGZOptionFlags { GGZ_OPT_PARSER = 0x0001, GGZ_OPT_MODULES = 0x0002, GGZ_OPT_THREADED_IO = 0x0004, GGZ_OPT_EMBEDDED = 0x0008, GGZ_OPT_RECONNECT = 0x0010 } |
| enum | GGZHookReturn { GGZ_HOOK_OK, GGZ_HOOK_REMOVE, GGZ_HOOK_ERROR, GGZ_HOOK_CRISIS } |
| enum | GGZLoginType { GGZ_LOGIN, GGZ_LOGIN_GUEST, GGZ_LOGIN_NEW } |
| enum | GGZServerEvent { GGZ_CONNECTED, GGZ_CONNECT_FAIL, GGZ_NEGOTIATED, GGZ_NEGOTIATE_FAIL, GGZ_LOGGED_IN, GGZ_LOGIN_FAIL, GGZ_MOTD_LOADED, GGZ_ROOM_LIST, GGZ_TYPE_LIST, GGZ_SERVER_PLAYERS_CHANGED, GGZ_ENTERED, GGZ_ENTER_FAIL, GGZ_LOGOUT, GGZ_NET_ERROR, GGZ_PROTOCOL_ERROR, GGZ_CHAT_FAIL, GGZ_STATE_CHANGE, GGZ_CHANNEL_CONNECTED, GGZ_CHANNEL_READY, GGZ_CHANNEL_FAIL, GGZ_SERVER_ROOMS_CHANGED, GGZ_NUM_SERVER_EVENTS } |
| enum | GGZRoomEvent { GGZ_PLAYER_LIST, GGZ_TABLE_LIST, GGZ_CHAT_EVENT, GGZ_ROOM_ENTER, GGZ_ROOM_LEAVE, GGZ_TABLE_UPDATE, GGZ_TABLE_LAUNCHED, GGZ_TABLE_LAUNCH_FAIL, GGZ_TABLE_JOINED, GGZ_TABLE_JOIN_FAIL, GGZ_TABLE_LEFT, GGZ_TABLE_LEAVE_FAIL, GGZ_PLAYER_LAG, GGZ_PLAYER_STATS, GGZ_PLAYER_COUNT, GGZ_PLAYER_PERMS } |
| enum | GGZGameEvent { GGZ_GAME_LAUNCHED, GGZ_GAME_LAUNCH_FAIL, GGZ_GAME_NEGOTIATED, GGZ_GAME_NEGOTIATE_FAIL, GGZ_GAME_PLAYING } |
| enum | GGZStateID { GGZ_STATE_OFFLINE, GGZ_STATE_CONNECTING, GGZ_STATE_RECONNECTING, GGZ_STATE_ONLINE, GGZ_STATE_LOGGING_IN, GGZ_STATE_LOGGED_IN, GGZ_STATE_ENTERING_ROOM, GGZ_STATE_IN_ROOM, GGZ_STATE_BETWEEN_ROOMS, GGZ_STATE_LAUNCHING_TABLE, GGZ_STATE_JOINING_TABLE, GGZ_STATE_AT_TABLE, GGZ_STATE_LEAVING_TABLE, GGZ_STATE_LOGGING_OUT } |
| The states a server connection may be in. More... | |
| enum | GGZModuleEnvironment { GGZ_ENVIRONMENT_PASSIVE, GGZ_ENVIRONMENT_CONSOLE, GGZ_ENVIRONMENT_FRAMEBUFFER, GGZ_ENVIRONMENT_XWINDOW, GGZ_ENVIRONMENT_XFULLSCREEN } |
| The environment a game frontend expects. More... | |
Functions | |
| int | ggzcore_init (GGZOptions options) |
| void | ggzcore_reload (void) |
| void | ggzcore_destroy (void) |
| GGZServer * | ggzcore_server_new (void) |
| Create a new server object. | |
| int | ggzcore_server_reset (GGZServer *server) |
| Reset the server object. | |
| int | ggzcore_server_add_event_hook (GGZServer *server, const GGZServerEvent event, const GGZHookFunc func) |
| Register a callback handler for a server event. | |
| int | ggzcore_server_add_event_hook_full (GGZServer *server, const GGZServerEvent event, const GGZHookFunc func, const void *data) |
| Register a callback handler for a server event. | |
| int | ggzcore_server_remove_event_hook (GGZServer *server, const GGZServerEvent event, const GGZHookFunc func) |
| Remove a single hook function from an event's hook list. | |
| int | ggzcore_server_remove_event_hook_id (GGZServer *server, const GGZServerEvent event, const unsigned int hook_id) |
| Remove a hook function with given ID from the event's hook list. | |
| int | ggzcore_server_set_hostinfo (GGZServer *server, const char *host, const unsigned int port, const unsigned int use_tls) |
| Set host info for connecting to the server. | |
| int | ggzcore_server_set_logininfo (GGZServer *server, const GGZLoginType type, const char *handle, const char *password, const char *email) |
| Set login info for logging in to the server. | |
| int | ggzcore_server_log_session (GGZServer *server, const char *filename) |
| Initiate logging of ggzcore events. | |
| const char * | ggzcore_server_get_host (const GGZServer *server) |
| Get the hostname of the server. | |
| int | ggzcore_server_get_port (const GGZServer *server) |
| Get the port of the server. | |
| GGZLoginType | ggzcore_server_get_type (const GGZServer *server) |
| Get the login type being used for this server. | |
| const char * | ggzcore_server_get_handle (const GGZServer *server) |
| Get the handle being used for this server. | |
| const char * | ggzcore_server_get_password (const GGZServer *server) |
| Get the password being used for this server. | |
| int | ggzcore_server_get_fd (const GGZServer *server) |
| Get the socket used for connection with the server. | |
| int | ggzcore_server_get_channel (GGZServer *server) |
| Get the socket used for direct gane connections. | |
| GGZStateID | ggzcore_server_get_state (const GGZServer *server) |
| Get the state of the server connection. | |
| int | ggzcore_server_get_tls (const GGZServer *server) |
| Get the current TLS status of this server. | |
| int | ggzcore_server_get_num_players (const GGZServer *server) |
| Get the total number of players on the server. | |
| int | ggzcore_server_get_num_rooms (const GGZServer *server) |
| Return the number of rooms on the server, or -1 on error. | |
| GGZRoom * | ggzcore_server_get_nth_room (const GGZServer *server, const unsigned int num) |
| Return the nth room on the server, or NULL on error. | |
| int | ggzcore_server_get_room_num (const GGZServer *server, const GGZRoom *room) |
| Return the number (position in the room list) of the room. | |
| GGZRoom * | ggzcore_server_get_cur_room (const GGZServer *server) |
| Return the current room, or NULL if there is none. | |
| GGZPlayer * | ggzcore_server_get_player (GGZServer *server, const char *name) |
| Find the player, by name (or NULL). | |
| int | ggzcore_server_get_num_gametypes (const GGZServer *server) |
| Return the overall number of game types on the server. | |
| GGZGameType * | ggzcore_server_get_nth_gametype (const GGZServer *server, const unsigned int num) |
| Get the nth gametype, or NULL on error. | |
| GGZGame * | ggzcore_server_get_cur_game (const GGZServer *server) |
| Return the player's current game. | |
| int | ggzcore_server_is_online (const GGZServer *server) |
| Return TRUE iff the server is online (connected?). | |
| int | ggzcore_server_is_logged_in (const GGZServer *server) |
| Return TRUE iff we are logged into the server. | |
| int | ggzcore_server_is_in_room (const GGZServer *server) |
| Return TRUE iff we are in a room on the server. | |
| int | ggzcore_server_is_at_table (const GGZServer *server) |
| Return TRUE iff we are at a table on the server. | |
| int | ggzcore_server_connect (GGZServer *server) |
| Connect to the server. | |
| int | ggzcore_server_create_channel (GGZServer *server) |
| Establish a direct connection. | |
| int | ggzcore_server_login (GGZServer *server) |
| Log in to the server. | |
| int | ggzcore_server_motd (GGZServer *server) |
| Request the MOTD from the server. | |
| int | ggzcore_server_list_rooms (GGZServer *server, const int type, const char verbose) |
| Request room list. | |
| int | ggzcore_server_list_gametypes (GGZServer *server, const char verbose) |
| Request game type list. | |
| int | ggzcore_server_join_room (GGZServer *server, GGZRoom *room) |
| Join a room on the server. | |
| int | ggzcore_server_logout (GGZServer *server) |
| Log out of a server. | |
| int | ggzcore_server_disconnect (GGZServer *server) |
| Disconnect from a server after having logged out. | |
| int | ggzcore_server_data_is_pending (GGZServer *server) |
| Check for data pending from the server socket. | |
| int | ggzcore_server_read_data (GGZServer *server, int fd) |
| Read data for the server on the specified FD. | |
| void | ggzcore_server_free (GGZServer *server) |
| Free GGZServer object and accompanying data. | |
| GGZRoom * | ggzcore_room_new (void) |
| Allocate space for a new room object. | |
| void | ggzcore_room_free (GGZRoom *room) |
| De-allocate room object and its children. | |
| GGZServer * | ggzcore_room_get_server (const GGZRoom *room) |
| Return the server for this room (or NULL on error). | |
| const char * | ggzcore_room_get_name (const GGZRoom *room) |
| Return the name of the room (or NULL on error). | |
| const char * | ggzcore_room_get_desc (const GGZRoom *room) |
| Return the description of the room (or NULL on error). | |
| GGZGameType * | ggzcore_room_get_gametype (const GGZRoom *room) |
| Return the type of game played in this room (or NULL on error). | |
| int | ggzcore_room_get_num_players (const GGZRoom *room) |
| Return the number of players in the room (or negative on error). | |
| GGZPlayer * | ggzcore_room_get_nth_player (const GGZRoom *room, const unsigned int num) |
| Return the nth player in the room (or NULL on error). | |
| int | ggzcore_room_get_num_tables (const GGZRoom *room) |
| Return the number of tables in the room (or negative on error). | |
| GGZTable * | ggzcore_room_get_nth_table (const GGZRoom *room, const unsigned int num) |
| Return the nth table in the room (or NULL on error). | |
| GGZTable * | ggzcore_room_get_table_by_id (const GGZRoom *room, const unsigned int id) |
| Return the table in this room with matching ID (NULL on error). | |
| int | ggzcore_room_get_closed (const GGZRoom *room) |
| Return whether this room is closed (1), or open as usual (0). | |
| int | ggzcore_room_add_event_hook (GGZRoom *room, const GGZRoomEvent event, const GGZHookFunc func) |
| Register a handler (hook) for the room event. | |
| int | ggzcore_room_add_event_hook_full (GGZRoom *room, const GGZRoomEvent event, const GGZHookFunc func, const void *data) |
| Register a handler (hook) for thee room event, with data. | |
| int | ggzcore_room_remove_event_hook (GGZRoom *room, const GGZRoomEvent event, const GGZHookFunc func) |
| Remove a hook from an event. | |
| int | ggzcore_room_remove_event_hook_id (GGZRoom *room, const GGZRoomEvent event, const unsigned int hook_id) |
| Remove a hook from an event, by ID. | |
| int | ggzcore_room_list_players (GGZRoom *room) |
| Call to request a list of players in the room. | |
| int | ggzcore_room_list_tables (GGZRoom *room, const int type, const char global) |
| Call to request a list of tables in the room. | |
| int | ggzcore_room_chat (GGZRoom *room, const GGZChatType opcode, const char *player, const char *msg) |
| Chat! | |
| int | ggzcore_room_admin (GGZRoom *room, GGZAdminType type, const char *player, const char *reason) |
| Server- and room-level administrative actions. | |
| int | ggzcore_room_launch_table (GGZRoom *room, GGZTable *table) |
| Launch a table in the room. | |
| int | ggzcore_room_join_table (GGZRoom *room, const unsigned int table_id, int spectator) |
| Join a table in the room, so that you can then play at it. | |
| int | ggzcore_room_leave_table (GGZRoom *room, int force) |
| Leave the table you are currently playing at. | |
| char * | ggzcore_player_get_name (const GGZPlayer *player) |
| Return the name of the player. | |
| GGZPlayerType | ggzcore_player_get_type (const GGZPlayer *player) |
| Return the type of the player (admin/registered/guest). | |
| GGZRoom * | ggzcore_player_get_room (const GGZPlayer *player) |
| Return the player's room, or NULL if none. | |
| GGZTable * | ggzcore_player_get_table (const GGZPlayer *player) |
| Return the player's table, or NULL if none. | |
| bool | ggzcore_player_has_perm (const GGZPlayer *player, GGZPerm perm) |
| Return true iff the player has this permission. | |
| int | ggzcore_player_set_perm (GGZPlayer *player, GGZPerm perm, bool set) |
| Administer player permissions. | |
| int | ggzcore_player_get_lag (const GGZPlayer *player) |
| Return the player's lag class (1..5). | |
| int | ggzcore_player_get_record (const GGZPlayer *player, int *wins, int *losses, int *ties, int *forfeits) |
| Get the player's win-loss record. | |
| int | ggzcore_player_get_rating (const GGZPlayer *player, int *rating) |
| Get the player's rating. | |
| int | ggzcore_player_get_ranking (const GGZPlayer *player, int *ranking) |
| Get the player's ranking. | |
| int | ggzcore_player_get_highscore (const GGZPlayer *player, int *highscore) |
| Get the player's highscore. | |
| GGZTable * | ggzcore_table_new (void) |
| Create a new table object. | |
| int | ggzcore_table_init (GGZTable *table, const GGZGameType *gametype, const char *desc, const unsigned int num_seats) |
| Set data on a table object. | |
| void | ggzcore_table_free (GGZTable *table) |
| Free the table object. | |
| int | ggzcore_table_set_seat (GGZTable *table, const unsigned int seat, GGZSeatType type, const char *name) |
| Set a seat type at a table, pre-launch. | |
| int | ggzcore_table_remove_player (GGZTable *table, const char *name) |
| Find and remove the player from the table. | |
| int | ggzcore_table_get_id (const GGZTable *table) |
| Return the ID of the table. | |
| const GGZRoom * | ggzcore_table_get_room (const GGZTable *table) |
| Return the room this table is in. | |
| const GGZGameType * | ggzcore_table_get_type (const GGZTable *table) |
| Return the game type of the table. | |
| const char * | ggzcore_table_get_desc (const GGZTable *table) |
| Return the table's description (or NULL). | |
| GGZTableState | ggzcore_table_get_state (const GGZTable *table) |
| Return the state of the table. | |
| int | ggzcore_table_get_num_seats (const GGZTable *table) |
| Return the number of seats at the table. | |
| int | ggzcore_table_set_desc (GGZTable *table, const char *desc) |
| Set the table description. | |
| int | ggzcore_table_get_seat_count (const GGZTable *table, GGZSeatType type) |
| Count the seats of the given type. | |
| const char * | ggzcore_table_get_nth_player_name (const GGZTable *table, const unsigned int num) |
| Return the name of a player at the table, or NULL on error. | |
| int | ggzcore_table_get_num_spectator_seats (const GGZTable *table) |
| Return the number of spectator seats at the table, or -1. | |
| const char * | ggzcore_table_get_nth_spectator_name (const GGZTable *table, const unsigned int num) |
| Return the name of the nth spectator, or NULL if seat is empty. | |
| GGZSeatType | ggzcore_table_get_nth_player_type (const GGZTable *table, const unsigned int num) |
| Return the type of a player at the table, or GGZ_PLAYER_NONE on error. | |
| unsigned int | ggzcore_gametype_get_id (const GGZGameType *type) |
| Get the ID of this gametype. | |
| const char * | ggzcore_gametype_get_name (const GGZGameType *type) |
| Get the name of the game type. | |
| const char * | ggzcore_gametype_get_prot_engine (const GGZGameType *type) |
| Get the protocol "engine" used by the game type. | |
| const char * | ggzcore_gametype_get_prot_version (const GGZGameType *type) |
| Get the version of the protocol the game uses. | |
| const char * | ggzcore_gametype_get_version (const GGZGameType *type) |
| Get the version of the game itself. | |
| const char * | ggzcore_gametype_get_author (const GGZGameType *type) |
| Get the author of the game. | |
| const char * | ggzcore_gametype_get_url (const GGZGameType *type) |
| Get a URL for more info about the game. | |
| const char * | ggzcore_gametype_get_desc (const GGZGameType *type) |
| Get a description of the game. | |
| int | ggzcore_gametype_get_max_players (const GGZGameType *type) |
| Get the maximum number of players the game can support. | |
| int | ggzcore_gametype_get_max_bots (const GGZGameType *type) |
| Get the maximum number of bots the game can support. | |
| int | ggzcore_gametype_get_spectators_allowed (const GGZGameType *type) |
| Return TRUE iff spectators are allowed for this game type. | |
| int | ggzcore_gametype_num_players_is_valid (const GGZGameType *type, unsigned int num) |
| Return TRUE iff the given number of players is valid. | |
| int | ggzcore_gametype_num_bots_is_valid (const GGZGameType *type, unsigned int num) |
| Return TRUE iff the given number of bots is valid. | |
| int | ggzcore_gametype_get_num_namedbots (const GGZGameType *type) |
| Return the number of named bots for this gametype. | |
| const char * | ggzcore_gametype_get_namedbot_name (const GGZGameType *type, unsigned int num) |
| const char * | ggzcore_gametype_get_namedbot_class (const GGZGameType *type, unsigned int num) |
| int | ggzcore_gametype_get_peers_allowed (const GGZGameType *type) |
| Return TRUE iff this game may disclose the player's hostname. | |
| int | ggzcore_conf_initialize (const char *g_path, const char *u_path) |
| int | ggzcore_conf_write_string (const char *section, const char *key, const char *value) |
| int | ggzcore_conf_write_int (const char *section, const char *key, int value) |
| int | ggzcore_conf_write_list (const char *section, const char *key, int argc, char **argv) |
| char * | ggzcore_conf_read_string (const char *section, const char *key, const char *def) |
| int | ggzcore_conf_read_int (const char *section, const char *key, int def) |
| int | ggzcore_conf_read_list (const char *section, const char *key, int *argcp, char ***argvp) |
| int | ggzcore_conf_remove_section (const char *section) |
| int | ggzcore_conf_remove_key (const char *section, const char *key) |
| int | ggzcore_conf_commit (void) |
| unsigned int | ggzcore_module_get_num (void) |
| This returns the number of registered modules. | |
| int | ggzcore_module_add (const char *name, const char *version, const char *prot_engine, const char *prot_version, const char *author, const char *frontend, const char *url, const char *exe_path, const char *icon_path, const char *help_path, GGZModuleEnvironment environment) |
| int | ggzcore_module_get_num_by_type (const char *game, const char *engine, const char *version) |
| Returns how many modules support this game and protocol. | |
| GGZModule * | ggzcore_module_get_nth_by_type (const char *game, const char *engine, const char *version, const unsigned int num) |
| Returns n-th module that supports this game and protocol. | |
| const char * | ggzcore_module_get_name (GGZModule *module) |
| Return the name of the module. | |
| const char * | ggzcore_module_get_version (GGZModule *module) |
| Return the (game?) version of the module. | |
| const char * | ggzcore_module_get_prot_engine (GGZModule *module) |
| Return the name of the module's protocol engine. | |
| const char * | ggzcore_module_get_prot_version (GGZModule *module) |
| Return the version of the module's protocol engine. | |
| const char * | ggzcore_module_get_author (GGZModule *module) |
| Return the author of the module. | |
| const char * | ggzcore_module_get_frontend (GGZModule *module) |
| Return the module's frontend type. | |
| const char * | ggzcore_module_get_url (GGZModule *module) |
| Return the URL associated with the module. | |
| const char * | ggzcore_module_get_icon_path (GGZModule *module) |
| const char * | ggzcore_module_get_help_path (GGZModule *module) |
| Return the help path of the module (?). | |
| char ** | ggzcore_module_get_argv (GGZModule *module) |
| Return the executable arguments for the module. See exec(). | |
| GGZModuleEnvironment | ggzcore_module_get_environment (GGZModule *module) |
| Return the preferred environment type. | |
| GGZGame * | ggzcore_game_new (void) |
| Make a new game object. | |
| int | ggzcore_game_init (GGZGame *game, GGZServer *server, GGZModule *module) |
| Initialize the game object. | |
| void | ggzcore_game_free (GGZGame *game) |
| Free the game object. | |
| int | ggzcore_game_add_event_hook (GGZGame *game, const GGZGameEvent event, const GGZHookFunc func) |
| Register a hook for a game event. | |
| int | ggzcore_game_add_event_hook_full (GGZGame *game, const GGZGameEvent event, const GGZHookFunc func, const void *data) |
| Register a hook for a game event. | |
| int | ggzcore_game_remove_event_hook (GGZGame *game, const GGZGameEvent event, const GGZHookFunc func) |
| Remove a hook from a game event. | |
| int | ggzcore_game_remove_event_hook_id (GGZGame *game, const GGZGameEvent event, const unsigned int hook_id) |
| Remove a specified hook from a game event. | |
| int | ggzcore_game_get_control_fd (GGZGame *game) |
| Return the control (ggzmod) socket for the game. | |
| void | ggzcore_game_set_server_fd (GGZGame *game, unsigned int fd) |
| Return the game's server socket. Needed only for channels set up by ggzcore. | |
| GGZModule * | ggzcore_game_get_module (GGZGame *game) |
| Return the module set for the game. | |
| int | ggzcore_game_launch (GGZGame *game) |
| Launch thee game! | |
| int | ggzcore_game_read_data (GGZGame *game) |
| Read data from the game. When data is pending on the control socket, call this function. | |
| typedef void(*) GGZDestroyFunc(void *data) |
| typedef struct _GGZGameType GGZGameType |
Contains information about a _game type_.
| typedef GGZHookReturn(*) GGZHookFunc(unsigned int id, const void *event_data, const void *user_data) |
GGZ Event hook function type, used as a vallback for events
| typedef struct _GGZOptions GGZOptions |
Options structure for ggzcore library
| enum GGZGameEvent |
A GGZGameEvent is an event associated with the game, that is triggered by a communication from the server or from the game. When a game event occurs, the associated event handle will be called, and will be passed the event data (a void*) along with the (optional) user data. All game events apply to the current game. Game events are usually triggered by calling ggzcore_server_read_data or ggzcore_game_read_data.
| GGZ_GAME_LAUNCHED |
A game was launched by the player (you). After this the core client should call ggzcore_game_get_control_fd, monitor the socket that function returns, and call ggzcore_game_read_data when there is data pending. This event is triggered inside of ggzcore_game_launch.
| |||
| GGZ_GAME_LAUNCH_FAIL |
Your game launch has failed. Triggered instead of GGZ_GAME_LAUNCHED when there's a failure somewhere.
| |||
| GGZ_GAME_NEGOTIATED |
Negotiation with server was successful. This should happen some time after the launch succeeds. The core client need do nothing at this point.
| |||
| GGZ_GAME_NEGOTIATE_FAIL |
Negotiation was not successful, game launch failed.
| |||
| GGZ_GAME_PLAYING |
Game reached the 'playing' state. When this happens the core client should call ggzcore_room_launch_table or ggzcore_room_join_table to finalize the game join.
|
| enum GGZHookReturn |
| enum GGZLoginType |
This controls the type of login a user chooses. A different value will require different information to be sent to the server.
| enum GGZModuleEnvironment |
The environment a game frontend expects.
Core clients should offer those game modules which fit their own environment.
| enum GGZOptionFlags |
| enum GGZRoomEvent |
A GGZRoomEvent is an event associated with the room, that is triggered by a communication from the server. When a room event occurs, the associated event handler will be called, and will be passed the event data (a void*), along with the (optional) user data. All room events apply to the current room unless a room number is given. Room events are almost always triggered by calling ggzcore_server_read_data.
| GGZ_PLAYER_LIST |
The list of players in a room has arrived.
| |||
| GGZ_TABLE_LIST |
Received the list of active tables.
| |||
| GGZ_CHAT_EVENT |
Received a chat message of any kind. This can happen at any time when you're in a room.
| |||
| GGZ_ROOM_ENTER |
A player has entered the room with you.
| |||
| GGZ_ROOM_LEAVE |
A player has left your room.
| |||
| GGZ_TABLE_UPDATE |
One of the tables in the current room has changed.
| |||
| GGZ_TABLE_LAUNCHED |
The table you tried to launch has launched!
| |||
| GGZ_TABLE_LAUNCH_FAIL |
The table you tried to launch couldn't be launched
| |||
| GGZ_TABLE_JOINED |
Your table join attempt has succeeded.
| |||
| GGZ_TABLE_JOIN_FAIL |
Joining a table did not succeed.
| |||
| GGZ_TABLE_LEFT |
You have successfully left the table you were at.
| |||
| GGZ_TABLE_LEAVE_FAIL |
Your attempt to leave the table has failed.
| |||
| GGZ_PLAYER_LAG |
A player's lag (measure of connection speed) has been updated
| |||
| GGZ_PLAYER_STATS |
A player's stats have been updated.
| |||
| GGZ_PLAYER_COUNT |
The number of players in a room has arrived.
| |||
| GGZ_PLAYER_PERMS |
A player's permissions have been updated.
|
| enum GGZServerEvent |
A GGZServerEvent is an event triggered by a communication from the server. Each time an event occurs, the associated event handler will be called, and will be passed the event data (a void*). Most events are generated as a result of ggzcore_server_read_data.
| GGZ_CONNECTED |
We have just made a connection to the server. After this point the server's socket should be accessible and should be monitored for data. It happens in direct response to ggzcore_server_connect. Note that most events after this will only happen by calling ggzcore_server_read_data on the server's FD!
| |||
| GGZ_CONNECT_FAIL |
Error: we have failed to connect to the server. This is generated in place of GGZ_CONNECTED if the connection could not be made. The server object is otherwise unaffected.
| |||
| GGZ_NEGOTIATED |
We have negotiated a connection to the server. This will happen automatically once a connection has been established, if the server socket is monitored.
| |||
| GGZ_NEGOTIATE_FAIL |
Error: negotiation failure. Could be the wrong version. This will happen in place of a GGZ_NEGOTIATED if the server could not be negotiated with.
| |||
| GGZ_LOGGED_IN |
We have successfully logged in. We can now start doing stuff. This will not happen until the client sends their login information.
| |||
| GGZ_LOGIN_FAIL |
Error: login failure. This will happen in place of GGZ_LOGGED_IN if the login failed. The server object will be otherwise unaffected.
| |||
| GGZ_MOTD_LOADED |
The MOTD has been read from the server and can be displayed. The server will send us the MOTD automatically after login; it can also be requested by ggzcore_server_motd. It is up to the client whether or not to display it. See the online documentation (somewhere?) about the MOTD markup format.
| |||
| GGZ_ROOM_LIST |
The room list arrived. This will only happen after the list is requested by ggzcore_server_list_rooms(). The list may be accessed through ggzcore_server_get_num_rooms() and ggzcore_server_get_nth_room(). Until this event arrives these functions will be useless!
| |||
| GGZ_TYPE_LIST |
The list of game types is available. This will only happen after the list is requested by ggzcore_server_list_types(). The list may be accessed through ggzcore_server_get_num_gametypes() and ggzcore_server_get_nth_gametype(). Until this event arrives these functions will be useless!
| |||
| GGZ_SERVER_PLAYERS_CHANGED |
The number of players on the server has changed. This event is issued rather frequently every time players enter or leave.
| |||
| GGZ_ENTERED |
We have successfully entered a room. This will be issued to tell us a room join has succeeded, after it has been requested.
| |||
| GGZ_ENTER_FAIL |
Error: we have tried to enter a room and failed. This will be issued to tell us a room join has failed.
| |||
| GGZ_LOGOUT |
Logged out of the server. This will happen when the server completes the communication; usually after ggzcore_net_send_logout is called.
| |||
| GGZ_NET_ERROR |
Error: a network (transmission) error occurred. The server will automatically disconnect.
| |||
| GGZ_PROTOCOL_ERROR |
Error: a communication protocol error occured. This can happen in a variety of situations when the server sends us something we can't handle. The server will be automatically disconnected.
| |||
| GGZ_CHAT_FAIL |
Error: A chat message could not be sent. This will happen when we try to send a chat and the server rejects it.
| |||
| GGZ_STATE_CHANGE |
The internal state of ggzcore has changed. This may happen at any time.
| |||
| GGZ_CHANNEL_CONNECTED |
Status event: a requested direct game connection has been established. To start a game (table), a channel must be created. This event will alert that the channel has been established. The channel's FD should then be monitored for input, which should then be passed back to the server object for handling.
| |||
| GGZ_CHANNEL_READY |
Game channel is ready for read/write operations. After the channel has been connected, if we continue to monitor the socket eventually it will be negotiated and ready to use. At this point it is ready for the game client to use.
| |||
| GGZ_CHANNEL_FAIL |
Error: Failure during setup of direct connection to game server. If the channel could not be prepared, this event will happen instead of GGZ_CHANNEL_READY or GGZ_CHANNEL_CONNECTED event. At this point the channel is no longer useful (I think).
| |||
| GGZ_SERVER_ROOMS_CHANGED |
The room configuration on the server changed. A room was either added or removed, or scheduled for removing (closed).
| |||
| GGZ_NUM_SERVER_EVENTS | Terminator. Do not use. |
| enum GGZStateID |
The states a server connection may be in.
On the client side, a simplistic state maching is used to tell what's going on. A game client should usually consult the current state when determining what actions are possible.
| int ggzcore_conf_commit | ( | void | ) |
ggzcore_conf_commit() - Commits the core user config file to disk
| int ggzcore_conf_initialize | ( | const char * | g_path, | |
| const char * | u_path | |||
| ) |
ggzcore_conf_initialize() Opens the global and/or user configuration files for the frontend. Either g_path or u_path can be NULL if the file is not to be used. The user config file will be created if it does not exist.
| int ggzcore_conf_read_int | ( | const char * | section, | |
| const char * | key, | |||
| int | def | |||
| ) |
ggzcore_conf_read_int() - Read a integer from the configuration file(s)
| section | section to get value from | |
| key | key value was stored under | |
| def | default value to return if none is found |
| int ggzcore_conf_read_list | ( | const char * | section, | |
| const char * | key, | |||
| int * | argcp, | |||
| char *** | argvp | |||
| ) |
ggzcore_conf_read_list() - Read a list from the configuration file(s)
| section | section to get value from | |
| key | key value was stored under | |
| argcp | ptr to int which will receive the list entry count | |
| argvp | a pointer to a dynamically allocated array that ggzcore_conf_read_list() will build |
| char* ggzcore_conf_read_string | ( | const char * | section, | |
| const char * | key, | |||
| const char * | def | |||
| ) |
ggzcore_conf_read_string() - Read a string from the configuration file(s)
| section | section to get value from | |
| key | key value was stored under | |
| def | default value to return if none is found |
| int ggzcore_conf_remove_key | ( | const char * | section, | |
| const char * | key | |||
| ) |
ggzcore_conf_remove_key() - Removes a key entry from the user config file
| section | section to remove | |
| key | key entry to remove |
| int ggzcore_conf_remove_section | ( | const char * | section | ) |
ggzcore_conf_remove_section() - Removes a section from the user config file
| section | section to remove |
| int ggzcore_conf_write_int | ( | const char * | section, | |
| const char * | key, | |||
| int | value | |||
| ) |
ggzcore_conf_write_int() - Write a integer to the user config file
| section | section to store value in | |
| key | key to store value under | |
| value | value to store |
| int ggzcore_conf_write_list | ( | const char * | section, | |
| const char * | key, | |||
| int | argc, | |||
| char ** | argv | |||
| ) |
ggzcore_conf_write_list() - Write a list to the user config file
| section | section to store value in | |
| key | key to store value under | |
| argc | count of string arguments in list | |
| argv | array of NULL terminated strings |
| int ggzcore_conf_write_string | ( | const char * | section, | |
| const char * | key, | |||
| const char * | value | |||
| ) |
ggzcore_conf_write_string() - Write a string to the user config file
| section | section to store value in | |
| key | key to store value under | |
| value | value to store |
| void ggzcore_destroy | ( | void | ) |
ggzcore_destroy() - Cleanup function for ggzcore lib.
| int ggzcore_game_add_event_hook | ( | GGZGame * | game, | |
| const GGZGameEvent | event, | |||
| const GGZHookFunc | func | |||
| ) |
Register a hook for a game event.
| int ggzcore_game_add_event_hook_full | ( | GGZGame * | game, | |
| const GGZGameEvent | event, | |||
| const GGZHookFunc | func, | |||
| const void * | data | |||
| ) |
Register a hook for a game event.
| int ggzcore_game_read_data | ( | GGZGame * | game | ) |
Read data from the game. When data is pending on the control socket, call this function.
| int ggzcore_game_remove_event_hook | ( | GGZGame * | game, | |
| const GGZGameEvent | event, | |||
| const GGZHookFunc | func | |||
| ) |
Remove a hook from a game event.
| int ggzcore_game_remove_event_hook_id | ( | GGZGame * | game, | |
| const GGZGameEvent | event, | |||
| const unsigned int | hook_id | |||
| ) |
Remove a specified hook from a game event.
| unsigned int ggzcore_gametype_get_id | ( | const GGZGameType * | type | ) |
Get the ID of this gametype.
| int ggzcore_gametype_get_max_bots | ( | const GGZGameType * | type | ) |
Get the maximum number of bots the game can support.
| int ggzcore_gametype_get_max_players | ( | const GGZGameType * | type | ) |
Get the maximum number of players the game can support.
| int ggzcore_init | ( | GGZOptions | options | ) |
ggzcore_init() - Initializtion function for ggzcore lib.
| options | options structure |
| int ggzcore_module_add | ( | const char * | name, | |
| const char * | version, | |||
| const char * | prot_engine, | |||
| const char * | prot_version, | |||
| const char * | author, | |||
| const char * | frontend, | |||
| const char * | url, | |||
| const char * | exe_path, | |||
| const char * | icon_path, | |||
| const char * | help_path, | |||
| GGZModuleEnvironment | environment | |||
| ) |
This adds a local module to the list. It returns 0 if successful or -1 on failure.
| const char* ggzcore_module_get_icon_path | ( | GGZModule * | module | ) |
This is (intended to be) an optional xpm file that the module can provide to use for representing the game graphically.
| int ggzcore_player_get_highscore | ( | const GGZPlayer * | player, | |
| int * | highscore | |||
| ) |
Get the player's highscore.
| int ggzcore_player_get_ranking | ( | const GGZPlayer * | player, | |
| int * | ranking | |||
| ) |
Get the player's ranking.
| int ggzcore_player_get_rating | ( | const GGZPlayer * | player, | |
| int * | rating | |||
| ) |
Get the player's rating.
| int ggzcore_player_get_record | ( | const GGZPlayer * | player, | |
| int * | wins, | |||
| int * | losses, | |||
| int * | ties, | |||
| int * | forfeits | |||
| ) |
Get the player's win-loss record.
| int ggzcore_player_set_perm | ( | GGZPlayer * | player, | |
| GGZPerm | perm, | |||
| bool | set | |||
| ) |
Administer player permissions.
| player | Name of the target player | |
| perm | The permission to (un)set. | |
| set | Whether to set or clear the permission. |
| void ggzcore_reload | ( | void | ) |
ggzcore_reload() - Reload game module database
| int ggzcore_room_add_event_hook | ( | GGZRoom * | room, | |
| const GGZRoomEvent | event, | |||
| const GGZHookFunc | func | |||
| ) |
Register a handler (hook) for the room event.
A room event will happen when data is received from the server. To make updates to the frontend, the client will need to register a hook function to handle the event. This hook function will be called each time the room event occurrs. More than one hook function may be specified, in which case they will all be called (in FIFO order).
| room | The room object to associate the hook with. | |
| event | The event the handler is going to be "hooked" onto. | |
| func | The event handler itself. This is called during the event. |
| int ggzcore_room_add_event_hook_full | ( | GGZRoom * | room, | |
| const GGZRoomEvent | event, | |||
| const GGZHookFunc | func, | |||
| const void * | data | |||
| ) |
Register a handler (hook) for thee room event, with data.
This function is similar to ggzcore_room_add_event_hook, except that user data will be associated with the hook. This data will be passed back to the function each time it is invoked on this event.
| room | The room object to associate the hook with. | |
| event | The event the handler is going to be "hooked" onto. | |
| func | The event handler itself. This is called during the event. | |
| data | The user data associated with the hook. |
| int ggzcore_room_admin | ( | GGZRoom * | room, | |
| GGZAdminType | type, | |||
| const char * | player, | |||
| const char * | reason | |||
| ) |
Server- and room-level administrative actions.
| room | Your current room. | |
| type | Type of action (gag, ungag, kick, ...) | |
| player | Name of the target player | |
| reason | The reason for the action (only for kicking) |
| int ggzcore_room_chat | ( | GGZRoom * | room, | |
| const GGZChatType | opcode, | |||
| const char * | player, | |||
| const char * | msg | |||
| ) |
Chat!
| room | Your current room. | |
| opcode | The chat type. | |
| player | The name of the target player (only for certain chat types) | |
| msg | The text of the chat message (some chat types don't need it) |
| int ggzcore_room_join_table | ( | GGZRoom * | room, | |
| const unsigned int | table_id, | |||
| int | spectator | |||
| ) |
Join a table in the room, so that you can then play at it.
| room | Your current room. | |
| table_id | The table to join. | |
| spectator | TRUE if you wish to spectate, FALSE if you want to play |
Launch a table in the room.
When a player wants to launch a new table, this is the function to do it. You must first create the table and set up the number and type of seats. Then call this function to initiate the launch.
| room | Your current room. | |
| table | The table to launch. |
| int ggzcore_room_leave_table | ( | GGZRoom * | room, | |
| int | force | |||
| ) |
Leave the table you are currently playing at.
This function tries to leave your current table. You should "force" the leave only if the game client is inoperable, since for some games this will destroy the game server as well.
| room | Your current room. | |
| force | TRUE to force the leave, FALSE to leave it up to ggzd |
| int ggzcore_room_list_players | ( | GGZRoom * | room | ) |
| int ggzcore_room_list_tables | ( | GGZRoom * | room, | |
| const int | type, | |||
| const char | global | |||
| ) |
Call to request a list of tables in the room.
| room | Your current room | |
| type | currently ignored (???) | |
| global | currently ignored (???) |
| int ggzcore_room_remove_event_hook | ( | GGZRoom * | room, | |
| const GGZRoomEvent | event, | |||
| const GGZHookFunc | func | |||
| ) |
Remove a hook from an event.
Removes a specific hook function from the hook list for the given room event. If more than one copy of the function exists in the list, the oldest one will be removed.
| room | The room object to associate the hook with. | |
| event | The event the handler is to be unhooked from. | |
| func | The event handler function to remove. |
| int ggzcore_room_remove_event_hook_id | ( | GGZRoom * | room, | |
| const GGZRoomEvent | event, | |||
| const unsigned int | hook_id | |||
| ) |
Remove a hook from an event, by ID.
Removes a specific hook from the hook list for the given room. The "ID" should be the same as that returned when the hook was added.
| room | The room object to associate the hook with. | |
| event | The event the handler is to be unhooked from. | |
| id | The ID of the hook to remove, as returned by the add function return 0 on success, negative on failure |
| int ggzcore_server_add_event_hook | ( | GGZServer * | server, | |
| const GGZServerEvent | event, | |||
| const GGZHookFunc | func | |||
| ) |
Register a callback handler for a server event.
Call this function to register the given GGZHookFunc as a handler for the given event. Then any time that event happens the handler function will be called.
| server | The GGZ server object. | |
| event | The server event to be handled. | |
| func | The handler function to be called when the event occurs. |
More than one handler can be registered for each event.
| int ggzcore_server_add_event_hook_full | ( | GGZServer * | server, | |
| const GGZServerEvent | event, | |||
| const GGZHookFunc | func, | |||
| const void * | data | |||
| ) |
Register a callback handler for a server event.
| data | An arbitrary pointer that will be passed to the hook function. |
| int ggzcore_server_connect | ( | GGZServer * | server | ) |
Connect to the server.
Call this function to initially connect to a GGZ server. Connection info is set using the ggzcore_server_set_hostinfo function.
The function is asynchronous and will return very quickly. After the connection is (hopefully) established we will receive either a GGZ_CONNECTED or GGZ_CONNECT_FAIL server event. If the connection succeeds, negotiations with the GGZ server will begin automatically. Once this is complete, we will receive either a GGZ_NEGOTIATED or GGZ_NEGOTIATE_FAIL event.
| server | The GGZ server object. |
On failure a GGZ_CONNECT_FAIL event may or may not be generated.
| int ggzcore_server_create_channel | ( | GGZServer * | server | ) |
Establish a direct connection.
Direct connections are requested for games. They are similar to connections, instead of that no login takes place, but a channel for arbitrary game data is created. Needed only for channels set up by ggzcore.
| server | The GGZ server object. |
| int ggzcore_server_get_channel | ( | GGZServer * | server | ) |
Get the socket used for direct gane connections.
This returns the file descriptor of the socket for the TCP game connection. This will be handed off to a game module when it is ready. Needed only for channels set up by ggzcore.
| server | The GGZ server object. |
| int ggzcore_server_get_fd | ( | const GGZServer * | server | ) |
Get the socket used for connection with the server.
This returns the file descriptor of the primary socket for the TCP connection to the server. All GGZ data goes across this socket.
| server | The GGZ server object. |
| const char* ggzcore_server_get_handle | ( | const GGZServer * | server | ) |
Get the handle being used for this server.
| server | The GGZ server object. |
| const char* ggzcore_server_get_host | ( | const GGZServer * | server | ) |
Get the hostname of the server.
| server | The GGZ server object. |
| int ggzcore_server_get_num_gametypes | ( | const GGZServer * | server | ) |
Return the overall number of game types on the server.
| server | The GGZ server object. |
| int ggzcore_server_get_num_players | ( | const GGZServer * | server | ) |
Get the total number of players on the server.
| server | The GGZ server object return An approximate number of players in all rooms of the server. |
| int ggzcore_server_get_num_rooms | ( | const GGZServer * | server | ) |
Return the number of rooms on the server, or -1 on error.
| const char* ggzcore_server_get_password | ( | const GGZServer * | server | ) |
Get the password being used for this server.
| server | The GGZ server object. |
Find the player, by name (or NULL).
This function is inefficient.
| int ggzcore_server_get_port | ( | const GGZServer * | server | ) |
Get the port of the server.
| server | The GGZ server object. |
| GGZStateID ggzcore_server_get_state | ( | const GGZServer * | server | ) |
Get the state of the server connection.
| server | The GGZ server object. |
| int ggzcore_server_get_tls | ( | const GGZServer * | server | ) |
Get the current TLS status of this server.
| server | The GGZ server object |
| GGZLoginType ggzcore_server_get_type | ( | const GGZServer * | server | ) |
Get the login type being used for this server.
| server | The GGZ server object. |
Join a room on the server.
| server | The GGZ server object. | |
| room | The number of the room to join. |
| int ggzcore_server_list_gametypes | ( | GGZServer * | server, | |
| const char | verbose | |||
| ) |
Request game type list.
| server | The GGZ server object. | |
| verbose | Receive detailed gametype information or not. |
| int ggzcore_server_list_rooms | ( | GGZServer * | server, | |
| const int | type, | |||
| const char | verbose | |||
| ) |
Request room list.
| server | The GGZ server object. | |
| type | Not used yet. | |
| verbose | Receive all information about a room or only the essentials. |
| int ggzcore_server_log_session | ( | GGZServer * | server, | |
| const char * | filename | |||
| ) |
Initiate logging of ggzcore events.
Normally, ggzcore traffic is not logged anywhere. With this functions, such output can be directed into a file. It contains all the network messages received from the server.
| server | The GGZ server object. | |
| filename | The file the messages are written to. |
| int ggzcore_server_login | ( | GGZServer * | server | ) |
Log in to the server.
Call this function to log in to the server once a connection has been established. Typically you must first connect to the server, then wait to receive the GGZ_CONNECTED and GGZ_NEGOTIATED events before attempting to log in. Login info is set using the ggzcore_server_set_logininfo function.
The function is asynchronous and will return immediately. After the login request is sent, we will wait to receive either a GGZ_LOGGED_IN or GGZ_LOGIN_FAIL server event.
| server | The GGZ server object. |
| GGZServer* ggzcore_server_new | ( | void | ) |
Create a new server object.
Call this function to create a server object. This object holds all state data for communicating with a ggz server. It is necessary for any kind of connection.
| int ggzcore_server_read_data | ( | GGZServer * | server, | |
| int | fd | |||
| ) |
Read data for the server on the specified FD.
| int ggzcore_server_remove_event_hook | ( | GGZServer * | server, | |
| const GGZServerEvent | event, | |||
| const GGZHookFunc | func | |||
| ) |
Remove a single hook function from an event's hook list.
| server | The GGZ server object. | |
| event | The server event the hook is associated with. | |
| func | The function to be removed from the hook list. |
| int ggzcore_server_remove_event_hook_id | ( | GGZServer * | server, | |
| const GGZServerEvent | event, | |||
| const unsigned int | hook_id | |||
| ) |
Remove a hook function with given ID from the event's hook list.
| server | The GGZ server object. | |
| event | The server event the hook is associated with. | |
| hook_id | The ID of the hook event. |
| int ggzcore_server_reset | ( | GGZServer * | server | ) |
Reset the server object.
After you've disconnected, call this function to discard all state data and reset the state of the server object. You can then connect again.
| int ggzcore_server_set_hostinfo | ( | GGZServer * | server, | |
| const char * | host, | |||
| const unsigned int | port, | |||
| const unsigned int | use_tls | |||
| ) |
Set host info for connecting to the server.
Call this function to set host info for the GGZ server before trying to connect to it.
| server | The GGZ server object. | |
| host | A string containing the hostname. | |
| port | The port to connect to. | |
| use_tls | If set, the connection will be encrypted. |
| int ggzcore_server_set_logininfo | ( | GGZServer * | server, | |
| const GGZLoginType | type, | |||
| const char * | handle, | |||
| const char * | password, | |||
| const char * | ||||
| ) |
Set login info for logging in to the server.
Call this function to set login info for the GGZ server before trying to login. This should only be called when the server is in certain states.
| server | The GGZ server object. | |
| type | The type of login to attempt. | |
| handle | The username to use with the server. | |
| password | The password to use (may be NULL with some login types). | |
| The email address to use (may be NULL with some login types). |
| int ggzcore_table_get_seat_count | ( | const GGZTable * | table, | |
| GGZSeatType | type | |||
| ) |
Count the seats of the given type.
Given a table and a seat type, this function returns the number of seats at the table that match the type.
| table | A GGZ table. | |
| type | A GGZSeatType. |
| int ggzcore_table_init | ( | GGZTable * | table, | |
| const GGZGameType * | gametype, | |||
| const char * | desc, | |||
| const unsigned int | num_seats | |||
| ) |
Set data on a table object.
| GGZTable* ggzcore_table_new | ( | void | ) |
Create a new table object.
| int ggzcore_table_set_seat | ( | GGZTable * | table, | |
| const unsigned int | seat, | |||
| GGZSeatType | type, | |||
| const char * | name | |||
| ) |
Set a seat type at a table, pre-launch.
When launching a table, call this function to set up a particular seat at the table. It can also be used to fiddle with already existing tables, but that would be extremely unwise.
| table | The table object to change. | |
| seat | The seat number at the table to change. | |
| type | The type of seat to make it (open, reserved, or bot). | |
| name | The name of the seat (must be valid for reserved seats). |
1.5.1