Commit graph

168 commits

Author SHA1 Message Date
Al Riddoch
5360789b4d 2005-09-19 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Report if entities have velocity on
	  creation.
2005-09-19 20:07:30 +00:00
Al Riddoch
f2a739734a 2005-09-14 Al Riddoch <alriddoch@zepler.org>
* client/ClientConnection.cpp: Improve error reporting when
	  unexpected object arrives from server.

	* rulesets/Character.cpp: Invert test so that tool use op arguments
	  are now set correctly.

	* rulesets/Entity.cpp: Use proper entities to handle responses to
	  Create and Look ops.

	* server/Connection.cpp, server/EntityFactory.cpp: Improve error
	  reporting using String::compose.

	* server/EntityFactory.cpp: Invert test so that all custom ops
	  now don't fail to get installed. Ensure that custom ops that
	  need to wait for their parent a properly inserted into the
	  waiting queue.
2005-09-13 23:29:42 +00:00
Al Riddoch
5fd6bc0abd 2005-09-12 Al Riddoch <alriddoch@zepler.org>
* common/inheritance_impl.h, common/inheritance.h,
	  common/inheritance.cpp, common/custom.cpp: Get rid of the op
	  factory feature of inheritance, as its not required.

	* server/EntityFactory.cpp: Register op types defined in the
	  data into the Atlas factory rather than the old inheritance
	  factory mechanism.
2005-09-12 01:33:53 +00:00
Al Riddoch
9ef58988e3 2005-09-11 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp: Remove handling of
	  LOC attribute from readFromEntity() as every use of this function
	  has differen requirements.

	* rulesets/MemMap.cpp: Implement setting LOC so that the minimum
	  of lookups in the world dictionary are required.

	* server/EntityFactory.cpp: Implement setting LOC in a much simpler
	  way, as its always uninitialised at this point.

	* client/BaseClient.cpp: Add a note that LOC is currently unhandled,
	  as there is nothing sane to do with it.
2005-09-11 01:43:29 +00:00
Al Riddoch
372ddf5271 2005-09-10 Al Riddoch <alriddoch@zepler.org>
* modules/Location.cpp, modules/Location.h: Add a new method to
	  read location data from an Atlas Entity.

	* rulesets/MemMap.cpp, server/EntityFactory.cpp, client/BaseClient.cpp:
	  Switch to using new function rather than Entity::getLocation.

	* rulesets/Entity.h, rulesets/Entity_getLocation.h: Remove obsolete
	  getLocation method.
2005-09-10 10:28:45 +00:00
Al Riddoch
84b04428eb 2005-09-08 Al Riddoch <alriddoch@zepler.org>
* rulesets/Entity.cpp: Update copyright date.

	* rulesets/BaseMind.cpp, rulesets/Entity_getLocation.h,
	  rulesets/Entity.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Py_Map.cpp, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/WorldRouter.cpp,
	  client/BaseClient.cpp, client/CreatorClient.cpp:
	  Change various methods to pass entity information
	  around as RootEntity rather than MapType.
2005-09-08 15:03:31 +00:00
Al Riddoch
42e1c99565 2005-08-30 Al Riddoch <alriddoch@zepler.org>
* common/AtlasFileLoader.cpp, common/Database.cpp,
	  common/FormattedXMLWriter.cpp, common/Property.cpp,
	  common/accountbase.cpp, rulesets/Character.cpp,
	  rulesets/Entity_getLocation.h, rulesets/MemMap.cpp,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp,
	  rulesets/Py_Object.cpp, rulesets/Thing.cpp,
	  server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
	  server/WorldRouter.cpp, tools/AdminClient.cpp, tools/cycmd.cpp,
	  tools/cyconvertrules.cpp: After an Element has been checked
	  with isFoo(), it is more efficient to get its value using Foo()
	  rather than asFoo() which repeats the check.
2005-08-30 20:43:19 +00:00
Al Riddoch
fdd316b628 2005-08-27 Al Riddoch <alriddoch@zepler.org>
* Port whole code base to Atlas-C++ 0.6 series. Main server binary
	  now links.
2005-08-27 14:52:12 +00:00
Al Riddoch
9b76a9c3a7 2005-05-18 Al Riddoch <alriddoch@zepler.org>
* data/basic.xml, data/mason.xml: Add objtype to all rules.
	  Add a rule for ignite operation definition.

	* common/custom.cpp: Remove hardcoded ignite operation definition.

	* server/EntityFactory.cpp, server/EntityFactory.h: Remove some debug
	  output. Add new code to allow op_definitions to be installed as
	  rules.

	* common/inheritance.cpp, common/inheritance.h: Return an error code
	  when a type without parents gets installed, rather than throwing an
	  exception.

	* tests/inheritancetest.cpp: Fix test so it no longer expects an
	  exception.

	* rulesets/mason/world/objects/clothing/Garment.py: Remove some
	  debug output.

	* tools/AdminClient.cpp: Remove hardcoded objtype, depending instead
	  on objtype from the data file. Fix a bug where the full rule
	  was not getting uploaded when updating an existing rule.
	  Improve error reporting when update fails.
2005-05-17 23:51:26 +00:00
Al Riddoch
b29802ef4a 2005-05-16 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Implement updating default attributes
	  and other metadata when types are modified from the client.

	* server/ScriptFactory.cpp: Handle errors that occur when reloading
	  modules. Store the new module correctly.

	* tools/AdminClient.cpp, tools/AdminClient.h: Change behavoir of
	  cyaddrules so it updates types that have already been installed.
	  Requires adding a set op types that have already been uploaded
	  or updated, to ensure that types in a base ruleset don't override
	  the one already in the server.
2005-05-16 01:23:17 +00:00
Al Riddoch
2074741d06 2005-05-15 Al Riddoch <alriddoch@zepler.org>
* server/ScriptFactory.h: Add accessor for script package.

	* server/EntityFactory.cpp, server/EntityFactory.h: Move code that
	  adds data to a factory into a separate function so it can
	  potentially be called from elsewhere.
2005-05-15 22:52:13 +00:00
Al Riddoch
02fb039b4d 2005-05-15 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Implement reloading scripts when
	  a client asks to modify an installed type.

	* server/Admin.cpp: Re-order checks when client asks to modify
	  an installed type, so the client doesn't have to set the parents.

	* tools/cycmd.cpp: Add a reload command which causes the server
	  to update an existing type, thus reloading its script if it has
	  one.
2005-05-15 20:32:29 +00:00
Al Riddoch
8b5f80510b 2005-05-15 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, server/EntityFactory.h: Add a public
	  method to allow the attributes of an installed type to be
	  modified.

	* server/Admin.cpp: Correctly handle Create ops from client
	  to install new types from the client rather than Set.
	  Leave Set available as a legacy feature. Allow Set to be
	  used to modify the attributes of an existing type.

	* tools/AdminClient.cpp, tools/AdminClient.h: Clean up headers,
	  move constructor and destructor into the .cpp file,
	  and make better use of using. Send Create ops instead of Set
	  ops when installing new types in the server.
2005-05-15 18:29:52 +00:00
Al Riddoch
740e132e58 2005-05-15 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Make a bunch
	  of functions private, as they should not be available elsewhere.
	  Make installRule() public, and make it return an error status.

	* server/Admin.cpp: Use installRule() to install new rules from the
	  client, so that the full data is installed.
2005-05-15 12:43:02 +00:00
Al Riddoch
9310b52de3 2005-05-15 Al Riddoch <alriddoch@zepler.org>
* rulesets/mason/world/objects/tools/Rope.py: Correct the syntax
	  of stub functions.

	* rulesets/basic/world/objects/buildings/StoneHouse.py: Fix the import
	  statements.

	* rulesets/basic/world/objects/buildings/House.py: Fix import for
	  physics module.

	* rulesets/basic/mind/goals/common/misc_goal.py: Fix typo in
	  cut_something.

	* server/ScriptFactory.cpp, server/ScriptFactory.h: New factory
	  class for handling python scripts for entities much more
	  efficiently, and provide a means where they can be re-imorted
	  at an apropriate time.

	* server/PersistantThingFactory.h,
	  server/PersistantThingFactory.cpp: Make PersistantThingFactory
	  copy constructor protected, to ensure its not used accidentally.
	  Replace strings for storing python script data with a pointer
	  to a factory for creating scripts.

	* server/EntityFactory.cpp: Use the new ScriptFactory mechnism
	  for creating scripts attached to entities. Improve variable
	  names a little.
2005-05-15 00:54:08 +00:00
Al Riddoch
1f283e4f50 2005-05-14 Al Riddoch <alriddoch@zepler.org>
* rulesets/Python_Script_Utils.h, rulesets/Python_API.h,
	  rulesets/Python_API.cpp, rulesets/MindFactory.cpp,
	  server/EntityFactory.cpp: Move functions related to creating
	  script objects into a new header, to avoid namespace pollution.
2005-05-14 23:02:02 +00:00
Al Riddoch
c72568b8dc 2005-04-26 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Cast the world entity factory to the
	  right type when using it to persist the world during database
	  bootstrap.
2005-04-26 21:44:54 +00:00
Al Riddoch
33bf3ee3ee 2005-04-25 Al Riddoch <alriddoch@zepler.org>
* server/PersistantThingFactory.h, PersistantThingFactory_impl.h,
	  server/PersistantThingFactory.cpp: Add ForbiddenThingFactory
	  for entity classes that need persistence, but can't be instantiated
	  through the normal channels.

	* server/EntityFactory.cpp: Use ForbiddenThingFactory for World.

	* server/WorldRouter.cpp: Correct error message for entity
	  creation failure to include "forbidden" as a possible cause.
2005-04-25 00:10:37 +00:00
Al Riddoch
ec00093515 2005-02-12 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: If no persistent ruleset exists in the
	  database, print an error and load the rules from files instead.
2005-02-12 20:38:33 +00:00
Al Riddoch
5f34ba522e 2004-01-17 Al Riddoch <alriddoch@zepler.org>
* common/BaseWorld.h, rulesets/Character.cpp, rulesets/Py_World.cpp,
	  rulesets/PythonThingScript.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
	  server/Admin.cpp, server/Connection.cpp, server/EntityFactory.cpp,
	  server/Restoration.cpp, server/WorldRouter.cpp, server/WorldRouter.h:
	  Rename some functions in the World interface so they make more
	  sense.

	* rulesets/Entity.cpp, rulesets/Entity.h: Add destroyed flag to
	  Entity so we can tell if its no longer in the world.

	* server/WorldRouter.cpp: Cut down the special case handling of
	  delete ops as we can now broadcast ops from entities that
	  have been removed from the world.
2005-01-17 01:42:25 +00:00
Al Riddoch
8e12cf8de0 2004-01-13 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Improve error reporting for query errors.

	* common/const.cpp, common/const.h: Add full details and comments
	  for enable_database option.

	* common/id.h, common/id.cpp: New ID generator for use when we
	  are not using the Database.

	* common/AtlasFileLoader.cpp, common/AtlasFileLoader.h: Generic
	  class for loading Atlas data from a file.

	* server/Connection.cpp, server/EntityFactory.h,
	  server/EntityFactory.cpp, server/Persistor.cpp,
	  server/WorldRouter.cpp, server/server.cpp:
	  Implement the enable_database option by wrapping all use of database
	  in if statements. Rules are loaded from files instead.
2005-01-13 00:38:41 +00:00
Al Riddoch
299efcafdc 2004-12-03 Al Riddoch <alriddoch@zepler.org>
* client/BaseClient.cpp, client/BaseClient.h,
	  client/CharacterClient.cpp, client/CharacterClient.h,
	  client/ClientConnection.cpp, client/ClientConnection.h,
	  client/CreatorClient.cpp, client/CreatorClient.h,
	  client/Py_CreatorClient.cpp, common/BaseEntity.cpp,
	  common/BaseEntity.h, common/BaseWorld.h, common/custom.cpp,
	  common/inheritance.cpp, common/inheritance.h,
	  common/inheritance_impl.h, common/op_switch.h, common/type_utils.h,
	  common/types.h, common/utility.cpp, common/utility.h,
	  modules/Location.cpp, rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/Character.cpp, rulesets/Character.h, rulesets/Creator.cpp,
	  rulesets/Creator.h, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/EntityProperties.cpp, rulesets/Entity_getLocation.h,
	  rulesets/Food.cpp, rulesets/Food.h, rulesets/MemMap.cpp,
	  rulesets/MemMap.h, rulesets/Missile.h, rulesets/Pedestrian.cpp,
	  rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_Mind.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Operation.h, rulesets/Py_Thing.cpp,
	  rulesets/PythonMindScript.h, rulesets/PythonScript.h,
	  rulesets/PythonThingScript.h, rulesets/Python_API.cpp,
	  rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp,
	  rulesets/Stackable.h, rulesets/Thing.cpp, rulesets/Thing.h,
	  rulesets/World.cpp, rulesets/World.h,
	  server/Account.cpp, server/Account.h server/Admin.cpp, server/Admin.h,
	  server/CommClient.cpp, server/Connection.cpp, server/Connection.h,
	  server/EntityFactory.cpp, server/EntityFactory.h, server/Lobby.cpp,
	  server/Lobby.h, server/Persistance.cpp, server/Persistance.h,
	  server/Persistor.cpp, server/Player.cpp, server/Player.h,
	  server/ServerRouting.cpp, server/ServerRouting.h,
	  server/TrustedConnection.cpp, server/TrustedConnection.h,
	  server/WorldRouter.cpp, server/WorldRouter.h, tests/Areatest.cpp,
	  tests/Charactertest.cpp, tests/Creatortest.cpp,
	  tests/EntityExerciser.h, tests/Entitytest.cpp, tests/Foodtest.cpp,
	  tests/IGEntityExerciser.h, tests/Linetest.cpp, tests/Planttest.cpp,
	  tests/Stackabletest.cpp, tests/Structuretest.cpp, tests/Thingtest.cpp,
	  tests/Worldtest.cpp, tests/allOperations.h, tests/inheritancetest.cpp,
	  tests/utilitytest.cpp, tools/cycmd.cpp:
	  Modify the entity interface so that all Operation methods
	  take references to RootOperation, as its cleaner, and requires
	  less nasty casts. Clean up operations in headers generally.
2004-12-03 14:49:13 +00:00
Al Riddoch
4013390b5a 2004-11-24 Al Riddoch <alriddoch@zepler.org>
* server/PersistantThingFactory_impl.h, server/PersistantThingFactory.h:
	  Add a flag indicating whether a thing factory owns its persistor
	  object, so that the destructor knows whether to delete it.
	  Leak now fixed.

	* server/EntityFactory.cpp: Clear the entity factories dictionary.

	* common/inheritance.cpp: Fix leak of operation factories by flushing
	  and clearing the factory dictionary.
2004-11-24 12:07:58 +00:00
Al Riddoch
c4a92de9f3 2004-11-06 Al Riddoch <alriddoch@zepler.org>
* aiclient/ClientConnection.cpp, client/BaseClient.cpp,
	  client/CharacterClient.cpp, client/ClientConnection.cpp,
	  common/Database.cpp, common/FormattedXMLWriter.cpp,
	  common/inheritance.cpp, common/refno.h, common/terrain_utils.cpp,
	  common/type_utils.h, common/utility.cpp, modules/WorldTime.cpp,
	  modules/WorldTime.h, physics/Collision.cpp, rulesets/Area.cpp,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Line.cpp, rulesets/MemMap.cpp, rulesets/MemMap_methods.h,
	  rulesets/Movement.cpp, rulesets/Plant.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp,
	  rulesets/Py_Oplist.cpp, rulesets/PythonMindScript.cpp,
	  rulesets/PythonThingScript.cpp, rulesets/Python_API.cpp,
	  rulesets/Stackable.cpp, rulesets/TerrainProperty.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp,
	  server/CommClient.cpp, server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Lobby.cpp, server/Persistance.cpp,
	  server/Player.cpp, server/Restoration.cpp, server/ServerRouting.cpp,
	  server/WorldRouter.cpp, tests/EntityExerciser.h,
	  tests/IGEntityExerciser.h, tests/inheritancetest.cpp,
	  tools/cycmd.cpp, tools/cyconvertrules.cpp, tools/cydbload.cpp,
	  tools/cyloadrules.cpp:
	  Tweak for loops to avoid creating a temporary iterator each
	  iteration.

	* tests/type_utilstest.cpp: New test for function which does
	  list conversions.
2004-11-06 20:36:03 +00:00
Al Riddoch
68ab5f7fc8 2004-09-20 Al Riddoch <alriddoch@zepler.org>
* physics/Vector3D.h, physics/Vector3D.cpp, modules/Location.h,
	  modules/Location.cpp: Convert to using WFMath::Point instead of
	  WFMath::Vector for position.

	* physics/Collision.h, physics/Collision.cpp: Update collision code
	  to use new pos type.

	* rulesets/Py_Point3D.h, rulesets/Py_Point3D.cpp: New python
	  wrappers for WFMath::Point.

	* rulesets/Py_Location.cpp, rulesets/Py_Vector3D.cpp,
	  rulesets/Python_API.cpp:
	  Update python wrappers to take into account new pos type.
	  Ensure that only apropriate functionality is available for
	  point and vector.

	* rulesets/Character.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Line.cpp, rulesets/Movement.cpp, rulesets/Movement.h,
	  rulesets/Pedestrian.cpp, rulesets/Pedestrian.h,
	  rulesets/Plant.cpp, rulesets/Thing.cpp, rulesets/World.cpp,
	  server/EntityFactory.cpp, server/WorldRouter.cpp,
	  server/WorldRouter.h: Update the rest of the code for new pos
	  type, converting all places where entity parenting is changed
	  to use WFMath toParentCoords() and toLocalCoords() methods,
	  so that orientation is handled correctly.

	* tests/transformtest.cpp: New test to ensure that toParentCoords()
	  and toLocalCoords() perform as expected.

	* tests/Creatortest.cpp, tests/Locationtest.cpp, tests/Worldtest.cpp,
	  tests/collisiontest.cpp, tests/emergencetest.cpp:
	  Update the rest of the tests.
2004-09-20 10:16:04 +00:00
Al Riddoch
93f0c7fdac 2004-09-18 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Replace check for NULL factory pointer
	  in installFactory() with an assert, as NULL should never occur.
2004-09-18 13:36:00 +00:00
Al Riddoch
392a44ea9e 2004-09-14 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Fix queries on ID relation
	  tables. Add methods to result functions for decoding the contents
	  of fields more directly. Implement selecting from array tables.

	* common/terrain_utils.cpp, common/terrain_utils.h: New functions
	  for handling terrain in array database tables.

	* rulesets/World.cpp, rulesets/World.h: Add functionality to track
	  changes to the terrain for persistence purposes.

	* server/EntityFactory.cpp, server/EntityFactory.h, server/server.cpp:
	  Modify the way world entity persistence is bootstrapped to be
	  more consistent.

	* server/Persistor.cpp: Provide specialisations to handle world so
	  that terrain is persisted. Implement storing terrain at entity
	  creation.

	* server/Restoration.cpp, server/Restoration.h: Remove obsolete
	  restoration code. Return a status more accuratly representing
	  when restoration fails because of error, or if there is nothing
	  to restore.

	* server/Restorer.cpp, server/Restorer.h, server/Restorer_impl.h:
	  Convert to using methods for restoring data in the Database class.
	  Implement restoring terrain from the database.
2004-09-14 16:39:30 +00:00
Al Riddoch
96f13800c8 2004-08-07 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.cpp, common/BaseEntity.h, common/BaseWorld.h,
	  common/Database.cpp, common/Database.h, common/FormattedXMLWriter.cpp,
	  common/FormattedXMLWriter.h, common/accountbase.cpp,
	  common/accountbase.h, common/custom.cpp, common/inheritance.cpp,
	  common/inheritance.h, common/operations.h, common/type_utils.h,
	  common/utility.cpp, common/utility.h, modules/Location.cpp,
	  modules/Location.h, rulesets/Area.cpp, rulesets/Area.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp, rulesets/Character.h,
	  rulesets/Creator.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Entity_getLocation.h, rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/Line.h, rulesets/MemMap.cpp, rulesets/MemMap.h,
	  rulesets/Pedestrian.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Py_Mind.cpp, rulesets/Py_Object.cpp, rulesets/Py_Object.h,
	  rulesets/Py_Operation.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h,
	  rulesets/Thing.cpp, rulesets/World.cpp, rulesets/World.h,
	  server/Account.cpp, server/Account.h, server/Admin.cpp,
	  server/Admin.h, server/CommClient.cpp, server/CommClient.h,
	  server/CommListener.cpp, server/CommListener.h,
	  server/CommLocalClient.cpp, server/CommLocalClient.h,
	  server/CommMetaClient.h, server/CommPSQLSocket.h,
	  server/CommRemoteClient.cpp, server/CommRemoteClient.h,
	  server/CommServer.cpp, server/CommServer.h, server/CommSocket.cpp,
	  server/CommSocket.h, server/CommUnixListener.cpp,
	  server/CommUnixListener.h, server/Connection.cpp,
	  server/Connection.h, server/EntityFactory.cpp,
	  server/EntityFactory.h, server/Lobby.cpp, server/Lobby.h,
	  server/Persistance.cpp, server/Persistance.h,
	  server/PersistantThingFactory.h, server/Persistor.cpp,
	  server/Player.cpp, server/Player.h, server/Restorer.h,
	  server/Restorer_impl.h, server/ServerRouting.cpp,
	  server/ServerRouting.h, server/TrustedConnection.cpp,
	  server/TrustedConnection.h, server/WorldRouter.cpp,
	  server/WorldRouter.h: Convert code to using Atlas Message
	  typedefs as found in Atlas-C++ 0.6 to aid conversion later.
2004-08-16 14:26:47 +00:00
Al Riddoch
91c9437c81 2004-07-12 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp, common/Database.h: Add capability to specify
	  extra columns in generic Atlas database tables. Query the results
	  columns more robustly. Add a ruleset name column to the rules
	  table.

	* server/EntityFactory.cpp: Re-write rule loader to handle new
	  format rules. Tighten up strictness of rule data. It is no
	  longer possible to specify defaults for location in the rule.

	* tools/cyconvertrules.cpp: Ensure that the playable flag is
	  copied across when converting rules.

	* tools/cyloadrules.cpp: Adapt to load the new format rules,
	  including handling the ruleset name column.
2004-07-12 10:58:20 +00:00
Al Riddoch
b23400e643 2004-07-08 Al Riddoch <alriddoch@zepler.org>
* client/CommClient.cpp, rulesets/MemMap.cpp, server/CommServer.cpp,
	  server/EntityFactory.cpp, server/Persistor_impl.h,
	  server/Restorer.cpp, server/Restorer_impl.h:
	  Fix code to comply with stricter gcc 3.4.1 template rules.
2004-07-08 17:07:38 +00:00
Al Riddoch
b93c71636e 2004-06-21 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp: Change check in new Entity code to ensure
	  that entities already have valid location at this point.

	* server/EntityFactory.cpp: Implement randomized starting position
	  in entity factory.
2004-06-21 06:37:01 +00:00
Al Riddoch
3ccbbbc808 2004-05-11 Al Riddoch <alriddoch@zepler.org>
* client/CommClient.cpp, rulesets/Entity.cpp, rulesets/Entity.h,
	  rulesets/Entity_getLocation.h, server/EntityFactory.cpp:
	  Make Entity::getLocation a template, so it works with maps on
	  types other than entity.

	* rulesets/BaseMind.cpp, rulesets/BaseMind.h,
	  rulesets/MemEntity.cpp, rulesets/MemEntity.h,
	  rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/Py_Map.cpp:
	  Make MemEntity inherit from Entity, and BaseMind inherit from
	  MemEntity, and use MemEntity for all objects in MemMap, so we
	  can have extra functionality on MemEntity.
2004-05-11 18:10:36 +00:00
Al Riddoch
f3fed3984f 2004-04-27 Al Riddoch <alriddoch@zepler.org>
* common/const.cpp, common/const.h, server/EntityFactory.cpp,
	  server/Restoration.cpp: Add flag to disable saving of state
	  to the database.
2004-04-27 11:23:38 +00:00
Al Riddoch
43bbc588bd 2004-01-22 Al Riddoch <alriddoch@zepler.org>
* common/custom.cpp, common/inheritance.cpp, common/operations.cpp,
	  server/EntityFactory.cpp: Use new Atlas-C++ Class() method
	  for class objects.
2004-01-22 00:48:22 +00:00
Al Riddoch
6e5aaf2578 2003-09-17 Al Riddoch <alriddoch@zepler.org>
* tests/Worldtest.cpp: Update test to take account of changes
	  in the BaseWorld interface.

	* server/WorldRouter.cpp: Report an error if an entity creation
	  attempt of unknown type is attempted.

	* server/EntityFactory.h, server/EntityFactory.cpp: Modify
	  unbound rule queue so it handles multiple rules depending
	  on a single parent.
2003-09-17 15:05:08 +00:00
Al Riddoch
95dd9ea734 2003-09-17 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.h, server/EntityFactory.cpp: Add
	  a wait queue for rules whose parent is not yet installed,
	  so installing rules in any order can be handled, and
	  there is no problem with rules inheriting from each other.
2003-09-17 08:20:50 +00:00
Al Riddoch
2a2362120f 2003-09-17 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Be much stricter about missing types,
	  and missing parents of types. Refuse to add types or instances
	  which have non-existant parents.

	* common/BaseWorld.h, rulesets/Thing.cpp, server/Account.cpp,
	  server/Account.h, server/EntityFactory.h,
	  server/WorldRouter.cpp, server/WorldRouter.h:
	  Change names of functions used to add new objects to the world
	  to reflect that they do this. Handle failure to create an
	  entity.
2003-09-17 01:22:53 +00:00
Al Riddoch
0fbfc771ad 2003-08-07 Al Riddoch <alriddoch@zepler.org>
* server/Lobby.cpp: Add some debugging messages.

	* server/CommServer.cpp: Tweak select loop so that closed connections
	  are cleaned up as soon as they are detected.

	* rulesets/World.cpp: Make demo terrain a bit more mountainous.

	* Convert entire codebase over to using Atlas-C++ 0.4.90, as
	  start of transition to 0.6 API.
2003-08-07 23:03:26 +00:00
Al Riddoch
049793be02 2003-07-19 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp: Add debugging output required to monitor
	  use of entity factory.
2003-07-19 22:48:04 +00:00
Al Riddoch
693a2109a5 2003-05-05 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, rulesets/Python_API.h,
	  rulesets/Python_API.cpp, rulesets/PythonThingScript.h,
	  rulesets/PythonThingScript.cpp, rulesets/PythonMindScript.cpp,
	  rulesets/Py_World.cpp, rulesets/Py_Thing.h, rulesets/Py_Thing.cpp,
	  rulesets/Py_Operation.cpp, rulesets/Py_Map.cpp,
	  rulesets/Py_Location.cpp, rulesets/Movement.h,
	  rulesets/MemMap_methods.h, rulesets/MemMap.h, rulesets/MemMap.cpp,
	  rulesets/Entity.cpp, rulesets/BaseMind.cpp,
	  client/Py_CreatorClient.cpp:
	  Rename all references from thing to entity, as thing is
	  no longer the base class for IG entities.

	* rulesets/World.h, rulesets/World.cpp, rulesets/Thing.h,
	  rulesets/Structure.h, rulesets/Stackable.h, rulesets/Stackable.cpp,
	  rulesets/Plant.h, rulesets/Plant.cpp, rulesets/Missile.h,
	  rulesets/Line.h, rulesets/Line.cpp, rulesets/Food.h,
	  rulesets/Food.cpp, rulesets/Creator.h, rulesets/Character.h,
	  rulesets/Character.cpp, rulesets/Area.h, rulesets/Area.cpp:
	  Add a typedef for the parent class of all entity classes.

	* rulesets/Plant.h, rulesets/Plant.cpp:
	  Add in code to fully integrate hardcoded attributes.
2003-05-05 21:57:50 +00:00
Al Riddoch
88bb8c6a42 2003-05-04 Al Riddoch <alriddoch@zepler.org>
* Clean up member variable names.
2003-05-04 18:31:38 +00:00
Al Riddoch
f3f73897e3 2003-05-03 Al Riddoch <alriddoch@zepler.org>
* server/Restoration.cpp: Send restored entities a setup op, so the
	  AI gets initialised as if the entity had just been created.

	* Clean up member variable names.

	* rulesets/mason/mind/SkelMind.py: Get skeleton to recognise
	  settlers.
2003-05-03 19:52:41 +00:00
Al Riddoch
b24ad0c18a 2003-03-22 Al Riddoch <alriddoch@zepler.org>
* client/CommClient.cpp, client/CreatorClient.cpp,
	  client/ObserverClient.cpp, client/Py_CreatorClient.cpp,
	  common/BaseEntity.cpp, common/BaseEntity.h,
	  common/types.h, rulesets/Area.cpp, rulesets/BaseMind.cpp,
	  rulesets/Character.cpp, rulesets/Entity.cpp,
	  rulesets/Food.cpp, rulesets/Line.cpp,
	  rulesets/MemMap.cpp, rulesets/Pedestrian.cpp,
	  rulesets/Plant.cpp, rulesets/Py_Mind.cpp,
	  rulesets/Py_Object.cpp, rulesets/Py_Thing.cpp,
	  rulesets/Python_API.cpp, rulesets/Stackable.cpp,
	  rulesets/Thing.cpp, rulesets/World.cpp,
	  server/Account.cpp, server/Admin.cpp, server/CommClient.cpp,
	  server/CommServer.cpp, server/Connection.cpp,
	  server/EntityFactory.cpp, server/Lobby.cpp,
	  server/Persistance.cpp, server/Player.cpp,
	  server/ServerRouting.cpp, server/WorldRouter.cpp:
	  Switch to using Element as name for Atlas::Message::Object,
	  to avoid name clashes on Object, and bring into line with
	  the way Atlas-C++ will be.
2003-03-23 00:55:09 +00:00
Al Riddoch
096b4d898d 2003-03-21 Al Riddoch <alriddoch@zepler.org>
* modules/Location.h, modules/Location.cpp: Change location
	  member names to fit the Atlas attributes they map to, and
	  make it clear they are members.
2003-03-21 10:48:17 +00:00
Al Riddoch
15ef748518 2003-03-07 Al Riddoch <alriddoch@zepler.org>
* Use " instead of < when including application headers.

	* Re-work the interface between server and worldrouter objects
	  so that the are less tied together, and more flexible.
2003-03-07 00:22:12 +00:00
Al Riddoch
24742327ca 2003-01-12 Al Riddoch <alriddoch@zepler.org>
* mason.xml, rulesets/mason/world/objects/outdoor/Campfire.py:
	  Add three missing rules.

	* server/EntityFactory.cpp: Remove some old obsolete FIXMEs.

	* server/Restoration.cpp: Remove redundant extra connection of
	  world persistor.
2003-01-12 17:27:11 +00:00
Al Riddoch
8915b80e5d 2002-12-23 Al Riddoch <alriddoch@zepler.org>
* common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h,
	  common/OOGThing.h, rulesets/Area.cpp, rulesets/Area.h,
	  rulesets/BaseMind.cpp, rulesets/Character.cpp,
	  rulesets/Character.h, rulesets/Creator.cpp, rulesets/Creator.h,
	  rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Food.cpp,
	  rulesets/Food.h, rulesets/Line.cpp, rulesets/Line.h,
	  rulesets/MemMap.cpp, rulesets/Plant.cpp, rulesets/Plant.h,
	  rulesets/Stackable.cpp, rulesets/Stackable.h,
	  rulesets/Structure.h, rulesets/Thing.cpp, rulesets/Thing.h,
	  rulesets/World.cpp, rulesets/World.h, server/Account.cpp,
	  server/CommClient.cpp, server/CommClient.h,
	  server/Connection.cpp, server/Connection.h,
	  server/EntityFactory.cpp, server/Lobby.cpp, server/Lobby.h,
	  server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h,
	  server/Restorer.cpp, server/Restorer_impl.h, server/ServerRouting.cpp,
	  server/WorldRouter.cpp: Assign ID at entity construction time,
	  and make it constant, and thus unmodifiable.
2002-12-23 23:22:25 +00:00
Al Riddoch
201c6d683a 2002-12-21 Al Riddoch <alriddoch@zepler.org>
* server/WorldRouter.cpp, server/Admin.cpp:
	  Use consts::rootWorldId correctly.

	* server/Persistor.cpp, server/PersistantThingFactory.cpp,
	  server/PersistantThingFactory.h, server/EntityFactory.h,
	  server/EntityFactory.cpp: Add World specialisation of Persistor
	  so that row in entity database is maintained, but not created.

	* common/Database.h: Ensure iterator has != as well as ==.

	* common/Database.cpp: Check that tuples have been returned
	  in response to a select.

	* server/Restoration.cpp, server/Restoration.h,
	  server/Restorer.cpp: Restoration code now iterates over the
	  contents of the database, but does not attempt to actually
	  restore it yet.
2002-12-21 21:28:20 +00:00
Al Riddoch
b0ff377468 2002-12-19 Al Riddoch <alriddoch@zepler.org>
* server/EntityFactory.cpp, server/PersistantThingFactory.cpp,
	  server/PersistantThingFactory.h,
	  server/PersistantThingFactory_impl.h,
	  server/Persistor.cpp: Cut down template bloat by minimising the
	  places where template instances are created.
2002-12-19 14:52:05 +00:00
Al Riddoch
6509955895 2002-12-18 Al Riddoch <alriddoch@zepler.org>
* common/Database.cpp: Fix badly generated insert query.

	* rulesets/Character.h: Add accessors for some hard attributes.

	* rulesets/Entity.h, server/EntityFactory.cpp: Add a way of clearing
	  all the update flags, and clear them after creating the database
	  row.

	* server/Persistor.h, server/Persistor_impl.h, server/Persistor.cpp:
	  Progress on the SQL update query generating code. Now generates
	  what looks like good update queries.
2002-12-18 15:44:37 +00:00