Commit graph

322 commits

Author SHA1 Message Date
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
Erik Ogenvik
b4572d67e6 Moved operation dispatch to separate class.
So it can better be reused.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
766f4e361b Apply time multiplicator when calculating time. 2015-04-09 13:44:46 +02:00
Erik Ogenvik
ec9cad7eab Update monitors after ops have been handled. 2015-04-09 10:57:45 +02:00
Erik Ogenvik
4e9419c564 Make sure to always process any immediate ops first.
We need to check for immediate ops in each iteration, since these might
have been added as a result of the last op.
2015-04-08 23:25:11 +02:00
Erik Ogenvik
d2d4d4ba2f Use for each iteration. 2015-04-08 19:16:54 +02:00
Erik Ogenvik
49e4e26bd6 Update monitors at more correct time. 2015-04-08 19:16:54 +02:00
Erik Ogenvik
e05c35dea6 Fixed issue with queue altered while iterating.
If the operation results in more operations being pushed onto the
queue, this can in some cases invalidate the reference, leading to
segfaults.
2015-04-08 19:16:53 +02:00
Erik Ogenvik
65a1cff8f2 Print queue ops in debug mode. 2015-04-06 00:57:13 +02:00
Erik Ogenvik
a93bd55199 Add metrics for operations queue size. 2015-04-05 22:04:30 +02:00
Erik Ogenvik
23e9eb8ff8 Fixed issue with not checking domain. 2014-09-15 21:11:36 +02:00
Erik Ogenvik
dbf1a9e345 Let the Domain determine broadcast visibility. 2014-09-15 21:11:36 +02:00
Erik Ogenvik
b171410b05 Let the domain be specified by a property.
This means that we only attach domains to entities that have the
"domain" property. The "land" entity type for example.
2014-09-15 21:11:35 +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
d0d7690cfb Removed obsolete method. 2014-02-04 12:25:49 +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
79c7a6f057 Fix issue with stale time values.
Don't keep the time in field, updated only at poll requests. Instead
calculate it when it's needed.
This fixes an old bug where all client movements were slightly
incorrect. The time was only recalculated at WorldRouter::poll calls. However,
when polling for IO the process waited up to 100 milliseconds. That
meant that any client received operation would get an on average 50
milliseconds offset in it's registered time. The result of this was that
most Move operations would be slightly incorrect, resulting in jerky
movement.
2014-02-01 20:24:45 +01:00
Erik Ogenvik
64deae5519 Fix slightly incorrect op counting.
The op count was increased even if there was no ops to dispatch.
2014-01-31 23:22:18 +01:00
Erik Ogenvik
18d5bccf14 Use std::queue instances for the op queues.
Since they are queues after all.
2014-01-31 23:20:22 +01:00
Erik Ogenvik
226c3f601b Removed some minor redundancy. 2014-01-31 23:12:27 +01:00
Erik Ogenvik
312a7efedd Use a priority queue for operations.
Since they are sorted by seconds anyway a priority queue is more
suitable.
2014-01-31 23:04:33 +01:00
Erik Ogenvik
6bcfcb2c11 Moved spawn filtering to Account. 2014-01-24 12:29:25 +01:00
Erik Ogenvik
10364de724 Only send spawn points with character_types.
I.e. those spawn points which allows for characters to be created.
2014-01-24 08:54:36 +01:00
Erik Ogenvik
9307b0dfc6 Fixed issue with invalid spawn points.
Since the queues weren't queues until after the destructor had run,
there was a risk of a spawn entity being deleted later on, leading to it
referencing invalid spawns since m_spawns weren't cleared.
2014-01-21 21:05:49 +01:00
Erik Ogenvik
88000ef7cc Fixed memory leak. 2014-01-20 18:38:36 +01:00