ggz.client.core
Class ServerEvent

java.lang.Object
  extended by ggz.client.core.ServerEvent

public class ServerEvent
extends java.lang.Object

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

Field Summary
static ServerEvent GGZ_CHANNEL_CONNECTED
          Status event: a requested direct game connection has been established.
static ServerEvent GGZ_CHANNEL_FAIL
          Error: Failure during setup of direct connection to game server.
static ServerEvent GGZ_CHANNEL_READY
          Game channel is ready for read/write operations.
static ServerEvent GGZ_CHAT_FAIL
          Error: A chat message could not be sent.
static ServerEvent GGZ_CONNECT_FAIL
          Error: we have failed to connect to the server.
static ServerEvent GGZ_CONNECTED
          We have just made a connection to the server.
static ServerEvent GGZ_ENTER_FAIL
          Error: we have tried to enter a room and failed.
static ServerEvent GGZ_ENTERED
          We have successfully entered a room.
static ServerEvent GGZ_LOGGED_IN
          We have successfully logged in.
static ServerEvent GGZ_LOGIN_FAIL
          Error: login failure.
static ServerEvent GGZ_LOGOUT
          Logged out of the server.
static ServerEvent GGZ_MOTD_LOADED
          The MOTD has been read from the server and can be displayed.
static ServerEvent GGZ_NEGOTIATE_FAIL
          Error: negotiation failure.
static ServerEvent GGZ_NEGOTIATED
          We have negotiated a connection to the server.
static ServerEvent GGZ_NET_ERROR
          Error: a network (transmission) error occurred.
static ServerEvent GGZ_NUM_SERVER_EVENTS
          Terminator.
static ServerEvent GGZ_PROTOCOL_ERROR
          Error: a communication protocol error occured.
static ServerEvent GGZ_ROOM_LIST
          The room list arrived.
static ServerEvent GGZ_SERVER_PLAYERS_CHANGED
          The number of players on the server has changed.
static ServerEvent GGZ_SERVER_ROOMS_CHANGED
          A room was added, deleted or closed.
static ServerEvent GGZ_STATE_CHANGE
          The internal state of ggzcore has changed.
static ServerEvent GGZ_TYPE_LIST
          The list of game types is available.
 
Method Summary
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GGZ_CONNECTED

public static final ServerEvent 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!

See Also:
ggzcore_server_connect

GGZ_CONNECT_FAIL

public static final ServerEvent 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.

See Also:
ggzcore_server_connect

GGZ_NEGOTIATED

public static final ServerEvent 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.

See Also:
ggzcore_server_read_data

GGZ_NEGOTIATE_FAIL

public static final ServerEvent 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.

See Also:
ggzcore_server_read_data

GGZ_LOGGED_IN

public static final ServerEvent 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, ggzcore_server_read_data

GGZ_LOGIN_FAIL

public static final ServerEvent 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.

See Also:
GGZErrorEventData, ggzcore_server_read_data

GGZ_MOTD_LOADED

public static final ServerEvent 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.

See Also:
ggzcore_server_motd, ggzcore_server_read_data!

GGZ_ROOM_LIST

public static final ServerEvent 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!

See Also:
ggzcore_server_read_data

GGZ_SERVER_ROOMS_CHANGED

public static final ServerEvent GGZ_SERVER_ROOMS_CHANGED
A room was added, deleted or closed. This happens after the initial room list has been received and a new room is created or deleted dynamically.


GGZ_TYPE_LIST

public static final ServerEvent 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!

See Also:
ggzcore_server_read_data

GGZ_SERVER_PLAYERS_CHANGED

public static final ServerEvent 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. It is also used to notify that the count of players in a room has changed even if the number of players on the server hasn't.

See Also:
Server.get_num_players()

GGZ_ENTERED

public static final ServerEvent 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.

See Also:
ggzcore_server_join_room, ggzcore_server_read_data

GGZ_ENTER_FAIL

public static final ServerEvent 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.

See Also:
GGZErrorEventData, ggzcore_server_join_room, ggzcore_server_read_data

GGZ_LOGOUT

public static final ServerEvent GGZ_LOGOUT
Logged out of the server. This will happen when the server completes the communication; usually after ggzcore_net_send_logout is called.

See Also:
ggzcore_server_read_data

GGZ_NET_ERROR

public static final ServerEvent GGZ_NET_ERROR
Error: a network (transmission) error occurred. The server will automatically disconnect.

See Also:
ggzcore_server_read_data

GGZ_PROTOCOL_ERROR

public static final ServerEvent 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.

See Also:
ggzcore_server_read_data

GGZ_CHAT_FAIL

public static final ServerEvent 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.

See Also:
GGZErrorEventData, ggzcore_server_read_data

GGZ_STATE_CHANGE

public static final ServerEvent GGZ_STATE_CHANGE
The internal state of ggzcore has changed. This may happen at any time.

See Also:
GGZStateID, ggzcore_server_get_state

GGZ_CHANNEL_CONNECTED

public static final ServerEvent 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.

See Also:
ggzcore_server_get_channel, ggzcore_server_read_data

GGZ_CHANNEL_READY

public static final ServerEvent 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.

See Also:
ggzcore_server_read_data

GGZ_CHANNEL_FAIL

public static final ServerEvent 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).

See Also:
ggzcore_server_read_data

GGZ_NUM_SERVER_EVENTS

public static final ServerEvent GGZ_NUM_SERVER_EVENTS
Terminator. Do not use.