Skip to content
Rubykuby edited this page Dec 9, 2014 · 6 revisions

XML Protocol

OK

This command is simple, and is the only command that the front-end ever has to send. It must only ever be sent AFTER a command is finished.

<Simulation>
    <Ok>
        <id>$message_id</id>
    </Ok>
</Simulation>

Create

This command is called on a date when a transporter is meant to arrive. It looks like this:

<Controller>
    <id>$message_id</id>
    <Create>
        <Transporter type=$transporter_type identifier=$identifier>
            <Container>
                ...
            </Container>
            <Container>
                ...
            </Container>
            ...
        </Transporter>
    </Create>
</Controller>

where Container looks like:

<Container>
    <iso>$iso</iso>
    <owner>$owner</owner>
    <xLoc>$xLoc</xLoc>
    <yLoc>$yLoc</yLoc>
    <zLoc>$zLoc</zLoc>
</Container>

When caught by the frontend, create the transporter and its containers, but DO NOT attach the transporter to rootNode. Add it to a queue of sorts until an Arrive message comes in.

After the transporter and its containers are created and added to a queue, return an OK message.

Arrive

This command tells a created transporter to be spawned, and arrive at its depot.

<Controller>
    <id>$message_id</id>
    <Arrive>
        <transporterId>$unique_transporter_id</transporterId>
        <depotIndex>$depot_index</depotIndex>
    </Arrive>
<Controller>

The depot index is self-explanatory. In the case of a train, there is only one depot index. In the case of inland ships, two. Here are the exact amounts of depots per transport types as defined by the backend:

depots.put("vrachtauto", new Transporter[20]);
depots.put("trein", new Transporter[1]);
depots.put("binnenschip", new Transporter[2]);
depots.put("zeeschip", new Transporter[1]);

An OK message is sent AFTER the ship arrives at its destination, not while it is still moving.

Clone this wiki locally