Commit graph

84 commits

Author SHA1 Message Date
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
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
664988645e Make all properties define type and optional name. 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
c23b322ead Use "add" and "remove" for flags.
Since it's more descriptive.
2018-04-25 20:15:28 +02:00
Erik Ogenvik
4d530e25e4 Move domain property Entity.
And rename and fixup smaller things.
2017-07-25 23:40:39 +02:00
Erik Ogenvik
0286bcd47d Replace "parents" with "parent". 2017-07-24 15:05:18 +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
615db49b2b Fixed incorrect setting of flags. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
220e6895b0 Fixed incorrect flag checking.
Which resulted in entities not being properly stored.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
b56c6ee40e Improve logs. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
894a8389b0 Added signal emitted when property is updated.
Used to let other components listen to properties being altered.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
5754a5dfa1 Initial work on Bullet powered physical domains. 2016-12-15 18:27:42 +01:00
Olek Wojnar
9e1b3b92c3 Fix typos
Courtesy of lintian
2016-09-06 22:29:36 -04:00
Erik Ogenvik
3ee07ea63c Removed build warning. 2015-05-28 22:23:12 +02:00
Erik Ogenvik
3b70e9c3cb Regularly persist thoughts to database.
Instead as before only persisting at shutdown.
2015-05-26 22:27:39 +02:00
Erik Ogenvik
74bb437540 Fixed tests. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
0171538dc9 Fixed incorrect restoration of props.
The overloaded modProperty method in Entity creates a new instance
property automatically from any type property, which is something we
have to take into account.
2015-04-08 23:24:26 +02:00
Erik Ogenvik
2344c73837 Quote monitor tags. 2015-04-05 22:17:25 +02:00
Erik Ogenvik
ea59b13819 Fix possible segfaults. 2014-09-30 23:36:10 +02:00
Erik Ogenvik
311fc9cd2f Fixed issues with tying accounts to entities.
Since entries in the database tying entities to accounts only can be
created if the entity already is created in the database we need to make
sure the relation in "accounts_entities" isn't created until the entry in
"entities". This is done by letting the StorageManager handle it.
The way to interface between the Persistance and the StorageManager
classes isn't obvious, so we'll have to do it by signals.
2014-09-20 22:13:49 +02:00
Erik Ogenvik
368b9f8642 Make sure to also set type properties for restore. 2014-09-18 21:45:35 +02:00
Erik Ogenvik
dccaec3c41 Don't set default attributes when restoring.
When we're restoring from storage we don't want to apply any properties
at all when the entity is created, since we'll do that ourselves in a
later pass. This is done by submitting an invalid RootOperation pointer.
2014-09-15 21:11:35 +02:00
Erik Ogenvik
f46a1104d8 Reordered restoration order.
We now first create all of the entities, in order, but without setting
any properties. Once that's done we then go through all entities again,
in order, and set their properties. This is to make sure that
1) We don't set any properties until all child entities are created.
This is crucial for things like outfits to work.
2) We first set the properties of the parent, and then the properties of
the children. This is crucial for things like terrain modifiers to work.
2014-09-09 20:46:30 +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
2fd2e51d89 Avoid segfault. 2014-06-02 22:15:48 +02:00
Erik Ogenvik
0f9ecdc74e Improve property restoring code.
Add extra checks to make sure that pre-existing properties aren't
installed or applied unless the data has changed.
2014-02-18 20:38:23 +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
8a80f8e2e3 Fix issue with restoration of entities.
It's important that the order is correct. In order for properties which
refer to other entities (like the "outfit" property) to work the
children must first be restored before the properties are restored.
2013-11-11 15:43:18 +01:00
Erik Ogenvik
efada4d5ea Only send thoughts to entities with minds. 2013-08-22 10:43:03 +02:00
Erik Ogenvik
65dba3c5d6 Added feature for async mind persistence.
This is done through the MindInspector which queries entities for their
minds, and asynchronously emits a signal when thoughts arrive.
2013-08-21 20:56:09 +02:00
Erik Ogenvik
a17839f8fe Use Think and Commune for thoughts. 2013-08-14 00:06:25 +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
Erik Ogenvik
1d62c0f8fa Persist containment changes. 2013-06-15 22:54:09 +02:00
Erik Ogenvik
88740dd726 Enable location updates of persisted entities. 2013-06-15 22:46:52 +02:00
Erik Ogenvik
1fa16defff Only print if something changed.
To make the log a little more readable.
2013-06-15 22:23:17 +02:00
Erik Ogenvik
eaa85d2f0c Make sure parent entities are informed.
We must make sure that the parent entity is informed of new child
entities. This is needed in order for minds to be correctly restored.
2013-04-21 11:25:07 +02:00
Erik Ogenvik
3e8207993a Send Sight when restoring entities.
This is needed to make sure that the entity's mind is aware of itself.
2013-04-20 17:56:24 +02:00
Erik Ogenvik
18e3778dd6 Don't check for character type.
As we'll instead are sending a message to the entity.
2013-04-13 23:32:06 +02:00
Erik Ogenvik
9beee13a21 Send thoughts as "Thought" op.
Instead of wrapping it in a "Set" op. This is more idiomatic.
2013-04-13 23:25:16 +02: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
3d6f39cdee Modify Property install method to take name
This change also switches DecaysProperty to using delegates as a proof of
concept.
2013-02-13 00:45:36 +00:00
Alistair Riddoch
4a9c7078f7 Refactor to use LocatedEntity as base class
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
2013-01-17 10:17:07 +00:00
Alistair Riddoch
2b26bdf9ca These don't need consts any more 2011-12-20 15:49:18 +00:00
Alistair Riddoch
e0c92ebf39 Remove reference to BaseWorld in EntityBuilder 2011-09-21 12:45:18 +01:00
Erik Hjortsberg
1a99d07383 Fixed a segfault when a type is missing when restoring an entity.
We'll instead log an error and skip that entity, as this is an expected
situation when authoring the world.
2010-03-02 13:07:26 +01:00
Alistair Riddoch
d52550a9e3 Rename Monitor class tree to Variable for clarity. 2009-09-03 00:38:50 +01:00