ggz.client.mod
Interface ModEventHandler

All Known Implementing Classes:
CardGamePanel, GamePanel, TicTacToePanel

public interface ModEventHandler


Method Summary
 void handleChat(java.lang.String player, java.lang.String msg)
          A chat message event.
 void handleError(java.lang.String msg)
          An error has occurred This event occurs when a GGZMod error has occurred.
 void handleInfo(PlayerInfo info)
          Player information has arrived.
 void handlePlayer(java.lang.String oldName, boolean oldIsSpectator, int oldSeatNum)
          The player's seat status has changed.
 void handleSeat(Seat oldSeat, Seat newSeat)
          A seat change.
 void handleServer(java.net.Socket fd)
          A new server connection has been made.
 void handleSpectatorSeat(SpectatorSeat old_seat, SpectatorSeat newSeat)
          Invoked when a spectator leaves or joins.
 void handleState(ModState oldState)
          Module status changed.
 void handleStats()
          Players' stats have been updated.
 void init(ModGame mod)
           
 

Method Detail

init

void init(ModGame mod)
          throws java.io.IOException
Throws:
java.io.IOException

handleState

void handleState(ModState oldState)
Module status changed. This event occurs when the game's status changes. The old state (a ModState) is passed as the event's data.

See Also:
ModState

handleServer

void handleServer(java.net.Socket fd)
                  throws java.io.IOException
A new server connection has been made. This event occurs when a new connection to the game server has been made, either by the core client or by the game client itself. The socket is passed as the event's data.

Throws:
java.io.IOException
See Also:
ModGame.connect()

handlePlayer

void handlePlayer(java.lang.String oldName,
                  boolean oldIsSpectator,
                  int oldSeatNum)
The player's seat status has changed. Invoked when information about the current player changes. e.g. When standing the player changes to a spectator or when changing seats the seat number changes. The old values are passed as parameters and to obtain the new values, call the accessor methods on the GGZMod.

Parameters:
oldName -
oldIsSpectator -
oldSeatNum -

handleSeat

void handleSeat(Seat oldSeat,
                Seat newSeat)
A seat change. This event occurs when a seat change occurs. The old seat (a Seat) is passed as the event's data. The seat information will be updated before the event is invoked.

Parameters:
oldSeat - Old seat information at that seat number.
newSeat - New seat information at that seat number.

handleSpectatorSeat

void handleSpectatorSeat(SpectatorSeat old_seat,
                         SpectatorSeat newSeat)
Invoked when a spectator leaves or joins. The seat name will be null when a spectator leaves and will contain the name of the spectator on join.

Parameters:
oldSeat - the old seat.
newSeat - the new seat.

handleChat

void handleChat(java.lang.String player,
                java.lang.String msg)
A chat message event. This event occurs when we receive a chat. The chat may have originated in another game client or from the GGZ client; in either case it will be routed to us. The chat information is passed as the event's data. Note that the chat may originate with a player or a spectator, and they may have changed seats or left the table by the time it gets to us.


handleStats

void handleStats()
Players' stats have been updated.


handleInfo

void handleInfo(PlayerInfo info)
Player information has arrived. Information has been requested about one or more players and it has now arrived. The event data is a PlayerInfo object or null if info about all players was requested.


handleError

void handleError(java.lang.String msg)
An error has occurred This event occurs when a GGZMod error has occurred. An error message will be passed as the event's data. GGZMod may attempt to recover from the error, but it is not guaranteed that the GGZ connection will continue to work after an error has happened.