5. Network Support
With the release of version 0.2, KPuissance4 now
support playing across the network. That means that you can play with someone
else anywhere in the world, provided that both players have access to network
(and KDE-1.1 of course). This version can also be used to play alone as
it implements the same artificial intelligence as in the normal version.
The only thing you have to do is to create a computer player before starting
to play.
The following text describes shortly the interface
of the client program and the operations to make to be able to use network
support.
5.1 Menus
There are essentially the same as the menus for
the local version (see section 4.1). There
is however a supplementary menu entry called Action
which contains the following entries :
-
start server
-
connect to server
-
disconnect from server
-
configure
-
create computer player
-
undo
-
hint
5.2 Toolbar
In comparison with the toolbar of the local version,
the toolbar of the network version contains some buttons which allow the
user to control the server, the connection and the configuration.
-
start server
-
connect to server
-
disconnect from server
-
configure
-
restart : to start a game
-
create computer player : when playing alone
-
undo
-
hint : to know what computer would do
-
quit
-
help
5.3 Server options
These options allow the user to control the server
configuration when started from the client, and to control the connection
to the server.
Note that when the server is started and/or the
client is connected to the server, some entries are disabled. You have
to disconnect from server or shutdown the server to be able to change them.
5.4 Operations
Here are the operations to be able to play KPuissance4
across the network :
-
start the client kpuissance4_client
-
start the server, either from the client or separately
with kpuissance4_server
-
connect to server : when 2 players are connected,
you will be noticed by the server
-
start the game by choosing restart
5.5 Server invocation
Here are the options when starting the server from
the command line
-
-p <port> : specify the port for socket
communication
-
-nc <cols> : speficy the number of columns
-
-nr <rows> : specify the number of rows
-
-np <puis> : specify the puissance for
the game
-
-local <path> : specify the UNIX socket
to use (for local mode)
Note : when specified, the local option overrides
any port specification.
5.6 Interface description
In addition to the normal grid, the interface contains
2 widgets :
-
debug window : where the messages received from
socket are displayed.
-
message window (bottom) : when pressing the <Enter>
the content of the edit line is sent to the other player, this message
then appears as a message box to the receiver.