When a signal is caught we want to exit from the boost::asio loop.
However, we can't do this by pusing another handler onto the io_service,
since this will involve a malloc call, and this can cause a deadlock (if
the signal handler is invoked from within a malloc call).
Therefore we instead need to use the signal_set functionality of
boost::asio, which guarantees that signal handling is done without
issue.
As any world can contain multiple domains, we let the domain handle the
sights calculations.
This is a change from how this previously was done, as previously
sight checks were only done for the top level World entity. This has
changes however, so that sights checks now are done for all entities.
When determining whether an entity can be seen, the system first checks
the size of the entity against the distance from the observer. If this
check fails, the system makes exceptions if the entity in case is
outfitted or wielded.
Instead of the root entity always being the default one (for new
entities being created etc.) we now can specify another entity which is
the default one.
Since we're targetting the latest LTS release of Ubuntu as a nice
baseline, and that currently only supports 1.46, we need to remove the
nice steady_timer code. For now.
This commit should probably be reverted once a newer version of Ubuntu
LTS is available.
When the server is run it checks if it's empty. If that's true, and the
cyphesis:autoimport variable is set (which it is by default), and the
file it points to exists, the server will spawn a new process which will
call on the "cyimport" tool to import the world specified.
The effect of this is that when cyphesis is run for the first time, it
will automatically populate the world into a playable state. This should
allow for a much better user experience, since many users never manage
to properly populate the world.
Note that we're spawning a separate process to run the cyimport command.
We could as well just do the importing in-process, but that would
require some more coding. Using a separate process if good enough, so
that will do for now.
Currently thoughts are only stored when the server is shut down. A more
proper way would probably be to query character and store their thoughts
at regular intervals while the simulation is running.