Commit graph

291 commits

Author SHA1 Message Date
Erik Ogenvik
3966c31fdb Allow directory for binaries to be set.
By default it will use binreloc to figure out where it's running, as
with other directories.
2015-05-28 21:22:11 +02:00
Erik Ogenvik
140d124028 Removed excessive logging. 2015-05-24 12:52:37 +02:00
Erik Ogenvik
f5d6eaf033 Make Cyphesis spawn AI clients automatically.
By default an AI child process is spawned at startup, unless the
"aiclients" config value is set to 0.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
f5dae1fba7 Rename Teleport* to Possess*
So that the functionality can be used in more general situations.
2015-05-24 11:25:06 +02:00
Erik Ogenvik
7ec0ea3dd4 Integrate signal handling with boost::asio.
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.
2015-04-10 22:00:56 +02:00
Erik Ogenvik
81a7c3f1d9 Format logging a bit better. 2015-04-10 21:58:31 +02:00
Erik Ogenvik
29b4de49dc Fixed incorrect format. 2015-04-09 10:57:35 +02:00
Erik Ogenvik
37f4f97c12 Clean up HttpCache when shutting down.
Also print some info.
2015-04-08 19:16:54 +02:00
Erik Ogenvik
3b9ceae5d6 Clean up monitors when shutting down. 2015-04-08 19:16:54 +02:00
Erik Ogenvik
18930c7957 Added explanatory text. 2014-10-01 19:45:42 +02:00
Erik Ogenvik
2f3ab1da18 Let the Domain handle sights.
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.
2014-09-15 21:11:36 +02:00
Erik Ogenvik
3b295ca0a1 Added concept of a default entity.
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.
2014-08-27 22:17:09 +02:00
Erik Ogenvik
277bf7fc10 Improve TCP/IP responsiveness. 2014-04-09 23:08:57 +02:00
Erik Ogenvik
a8956015f9 Clarify destruction order. 2014-02-17 23:22:17 +01:00
Erik Ogenvik
850fb9247b Use more canonical way to prevent io_server stops. 2014-02-08 13:53:56 +01:00
Erik Ogenvik
c3e2487979 Support boost 1.46.
io_service::stopped() isn't available in this version.
2014-02-07 16:11:42 +01:00
Erik Ogenvik
27d264f8c0 Reset the io_sevice when it runs out of work. 2014-02-07 16:03:34 +01:00
Erik Ogenvik
9ddbce3187 Fix shutdown order issue.
The io_service needs to be destroyed pretty early on in the shutdown
process, thus it's easier with a heap allocated one.
2014-02-04 20:57:09 +01:00
Erik Ogenvik
bf4b853e61 Use a timer for soft exit. 2014-02-04 16:10:22 +01:00
Erik Ogenvik
a287ca4429 Break out of io_service loop when exiting.
The io_service might be waiting inside a run_one call. This makes sure
that it exits as soon as the exit flag is set.
2014-02-04 15:56:46 +01:00
Erik Ogenvik
642faeeb28 Adapt to boost 1.46.
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.
2014-02-04 12:25:18 +01:00
Erik Ogenvik
f7b242fe8a Make the main loop more efficient.
Whenever there's no work to be done we should wait on IO. This makes the
process responsive while keeping the amount of CPU used down.
2014-02-01 21:15:53 +01:00
Erik Ogenvik
c002f4222b Removed further skstream related references. 2014-01-31 22:02:54 +01:00
Erik Ogenvik
fbf0b752c8 Removed obsolete files.
Since we're now using boost::asio for io.
2014-01-31 21:59:57 +01:00
Erik Ogenvik
5ab8868117 Remove commServer.
As we're using boost::asio for all comms now.
2014-01-31 14:01:46 +01:00
Erik Ogenvik
00d34185ab Use boost asio for idle connector. 2014-01-31 14:01:36 +01:00
Erik Ogenvik
368c18fd45 Use boost asio for Avahi. 2014-01-31 14:01:36 +01:00
Erik Ogenvik
4309206337 Use boost::asio for postgres socket. 2014-01-31 11:17:48 +01:00
Erik Ogenvik
46cde5fafe Use boost::asio for meta server client. 2014-01-30 21:40:43 +01:00
Erik Ogenvik
b53cac61d4 Use boost::asio for the Python listener. 2014-01-29 15:15:10 +01:00
Erik Ogenvik
7e5a4e2e9d Use boost::asio for the HTTP client. 2014-01-29 13:08:52 +01:00
Erik Ogenvik
f35ed7b254 Cleanup type references a bit. 2014-01-29 09:05:07 +01:00
Erik Ogenvik
2eb5481650 Use a function for starting clients.
This is more light weight than having to use factories.
2014-01-28 23:08:15 +01:00
Erik Ogenvik
051dc01bd5 Added client factory intermediary. 2014-01-28 22:29:21 +01:00
Erik Ogenvik
6e40b48e05 Use asio listeners for tcp and domain sockets. 2014-01-28 14:44:48 +01:00
Erik Ogenvik
5a602a5588 Remove domain socket on start.
This should probably be done a little better.
2014-01-25 23:22:52 +01:00
Erik Ogenvik
3d7c81bc3b Initial work on using boost::asio. 2014-01-25 20:29:45 +01:00
Erik Ogenvik
432b4d9899 Resume autoimported world.
We want the world to be in a playable state by default.
2013-11-24 23:46:27 +01:00
Erik Ogenvik
28ced0076e Adjusted logging. 2013-11-24 23:10:04 +01:00
Erik Ogenvik
a642bc29b4 Added autoimport into empty servers.
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.
2013-11-24 22:26:22 +01:00
Erik Ogenvik
a5aa7ddc90 Fix comment. 2013-11-24 21:19:11 +01:00
Erik Ogenvik
d21ec0a2fc Fix memory leak.
This doesn't really matter as the process is shut down anyway, but
having the leak messes with Valgrind.
Plus it's the right thing to do.
2013-09-12 22:27:27 +02:00
Erik Ogenvik
4f614189dc Spelling. 2013-08-22 10:47:08 +02:00
Erik Ogenvik
1a22c60669 Try to print out more info is std exception. 2013-08-22 10:45:06 +02:00
Erik Ogenvik
efada4d5ea Only send thoughts to entities with minds. 2013-08-22 10:43:03 +02:00
Erik Ogenvik
5b308280c5 Set up mind persistence through soft exit. 2013-08-22 09:54:46 +02:00
Olek Wojnar
7f9ff2246d Remove CVS $Id tags
The legacy tags are causing build issues in Debian.
2013-07-15 20:31:59 +02:00
Sean Ryan
88773d1e99 Install MetaServerAPI 1:0:0 and integrate.
Use of just MSP for packet wrangling, and then
using current form of commserver transport.  Also
added server attribute section to config.
2013-05-30 16:31:20 -04:00
Erik Ogenvik
d523b3083c Allow user to abort shutdown.
This is mainly a way to jump out of the shutdown process if it hangs.
2013-04-07 23:20:23 +02:00
Erik Ogenvik
873a6d7ffb Store and restore thoughts.
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.
2013-04-07 23:20:23 +02:00