A FILE FORMAT

A.0 CONFIG FILE

This is the main configuration file of Yagga.server.MultiGame. If no config file exists Yagga exits.

The config file can contain comments (/* */, //, #) and its entries are in the form <param> "=" <value> on a single line:

Multi value params (marked with "[MV]") can have the form

<param> "=" <value> , <value>... on a single line or the same entry can appear multiple times in the conf. file with one or more values.

Usually values are paths and filenames.

If a boolean value is required it can be "on" "off" "true" or "false".

Valid params are:

ServerRoot

if specified indicates the root of every relative path found in the config file and in the players file. Absolute paths are treated as they should, i.e. as absolute paths. Only relative paths are affected by the ServerRoot value.

NextConf

if specified tells yagga to immediately execute another turn after the current one has successfully executed. Next turn info is located in the config file specified by NextConf. Use this directive to set up a server that waits endlessly for user commands.

//just one of this two directives

PbMLFile [MV]

files with a PbML world

PbMLDirectory

directory containing all (and only) the PbML files of the world (not yet impl.)

//just StatusFile or OldStatusFile AND NewStatusFile

OldStatusFile

file with old status of Yagga's world

NewStatusFile

file where new status of Yagga's world will be written

StatusFile template file name whre status is to be written and read.

Files will be numbererd by yagga. This information is also used by Yagga to retrieve the current turn number. For example, if StatusFile = test.data, yagga will look for the latest file of the tipe "yagga.XXX.data" and will write the next turn's data in test.XXY.data. If the latest file (regarding the file version written in the file name) is test.016.data, the new turn will be written to test.017.data.

PlayersFile

specifies the players' data file

PlayerFileNumbering (boolean)

specifies wether players files (command files and views files) are to be numbered or overwritten each turn. Default is on.

PhasesFile

specifies the file with phases Turn (integer) forces Yagga to execute the turn specified, regardless of the number of the turn found in the name of the status file. Use with caution!!

ProtoTableFiles [MV]

ProtoDataFiles [MV]

specifies files with prototype definition. the first directive indicates table like files, the latter free form data files. Please see appendix A.4 for these files' syntax.

DebugFile

specifies the debug file where the Yagga::debug() command will write debug information. If no debug file is specified this information will be written to STDERR.

LibClasses [MV]

specifies the Java classes whose methods can be used in PbML code as library call. The classes should be fully specified, e.g. "com.mysoft.utility.FormattedPrinter". Please see appendix C for detail on how to integrate PbML and Java.

Default value is :

java.lang.Math, yagga.lib.Yagga, yagga.custom.Sys

If no config file is given Yagga looks for the default "yagga.conf" file.

 

A.1 PLAYERS DATA

Player information is stored in the file named after the value specified in the PlayersFile directive in the config file.

First line gives column names, then each line contains three values:

<player name> <player command file> <player view file>

Example:

PlayerName File ViewFile
player1 player1.cmd player1.view
player2 player2.cmd player2.view
mike player3.cmd mike.view

A.2 PLAYER COMMANDS

Player commands are stored in a file named after the value specified in the PlayersFile file.

A command file is just a sequence of commands, one per line. Order is not important since commands are executed during their specific phases.

The arguments to the commands can be: numeruci, the boolean literals true/false or string or list of scalar values.

To put a list of values (provided the command in the pbml has a parameter of type list) put braces around values. No literal values can be passed as arguments, i.e. reference to objects. Only scalar values.

A command file is divided into sections: each section list commands to a particular object.

[<object_name>]
<command_name>(params);
/* commands there*/

Example:

/* Commands */
[nave1]
Com1(78);
changeGear(true);
[nave2]
Com1(738);
TakeOff("L.A.",8,false);

Shout("Airl009",("aaaa","bbbb","cccc")); //note list of scalar values

 

A.3 VIEW FILE

Views are stored in a file named after the value specified in the PlayersFile file.

A view file is just a collection of views. Each view is related to an object:

<object_name>]
{pairs...}
{pairs...}
....

Example:

[m2]
{ type=introspection
gear=0
max=5
fuel=10
}
{
//other views, pairs number 2
}
...
[onj009]
{
//pairs... number 3
}
{
//pairs number 4
}

Each view is related to the last object (from top to bottom) whose id is found between square brackets.

So, in the example above, pairs number 3 and 4 are related to the object whose id is "onj009".

A.4 PROTOTYPES FILES

Prototype file can have two formats: table file and data file.

Both type of file can be used, but table files have some restrictions, whereas data file are more complex and more powerful.

Prototype names can be specified as quoted strings or not quoted if they don't enclose space.

They must be unique, even among different classes.

A.4.1 TABLE FILE

A table file can be used to define prototypes with only scalar attribute assignment.

One can only define prototypes of object belonging to a single class in a given prototype table file.

The format is:

class_name attrib_name1 ... attrib_name_N
proto_name_1 value11 ... value1N
...      
proto_name_M valueM1 ... valueMN

Comments are not allowed, empty lines can be used.

A.4.2 DATA FILE

Data file are more complex. One can define several prototype belonging to different classes, and can assign values to objects, list of objects, devices and list of devices, scalars and list of scalars.

The format is:

[class_name proto_name1]
attrib1=value1
...
object1=proto_name_i
...
devices3<=proto_name_j1,.... proto_name_jM
...
list_numbers<=1,45,12231,4.04,6
[other_class_name proto_nameN]
attrib1=value1
...
object1=proto_name_l
object2=proto_name_l2
objects4<=proto_name1a, proto_name2a, proto_name3a
...
devices3<=proto_name_j1,.... proto_name_jM
...

Comments (/* */, //, #) are allowed as are empty lines.

Please note the following: