de.kosi
Class ComputerPlayerClient

java.lang.Object
  |
  +--de.kosi.AbstractClient
        |
        +--de.kosi.ComputerPlayerClient
All Implemented Interfaces:
FoyerListener, java.rmi.Remote

public class ComputerPlayerClient
extends AbstractClient

Establishes a connection between the Oz computer player and the KOSI server. Currently logs in and waits to be invited.

Author:
KoSI Bidding-/Playing Group

Constructor Summary
ComputerPlayerClient()
          Creates a new ComputerPlayerClient.
 
Method Summary
 void invite(Table table, User byUser, int direction)
          This method will be called if another user invites the user who registered this listener to take a seat at a specific table.
 void invite(Tournament tournament)
          This method will be called if another user invites the user who registered this listener to take part in a specific tournament.
static void main(java.lang.String[] args)
          Main method
 void notify(Game game)
          A call of this method notifies the user who registered this listener that he is currently playing the given game.
 void notify(Table table)
          A call of this method notifies the user who registered this listener that he is currently sitting at the given table.
 void notify(Tournament tournament)
          This method will be called if another user invites the user who registered this listener to take part in a specific tournament.
 void ping()
          This method is used for ping signals.
 
Methods inherited from class de.kosi.AbstractClient
connect, disconnect, disconnectFromServer, getFoyer, login, logout
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComputerPlayerClient

public ComputerPlayerClient()
Creates a new ComputerPlayerClient.
Method Detail

ping

public void ping()
This method is used for ping signals. If the call of this method fails (throws an exception) the associated user's connection will be concerned as lost.
Overrides:
ping in class AbstractClient
Following copied from interface: de.kosi.model.FoyerListener
Throws:
java.rmi.RemoteException - If the remote call of this method fails.

notify

public void notify(Table table)
A call of this method notifies the user who registered this listener that he is currently sitting at the given table. This might be necessary if the user interimely lost his connection and its client got confused.
Parameters:
table - The table the user is currently sitting at.

notify

public void notify(Game game)
A call of this method notifies the user who registered this listener that he is currently playing the given game. This might be necessary if the user interimely lost his connection and its client got confused.
Parameters:
game - The game the user is currently playing.

notify

public void notify(Tournament tournament)
This method will be called if another user invites the user who registered this listener to take part in a specific tournament. (How do you get the inviter's nickname???)
Parameters:
tournament - The tournament the user gets invited to.

invite

public void invite(Table table,
                   User byUser,
                   int direction)
            throws java.rmi.RemoteException
This method will be called if another user invites the user who registered this listener to take a seat at a specific table. Only table owners may invite other users, so you get the inviter by the table's getOwner() method.
Parameters:
table - The table the user gets invited to.
Throws:
RemoteException - If the remove call fails.

invite

public void invite(Tournament tournament)
This method will be called if another user invites the user who registered this listener to take part in a specific tournament. (How do you get the inviter's nickname???)
Parameters:
tournament - The tournament the user gets invited to.

main

public static void main(java.lang.String[] args)
Main method
Parameters:
args[0] - port number of the computer player server
args[1] - KoSI server name
args[2] - login name
args[3] - password