World Hearts Server Version 00.01b
This is the Beta Version of World Heart Web/Game Server for Java.
This readme file includes the following,
Introduction
World Hearts Web/Game Server implements a combination of HTTP protocol
and its own Hearts game protocol to communicate with its clients. It
is so designed that the clients could be a web browser, a Java applets,
or any application that commnunicates through TCP/IP protocol.
If the client sends an http request to the server, the server works as a
web server and response with the requested documents. While if the client
sends a Hearts game message (which is embedded in HTTP format), the server
react as a World Hearts Game server and response properly based on the
request from the client. For more detail on the World Hearts' message protocol,
please see the protocol.html file under ./docs.
A regular HTTP connection is supposed to be non-persistant, but a World Hearts
Game message stays up through the whole game session.
The server is designed to work with JDK1.1
Please check out http://www.javasoft.com for more information about jdk.
System Requirements
* The server can run on any plateform that supports Java. If you are
planning to run the server on an Intel based PC, a 486 DX66 or above CPU
is recommanded. (Though it would run with even slower CPUs)
* TCP/IP socket connection. You need a valid IP address and a port
(default 80) to bind to. If you are running on Unix-like platform and wish
to run on standard port 80, super user privilege is required.
To run the server and browser client on the same machine, you can set IP to
127.0.0.1 or localhost and point your browser to http://localhost:[port]/Hearts.html
and play with the computer players on the server.
Installation
1. Make a directory where you want the server to be installed on.
2. Unzip the hserver.zip(or hserver.tar.gz) file to that directory.
After unzipping the file, you should see the following files and directories under the
./hserver directory,
- readme.1st : the readme file.
- jwhserver.properties : properties file for the server.
- server.zip : all server classes in zip format.
- applets/ : contains client applets and 2 directoris -- images/ and sound/ for applets.
- cgi-bin/ : not implemented.
- docs/ : document root.
- images/ : directory for image files.
- membersonly/ : restricted directory. use Authetication under Configuration to add users.
- robot/ : contains classes for robot player.
- servlets/ : currently not implemented.
To run the server, you need to have JDK1.1.1 or later installed on your system.
If you already have JDK on your system, you can then run the server in one of the following ways,
- under ./hserver, use -classpath option, like 'java -classpath %CLASSPATH%;.\server.zip ServerConsole ' in DOS.
- unzip all the classes in server.zip to the ./hserver directory. then run 'java ServerConsole'
Configuration
Note: please use "/" for directory separator on all plateforms.
1. Go to Setup menu and select 'HTTP'. (See SnapShot)
There are the following 5 catagories that are configurable in this section,
a. Network.
IP: specify your server's IP address
PORT: specify the port this server listens on.
Admin Mail: administer's email address.
Document Root: server's document root directory.
CGI Root: cgi programs' root directory. (not implemented)
Default Doc: Default document when no document specified in a url.
Receive Timeout: timeout for receiving request from client.
Send Timeout: timeout when waiting for sending message.
Max Number of Connections: maximum number of connections.
b. Logging
Access Log: access log's directory and name.
Error Log: error log's directory and name.
Logging Level: logging level determines how detail the server logs events.
c. Alias
Mapping from server's file system to url's.
d. MIME
MIME types.
e. Authetication
Use 'Add Doc' and 'Delete Doc' to add/delete directories for access control.
Use 'Add User' and 'Delete User' to add/delete users for the protected directories.
You can Test Access Control from here.
2. Game. (currently not configurable)
3. Properties File
The following configurable fields are in the jwhserver.properties file. You can
manually edit it or run the server and configure it by clicking the setup
menu item on the menu bar.
Using server setup is recommanded. Extra care should be taken if you manually
configure the properties file.
Here is a sample properties file,
#Properties file for World Hearts Server.
#Use '/' as separator for both DOS and Unix
#Wed Dec 03 00:39:24 PST 1997
network.port=2008
alias.3=/Java_Dev/hserver/images/\u001C/images/
alias.2=/Java_Dev/hserver/applets/\u001C/applets/
network.max_connections=8
alias.1=/Java_Dev/hserver/membersonly/\u001C/membersonly/
authDir.1=/membersonly/
alias.count=3
log.error=/temp/error.log
service.default_doc=index.html
service.cgi_root=/Java_Dev/hserver/cgi-bin/
service.doc_root=/Java_Dev/hserver/docs/
network.send_timeout=5
network.ip=127.0.0.1
network.cgi_timeout=5
mime.6=application/x-zip\u001C.zip
mime.5=image/gif\u001C.gif
mime.4=image/jpeg\u001C.jpeg
mime.3=image/jpeg\u001C.jpg
network.receive_timeout=30
mime.2=text/html\u001C.htm
mime.1=text/html\u001C.html
service.admin_email=you@mail.address
log.access=/temp/access.log
authUser.3=steveh\u001Csteveh
authUser.2=usr2\u001Cpswd2
mime.count=6
authUser.1=usr1\u001Cpswd1
log.loglevel=0
authDir.count=1
authUser.count=3
Program Execution
1. Start the Console.
under command line prompt, type 'java ServerConsole'. This should start the server
without any problem if your JDK1.1 is installed correctly.
2. Start Server.
You can click on the left most button or goto the admin menu and select the 'Start Server'
item.
3. Stop Server.
You can click on the stop button or goto the admin menu and select the 'Stop Server'
item.
4. Restart Server.
You can click on the restart button or goto the admin menu and select the 'Restart Server'
item.
5. Close All Connection.
If you want all connections to the server be dropped. Click on the Close Connections button
or goto the admin menu and select the 'Close Connections' item.
Warning: All connections to the server will be closed after you click on this option. This
includes all the game connections.
6. Show HTTP Message. (See SnapShot)
Shows http message from the client. This is mainly for debugging and monitoring browser
behavior.
Click on the left glasses button or select 'View HTTP Message' on the View menu.
7. Show Game Message. (See SnapShot)
Shows World Hearts game message. This is mainly for debugging.
Click on the right glasses button or select 'View Game Message' on the View menu.
8. Show HTTP Statistics.
Shows the HTTP hits in the previous 10 minutes time period.
9. Show Game Statistics.
Shows the Game messages count in the previous 10 minutes time period.
Trouble Shooting
1. Can't run serverconsole :
-> Check if java is in your path setting.
-> Check if CLASSPATH is correctly set.
-> If running on Unix-like platform, check if . is in your path.
2. Server can't start :
-> Check your Network TCP/IP setting.
-> Check your user privilege if you are running on Unix-based machines.
-> Check if the port has been used already.
3. Document not found retured to clients :
-> Check if the request URL is valid.
-> Check if the Document Root under Network is setup correctly.
-> Check if the document have the right permission bit set.
-> Check if the document is placed in the right directory.
Bug Reports
HTTP is a complicated protocol. The server does NOT implement all the detail in the
HTTP/1.0 specification.
I will try to make is more complete in the future server version. Due to limited resources,
We do not test the application on all the plateforms.
* Report any bugs to worldhearts@geocities.com
Describe server version, your system environment, error messages, and other informations.
have fun!