JSettlers v1.0.6 API
Built ${date}

soc.client
Class SOCPlayerClient

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended bysoc.client.SOCPlayerClient
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.lang.Runnable, java.io.Serializable

public class SOCPlayerClient
extends java.applet.Applet
implements java.lang.Runnable, java.awt.event.ActionListener

Applet/Standalone client for connecting to the SOCServer. If you want another connection port, you have to specify it as the "port" argument in the html source. If you run this as a stand-alone, you have to specify the port.

Author:
Robert S Thomas
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  java.applet.AppletContext ac
           
protected  java.awt.CardLayout cardLayout
           
protected  java.awt.TextField channel
           
protected  java.util.Hashtable channels
          the channels
protected  java.awt.List chlist
           
protected  boolean connected
           
protected  java.lang.Exception ex
           
protected  java.awt.TextField game
           
protected  java.util.Hashtable games
          the games
protected  java.awt.List gmlist
           
protected  boolean gotPassword
          true if we've stored the password
protected  java.lang.String host
           
protected  java.util.Vector ignoreList
          the ignore list
protected  java.io.DataInputStream in
           
protected  java.awt.Button jc
           
protected  java.awt.Button jg
           
protected  java.lang.String lastMessage
           
protected  java.awt.Label messageLabel
           
protected  java.awt.TextField nick
           
protected  java.lang.String nickname
          the nickname
protected  java.io.DataOutputStream out
           
protected  java.awt.TextField pass
           
protected  java.lang.String password
          the password
protected  java.util.Hashtable playerInterfaces
          the player interfaces for the games
protected  int port
           
protected  java.lang.Thread reader
           
protected  java.net.Socket s
           
protected static java.lang.String STATSPREFEX
           
protected  java.awt.TextField status
           
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SOCPlayerClient()
          Create a SOCPlayerClient connecting to localhost port 8880
SOCPlayerClient(java.lang.String h, int p)
          Constructor for connecting to the specified host, on the specified port.
 
Method Summary
 void acceptOffer(SOCGame ga, int from)
          the user is accepting an offer
 void actionPerformed(java.awt.event.ActionEvent e)
          Handle mouse clicks and keyboard
 void addToGameList(java.lang.String thing)
          add a new game
protected  void addToIgnoreList(java.lang.String name)
          add this name to the ignore list
 void addToList(java.lang.String thing, java.awt.List lst)
          add a new channel or game, put it in the list in alphabetical order
 void bankTrade(SOCGame ga, SOCResourceSet give, SOCResourceSet get)
          the user wants to trade with the bank
 void buildRequest(SOCGame ga, int piece)
          request to build something
 void buyDevCard(SOCGame ga)
          request to buy a development card
 void cancelBuildRequest(SOCGame ga, int piece)
          request to cancel building something
 void changeFace(SOCGame ga, int id)
          the user is changing the face image
 void choosePlayer(SOCGame ga, int pn)
          the user chose a player to steal from
 void chSend(java.lang.String ch, java.lang.String mes)
          send a text message to a channel
 void clearOffer(SOCGame ga)
          the user is clearing an offer
 void connect()
          Attempts to connect to the server.
 void considerMove(SOCGame ga, java.lang.String pname, SOCPlayingPiece piece)
          send a command to the server with a message asking a robot to show the debug info for a possible move after a move has been made
 void considerTarget(SOCGame ga, java.lang.String pname, SOCPlayingPiece piece)
          send a command to the server with a message asking a robot to show the debug info for a possible move before a move has been made
 void deleteFromGameList(java.lang.String gameName)
          delete a game from the list
 void deleteFromList(java.lang.String thing, java.awt.List lst)
          delete a group
 void destroy()
          destroy the applet
 void discard(SOCGame ga, SOCResourceSet rs)
          the user wants to discard
protected  void disconnect()
          disconnect from the net
 void discoveryPick(SOCGame ga, SOCResourceSet rscs)
          the user picked 2 resources to discover
 boolean doLocalCommand(SOCGame ga, java.lang.String cmd)
          handle local client commands for games
 boolean doLocalCommand(java.lang.String ch, java.lang.String cmd)
          handle local client commands for channels
 void endTurn(SOCGame ga)
          the user is done with the turn
 java.lang.String getAppletInfo()
          applet info
 int getHexParameter(java.lang.String name)
          Retrieve a parameter and translate to a hex value.
 java.lang.String getNickname()
           
protected  void handleBCASTTEXTMSG(SOCBCastTextMsg mes)
          handle a broadcast text message
protected  void handleBOARDLAYOUT(SOCBoardLayout mes)
          handle the "board layout" message
protected  void handleCHANGEFACE(SOCChangeFace mes)
          handle the "change face" message
protected  void handleCHANNELS(SOCChannels mes)
          handle the "list of channels" message
protected  void handleCHOOSEPLAYERREQUEST(SOCChoosePlayerRequest mes)
          handle the "choose player request" message
protected  void handleCLEAROFFER(SOCClearOffer mes)
          handle the "clear offer" message
protected  void handleCLEARTRADEMSG(SOCClearTradeMsg mes)
          handle the "clear trade message" message
protected  void handleDELETECHANNEL(SOCDeleteChannel mes)
          handle the "delete channel" message
protected  void handleDELETEGAME(SOCDeleteGame mes)
          handle the "delete game" message
protected  void handleDEVCARD(SOCDevCard mes)
          handle the "development card action" message
protected  void handleDEVCARDCOUNT(SOCDevCardCount mes)
          handle the "number of development cards" message
protected  void handleDICERESULT(SOCDiceResult mes)
          handle the "dice result" message
protected  void handleDISCARDREQUEST(SOCDiscardRequest mes)
          handle the "discard request" message
protected  void handleFIRSTPLAYER(SOCFirstPlayer mes)
          handle the "first player" message
protected  void handleGAMEMEMBERS(SOCGameMembers mes)
          handle the "game members" message
protected  void handleGAMES(SOCGames mes)
          handle the "list of games" message
protected  void handleGAMESTATE(SOCGameState mes)
          handle the "game state" message
protected  void handleGAMESTATS(SOCGameStats mes)
          handle the "game stats" message
protected  void handleGAMETEXTMSG(SOCGameTextMsg mes)
          handle the "game text message" message
protected  void handleJOIN(SOCJoin mes)
          handle the "join channel" message
protected  void handleJOINAUTH(SOCJoinAuth mes)
          handle the "join authorization" message
protected  void handleJOINGAME(SOCJoinGame mes)
          handle the "join game" message
protected  void handleJOINGAMEAUTH(SOCJoinGameAuth mes)
          handle the "join game authorization" message
protected  void handleLARGESTARMY(SOCLargestArmy mes)
          handle the "largest army" message
protected  void handleLEAVE(SOCLeave mes)
          handle the "leave channel" message
protected  void handleLEAVEGAME(SOCLeaveGame mes)
          handle the "leave game" message
protected  void handleLONGESTROAD(SOCLongestRoad mes)
          handle the "longest road" message
protected  void handleMAKEOFFER(SOCMakeOffer mes)
          handle the "make offer" message
protected  void handleMEMBERS(SOCMembers mes)
          handle the "members" message
protected  void handleMOVEROBBER(SOCMoveRobber mes)
          handle the "robber moved" message
protected  void handleNEWCHANNEL(SOCNewChannel mes)
          handle the "new channel" message
protected  void handleNEWGAME(SOCNewGame mes)
          handle the "new game" message
protected  void handlePLAYERELEMENT(SOCPlayerElement mes)
          handle the "player information" message
protected  void handlePOTENTIALSETTLEMENTS(SOCPotentialSettlements mes)
          handle the "list of potential settlements" message
protected  void handlePUTPIECE(SOCPutPiece mes)
          handle the "put piece" message
protected  void handleREJECTCONNECTION(SOCRejectConnection mes)
          handle the "reject connection" message
protected  void handleREJECTOFFER(SOCRejectOffer mes)
          handle the "reject offer" message
protected  void handleRESOURCECOUNT(SOCResourceCount mes)
          handle "resource count" message
protected  void handleSETPLAYEDDEVCARD(SOCSetPlayedDevCard mes)
          handle the "set played dev card flag" message
protected  void handleSETSEATLOCK(SOCSetSeatLock mes)
          handle the "set seat lock" message
protected  void handleSETTURN(SOCSetTurn mes)
          handle the "set turn" message
protected  void handleSITDOWN(SOCSitDown mes)
          handle the "player sitting down" message
protected  void handleSTARTGAME(SOCStartGame mes)
          handle the "start game" message
protected  void handleSTATUSMESSAGE(SOCStatusMessage mes)
          handle the "status message" message
protected  void handleTEXTMSG(SOCTextMsg mes)
          handle a text message
protected  void handleTURN(SOCTurn mes)
          handle the "turn" message
 void init()
          Initialize the applet
protected  void initVisualElements()
          init the visual elements
 void leaveChannel(java.lang.String ch)
          the user leaves the given channel
 void leaveGame(SOCGame ga)
          the user leaves the given game
 void lockSeat(SOCGame ga, int pn)
          the user is locking a seat
static void main(java.lang.String[] args)
          for stand-alones
 void monopolyPick(SOCGame ga, int res)
          the user picked a resource to monopolize
 void moveRobber(SOCGame ga, SOCPlayer pl, int coord)
          the player wants to move the robber
 void offerTrade(SOCGame ga, SOCTradeOffer offer)
          the user is making an offer to trade
protected  boolean onIgnoreList(java.lang.String name)
           
 void playDevCard(SOCGame ga, int dc)
          the user wants to play a development card
 boolean put(java.lang.String s)
          write a message to the net
 void putPiece(SOCGame ga, SOCPlayingPiece pp)
          put a piece on the board
 void rejectOffer(SOCGame ga)
          the user is rejecting the current offers
protected  void removeFromIgnoreList(java.lang.String name)
          remove this name from the ignore list
 void resend()
          resend the last message
 void rollDice(SOCGame ga)
          the user rolls the dice
 void run()
          continuously read from the net in a separate thread
 void sendText(SOCGame ga, java.lang.String me)
          send a text message to the people in the game
 void sitDown(SOCGame ga, int pn)
          the user sits down to play
 void start()
          Called when the applet should start it's work.
 void startGame(SOCGame ga)
          the user is starting the game
 void treat(SOCMessage mes)
          Treat the incoming messages
 void unlockSeat(SOCGame ga, int pn)
          the user is unlocking a seat
 void updateGameStats(java.lang.String gameName, int[] scores, boolean[] robots)
          DOCUMENT ME!
static void usage()
          for stand-alones
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STATSPREFEX

protected static java.lang.String STATSPREFEX

nick

protected java.awt.TextField nick

pass

protected java.awt.TextField pass

status

protected java.awt.TextField status

channel

protected java.awt.TextField channel

game

protected java.awt.TextField game

chlist

protected java.awt.List chlist

gmlist

protected java.awt.List gmlist

jc

protected java.awt.Button jc

jg

protected java.awt.Button jg

messageLabel

protected java.awt.Label messageLabel

ac

protected java.applet.AppletContext ac

lastMessage

protected java.lang.String lastMessage

cardLayout

protected java.awt.CardLayout cardLayout

host

protected java.lang.String host

port

protected int port

s

protected java.net.Socket s

in

protected java.io.DataInputStream in

out

protected java.io.DataOutputStream out

reader

protected java.lang.Thread reader

ex

protected java.lang.Exception ex

connected

protected boolean connected

nickname

protected java.lang.String nickname
the nickname


password

protected java.lang.String password
the password


gotPassword

protected boolean gotPassword
true if we've stored the password


channels

protected java.util.Hashtable channels
the channels


games

protected java.util.Hashtable games
the games


playerInterfaces

protected java.util.Hashtable playerInterfaces
the player interfaces for the games


ignoreList

protected java.util.Vector ignoreList
the ignore list

Constructor Detail

SOCPlayerClient

public SOCPlayerClient()
Create a SOCPlayerClient connecting to localhost port 8880


SOCPlayerClient

public SOCPlayerClient(java.lang.String h,
                       int p)
Constructor for connecting to the specified host, on the specified port. Must call 'init' to start up and do layout.

Parameters:
h - host
p - port
Method Detail

initVisualElements

protected void initVisualElements()
init the visual elements


getHexParameter

public int getHexParameter(java.lang.String name)
Retrieve a parameter and translate to a hex value.

Parameters:
name - a parameter name. null is ignored
Returns:
the parameter parsed as a hex value or -1 on error

start

public void start()
Called when the applet should start it's work.


init

public void init()
Initialize the applet


connect

public void connect()
Attempts to connect to the server. See connected for success or failure.

Throws:
java.lang.IllegalStateException - if already connected

getNickname

public java.lang.String getNickname()
Returns:
the nickname of this user

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handle mouse clicks and keyboard

Specified by:
actionPerformed in interface java.awt.event.ActionListener

run

public void run()
continuously read from the net in a separate thread

Specified by:
run in interface java.lang.Runnable

resend

public void resend()
resend the last message


put

public boolean put(java.lang.String s)
write a message to the net

Parameters:
s - the message
Returns:
true if the message was sent, false if not

treat

public void treat(SOCMessage mes)
Treat the incoming messages

Parameters:
mes - the message

handleSTATUSMESSAGE

protected void handleSTATUSMESSAGE(SOCStatusMessage mes)
handle the "status message" message

Parameters:
mes - the message

handleJOINAUTH

protected void handleJOINAUTH(SOCJoinAuth mes)
handle the "join authorization" message

Parameters:
mes - the message

handleJOIN

protected void handleJOIN(SOCJoin mes)
handle the "join channel" message

Parameters:
mes - the message

handleMEMBERS

protected void handleMEMBERS(SOCMembers mes)
handle the "members" message

Parameters:
mes - the message

handleNEWCHANNEL

protected void handleNEWCHANNEL(SOCNewChannel mes)
handle the "new channel" message

Parameters:
mes - the message

handleCHANNELS

protected void handleCHANNELS(SOCChannels mes)
handle the "list of channels" message

Parameters:
mes - the message

handleBCASTTEXTMSG

protected void handleBCASTTEXTMSG(SOCBCastTextMsg mes)
handle a broadcast text message

Parameters:
mes - the message

handleTEXTMSG

protected void handleTEXTMSG(SOCTextMsg mes)
handle a text message

Parameters:
mes - the message

handleLEAVE

protected void handleLEAVE(SOCLeave mes)
handle the "leave channel" message

Parameters:
mes - the message

handleDELETECHANNEL

protected void handleDELETECHANNEL(SOCDeleteChannel mes)
handle the "delete channel" message

Parameters:
mes - the message

handleGAMES

protected void handleGAMES(SOCGames mes)
handle the "list of games" message

Parameters:
mes - the message

handleJOINGAMEAUTH

protected void handleJOINGAMEAUTH(SOCJoinGameAuth mes)
handle the "join game authorization" message

Parameters:
mes - the message

handleJOINGAME

protected void handleJOINGAME(SOCJoinGame mes)
handle the "join game" message

Parameters:
mes - the message

handleLEAVEGAME

protected void handleLEAVEGAME(SOCLeaveGame mes)
handle the "leave game" message

Parameters:
mes - the message

handleNEWGAME

protected void handleNEWGAME(SOCNewGame mes)
handle the "new game" message

Parameters:
mes - the message

handleDELETEGAME

protected void handleDELETEGAME(SOCDeleteGame mes)
handle the "delete game" message

Parameters:
mes - the message

handleGAMEMEMBERS

protected void handleGAMEMEMBERS(SOCGameMembers mes)
handle the "game members" message

Parameters:
mes - the message

handleGAMESTATS

protected void handleGAMESTATS(SOCGameStats mes)
handle the "game stats" message


handleGAMETEXTMSG

protected void handleGAMETEXTMSG(SOCGameTextMsg mes)
handle the "game text message" message

Parameters:
mes - the message

handleSITDOWN

protected void handleSITDOWN(SOCSitDown mes)
handle the "player sitting down" message

Parameters:
mes - the message

handleBOARDLAYOUT

protected void handleBOARDLAYOUT(SOCBoardLayout mes)
handle the "board layout" message

Parameters:
mes - the message

handleSTARTGAME

protected void handleSTARTGAME(SOCStartGame mes)
handle the "start game" message

Parameters:
mes - the message

handleGAMESTATE

protected void handleGAMESTATE(SOCGameState mes)
handle the "game state" message

Parameters:
mes - the message

handleSETTURN

protected void handleSETTURN(SOCSetTurn mes)
handle the "set turn" message

Parameters:
mes - the message

handleFIRSTPLAYER

protected void handleFIRSTPLAYER(SOCFirstPlayer mes)
handle the "first player" message

Parameters:
mes - the message

handleTURN

protected void handleTURN(SOCTurn mes)
handle the "turn" message

Parameters:
mes - the message

handlePLAYERELEMENT

protected void handlePLAYERELEMENT(SOCPlayerElement mes)
handle the "player information" message

Parameters:
mes - the message

handleRESOURCECOUNT

protected void handleRESOURCECOUNT(SOCResourceCount mes)
handle "resource count" message

Parameters:
mes - the message

handleDICERESULT

protected void handleDICERESULT(SOCDiceResult mes)
handle the "dice result" message

Parameters:
mes - the message

handlePUTPIECE

protected void handlePUTPIECE(SOCPutPiece mes)
handle the "put piece" message

Parameters:
mes - the message

handleMOVEROBBER

protected void handleMOVEROBBER(SOCMoveRobber mes)
handle the "robber moved" message

Parameters:
mes - the message

handleDISCARDREQUEST

protected void handleDISCARDREQUEST(SOCDiscardRequest mes)
handle the "discard request" message

Parameters:
mes - the message

handleCHOOSEPLAYERREQUEST

protected void handleCHOOSEPLAYERREQUEST(SOCChoosePlayerRequest mes)
handle the "choose player request" message

Parameters:
mes - the message

handleMAKEOFFER

protected void handleMAKEOFFER(SOCMakeOffer mes)
handle the "make offer" message

Parameters:
mes - the message

handleCLEAROFFER

protected void handleCLEAROFFER(SOCClearOffer mes)
handle the "clear offer" message

Parameters:
mes - the message

handleREJECTOFFER

protected void handleREJECTOFFER(SOCRejectOffer mes)
handle the "reject offer" message

Parameters:
mes - the message

handleCLEARTRADEMSG

protected void handleCLEARTRADEMSG(SOCClearTradeMsg mes)
handle the "clear trade message" message

Parameters:
mes - the message

handleDEVCARDCOUNT

protected void handleDEVCARDCOUNT(SOCDevCardCount mes)
handle the "number of development cards" message

Parameters:
mes - the message

handleDEVCARD

protected void handleDEVCARD(SOCDevCard mes)
handle the "development card action" message

Parameters:
mes - the message

handleSETPLAYEDDEVCARD

protected void handleSETPLAYEDDEVCARD(SOCSetPlayedDevCard mes)
handle the "set played dev card flag" message

Parameters:
mes - the message

handlePOTENTIALSETTLEMENTS

protected void handlePOTENTIALSETTLEMENTS(SOCPotentialSettlements mes)
handle the "list of potential settlements" message

Parameters:
mes - the message

handleCHANGEFACE

protected void handleCHANGEFACE(SOCChangeFace mes)
handle the "change face" message

Parameters:
mes - the message

handleREJECTCONNECTION

protected void handleREJECTCONNECTION(SOCRejectConnection mes)
handle the "reject connection" message

Parameters:
mes - the message

handleLONGESTROAD

protected void handleLONGESTROAD(SOCLongestRoad mes)
handle the "longest road" message

Parameters:
mes - the message

handleLARGESTARMY

protected void handleLARGESTARMY(SOCLargestArmy mes)
handle the "largest army" message

Parameters:
mes - the message

handleSETSEATLOCK

protected void handleSETSEATLOCK(SOCSetSeatLock mes)
handle the "set seat lock" message

Parameters:
mes - the message

addToGameList

public void addToGameList(java.lang.String thing)
add a new game

Parameters:
thing - the thing to add to the list

addToList

public void addToList(java.lang.String thing,
                      java.awt.List lst)
add a new channel or game, put it in the list in alphabetical order

Parameters:
thing - the thing to add to the list
lst - the list

updateGameStats

public void updateGameStats(java.lang.String gameName,
                            int[] scores,
                            boolean[] robots)
DOCUMENT ME!

Parameters:
gameName - DOCUMENT ME!
scores - DOCUMENT ME!
robots - DOCUMENT ME!

deleteFromGameList

public void deleteFromGameList(java.lang.String gameName)
delete a game from the list

Parameters:
gameName - the game to remove

deleteFromList

public void deleteFromList(java.lang.String thing,
                           java.awt.List lst)
delete a group

Parameters:
thing - the thing to remove
lst - the list

chSend

public void chSend(java.lang.String ch,
                   java.lang.String mes)
send a text message to a channel

Parameters:
ch - the name of the channel
mes - the message

leaveChannel

public void leaveChannel(java.lang.String ch)
the user leaves the given channel

Parameters:
ch - the name of the channel

disconnect

protected void disconnect()
disconnect from the net


buyDevCard

public void buyDevCard(SOCGame ga)
request to buy a development card

Parameters:
ga - the game

buildRequest

public void buildRequest(SOCGame ga,
                         int piece)
request to build something

Parameters:
ga - the game
piece - the type of piece from SOCPlayingPiece

cancelBuildRequest

public void cancelBuildRequest(SOCGame ga,
                               int piece)
request to cancel building something

Parameters:
ga - the game
piece - the type of piece from SOCPlayingPiece

putPiece

public void putPiece(SOCGame ga,
                     SOCPlayingPiece pp)
put a piece on the board

Parameters:
ga - the game where the action is taking place
pp - the piece being placed

moveRobber

public void moveRobber(SOCGame ga,
                       SOCPlayer pl,
                       int coord)
the player wants to move the robber

Parameters:
ga - the game
pl - the player
coord - where the player wants the robber

sendText

public void sendText(SOCGame ga,
                     java.lang.String me)
send a text message to the people in the game

Parameters:
ga - the game
me - the message

leaveGame

public void leaveGame(SOCGame ga)
the user leaves the given game

Parameters:
ga - the game

sitDown

public void sitDown(SOCGame ga,
                    int pn)
the user sits down to play

Parameters:
ga - the game
pn - the number of the seat where the user wants to sit

startGame

public void startGame(SOCGame ga)
the user is starting the game

Parameters:
ga - the game

rollDice

public void rollDice(SOCGame ga)
the user rolls the dice

Parameters:
ga - the game

endTurn

public void endTurn(SOCGame ga)
the user is done with the turn

Parameters:
ga - the game

discard

public void discard(SOCGame ga,
                    SOCResourceSet rs)
the user wants to discard

Parameters:
ga - the game

choosePlayer

public void choosePlayer(SOCGame ga,
                         int pn)
the user chose a player to steal from

Parameters:
ga - the game
pn - the player id

rejectOffer

public void rejectOffer(SOCGame ga)
the user is rejecting the current offers

Parameters:
ga - the game

acceptOffer

public void acceptOffer(SOCGame ga,
                        int from)
the user is accepting an offer

Parameters:
ga - the game
from - the number of the player that is making the offer

clearOffer

public void clearOffer(SOCGame ga)
the user is clearing an offer

Parameters:
ga - the game

bankTrade

public void bankTrade(SOCGame ga,
                      SOCResourceSet give,
                      SOCResourceSet get)
the user wants to trade with the bank

Parameters:
ga - the game
give - what is being offered
get - what the player wants

offerTrade

public void offerTrade(SOCGame ga,
                       SOCTradeOffer offer)
the user is making an offer to trade

Parameters:
ga - the game
offer - the trade offer

playDevCard

public void playDevCard(SOCGame ga,
                        int dc)
the user wants to play a development card

Parameters:
ga - the game
dc - the type of development card

discoveryPick

public void discoveryPick(SOCGame ga,
                          SOCResourceSet rscs)
the user picked 2 resources to discover

Parameters:
ga - the game
rscs - the resources

monopolyPick

public void monopolyPick(SOCGame ga,
                         int res)
the user picked a resource to monopolize

Parameters:
ga - the game
res - the resource

changeFace

public void changeFace(SOCGame ga,
                       int id)
the user is changing the face image

Parameters:
ga - the game
id - the image id

lockSeat

public void lockSeat(SOCGame ga,
                     int pn)
the user is locking a seat

Parameters:
ga - the game
pn - the seat number

unlockSeat

public void unlockSeat(SOCGame ga,
                       int pn)
the user is unlocking a seat

Parameters:
ga - the game
pn - the seat number

doLocalCommand

public boolean doLocalCommand(java.lang.String ch,
                              java.lang.String cmd)
handle local client commands for channels

Returns:
true if a command was handled

doLocalCommand

public boolean doLocalCommand(SOCGame ga,
                              java.lang.String cmd)
handle local client commands for games

Returns:
true if a command was handled

onIgnoreList

protected boolean onIgnoreList(java.lang.String name)
Returns:
true if name is on the ignore list

addToIgnoreList

protected void addToIgnoreList(java.lang.String name)
add this name to the ignore list

Parameters:
name - the name to add

removeFromIgnoreList

protected void removeFromIgnoreList(java.lang.String name)
remove this name from the ignore list

Parameters:
name - the name to remove

considerMove

public void considerMove(SOCGame ga,
                         java.lang.String pname,
                         SOCPlayingPiece piece)
send a command to the server with a message asking a robot to show the debug info for a possible move after a move has been made

Parameters:
ga - the game
pname - the robot name
piece - the piece to consider

considerTarget

public void considerTarget(SOCGame ga,
                           java.lang.String pname,
                           SOCPlayingPiece piece)
send a command to the server with a message asking a robot to show the debug info for a possible move before a move has been made

Parameters:
ga - the game
pname - the robot name
piece - the piece to consider

getAppletInfo

public java.lang.String getAppletInfo()
applet info


destroy

public void destroy()
destroy the applet


usage

public static void usage()
for stand-alones


main

public static void main(java.lang.String[] args)
for stand-alones


JSettlers v1.0.6 API
Built ${date}