
Installation Instructions for Poker:

Save the shar file in "SHAR". Edit out the mail headers.
mkdir pokerdir
mv SHAR pokerdir
cd pokerdir
sh SHAR

This creates a bunch of source files and a Makefile.
Edit "port.h" and enter the HOST which the daemon will be running on
and a free Internet PORT number.
This way a game can span several machines. Edit "scores.c" and enter 
a pathname where the score file can be placed.
make pokerd ; make poker
chmod 711 pokerd ; chmod u+s pokerd
"pokerd" is the daemon, which must be running in order for anyone
to play. Start it with
pokerd >log &   or    pokerd >/dev/null &
"poker" is the user interface, so chmod 711 poker (&tell people
the path to it).

What happens when the user types "poker"?
If the daemon can't be reached, "Connection refused.", else it 
waits for the hand currently being played (if any) to finish.
Then, if there are <4 people already playing, the new player
will be dealt in. If the maximum player limit is already 
reached, the new player is ignored until someone quits ("TABLE FULL").
If someone starts "poker", then kills the process, the daemon
will become confused and crash. "poker" therefore disables BREAK.


Score Info:

The player's NAME from his environment and his userid are combined
when searching the stored scores. If POKER is defined, it is used
instead of NAME. Scores are kept when a player quits
and restored when next he plays. If NAME is not set, USER is used.


Misc:

When asked for Discard:, enter 134 to throw away the first, third, and
fourth cards, (i.e. the index of the card in your hand). You may discard
from 0 to 5 cards.
^L will redraw the screen.
Sitting out and quitting both do not take effect until AFTER the current
hand is finished.



Bugs:

It will wait forever for someone to respond; this can irritate other
players.
Sometimes crashes when a client is killed.
Computer is too easy to beat.
A player can get in twice on different terminals; then whichever of him
quits last is the score that is saved.



Disclaimers:

Warranty? What warranty?
Please excuse the low quality of this "documentation".
It is being written hastily and late at night.



Complaint Department:

rochester!ritcv!jjv3345


"A blurry-eyed hacker is a happy hacker!"

-------><----------------><----------------><----------------><---------

From this line, Hong Hunsoo wrote..

I found this program at
ftp://ftp.germany.eu.net/pub/applications/games/primitive/poker

I changed the poker program to the X-window system. In my modification, I
can not assure that the random number generator which is used at the time
of shuffling the cards generates the random number randomly.  If you are
familiar to the random number generator, please check the source codes and
fix some hidden errors.

I think that the original author explained the usage of the programs
correctly.  That is, the usage of the programs that I modified is the same
that of the original programs.

Remember that the environment variable POKER_HOST determines the host name
where the pokerd is running.  In the case when you did give the first
argument of poker, that argv[1] determines the pokerd server hostname.
Otherwise the environment variable POKER_HOST determines the pokerd server
host name.

Remember also that environment variable POKER, or NAME, or USER determins
your name at the poker display.  Following c source fragment explains all.

                if ((name = getenv("POKER")) == NULL)
                        if ((name = getenv("NAME")) == NULL)
                                name = getenv("USER");

Remember that the first banner message of 'KAIST gambling Area' can be
nullified by deleting the line of px_first();

By the line of #define SCORE_FILE /usr/games/lib/POKERSCORES of pokerd.c,
the scores are saved at this file.

Remember that whenever you restarts the pokerd, the poker server program,
the saved score numbers are gone foreever by the function named
score_mkempty();  I coded like this because I thought this behaviour is
more natural.

I modified the original source code style by using following sh commands
$ sh
for a in *.c
do
	protoize $a
	indent	$a
done
$

I did not checked this program a lot, maily because program consistency
checking of a network based program can not be done easily by an individual.

If you have any questions, feel free to email me.

Hong Hunsoo
department of physics of (KAIST)
Korea Advanced Institute of Science and Technology
1997/9/2
