typedef void(* GGZDestroyFunc )(void *data)GGZ object destroy function type.typedef _GGZServer GGZServerA server object containing all information about a connection.typedef _GGZRoom GGZRoomContains information about a single room on a server.typedef _GGZPlayer GGZPlayerContains information about a single player.typedef _GGZTable GGZTableContains information about a single table.typedef _GGZGameType GGZGameTypeContains information about a _game type_.typedef _GGZModule GGZModuleContains 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 GGZGameContains 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.

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.

See also:

ggzcore_game_add_event_hook

ggzcore_server_read_data

Enumeration values:

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.

Parameters:

data NULL

See also:

ggzcore_game_launch

GGZ_GAME_LAUNCH_FAIL

Your game launch has failed. Triggered instead of GGZ_GAME_LAUNCHED when there's a failure somewhere.

Parameters:

data NULL

See also:

GGZ_GAME_LAUNCHED

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.

Parameters:

data NULL

GGZ_GAME_NEGOTIATE_FAIL

Negotiation was not successful, game launch failed.

Todo

Currently this can't actually happen...

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.

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.

See also:

ggzcore_room_add_event_hook

ggzcore_server_read_data

Enumeration values:

GGZ_PLAYER_LIST

The list of players in a room has arrived.

Parameters:

data The room id (int *)

Note:

This will only be issued for the current room.

See also:

ggzcore_room_list_players

GGZ_TABLE_LIST

Received the list of active tables.

Parameters:

data NULL

See also:

ggzcore_room_list_tables

GGZ_CHAT_EVENT

Received a chat message of any kind. This can happen at any time when you're in a room.

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.

See also:

ggzcore_server_add_event_hook

Enumeration values:

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!

Parameters:

data NULL

See also:

ggzcore_server_connect

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.

Parameters:

data An error string (created by strerror)

See also:

ggzcore_server_connect

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.

Note:

This just means we've determined ggzd is at the other end.

Parameters:

data NULL

See also:

ggzcore_server_read_data

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.

Parameters:

data A useless error string.

See also:

ggzcore_server_read_data

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.

See also:

ggzcore_server_login

Parameters:

data NULL

See also:

ggzcore_server_read_data

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.

Parameters:

data A pointer to a GGZErrorEventData.

See also:

GGZErrorEventData

ggzcore_server_read_data

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.

Parameters:

data Pointer to a GGZMotdEventData including the full MOTD text.

See also:

ggzcore_server_motd

Todo

The MOTD cannot be accessed outside of this event

See also:ggzcore_server_read_data!

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!

Parameters:

data NULL

See also:

ggzcore_server_read_data

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!

Parameters:

data NULL

See also:

ggzcore_server_read_data

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.

Parameters:

data NULL

See also:

ggzcore_server_get_num_players

ggzcore_server_read_data

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.

Parameters:

data NULL

See also:

ggzcore_server_join_room

ggzcore_server_read_data

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.

Parameters:

data A pointer to a GGZErrorEventData.

See also:

GGZErrorEventData

ggzcore_server_join_room

ggzcore_server_read_data

GGZ_LOGOUT

Logged out of the server. This will happen when the server completes the communication; usually after ggzcore_net_send_logout is called.

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.

Parameters:

data A technical error string.

See also:

ggzcore_server_read_data

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.

Parameters:

data A pointer to a GGZErrorEventData.

See also:

GGZErrorEventData

ggzcore_server_read_data

GGZ_STATE_CHANGE

The internal state of ggzcore has changed. This may happen at any time.

Parameters:

data NULL

See also:

GGZStateID

ggzcore_server_get_state

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.

Parameters:

data NULL

Note:

This event is deprecated and should not be used.

See also:

ggzcore_server_get_channel

ggzcore_server_read_data

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.

Parameters:

data NULL

Note:

This event is deprecated and should not be used.

See also:

ggzcore_server_read_data

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).

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.

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

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).

Parameters:

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.

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.

Parameters:

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.

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.

Parameters:

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

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.

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.

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.

Parameters:

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). email The email address to use (may be NULL with some login types).