How to use the Card 304 Software

  1. Quick guide
  2. Supported Platforms
  3. Download
  4. Installation
  5. card 304 big picture
  6. card 304 client
  7. Running a 304 server


Quick Guide

  1. did you download the software? YES
  2. did you extract it? YES
  3. good, click on start_client file..OK
  4. do you know how to play?  YES, excellent, have fun.  NO, read this manual

Supported Platforms

This software runs on any platform where Java 1.4 and Eclipse are available.  Currently the following platforms are tested.
You can get Java Runtime Environment (JRE) for your operating system from SUN's  or IBM's website.  Card304 uses JRE version 1.4.  But it should work with any JRE version above 1.4 as well.

Eclipse is a free tool available from IBM.  It also provides a small/fast graphics library for Java.  Card304 uses that library.

Download

Download from http://www.sujee.net/projects/card304/downloads/
Later on this will be moved to the Source Forge site.

When downloading, be sure to download the right package format to your platform.  Currently packages for Windows and Linux are provided.  In addition there are also bundled packages with Java for each platform.

Note :  Packages with Java RunTime have  significantly larger sizes.  Download these if you are not sure you have JRE 1.4 installed and working on your machine.  If you do have JRE 1.4 already installed on your machine, then just download the plain package (smaller and quicker download)

Installationdirectory structure

There are no special installation instructions or requirements.  Thus there is no installer.

Packages are distributed in ZIP format.  On windows use WinZip or similar program to extract it to a directory.  Unixes come with unzip command.
cd <to a dir>
unzip card304-linux-gtk-v0.6.0.zip

Once you extracted the zip file you will see a similar directory structure to this.

The sh scripts (or bat files on Windows) in main directory launch the programs.
Docs directory contains documentation (including this one)

Resources directory contains icons, images, and configuration files.


304 Big Picture

bigpicture

304 games are hosted on a server (called 304-server).  These servers 'maintain' tables and allow users to share a table.   So as a user will follow the following to play a game
  1. Find a 304 server
  2. Create a table on the server, or join an existing table.
  3. wait for other players to join
  4. play the game.

304 Client

Client Explained

Launch start_client.sh or start_client.bat.  Here is how a card-304-client program looks like (red annotations added later)

client GUI

Client GUI is a single window application.  Here is the explanation.

How to play


main window
create table
create table2
table 1
trump select
main window
create table1
create table2
joining table
trump select

  1. Refresh the server list and find a server you want to join (a look at who is logged into the server might help you to decide)
  2. Now look at what tables are on that server.  If all tables are full, create a table (Rigth click on server and choose create).  you will be asked to supply a screen name (alias).  This name has to be unique for the server. 
  3. Join a table (Right click on the table and select Join)
  4. Wait for other players to join.  When we have all four players, the game will begin
  5. First every one would be issued four cards.  Only the recipient of the first hand will be asked if he wants to accept the cards or reject it.  If he rejects, cards are reshuffled and issued again.
  6. Once every players got four cards, every one is asked to choose a Trump card.  Again this goes in order and you can over bid other players, but not your own partners.
  7. Once the trump is set, game play begins.  Players are asked to play their cards in turn, in clock wise order.

Running a 304-server

If you want to run your own 304 server for a reason (local LAN, a private server for you and friends), it is pretty easy too.  Just launch start_server file in the main directory.

You can configure some parameters to the server.  The configuration file is located  in
    <install dir> / resources / server.cfg
The config file is a straight forward text file in .ini file format.

Configuration Parameters are
    1. Port
      The default port is 3040.  If you want to change it do do in
      Port=xxxx

      Note : If you are behind a firewall or NAT setup, make sure the above port is forwarded/allowed in your router/firewall.

    2. Published Name
      If a name is given here, the server will try to contact a master server and publish its existance.  This will allow other players to 'find' your server and play on it.  If you'd like to keep your server private, leave this blank.
When you run a server, you may want to give out it's network address to your friends to login.  If your computer is connected directly to the internet, it is pretty simple.  It would be your IP address and a port number you choose (default 3040).  But mostly this is NOT the scenario.  You may be sitting behind a company firewall or a personal router.

network

The diagram above depicts a typical home network setup.  Your 304 server is sitting behind a LAN (Local Area Network) behind a personal firewall/router.  Your  machine running 304 server has a local IP address 'w.x.y.z' (i.e. 192.168.1.10).  Your cable modem has an IP address assigned by your ISP.  It could be static or dynamically assigned.  Lets assume it is 'a.b.c.d' (i.e. 216.239.57.99).  Also assume the 304 server is running on port 'p' (i.e. 3040).  Now the server address you have to give out is
             a.b.c.d : p

Also you have to setup your firewall to accept connections at port 'p' and forward them to local IP address 'w.x.y.z'

Note : If your cable modem gets IP assigned dynamically (DHCP) then your IP address might change in a few hours or in a few days.  So you have to give out new  server addresses every time you get a new IP address.  One solution for this is to use a free DNS service.  I would recommend Dynamic DNS.  It is free and easy to use.  And they also have tools that would detect the change in your IP address and automatically update the DNS.   In fact 'card304.homelinux.org' relies on 'Dynamic DNS'.

Note : Opening up a port in a firewall is a serious consideration for most corportations & ISPs.  So we would urge you NOT to run a server on corporate networks if you can avoid it.