Class Cards304Server

java.lang.Object
  extended by Cards304Server

public class Cards304Server
extends java.lang.Object

This Cards304Server class represents the server actoins of this network based 304 card game. This class is mostly used to send and recieve messages to the and from the client class.


Nested Class Summary
private  class Cards304Server.ClientHandler
          This ClientHandler class is to run Thread and listen to client messages.
 
Field Summary
private  java.util.ArrayList clientOutputStreams
           
private  int gameId
           
(package private)  Game[] games
           
private  int playerId
           
 
Constructor Summary
Cards304Server()
          Constructor method of this Cards304Server class.
 
Method Summary
 int getGameId()
          This method returns gameId
 int getPlayerId()
          This method returns playerID
 void go()
          This method is to setup the network connection with Card304Client class.
static void main(java.lang.String[] args)
           
 void takeAction(java.lang.String srvMsg)
          This method is to take action for all the client messages.
 void tellEveryone(java.lang.String message)
          This methos is to brodcast a message to every clients.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

games

Game[] games

gameId

private int gameId

playerId

private int playerId

clientOutputStreams

private java.util.ArrayList clientOutputStreams
Constructor Detail

Cards304Server

public Cards304Server()
Constructor method of this Cards304Server class. Creates games array object and initiates the functionalities by calling go method.

Method Detail

getGameId

public int getGameId()
This method returns gameId

Returns:
int gameId

getPlayerId

public int getPlayerId()
This method returns playerID


go

public void go()
This method is to setup the network connection with Card304Client class.


tellEveryone

public void tellEveryone(java.lang.String message)
This methos is to brodcast a message to every clients.

Parameters:
message - String message to be sent to every clients.

main

public static void main(java.lang.String[] args)

takeAction

public void takeAction(java.lang.String srvMsg)
This method is to take action for all the client messages.

Parameters:
srvMsg - String server message.