Commit graph

996 commits

Author SHA1 Message Date
Erik Ogenvik
eb81c7eecb Use "git describe" for buildid.
Also removed circular dependency as well as CVS leftover script.
2016-06-22 17:06:50 +02:00
Erik Ogenvik
524952a30a Always catch by ref. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
69c9980d9f Added another debug specialization. 2016-03-19 23:05:13 +01:00
Erik Ogenvik
37bcfbd4db Handle Atlas API changes. 2016-03-18 20:07:23 +01:00
Erik Ogenvik
f363df3012 Added some more debug logging functions. 2015-10-31 16:10:24 +01:00
Erik Ogenvik
86bea785a9 Default to not use binreloc.
By default we don't want to use binreloc for setting the paths
dynamically. Instead this can be enabled through the command line
argument "--cyphesis:dynamicpaths=true".
We don't envision cyphesis will be distributed as a binreloc package
much. Using a container format such as Docker seems more plausible.
2015-07-15 11:31:34 +02:00
Erik Ogenvik
d3b9d1788b Use Atlas 0.7. 2015-06-04 21:41:27 +02: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
74bb437540 Fixed tests. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
6f8424422b Get all entity rules first.
This is needed in order for types to work. Note that we currently can't
handle dynamically changing rules; we get all rules up front. This will
have to do for now though.
2015-05-24 11:25:08 +02:00
Erik Ogenvik
dd352ec759 Refactor ai client to use op dispatch. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
f9bfd991cd Fixes after merge. 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
f8932858fd Enable aiclient.
The idea is that the aiclient runs in a separate process and handles all
AI functionality.
This is done by having a "possession" client which recieves possession
requests from the server, and spawns new AI clients for each request.
2015-05-24 11:25:06 +02:00
Erik Ogenvik
a2813a22f4 Added operation for requestion possession.
This is meant to be sent to an AI client so that it can possess a mind.
2015-05-24 11:25:06 +02:00
Erik Ogenvik
c21a3d8c7c Store instance property data separately.
In some cases you want to store property data for each instance. Often
you'll use member data on the entities themselves for this. But in some
cases you don't want to bloat the entity class with data for seldomly
used properties.
In these cases you can instead use the PropertyInstanceState class, and
keep a static instance of this per property.
2015-04-28 20:56:15 +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
4927359009 Don't allocate memory in signal handlers. 2015-04-09 13:44:26 +02:00
Erik Ogenvik
20bed69d51 Added function for printing ops to streams.
Useful when debugging.
2015-04-06 00:56:25 +02:00
Erik Ogenvik
a93bd55199 Add metrics for operations queue size. 2015-04-05 22:04:30 +02:00
Erik Ogenvik
e932f3464c Added http endpoints for numerical monitors.
This is useful for time series databases which only operates on
numerics.
2015-04-05 21:53:28 +02:00
Erik Ogenvik
85193b4991 Clarify that the second argument is microseconds. 2014-10-01 22:48:22 +02:00
Erik Ogenvik
efaadab385 Fixed issue with polling.
There was an issue where the polling loop would be called continously,
resulting in 100% cpu usage.
2014-10-01 22:42:19 +02:00
Erik Ogenvik
10de08034b Implmented proof of concept limbo property.
When a player controlled entity is deleted, and the player currently
isn't controlling it, it's placed in limbo. When the player once more
connects and start controlling it, the entity is respawned.
This prevents the world from being littered by inactive player
characters.
2014-09-18 21:45:35 +02:00
Erik Ogenvik
901259469a Call slightly faster version. 2014-09-15 21:11:35 +02:00
Erik Ogenvik
61cc42e98c Detect disconnects and shut down connection. 2014-09-10 19:59:08 +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
79d6bda7b2 Properly remove properties with delegates. 2014-08-26 21:09:02 +02:00
Erik Ogenvik
d8bd6147e5 Avoid memory allocation in segfaults.
When reporting the segfault we can't allocate any memory, since the
stack might have become corrupted. Using std::string allocates memory,
so we'll opt for the lower level fprintf().
2014-06-04 10:27:44 +02:00
Erik Ogenvik
14a054622b Added explicit instantiation for integers. 2014-05-01 11:29:03 +02:00
Sean Ryan
1494e74e02 Fix a few small issues with updates.
Convert readVariable to const and adjust accordingly.
Adjust tests and callers of readVariable accordingly.
2014-03-25 13:39:38 -04:00
Sean Ryan
7df22f14e8 Add readVariable method to monitors.
Inquiries into the monitors, that is variables that
have a monitor attached to them, can be done on a
individual key, rather than getting the entire
lot and parsing them.
2014-03-24 16:37:15 -04:00
Erik Ogenvik
6aa36e6bc2 Fixed incorrect time calculation.
When using posix_time with boost::asio one can't use local_time
directly.
2014-03-05 18:47:10 +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
a0ab8aa59d Reset the io_service if it's stopped after run_one. 2014-02-07 16:07:55 +01:00
Erik Ogenvik
6caffb14de Handle interleaved writes.
Since the streambuf instance will be invalidated by anything written to
it while it's being sent using an async call we need to use multiple
streambuf instances.
2014-02-06 13:38:32 +01:00
Erik Ogenvik
6e53159d71 Properly separate write and read buffers. 2014-02-04 22:24:27 +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
19fbeb26aa Check socket existence when polling. 2014-02-04 12:25:18 +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
2210d320c5 Removed further references to now removed classes. 2014-02-03 12:21:35 +01:00
Erik Ogenvik
3b7a3a44a6 Remove references to skstream. 2014-02-02 22:04:10 +01:00
Erik Ogenvik
826288c4fc Use boost::asio in clients. 2014-02-02 22:04:10 +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
86188fbad0 Adapt CommSocket to boost::asio. 2014-01-31 21:51:04 +01:00
Erik Ogenvik
96b02656e1 Make sure memory is properly released. 2014-01-20 23:07:22 +01:00
Erik Ogenvik
5b96570547 Call "remove" when removing properties.
Since some properties are class properties without any state we need to
add a "remove" method to call, rather than putting cleanup logic in the
destructor.
2013-11-24 20:23:45 +01:00
Erik Ogenvik
ce25a1d231 Added method for removing spawn points. 2013-11-24 15:01:38 +01:00