Erik Ogenvik
d128e1c406
Properly shut down the io_service.
...
We previously got hangs and errors when shutting down.
2018-05-22 22:47:11 +02:00
Erik Ogenvik
4ee75f5665
Vacuum sqlite db with interval (25 min).
2018-05-19 23:52:16 +02:00
Erik Ogenvik
86318d5f6e
Make database persistence standard.
...
We now use sqlite to persist the world by default.
Postgresql support is provided as an option.
2018-05-19 23:33:58 +02:00
Erik Ogenvik
b0cf29b18d
Use SQLite 3 for persistence.
...
Instead of storing data in Postgres we store it by default in SQLite,
using an in-process database.
This makes setup and handling much easier.
2018-05-19 21:47:24 +02:00
Erik Ogenvik
4e788e90c7
Separate out Postgres specific parts.
2018-05-16 21:48:18 +02:00
Erik Ogenvik
66baf9c9dc
Stor all rules as files only.
...
We should only store entities and accounts in the database.
2018-05-16 11:22:09 +02:00
Erik Ogenvik
f1785bd9b9
Reload python modules all at once.
...
To prevent inconsistencies when multiple file changes.
2018-05-10 01:15:35 +02:00
Erik Ogenvik
6e62796876
Reload rules in a better manner.
2018-05-10 00:21:30 +02:00
Erik Ogenvik
5b282419be
Finalize conversion to Python 3.
2018-05-07 11:15:26 +02:00
Erik Ogenvik
701d1a7208
Initial work on porting to Python 3.
2018-05-07 11:15:26 +02:00
Erik Ogenvik
e80d07560c
Reload entity scripts when python code changes.
...
For now we reload all scripts. We should be smarter and only reload
those scripts which are affected though.
2018-04-30 23:34:58 +02:00
Erik Ogenvik
7b0849d224
Enable assets manager.
2018-04-27 23:12:15 +02:00
Erik Ogenvik
7ae19d5038
Use Singleton base class.
...
I.e. make sure that all objects have a defined life time. This requires
that we actually set up and tear down the singletons.
2018-04-25 20:15:29 +02:00
Erik Ogenvik
283733225f
Added assets manager with file observation.
...
Initial code for a manager which automatically reload assets, rules and
scripts.
2018-04-25 20:15:29 +02:00
Erik Ogenvik
fd4cc2dfb7
Added "assets-download" build target.
...
This will download the Ember assets from amber.worldforge.org.
2018-02-06 13:45:11 +01:00
Erik Ogenvik
e7fa53214b
Use nullptr instead of NULL.
2018-02-06 13:45:11 +01:00
Erik Ogenvik
7fb146eb36
Standardize installation of standard types.
...
This way the base types are exposed to clients.
2018-02-06 13:45:10 +01:00
Erik Ogenvik
e43fbbea7f
Don't set "ipv6_only".
...
This seems to throw exceptions.
2017-08-13 17:16:02 +02:00
Erik Ogenvik
88aef433a4
Listen to both ipv6 and ipv4.
2017-08-08 13:59:53 +02:00
Erik Ogenvik
e9ce696dd7
Open sockets earlier in startup.
...
So we also fail earlier.
2017-06-24 21:46:48 +02:00
Erik Ogenvik
5e8d20a020
Use correct types.
2017-05-27 20:27:48 +02:00
Erik Ogenvik
7aaa9b9ba7
Optimize includes.
2017-03-19 21:36:52 +01:00
Erik Ogenvik
1067a4af5b
Shut down in correct order.
...
To avoid invalid reads.
2016-12-15 18:27:42 +01:00
Olek Wojnar
d9edddbb71
Remove obsolete buildTime/buildDate system
...
The __TIME__ and __DATE__ macros were interfering with reproducible builds.
2016-09-04 15:35:21 -04:00
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