The restart capability


Version 2.10 (or later) is not compatible with earlier releases.

In order to restart a game automatically, the moves need to be recorded in the restart database. This must consist of a relational database (called chushogi by default, but any valid name can be used), running on any database software that has a driver for JDBC (Java DataBase Connectivity) level 2.0. Such a database is PostgreSQL, which is available free for most O/Ses (even Mac OS) from http://www.postgresql.org.

First you need to install the database. I carried out the following activities on my RedHat Linux 6.2 system using PostgreSQL 6.5.3:

  1. I installed PostgreSQL by changing to the RPMS directory on my RedHat installation CD, and typed rpm -i postgresql*.
  2. I added /usr/lib/pgsql6.5-1.2.jar to the CLASSPATH. (This is the JDBC driver. It must be present in the CLASSPATH for the program to connect to the database).
  3. Then I started the postmaster: /etc/rc.d/init.d/postgres start
  4. Then I became user postgres and issued the createuser command for the userid under which Chu Shogi would run (I allowed this user to create databases, and be a superuser (the latter is probably not necessary).
  5. Then I logged on as that user, and issued a createdb chushogi command. (This automatically gives the user the required priviledges, so no GRANT commands need be issued. other databases may be different).

When you select the Settings->Internet->Wait for a connection option (or Wait on an alternate port), and someone attempts to connect , then the program automatically detects whether or not the restart database is available. In order for it to do this sucessfully, the database must be running (e.g. on Linux, you must do a postgres start), and the settings must be correct. You can alter the settings from the Settings->Internet->Database access option. This starts a Dialog, with the following fields:

User id
This is the id by which the user is known to the database (check your database documentation, if you are in doubt - in the SQL command: GRANT UPDATE ON tablename TO userid, that is the userid that is used.) The default is the Java System property, user.name. This corresponds to the logon-id on a Linux system.
Password
This is the password which you use to authenticate the User id to the database system. Check your database documentation - on my system it corresponds to the normal logon password.

The default setting is the empty string. If you do not change this, then you will be prompted for a password whenever someone attempts to connect. Your response to this prompt will not be saved if you subsequently do a Settings->Save Settings. This is to avoid storing un-encrypted passwords in property files. If you are confident (or just don't care) about your system's security, then you can change the default setting, so you will not have to reply to a prompt every time you play.

On POSIX systems (such as Linux), it is reasonably safe (if you trust your System Administrator(s)!) to just issue a chmod 600 chu.Properties command. Then only you yourself (or someone, such as a System Administrator, who knows the root password) will be able to read this password.

JDBC Driver
This is the name of the JDBC driver for your database. Consult your database documentation. The default is the name of the driver shipped with PostgreSQL 6.5 and later.
Database URL
This is the URL for the database system to which you are going to connect. The default is jdbc:postgresql://localhost/chushogi . This means connect to PostgreSQL, via a JDBC driver, on the local machine (it is possible to connect to a database on a remote machine, and this is indeed what I do - I do not run PostgreSQL on my Internet gateway machine, though I do have to have the JDBC driver installed there). The format is:

jdbc:subprotocol:subname

Where:

  1. jdbc is mandatory
  2. subprotocol depends upon the JDBC driver, for PostgreSQL it is postgresql. For others, see your JDBC driver documentation.
  3. subname depends upon the JDBC driver. For PostgreSQL, the format is one of:
    • database
    • //host/database
    • //host:port/database

    The default corresponds to the middle form (that is, use the database named chushogi on the local host, using the default port for PostgreSQL). You may call the database anything you like, but chushogi seems a sensible deafult.

None of these settings are saved automatically, so you should do a Settings->Save Settings, once you have got it right.

Back to Playing on the Internet

Top