ggz.ui
Class PrivateChatDialog.ChatDialogManager

java.lang.Object
  extended by ggz.ui.PrivateChatDialog.ChatDialogManager
All Implemented Interfaces:
RoomListener, ServerListener, java.util.EventListener
Enclosing class:
PrivateChatDialog

protected static class PrivateChatDialog.ChatDialogManager
extends java.lang.Object
implements RoomListener, ServerListener


Field Summary
protected  Room currentRoom
           
 
Constructor Summary
protected PrivateChatDialog.ChatDialogManager()
           
 
Method Summary
 void chat_event(ChatEventData data)
          Received a chat message of any kind.
 void player_count(int count)
          The number of players in a room has arrived.
 void player_lag(Player player)
          A player's lag (measure of connection speed) has been updated
 void player_list(java.util.List players)
          The list of players in a room has arrived.
 void player_stats(Player player)
          A player's stats have been updated.
 void room_enter(RoomChangeEventData data)
          A player has entered the room with you.
 void room_leave(RoomChangeEventData data)
          A player has left your room.
 void server_channel_connected()
          Status event: a requested direct game connection has been established.
 void server_channel_fail(java.lang.String error)
          Error: Failure during setup of direct connection to game server.
 void server_channel_ready()
          Game channel is ready for read/write operations.
 void server_chat_fail(ErrorEventData data)
          Error: A chat message could not be sent.
 void server_connect_fail(java.lang.String error)
          Error: we have failed to connect to the server.
 void server_connected()
          We have just made a connection to the server.
 void server_enter_fail(ErrorEventData data)
          Error: we have tried to enter a room and failed.
 void server_enter_ok()
          We have successfully entered a room.
 void server_list_rooms()
          The room list arrived.
 void server_list_types()
          The list of game types is available.
 void server_logged_out()
          Logged out of the server.
 void server_login_fail(ErrorEventData data)
          Error: login failure.
 void server_login_ok()
          We have successfully logged in.
 void server_motd_loaded(MotdEventData data)
          The MOTD has been read from the server and can be displayed.
 void server_negotiate_fail(java.lang.String error)
          Error: negotiation failure.
 void server_negotiated()
          We have negotiated a connection to the server.
 void server_net_error(java.lang.String error)
          Error: a network (transmission) error occurred.
 void server_players_changed()
          The number of players on the server has changed.
 void server_protocol_error(java.lang.String error)
          Error: a communication protocol error occured.
 void server_rooms_changed()
          A room has either been added, deleted or set to "closed".
 void server_state_changed()
          The internal state of ggzcore has changed.
 void table_add(Table table)
          A table has been created.
 void table_delete(Table table)
          A table has been removed from the room.
 void table_join_fail(java.lang.String error)
          Joining a table did not succeed.
 void table_joined(int table_index)
          Your table join attempt has succeeded.
 void table_launch_fail(ErrorEventData data)
          The table you tried to launch couldn't be launched
 void table_launched()
          The table you tried to launch has launched!
 void table_leave_fail(java.lang.String error)
          Your attempt to leave the table has failed.
 void table_left(TableLeaveEventData data)
          You have successfully left the table you were at.
 void table_list()
          Received the list of active tables.
 void table_update(Table table)
          One of the tables in the current room has changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentRoom

protected Room currentRoom
Constructor Detail

PrivateChatDialog.ChatDialogManager

protected PrivateChatDialog.ChatDialogManager()
Method Detail

server_channel_connected

public void server_channel_connected()
Description copied from interface: ServerListener
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.

Specified by:
server_channel_connected in interface ServerListener
See Also:
ggzcore_server_get_channel, ggzcore_server_read_data

server_channel_fail

public void server_channel_fail(java.lang.String error)
Description copied from interface: ServerListener
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).

Specified by:
server_channel_fail in interface ServerListener
See Also:
ggzcore_server_read_data

server_channel_ready

public void server_channel_ready()
Description copied from interface: ServerListener
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.

Specified by:
server_channel_ready in interface ServerListener
See Also:
ggzcore_server_read_data

server_chat_fail

public void server_chat_fail(ErrorEventData data)
Description copied from interface: ServerListener
Error: A chat message could not be sent. This will happen when we try to send a chat and the server rejects it.

Specified by:
server_chat_fail in interface ServerListener
Parameters:
data - A pointer to a GGZErrorEventData.
See Also:
GGZErrorEventData, ggzcore_server_read_data

server_connect_fail

public void server_connect_fail(java.lang.String error)
Description copied from interface: ServerListener
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.

Specified by:
server_connect_fail in interface ServerListener
See Also:
ggzcore_server_connect

server_connected

public void server_connected()
Description copied from interface: ServerListener
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!

Specified by:
server_connected in interface ServerListener
See Also:
ggzcore_server_connect

server_enter_fail

public void server_enter_fail(ErrorEventData data)
Description copied from interface: ServerListener
Error: we have tried to enter a room and failed. This will be issued to tell us a room join has failed.

Specified by:
server_enter_fail in interface ServerListener
Parameters:
data - A pointer to a GGZErrorEventData.
See Also:
GGZErrorEventData, ggzcore_server_join_room, ggzcore_server_read_data

server_enter_ok

public void server_enter_ok()
Description copied from interface: ServerListener
We have successfully entered a room. This will be issued to tell us a room join has succeeded, after it has been requested.

Specified by:
server_enter_ok in interface ServerListener
See Also:
ggzcore_server_join_room, ggzcore_server_read_data

server_list_rooms

public void server_list_rooms()
Description copied from interface: ServerListener
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!

Specified by:
server_list_rooms in interface ServerListener
See Also:
ggzcore_server_read_data

server_rooms_changed

public void server_rooms_changed()
Description copied from interface: ServerListener
A room has either been added, deleted or set to "closed".

Specified by:
server_rooms_changed in interface ServerListener

server_list_types

public void server_list_types()
Description copied from interface: ServerListener
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!

Specified by:
server_list_types in interface ServerListener
See Also:
ggzcore_server_read_data

server_logged_out

public void server_logged_out()
Description copied from interface: ServerListener
Logged out of the server. This will happen when the server completes the communication; usually after ggzcore_net_send_logout is called.

Specified by:
server_logged_out in interface ServerListener
See Also:
ggzcore_server_read_data

server_login_fail

public void server_login_fail(ErrorEventData data)
Description copied from interface: ServerListener
Error: login failure. This will happen in place of GGZ_LOGGED_IN if the login failed. The server object will be otherwise unaffected.

Specified by:
server_login_fail in interface ServerListener
Parameters:
data - A pointer to a GGZErrorEventData.
See Also:
GGZErrorEventData, ggzcore_server_read_data

server_login_ok

public void server_login_ok()
Description copied from interface: ServerListener
We have successfully logged in. We can now start doing stuff. This will not happen until the client sends their login information.

Specified by:
server_login_ok in interface ServerListener
See Also:
ggzcore_server_login, ggzcore_server_read_data

server_motd_loaded

public void server_motd_loaded(MotdEventData data)
Description copied from interface: ServerListener
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.

Specified by:
server_motd_loaded in interface ServerListener
Parameters:
data - Pointer to a GGZMotdEventData including the full MOTD text.
See Also:
ggzcore_server_motd, ggzcore_server_read_data!

server_negotiate_fail

public void server_negotiate_fail(java.lang.String error)
Description copied from interface: ServerListener
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.

Specified by:
server_negotiate_fail in interface ServerListener
See Also:
ggzcore_server_read_data

server_negotiated

public void server_negotiated()
Description copied from interface: ServerListener
We have negotiated a connection to the server. This will happen automatically once a connection has been established, if the server socket is monitored.

Specified by:
server_negotiated in interface ServerListener
See Also:
ggzcore_server_read_data

server_net_error

public void server_net_error(java.lang.String error)
Description copied from interface: ServerListener
Error: a network (transmission) error occurred. The server will automatically disconnect.

Specified by:
server_net_error in interface ServerListener
See Also:
ggzcore_server_read_data

server_players_changed

public void server_players_changed()
Description copied from interface: ServerListener
The number of players on the server has changed. This event is issued rather frequently every time players enter or leave.

Specified by:
server_players_changed in interface ServerListener
See Also:
ggzcore_server_get_num_players, ggzcore_server_read_data

server_protocol_error

public void server_protocol_error(java.lang.String error)
Description copied from interface: ServerListener
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.

Specified by:
server_protocol_error in interface ServerListener
See Also:
ggzcore_server_read_data

server_state_changed

public void server_state_changed()
Description copied from interface: ServerListener
The internal state of ggzcore has changed. This may happen at any time.

Specified by:
server_state_changed in interface ServerListener
See Also:
GGZStateID, ggzcore_server_get_state

chat_event

public void chat_event(ChatEventData data)
Description copied from interface: RoomListener
Received a chat message of any kind. This can happen at any time when you're in a room.

Specified by:
chat_event in interface RoomListener
Parameters:
data - The GGZChatEventData associated with the chat.
See Also:
GGZChatEventData

player_count

public void player_count(int count)
Description copied from interface: RoomListener
The number of players in a room has arrived.

Specified by:
player_count in interface RoomListener
Parameters:
count - The number of players in the room.

player_lag

public void player_lag(Player player)
Description copied from interface: RoomListener
A player's lag (measure of connection speed) has been updated

Specified by:
player_lag in interface RoomListener
Parameters:
player - The player whose lag has changed.
See Also:
ggzcore_player_get_lag

player_list

public void player_list(java.util.List players)
Description copied from interface: RoomListener
The list of players in a room has arrived.

Specified by:
player_list in interface RoomListener
Parameters:
players - The list of players.
See Also:
ggzcore_room_list_players

player_stats

public void player_stats(Player player)
Description copied from interface: RoomListener
A player's stats have been updated.

Specified by:
player_stats in interface RoomListener
Parameters:
player - The player whose stats have changed.
See Also:
void PLAYER_LIST, ggzcore_player_get_record, ggzcore_player_get_rating, ggzcore_player_get_ranking, ggzcore_player_get_highscore

room_enter

public void room_enter(RoomChangeEventData data)
Description copied from interface: RoomListener
A player has entered the room with you.

Specified by:
room_enter in interface RoomListener
Parameters:
data - A GGZRoomChangeEventData structure.

room_leave

public void room_leave(RoomChangeEventData data)
Description copied from interface: RoomListener
A player has left your room.

Specified by:
room_leave in interface RoomListener
Parameters:
data - A GGZRoomChangeEventData structure.

table_add

public void table_add(Table table)
Description copied from interface: RoomListener
A table has been created.

Specified by:
table_add in interface RoomListener

table_delete

public void table_delete(Table table)
Description copied from interface: RoomListener
A table has been removed from the room.

Specified by:
table_delete in interface RoomListener

table_join_fail

public void table_join_fail(java.lang.String error)
Description copied from interface: RoomListener
Joining a table did not succeed.

Specified by:
table_join_fail in interface RoomListener
See Also:
void TABLE_JOINED

table_joined

public void table_joined(int table_index)
Description copied from interface: RoomListener
Your table join attempt has succeeded.

Specified by:
table_joined in interface RoomListener
See Also:
ggzcore_room_join_table

table_launch_fail

public void table_launch_fail(ErrorEventData data)
Description copied from interface: RoomListener
The table you tried to launch couldn't be launched

Specified by:
table_launch_fail in interface RoomListener
Parameters:
data - A pointer to a GGZErrorEventData
See Also:
void TABLE_LAUNCHED

table_launched

public void table_launched()
Description copied from interface: RoomListener
The table you tried to launch has launched!

Specified by:
table_launched in interface RoomListener
See Also:
ggzcore_room_launch_table

table_leave_fail

public void table_leave_fail(java.lang.String error)
Description copied from interface: RoomListener
Your attempt to leave the table has failed.

Specified by:
table_leave_fail in interface RoomListener
See Also:
void TABLE_LEFT

table_left

public void table_left(TableLeaveEventData data)
Description copied from interface: RoomListener
You have successfully left the table you were at.

Specified by:
table_left in interface RoomListener
Parameters:
data - The GGZTableLeaveEventData associated with the leave.
See Also:
ggzcore_room_leave_table, GGZTableLeaveEventData

table_list

public void table_list()
Description copied from interface: RoomListener
Received the list of active tables.

Specified by:
table_list in interface RoomListener
See Also:
ggzcore_room_list_tables

table_update

public void table_update(Table table)
Description copied from interface: RoomListener
One of the tables in the current room has changed.

Specified by:
table_update in interface RoomListener