Commit graph

14 commits

Author SHA1 Message Date
Erik Ogenvik
56caaaeee9 Persist thoughts to server at regular interval.
Every 30 seconds the thoughts are persisted to the server, by sending a
Think op which wraps a Set op with the name of "persistthoughts".

An improvement to this would be to only send these ops when the thoughts
actually have changed.
2015-05-26 22:28:14 +02:00
Erik Ogenvik
dd352ec759 Refactor ai client to use op dispatch. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
0347c257b8 Handle possession without blocking. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
10684226b4 Handle entities being destroyed and remove minds. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
6b55383125 Keep a reference to the mind entity.
That way we'll make sure that it won't be destroyed while we have a
reference.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
932392ef09 Removed account handling code.
As we're reusing the account managed by the PossessionClient.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
faf8b0ea2d Alter to use one single connection.
Let the possession client and all of the AI clients use one single
connection. This makes it a bit simpler than having each mind use a
separate account and connection.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
d6b04f7989 Ignore dis- and appearence ops for account. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
a6d3bef031 Correctly handle initial sight of own entity. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
a77778bbc8 Make sure ops to mind are handled correctly. 2015-05-24 11:25:07 +02:00
Erik Ogenvik
8139af72ba Let the AI process handle ticks.
The server should never send Tick operations to the clients; these are
only to be used for world simulation (i.e. things growing, movement
etc.). Any mind code should be handled by the AI process itself, with
the amount of computation being done totally at its discretion.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
0daa0909c5 Fix incorrect op handling in MindClient. 2015-05-24 11:25:06 +02:00
Erik Ogenvik
8d39f81f58 Create BaseMind instances to handle minds. 2015-05-24 11:25:06 +02:00
Erik Ogenvik
ac946c417c Create MindClients per mind.
I.e. the PossessionClient will spawn new MindClients for every mind that
needs controlling.
2015-05-24 11:25:06 +02:00