Commit graph

280 commits

Author SHA1 Message Date
Erik Ogenvik
ed6246d86d Rename Teleport* to Possess*
So that the functionality can be used in more general situations.
2014-06-04 10:27:49 +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
Alistair Riddoch
215766ba4b Remove unused Entity.h include 2013-01-18 19:50:49 +00:00
Alistair Riddoch
95b078249a Rename database variable for disambiguation 2012-08-13 20:01:27 +01:00
Alistair Riddoch
d948e097f3 Add a new class for cleaner local clients 2012-07-31 23:42:35 +01:00
Alistair Riddoch
121137c490 Make template more flexible 2012-07-31 23:32:22 +01:00
Alistair Riddoch
e54995056d Use TCP listener factory for dynamic ports too 2012-07-25 21:34:20 +01:00
Alistair Riddoch
9cfc20606c Open the main listen socket with the factory
We now are listening correctly on dual stack!
2012-07-24 17:01:10 +01:00
Alistair Riddoch
c80adab634 Move code for listening into a factory class 2012-07-24 16:51:12 +01:00
Alistair Riddoch
b7bbf9f013 Remove debug output 2012-07-24 08:39:12 +01:00
Alistair Riddoch
96d42785c5 Switch to shared_ptr so listeners can share factories 2012-07-24 08:35:33 +01:00
Alistair Riddoch
83118ef6b7 Naive first pass dual stack listening
Make use of new skstream functionality to open two listen sockets on the
same port, one of each stack. This way is better than opening a single
socket for multiple stacks, as it is more portable.
2012-07-20 16:21:31 +01:00
Alistair Riddoch
7f15f86e54 Remove unused header 2012-07-20 01:13:34 +01:00