Commit graph

346 commits

Author SHA1 Message Date
Erik Ogenvik
b509b8b11d Don't load server rules in client. 2018-12-16 23:20:33 +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
f87233cd53 Clean up code. 2018-10-30 19:35:57 +01:00
Erik Ogenvik
e0b45800ef Fix broken tests. 2018-10-29 21:11:23 +01:00
Erik Ogenvik
92f44c0df2 Fixed issue with admin property.
Needs to be is_admin to not collide with "admin" type.
2018-10-06 13:42:06 +02:00
Erik Ogenvik
86f4820a38 Refactor aiclient main loop.
We now use a totally boost::asio based loop. As a result the client
now plays along with other asio based components. Other clients are
broken currently though, needs to be fixed.
2018-09-25 23:30:03 +02:00
Erik Ogenvik
6459ae4818 Separate main loop code into own class.
To be shared between server and client.
2018-09-22 23:11:22 +02: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
cf29a1607d Improve logging. 2018-08-11 23:25:38 +02:00
Erik Ogenvik
983e9d4e0f Don't broadcast all ops. 2018-08-11 15:23:09 +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
a95cb467a2 Use std::move where possible. 2018-08-04 18:01:20 +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
7634969eef Removed TaskFactory classes.
Since we always create Tasks from scripts.
Also fixed a lot of tests.
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
07438be29d Fixed bug with not adding to parent. 2018-07-25 19:48:19 +02:00
Erik Ogenvik
7edaae44d2 Store all entities as Refs in base world. 2018-07-25 13:01:33 +02:00
Erik Ogenvik
ba539df70e Use PyCXX throughout. 2018-07-23 16:43:39 +02:00
Erik Ogenvik
e23e6e1251 Use Refs wherever possible. 2018-07-23 11:03:18 +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
ce55a2f6ed Workaround for non-existing property.
This should be fixed so that removed properties are called with "remove"
for all entities that they've been installed on.
2018-07-13 17:10:28 +02:00
Erik Ogenvik
7895d1b0aa Reload minds when python code changes.
All thoughts are first persisted and then restored.
2018-05-01 22:23:31 +02:00
Erik Ogenvik
d4604d034d Correctly handled updated type properties.
When a type is updated we now property re-apply modified properties on
affected entities.
2018-04-29 17:21:44 +02:00
Erik Ogenvik
0f1559ba16 Reload types when they change. 2018-04-29 11:59:33 +02:00
Erik Ogenvik
09090a6446 Emit Change op when a type changes. 2018-04-27 23:12:15 +02:00
Erik Ogenvik
705b691ff5 Make "Account::operation" send directly to link. 2018-04-25 21:05:59 +02:00
Erik Ogenvik
f283ffbafb Communicate type changes to all clients. 2018-04-25 20:15:29 +02:00
Erik Ogenvik
36cbf54578 Remove unused code. 2018-02-20 22:26:27 +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
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
b40c613a78 Improve handling of broadcasts.
Use the domains for determining broadcasts.
2017-06-24 21:47:43 +02:00
Erik Ogenvik
b9cdbbbd1a Handle inventory domain better. 2017-06-12 18:01:52 +02:00
Erik Ogenvik
7aaa9b9ba7 Optimize includes. 2017-03-19 21:36:52 +01:00
Erik Ogenvik
0a133c75bc Handle broadcasts earlier.
Instead of handling broadcasts when the op is dispatched, handle them
when the op is first added to the world router.
This way we can better handle the case where an entity is deleted, as well
as make away with storage of perceptibles entities in the world router.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
fd34c235e4 Remove "transforms" and "modespec" property.
These properties didn't work out when we moved to a physics based world.
Instead we've introduced the properties "planted-offset" and "planted-scaled-offset".
These properties takes a float and specified vertical offset for planted entities.

Likewise with "planted-rotation" which specifies a rotation applied for planted entities.
"active-rotation" keeps track of any applied rotation.
2016-12-15 18:27:42 +01:00
Erik Ogenvik
5c665ca0d4 Rename method with changed meaning. 2016-12-15 18:27:42 +01:00
Erik Ogenvik
b77bfbe013 Remove old functionality for adjusting height. 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
Erik Ogenvik
8cfe2ba0eb Altered signature to prevent ambiguity. 2016-06-26 20:13:31 +02:00
Erik Ogenvik
ca3588041a Affect position directly.
No need to use an external transform for this kind of
ajustment.
2016-06-26 20:13:31 +02:00
Erik Ogenvik
d5d11df11e Let "transforms" property determine pos and orient
Instead of directly setting position and orientation we've now
added a "transforms" property. This property contains zero or many
transformations. The result of these is what drives changes to an
entity's position and orientation.
By cleanly separate disrete transformations we can more easily undo
or alter them. This allows us to do things where the position or
orientation of an entity is affected by other properties, or other
entities.

The client protocol is intact. Changes to position and orientation is
still sent the same way, by specifying "pos" and "orientation". However,
these values will now not be written directly to corresponding values on
 the entity. Instead they will first be written to the "transforms" property,
with the final values being a result of combining all data in the property.
2016-06-26 19:11:15 +02:00
Erik Ogenvik
d7bf27d180 Take plantable adjustment into account.
When an entity which is "planted" is adjusted, we also look
for if there's any offset specified for the height adjustment.
2016-06-26 19:08:54 +02:00
Erik Ogenvik
e9513169e6 Start visibility test from observer for broadcasts. 2016-06-22 17:29:27 +02:00
Erik Ogenvik
4f368a6fbc Let parent domain decide visibility and movement.
When visibility is determined, we always query the parent domain, and
never any ancestor domain.

The idea is to make the system more easy to follow.
2016-06-22 17:29:27 +02:00
Erik Ogenvik
dd352ec759 Refactor ai client to use op dispatch. 2015-05-24 11:25:08 +02:00