|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectggz.client.mod.ModGame
public class ModGame
How a game is launched (incomplete): 1. ggz client invokes ggzcore to execute the game. The game executable is started. If socketpair() is available then it is used to create a ggz<->game socket connection. 2. A game launch packet is sent from the GGZ client to the game client. 3. The game client sets its state to CONNECTED (from created).. 4. GGZ-client is informed of the game state change. 5a. set_server informs the game client about where to connect to. A "server" packet is sent GGZ -> game. 6ab.The GGZ core client (or the game client) creates a socket and connects to GGZ... 7b. ...GGZ_GAME_NEGOTIATED ggzcore event is triggered... 8b. ggzcore_set_server_fd is called by the GGZ core client... ...it calls set_server_fd 9. the game client sets its state to WAITING 10. GGZ-client is informed of the game state change 11. GGZ_GAME_PLAYING ggzcore event is triggered 12. table-join or table-launch packet is sent from ggz CLIENT->SERVER 13. ggz SERVER handles join/launch packets, sends response 14. ... and then what? ...
Method Summary | |
---|---|
void |
connect()
Connect to ggz. |
void |
disconnect()
Disconnect from ggz. |
java.lang.Object |
getGamedata()
Return gamedata object. |
java.lang.String |
getMyName()
Gets the name of the player that we represent. |
int |
getMySeatNum()
Call this function to find out where at the table this player is sitting. |
int |
getNumSeats()
Get the total number of seats at the table. |
int |
getNumSpectatorSeats()
Get the maximum number of spectators. |
Seat |
getSeat(int seatNum)
Get all data for the specified seat. |
java.net.Socket |
getServerSocket()
Get the socket of the game server connection. |
SpectatorSeat |
getSpectatorSeat(int seatNum)
Get a spectator's data. |
ModState |
getState()
Get the current state of the table. |
void |
handlePlayer(java.lang.String name,
boolean isSpectator,
int seatNum)
|
boolean |
isSpectator()
|
void |
requestBoot(java.lang.String name)
Boot a player. |
void |
requestBot(int seatNum)
Change the requested seat from an open seat to a bot. |
void |
requestChat(ChatType type,
java.lang.String target,
java.lang.String chatMsg)
Chat! This initiates a table chat. |
void |
requestOpen(int seatNum)
Change the requested seat from a bot to an open seat. |
void |
requestPlayerInfo(int seatNum)
Request extended player information for one or more players Depending on the seat parameter (-1 or valid number), this function asynchronously requests information about player(s), which trigget ModEventHandler.handleInfo(). |
void |
requestSit(int seatNum)
Sit down (move from a spectator seat into a player seat). |
void |
requestStand()
Stand up (move from your seat into a spectator seat). |
void |
setHandler(ModEventHandler listener)
|
void |
setState(ModState state)
Change the table's state. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public ModState getState()
public java.net.Socket getServerSocket()
public java.lang.Object getGamedata()
#setGameData(Object)
public void setHandler(ModEventHandler listener)
public void setState(ModState state) throws java.io.IOException
state
- The new state.
java.io.IOException
public void handlePlayer(java.lang.String name, boolean isSpectator, int seatNum)
public java.lang.String getMyName()
public boolean isSpectator()
public int getMySeatNum()
public int getNumSeats()
public int getNumSpectatorSeats()
public Seat getSeat(int seatNum)
seatNum
- The seat number (0..(number of seats - 1)).
public SpectatorSeat getSpectatorSeat(int seatNum)
seatNum
- The number, between 0 and (number of spectators - 1).
public void connect() throws java.io.IOException
java.io.IOException
public void disconnect() throws java.io.IOException
java.io.IOException
public void requestStand() throws java.io.IOException
java.io.IOException
public void requestSit(int seatNum) throws java.io.IOException
seatNum
- The seat to sit in.
java.io.IOException
public void requestBoot(java.lang.String name) throws java.io.IOException
name
- The name of the player to boot.
java.io.IOException
public void requestBot(int seatNum) throws java.io.IOException
seatNum
- The number of the seat to toggle.
java.io.IOException
public void requestOpen(int seatNum) throws java.io.IOException
seatNum
- The number of the seat to toggle.
java.io.IOException
public void requestChat(ChatType type, java.lang.String target, java.lang.String chatMsg) throws java.io.IOException
chatMsg
- The chat message.
java.io.IOException
public void requestPlayerInfo(int seatNum) throws java.io.IOException
seatNum
- The seat number to request info for, or -1 to select all.
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |