Commit graph

139 commits

Author SHA1 Message Date
Erik Ogenvik
889695af07 Provide const domain accessor. 2016-06-22 17:29:27 +02:00
Erik Ogenvik
6c7001724f Fixed typos. 2015-04-28 20:54:30 +02:00
Erik Ogenvik
4a43d78de6 Monitor the number of active entitites per type.
This is very useful for monitoring, as it allows us to recognize
problematic patterns.
2015-04-08 19:16:54 +02:00
Erik Ogenvik
f7c43f00ed Allow multiple delegates per operation.
Previously we only allows one delegate per operation. The one that was
installed first was called; all subsequent were ignored. This doesn't
work well with how we're moving to putting more and more functionality
in properties though, so we'll have to allow for multiple delegates per
operation.
I'm not entirely happy of how this currently works. We now just call all
of the delegates, in stochastic order. If any delegate blocks the
operation it doesn't prevent other delegates from getting it too.
But perhaps that's the only way to do it without adding additional
complexity.
2014-09-18 21:45:35 +02:00
Erik Ogenvik
79d6bda7b2 Properly remove properties with delegates. 2014-08-26 21:09:02 +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
835b9fadd6 Alter containered signal.
Make it not single shot. And supply the old location, as it was before
the container changed.
This is to make it more useful in general.
2013-06-15 22:53:50 +02:00
Alistair Riddoch
5eceba40cf Remove unused handler mechanism 2013-02-14 10:01:20 +00:00
Alistair Riddoch
9748d30fb4 Add calling delegates. 2013-02-10 02:37:16 +00:00
Alistair Riddoch
4a9c7078f7 Refactor to use LocatedEntity as base class
All IG code should use the interface of LocatedEntity when dealing
with any entity, rather than sometimes requiring Entity. Add virtual
functions to the interface where required, and modify all other interfaces
to stop them using Entity. This makes the code way cleaner, and much better
de-coupled.
2013-01-17 10:17:07 +00:00
Alistair Riddoch
4e66987bad Consolidate flags into one place 2013-01-14 09:59:54 +00:00
Alistair Riddoch
75d3705170 Add some property setAttr checks 2013-01-13 13:13:47 +00:00
Alistair Riddoch
52eb7c099a Cover map properties 2013-01-06 13:14:10 +00:00
Alistair Riddoch
8b53f5e041 Add interface for property delegates 2013-01-05 00:47:41 +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
5d06a0195c Add handlers for Get and Info to the core interface 2012-06-29 14:54:45 -07:00
Alistair Riddoch
a51fe0fae0 Return the property affected when setAttr is called 2011-02-27 23:56:11 +00:00
Alistair Riddoch
693feafbc0 Make outputting a Location to a stream entirely deterministic. 2010-09-16 04:44:45 +01:00
Alistair Riddoch
ea1be625e5 Modify setProperty to return a pointer to the new property 2009-11-16 03:14:08 +00:00
Alistair Riddoch
ad9b80c6a6 Remove obsolete include. 2009-08-22 03:39:52 +01:00
Alistair Riddoch
379a687776 Add Use operations to those passed around by default in-game. 2009-07-24 15:43:44 +01:00
Alistair Riddoch
2611d9d0f3 Call install and apply on new properties 2009-06-18 18:43:14 +01:00
Alistair Riddoch
98aee17cf0 Add a check so that printing Location doesn't segfault 2009-05-19 00:25:20 +01:00
Alistair Riddoch
8ded02b089 Add method to get the movement domain for an Entity 2009-05-12 23:27:40 +01:00
Al Riddoch
c6ab940214 2008-11-17 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Correct a FIXME about leaking a property
	  when requiring one of a given type.

	* tests/PropertyFlagtest.cpp: Add a note for test coverage that
	  will be required.
2008-11-17 01:06:54 +00:00
Al Riddoch
91cd73f9e1 2008-10-14 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.cpp, rulesets/Entity.h: Add a doc group for
	  Entity flags, and document them all in it.
2008-10-14 01:31:39 +00:00
Al Riddoch
b168817f85 2008-10-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Properly document propery modification
	  functions.
2008-10-01 20:41:55 +00:00
Al Riddoch
a80f85e85a 2008-10-01 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Make all the
	  property access functions that should never be used to modify a
	  property const. Remove requirePropertyClass() as it pretty much
	  can't be const.

	* rulesets/Entity.cpp, rulesets/Entity.h: Make overriden
	  getProperty() const as it is in the base class. Add new
	  property access functions for code that needs to modify the
	  properties which ensures class properties never get modified
	  through the Entity interface.

	* rulesets/Character.cpp, rulesets/Plant.cpp, rulesets/Py_Thing.cpp,
	  rulesets/TerrainModProperty.cpp, server/CorePropertyManager.cpp:
	  Change all the code that accesses properties to use the right
	  functions.
2008-10-01 18:20:57 +00:00
Al Riddoch
8b4ad25540 2008-09-30 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Update a doc comment.
2008-09-30 20:30:29 +00:00
Al Riddoch
351058f34c 2008-09-13 Al Riddoch <alriddoch@googlemail.com>
* data/basic.xml, data/characters.xml, data/mason.xml: Add tick
	  properties to a bunch of entity classes so they no longer need
	  a setup operation to get them going.

	* rulesets/mason/world/objects/Weather.py,
	  rulesets/mason/world/objects/elements/Fire.py,
	  rulesets/mason/world/objects/plants/seeds/Apple.py: Remove setup
	  handlers from a bunch of scripts as it is now handled by
	  properties.

	* data/buildings.xml: Add setup property to entity classes which
	  really need a setup op at startup.

	* client/BaseClient.cpp: Send a look when creating the avatar, so
	  that notifications get back without the need for a special case.

	* common/op_switch.h, rulesets/Creator.cpp, rulesets/Entity.cpp,
	  rulesets/Entity.h, server/WorldRouter.cpp:
	  Remove the setup operation sent to all entities on startup by
	  default. Get rid of some special cases that depended on it.

	* rulesets/InternalProperties.cpp, rulesets/InternalProperties.h:
	  Make the tick property schedule the operation on apply(), and
	  use the property value as the time to schedule it.
2008-09-13 18:02:08 +00:00
Al Riddoch
4dde75493a 2008-09-08 Al Riddoch <alriddoch@googlemail.com>
* common/inheritance.cpp: Set the instance pointer to null on
	  deletion, so it can be cleanly instanced again.
2008-09-08 11:49:22 +00:00
Al Riddoch
77856d0fd6 2008-09-03 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Add a new flag for ephemeral entities.
2008-09-03 20:30:42 +00:00
Al Riddoch
952568e699 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Make flags protected, and add convenient methods
	  to set and clear flags. Add a flag for indicating that the entity
	  is queued for a storage update.

	* rulesets/Entity.cpp: Reset the clean flag correcly when the entity
	  is made dirty.

	* server/StorageManager.cpp: Hook up Entity::updated, and implement
	  queueing things for update and making sure they only get added once.
2008-08-22 15:44:55 +00:00
Al Riddoch
187ef8fcd9 2008-08-22 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Move entity flags to the top of the header.
	  Replace destroyed and perceptive booleans with flag values,
	  and re-work check methods accordingly.

	* rulesets/Entity.cpp, rulesets/Creator.cpp, rulesets/Character.cpp:
	  Ensure that destroyed and perceptive flags are used correctly.
2008-08-22 03:00:38 +00:00
Al Riddoch
15faa7a6d7 2008-08-21 Al Riddoch <alriddoch@googlemail.com>
* rulesets/attributes.h: Remove old attribute flags used for
	  persistence from the build.

	* rulesets/Entity.h: Replace obsolete update flags with a more
	  general flags field, and define three needed to track the
	  cleanness of basic location data.

	* rulesets/Plant.cpp, rulesets/World.cpp: Remove now unused update
	  flags from property initialisation.

	* rulesets/Entity.cpp, rulesets/Thing.cpp, server/EntityFactory.cpp:
	  Replace code which updated update flags with simpler changes to
	  the new flags field.
2008-08-21 17:10:38 +00:00
Al Riddoch
b9e5f8d79f 2008-08-17 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.h: Add onUpdated() virtual method to be
	  called when the attributes of an Entity are changed.

	* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/LocatedEntity.cpp,
	  rulesets/Thing.cpp, server/WorldRouter.cpp: Implement onUpdated()
	  to emit the updated signal on Entity, and change all code to
	  call onUpdated instead of emiting the signal.
2008-08-16 23:21:06 +00:00
Al Riddoch
74ba744157 2008-03-26 Al Riddoch <alriddoch@googlemail.com>
* common/Actuate.h, common/Makefile.am, common/custom.cpp,
	  common/op_switch.h, common/operations.cpp: Add Actuate to the
	  cyphesis core custom operations.

	* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Character.cpp:
	  Add handlers for Actuate to the operation routing interface.

	* data/devices.xml: Add example device.

	* data/Makefile.am: Add new devices file.

	* data/operations.xml: Remove temporary soft Actuate definition.
2008-03-26 01:34:15 +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
ef88f10e33 2008-01-17 Al Riddoch <alriddoch@googlemail.com>
* common/BaseEntity.cpp, common/BaseEntity.h: Remove generic operation
	  routing code.

	* common/op_switch.h: Remove all OOG operations from the standard
	  op switch.

	* rulesets/Entity.cpp, rulesets/Entity.h: Replace generic operation
	  routing with a more specific IG routing implementation.

	* rulesets/BaseMind.cpp: Add a mind specific operation router
	  implementation.

	* server/Account.cpp, server/Account.h: Remove handling of Login,
	  which should never got to Account. Add base handler for Get,
	  as it needs to be overriden in Admin.
2008-01-17 18:54:04 +00:00
Al Riddoch
1b18d233e4 2008-01-07 Al Riddoch <alriddoch@googlemail.com>
* rulesets/Entity.h: Remove an obsolete include.
2008-01-07 00:22:53 +00:00
Al Riddoch
c362fd4e70 2008-01-06 Al Riddoch <alriddoch@googlemail.com>
* rulesets/LocatedEntity.cpp, rulesets/LocatedEntity.h: Add a virtual
	  function that is called when the location of an entity changes.

	* rulesets/Entity.cpp, rulesets/Entity.h: Implement the virtual
	  function called when location changes and use it to call the
	  containered signal. Remove the containered_oneshots list, and
	  make containered inherently one shot only.

	* rulesets/OutfitProperty.cpp: Remove the use of containered_oneshots
	  is this mechanism is obsolete and has been removed.
2008-01-07 00:06:18 +00:00
Al Riddoch
0ccb03b1f6 2007-12-24 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp, rulesets/Entity.h, rulesets/LocatedEntity.cpp,
	  rulesets/LocatedEntity.h: Remove raw atlas attributes, and use
	  properties for everything, cutting down the differences in
	  interface.

	* rulesets/Py_Thing.cpp, rulesets/Thing.cpp: Remove code that accessed
	  soft attributes directly.
2007-12-24 00:32:11 +00:00
Al Riddoch
94e6a0505a 2007-12-04 Al Riddoch <alriddoch@zepler.org>
* rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/Entity.cpp
	  rulesets/Entity.h: Remove the scriptSubscribed methods which
	  were empty and unused.

	* rulesets/Python_API.cpp, rulesets/Python_Script_Utils.h: Remove
	  Subscribe_Script() as it is useless now.

	* server/ScriptFactory.cpp: Remove call to Subscribe_Script().
2007-12-04 00:03:59 +00:00
Al Riddoch
dafe0ec0a2 2007-12-03 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h, rulesets/LocatedEntity.h: Update the doc strings
2007-12-03 23:55:11 +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
4c523c78c0 2007-12-02 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.h: Make the attribute interface virtual.

	* rulesets/LocatedEntity.cpp: Add in basic implementatios without
	  properties of the attribute interface.
2007-12-02 20:53:50 +00:00
Al Riddoch
bd3a9e153c 2007-11-28 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/CharacterClient.cpp,
	  client/CharacterClient.h, client/CreatorClient.cpp,
	  client/CreatorClient.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Thing.cpp,
	  rulesets/World.cpp, server/Account.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Persistor.cpp,
	  server/Persistor_impl.h, server/Restorer_impl.h,
	  server/WorldRouter.cpp: Remove the hard name attribute, now that
	  most entities don't set it.
2007-11-28 20:22:42 +00:00