7 CLIENT INTERACTION

7.1 VIEWS

The client knows the objects it can control ONLY via information it receives in views. Even basic information about an object, such attributes and commands available to an object are not sent to the client automatically. They must be sent explicitly via views.

In order to simplify this task we have provided a library call:

Yagga::createIntrospectionViews,

which creates a default view on the object passed as the parameter. By calling the code

Yagga::createIntrospectionViews(self);

one sends default information to the client about the calling object. Default information are, as for this version of PbML, only commands information.

Please see also the library documentation in appendix B.

7.2 COMMAND FILE

The other way of communication, from client to server, is ONLY via a command file, that lists every command the player issues to a particular object. Their format is explained in Appendix A.2.

7.3 WHAT A CLIENT SHOULD DO

A client program reads in every view in its view file, then displays the information to the player, allowing her to give hers objects commands (remember to issue a Yagga::CreateIntrospectionViews!), and recording the commands given in a command file that is to be sent back to the server.

This, of course, is the very basic behaviour. One feature that should really be implemented in a useful client, is the ability to foresee the outcome of a command. For example, if one issues the command to move from here to there to a starship, it would be useful to know how much fuel would it take.

7.4 HOW TO SET UP A STANDALONE SERVER

As far as we have explained it, Yagga is designed to run once for every turn. By mean of a command line parameter or a special directive in the config file, Yagga can be also be set up as a standalone server, that goes endlessly from turn to turn.

Each turn in yagga executes only if it finds every players' commands file. When it has found it, Yagga executes the host then goes on to the next turn and awaits for the successive batch of players' commands file.