Commit graph

99 commits

Author SHA1 Message Date
Erik Ogenvik
80afd7ce96 Supply default value when modifying. 2018-12-18 23:38:31 +01:00
Erik Ogenvik
e85f0831b2 Restructure rule classes.
Classes under "rulesets" have been moved to "rules", and split up into
futher subdirectories matching their library. As a result we can now
better separate the python bindings, so that things that belongs to the
simulation are separeted from things that belongs to the ai.
2018-10-31 21:38:35 +01:00
Erik Ogenvik
800d6f3d2c Put operations in separate directory. 2018-10-30 20:12:45 +01:00
Erik Ogenvik
038437bcaf Escape ' characters for SQLite. 2018-10-30 19:50:09 +01:00
Erik Ogenvik
599095bfd4 Improve handling of visibility for types. 2018-08-19 17:15:30 +02:00
Erik Ogenvik
139d229f80 Sync Python method names with C++. 2018-08-17 22:04:07 +02:00
Erik Ogenvik
6a3ec31b7e Remove Character class.
This is crucial since it now means that any entity can be controlled by
a mind. This makes the world much more versatile.
2018-08-14 22:25:56 +02:00
Erik Ogenvik
c84f5fe926 Don't implicitly convert from Ref to ptr.
Since it's too easy to introduce subtle bugs.
2018-08-05 20:47:09 +02:00
Erik Ogenvik
a12b1a00a3 Delete when refs go to zero.
This changes how entities are dereferenced to work more like you would
expect.
2018-08-05 14:36:21 +02:00
Erik Ogenvik
04fe84821e Use proper singletons everywhere.
I.e. ones where the lifespan is fully controlled.
The only exception is Options, since it's accessed during static
initialization.
2018-08-04 18:01:20 +02:00
Erik Ogenvik
092d122be2 Separate flags into own class.
Also allow broadcast to respect visibility.
2018-07-30 13:07:43 +02:00
Erik Ogenvik
43c3f6eb3d Better logging. 2018-07-29 19:52:24 +02:00
Erik Ogenvik
7edaae44d2 Store all entities as Refs in base world. 2018-07-25 13:01:33 +02:00
Erik Ogenvik
80d347993d Rename EntityRef to WeakEntityRef.
To mark that it's a weak ref.
2018-07-22 23:51:33 +02:00
Erik Ogenvik
e6bc7b2790 Use Ref for handling ref counting.
All LocatedEntities should always be handled through Ref instances.
These makes sure that the ref counting is correctly handled.
2018-07-22 23:48:42 +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
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