Commit graph

142 commits

Author SHA1 Message Date
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
12ed15aa98 Allow Think ops from the mind. 2015-05-26 22:22:43 +02:00
Erik Ogenvik
f9bfd991cd Fixes after merge. 2015-05-24 11:25:08 +02:00
Erik Ogenvik
cbef9864ee Use a proxy mind on character.
This is a mind which only registers the world, and then is responsible
to send what it knows about the world to any external mind that's
connected to the character.

Currently it only sends the thoughts that's been sent to the character.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
945a2dd3fe Improve external minds management.
We now register a an external mind with the ExternalMindsManager and
then let the manager make sure that there's an external mind connected.
When the external client is disconnected the manager will try to find a
new client to handle the mind.
2015-05-24 11:25:07 +02:00
Erik Ogenvik
f837532dd8 Added methods for adding and removing children.
Virtual so that they can be caught in subclasses. This is mainly meant
for the Limbo entity.
2014-09-20 22:09:00 +02:00
Erik Ogenvik
9433992096 Initial work on putting entities in limbo.
The idea is that entities which aren't externally controlled at the
moment of death are put in limbo. Once they become externally controlled
again (i.e. the user logs in) they are respawned. This ought to fix the
issue with the graveyard being full of abandoned characters.
2014-09-18 21:45:35 +02:00
Erik Ogenvik
45555fd698 Use custom format for archetypes.
This required the EntityKit to be refactored, so that most fields are
pushed into EntityFactory. Due to the nature of how the rule handlers
and the factories interact the code is pretty messy. It works, but it's
tangled and not really clean.
2013-11-15 21:39:35 +01:00
Erik Ogenvik
cb66644160 Fix segfault.
If a character a wielded an entity b, and then was destroyed, and then b
was re-containered, it would result in segfault due to a lingering
connection. This fixes it, but it's a temporary fix until we've
transferred to using "outfit" for wielding.
2013-10-25 16:39:00 +02:00
Erik Ogenvik
db2253354e Made Relay struct class local. 2013-08-21 20:54:39 +02:00
Erik Ogenvik
cb238bd5b3 Added a relay mechanism for operations.
The relay mechanism, through the new internal Relay operation, allows
one external client to relay an operation to another external client,
and get the response back.
This can currently only be used by Creator clients. It's main use is for
mind introspection.
2013-08-16 00:03:09 +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
Erik Ogenvik
9beee13a21 Send thoughts as "Thought" op.
Instead of wrapping it in a "Set" op. This is more idiomatic.
2013-04-13 23:25:16 +02:00
Alistair Riddoch
0f627d4e71 Rename methods to be more generic. 2012-12-05 09:45:16 +00:00
Alistair Riddoch
73b81a6ff7 Remove Character_parent typedef 2012-12-04 23:39:22 +00:00
Alistair Riddoch
71cbcdcfc1 Modify externalOperation to include Link
The Link reference provided is the object allowing direct communication
back to the external source of the operation. This allows us to handle
things more cleanly in some cases.
2012-12-04 20:39:35 +00:00
Alistair Riddoch
56173f3ffe Add filterExternalOperation to avoid externalOperation
externalOperation should only be called from code getting operations from
the outside world.
2012-12-03 15:37:40 +00:00
Alistair Riddoch
6057d60ff7 Add a return code to (un)linkExternalMind calls 2012-11-27 10:15:45 +00:00
Alistair Riddoch
a1dccd4767 Add a new method to handle unlinked a character 2012-11-26 21:23:33 +00:00
Alistair Riddoch
b8f46401b3 Add Character method to link avatar to client 2012-11-26 00:21:40 +00:00
Alistair Riddoch
b9a2667e35 Change m_externalMind to ExternalMind
This gets rid of the need for dynamic casts, and makes code cleaner.
2012-11-24 16:36:37 +00:00
Alistair Riddoch
558301a836 Add an Info handler to Character 2012-07-02 20:05:18 -07:00
Alistair Riddoch
111581e56a Remove obsolete m_task in Character
This pointer is made obsolete now that TasksProperty holds it
2011-12-02 02:37:42 +00:00
Alistair Riddoch
c38a8945dd Move clearTask into TasksProperty 2011-11-18 16:26:24 +00:00
Alistair Riddoch
85cce5e15e Add Actuate to those ops handled by Character 2010-11-23 14:00:38 +00:00
Alistair Riddoch
e1e039fda4 Remove obsolete includes. 2009-08-22 03:35:43 +01:00
Alistair Riddoch
76558ef3b6 Remove obsolete setTask member function. 2009-07-29 13:03:40 +01:00
Alistair Riddoch
70f25af6c8 Add a new unused method which handles all the steps of setting up a task. 2009-07-28 16:53:00 +01:00
Alistair Riddoch
188b6ecc5f Add handler for Use ops, and don't process them in the mind filter. 2009-07-24 20:18:11 +01:00
Alistair Riddoch
d291124470 Add handlers for thought and goal_info operation handlers. 2009-07-05 19:04:35 +01:00
Alistair Riddoch
0873305c5f Expose the task pointer so a property can reference it. 2009-06-17 19:31:29 +01:00
Al Riddoch
40a3bd1018 2008-12-10 Al Riddoch <alriddoch@googlemail.com>
* common/Identified.cpp, common/Identified.h, rulesets/Character.h,
	  rulesets/LocatedEntity.h, server/Account.h, server/Admin.cpp,
	  server/CommClient.cpp, server/CommClient.h, server/Connection.cpp,
	  server/Connection.h, server/ExternalMind.h,
	  server/ExternalProperty.cpp, server/ExternalProperty.h,
	  server/Lobby.h, server/Master.h, server/Peer.h,
	  server/ServerRouting.h, server/SlaveClientConnection.h:
	  Rename IdentifiedRouter to Router as it's the base class
	  for pretty much all routers.
2008-12-10 01:16:37 +00:00
Al Riddoch
4d37d77dd7 2008-12-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove an unused flag
	  used to signal a character is dead.
2008-12-07 03:51:06 +00:00
Al Riddoch
233b8bedd2 2008-11-29 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove all traces
	  of the hard coded statistics property from Character.

	* rulesets/Py_Property.cpp: Don't use Py_StatisticsProperty as the
	  default wrapper for a statistics property because it will no
	  longer work this way.

	* rulesets/Python_API.cpp: Remove the setup for the Statistics
	  wrapper.

	* rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h:
	  Change the footprint of this class so it is no longer hooked
	  into part of the Character class, and instead handles looking
	  up values from the script directly, and owns the script itself.

	* server/ArithmeticFactory.cpp, server/ArithmeticFactory.h,
	  server/EntityFactory.cpp, server/EntityFactory.h,
	  server/PersistantThingFactory.cpp: Remove setup of hard coded
	  statistics property.

	* rulesets/Statistics.h, rulesets/Statistics.cpp,
	  rulesets/Py_Statistics.h, rulesets/Py_Statistics.cpp,
	  rulesets/Makefile.am: Remove clases that are no longer used.
2008-11-29 23:17:38 +00:00
Al Riddoch
a8b1ab7c6d 2008-11-10 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.h, rulesets/Character.cpp: Replace hard coded
	  stamina value with a property.
2008-11-10 21:28:07 +00:00
Al Riddoch
5a5a0f0fa6 2008-11-10 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.h, rulesets/Character.cpp: Replace hard
	  coded maximum mass with an attribute check.
2008-11-10 21:13:06 +00:00
Al Riddoch
336ecf1486 2008-09-12 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove the setup
	  handler which used to install minds and send tick, as this is
	  all handled by properties now.
2008-09-12 14:04:15 +00:00
Al Riddoch
d261162c84 2008-05-28 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Character.cpp, rulesets/Character.h: Remove some of the
	  obsolete handlers in the filter on ops from the mind. Stop using
	  the generic IG op switch, and write a custom one.
	  Fix a bug where Use ops were getting filtered out unintentionally.
2008-05-28 19:42:35 +00:00
Al Riddoch
998e24e930 2008-03-20 Al Riddoch <alriddoch@googlemail.com>
* data/operations.xml: Add an op definition for "actuate" to be used
	  for interacting with devices and machines.

	* rulesets/Character.cpp, rulesets/Character.h: Mock up the code for
	  processing actuate operations from the client or mind.
2008-03-20 16:39:14 +00:00
Al Riddoch
adc64c3ced 2008-01-28 Al Riddoch <alriddoch@googlemail.com>
* client/BaseClient.cpp, common/BaseEntity.cpp, common/BaseEntity.h,
	  common/Identified.cpp, common/Identified.h, common/Makefile.am,
	  common/OOGThing.cpp, common/OOGThing.h, common/OperationRouter.cpp,
	  common/OperationRouter.h, rulesets/Character.h, rulesets/Entity.h,
	  rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h,
	  server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/CommClient.cpp, server/CommClient.h, server/Connection.cpp,
	  server/Connection.h, server/ExternalMind.cpp, server/ExternalMind.h,
	  server/ExternalProperty.cpp, server/ExternalProperty.h,
	  server/Lobby.cpp, server/Lobby.h, server/Master.cpp, server/Master.h,
	  server/Peer.cpp, server/Peer.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/SlaveClientConnection.cpp,
	  server/SlaveClientConnection.h: Factor out the more pointless base
	  classes, in favor of simple interface. Move destroyed signal to
	  Entity, which is the only place it is needed.
2008-01-28 23:48:30 +00:00
Al Riddoch
46e7161ff1 2008-01-06 Al Riddoch <alriddoch@googlemail.com>
* rulesets/EntityProperty.h, rulesets/EntityProperty.cpp:
	  Refactor so this property is always dynamic, and add an accessor.

	* rulesets/Character.cpp, rulesets/Character.h: Remove the hard
	  coded entity references used for wield tool, and replace with
	  a dynamic property.
2008-01-06 21:17:19 +00:00
Al Riddoch
f65cdaf5d2 2007-12-07 Al Riddoch <alriddoch@zepler.org>
* common/BaseWorld.h, common/PropertyFactory.h, rulesets/Character.h,
	  rulesets/LocatedEntity.h, rulesets/MemMap.h, rulesets/Py_Location.h,
	  rulesets/Py_Thing.h, rulesets/Python_Script_Utils.h,
	  rulesets/Statistics.h, server/Connection.h, server/EntityFactory.h,
	  server/Persistance.h, server/PersistantThingFactory.h,
	  server/Persistor.h, server/Restoration.h, server/TaskFactory.h:
	  Sort forward declarations alphabetically, because alphabetical
	  is good.
2007-12-07 01:19:16 +00:00
Al Riddoch
1f0c5d1f4d 2007-12-03 Al Riddoch <alriddoch@zepler.org>
* data/animals.xml: Give all the animals BIOMASS.

	* data/characters.xml: Add mass to some character classes that were
	  missing it.

	* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Statistics.cpp,
	  rulesets/World.cpp, server/CorePropertyManager.cpp,
	  server/Persistor.cpp, server/Persistor_impl.h,
	  server/Restorer_impl.h: Remove the hard coded mass property from
	  Entity.

	* rulesets/mason/world/statistics/Statistics.py: Fix scripts which
	  assume entities will have mass.
2007-12-03 23:18:51 +00:00
Al Riddoch
a32e84cfdc 2007-12-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp,
	  rulesets/Entity.h, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
	  rulesets/StatusProperty.cpp, rulesets/attributes.h,
	  server/CorePropertyManager.cpp, server/Persistor.cpp,
	  server/Persistor_impl.h, server/Restorer.cpp,
	  server/Restorer_impl.h: Remove the hard coded status property from
	  Entity, and the hard coded food property from character. Fix
	  the logic handling digestion and plants to use the new softer
	  properties.
2007-12-03 20:40:55 +00:00
Al Riddoch
8e8df5b482 2007-12-02 Al Riddoch <alriddoch@zepler.org>
* client/CreatorClient.cpp, client/CreatorClient.h,
	  client/Py_CreatorClient.cpp, common/BaseWorld.h, common/types.h,
	  modules/Location.cpp, modules/Location.h,
	  rulesets/AtlasProperties.cpp, rulesets/AtlasProperties.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/EntityProperties.cpp, rulesets/LocatedEntity.cpp,
	  rulesets/LocatedEntity.h, rulesets/MemEntity.cpp,
	  rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/Motion.cpp,
	  rulesets/Motion.h, rulesets/Py_Location.h, rulesets/Py_Mind.cpp,
	  rulesets/Py_Thing.cpp, rulesets/Py_Thing.h,
	  rulesets/PythonMindScript.h, rulesets/PythonScript.h,
	  rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h,
	  rulesets/Python_API.cpp, rulesets/Script.cpp, rulesets/Script.h,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/WorldRouter.cpp,
	  server/WorldRouter.h: Refactor all the entity code so there is now
	  a new base class for entities in the world simulation, and in the
	  mind which only contains things which are trully common to both.
	  This moves a lot of functionality which should not have been
	  present in mind entities away, and makes that code safer and more
	  efficient.

	* tests/TestWorld.h: Update the test world API to match the base
	  class.
2007-12-02 23:49:05 +00:00
Al Riddoch
cf29a4fb42 2007-07-02 Al Riddoch <alriddoch@zepler.org>
* common/op_switch.h, rulesets/Character.cpp, rulesets/Character.h:
	  Strip all the negative matching out of the filter for operations
	  going from world to mind, instead only dispatch those that pass, or
	  need to be checked.
2007-07-02 21:11:08 +00:00
Al Riddoch
f8aefa673a 2007-06-28 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/custom.cpp,
	  common/op_switch.h, rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/Character.h, rulesets/Thing.cpp, rulesets/Thing.h,
	  tests/EntityExerciser.h: Remove the long obsolete Action op from
	  the core code.
2007-06-27 23:59:02 +00:00
Al Riddoch
4c1f099eef 2007-06-28 Al Riddoch <alriddoch@zepler.org>
* common/op_switch.h, common/BaseEntity.cpp, common/BaseEntity.h,
	  rulesets/Character.cpp, rulesets/Character.h: Remove Cut operation
	  from the core code.
2007-06-27 23:37:23 +00:00
Al Riddoch
31b9c029cb 2007-06-22 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/op_switch.h,
	  rulesets/Character.cpp, rulesets/Character.h: Remove the chop
	  operation completely from the core code. Remove some OOG
	  operations from the world to mind filter, as they should never
	  occur.

	* rulesets/BaseMind.cpp, rulesets/Plant.cpp: Remove some obsolete
	  operation header includes.

	* tests/EntityExerciser.h: Remove Chop from the test for entity.
2007-06-25 18:53:38 +00:00
Al Riddoch
5b69541c95 2007-06-22 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/op_switch.h,
	  rulesets/Character.cpp, rulesets/Character.h, rulesets/Food.cpp,
	  rulesets/Food.h, rulesets/World.cpp, rulesets/World.h,
	  tests/EntityExerciser.h: Purge the burn operation from the core
	  operation handling code. One down, many still to go.
2007-06-22 12:56:33 +00:00