cyphesis/client/ObserverClient.cpp

182 lines
5.1 KiB
C++
Raw Permalink Normal View History

2006-01-19 Al Riddoch <alriddoch@zepler.org> * aiclient/ClientAccount.cpp, aiclient/ClientAccount.h, aiclient/ClientConnection.cpp, aiclient/ClientConnection.h, aiclient/client.cpp, aiclient/client.h, 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/ObserverClient.cpp, client/ObserverClient.h, client/Py_CreatorClient.cpp, client/Py_CreatorClient.h, client/client.cpp, client/define_world.cpp, client/define_world.h, common/Add.h, common/Affect.h, common/AtlasFileLoader.cpp, common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp, common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h, common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp, common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h, common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h, common/Eat.h, common/FormattedXMLWriter.cpp, common/FormattedXMLWriter.h, common/Generic.h, common/Load.h, common/Monitor.h, common/Mow.h, common/Nourish.h, common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp, common/Property.h, common/Property_impl.h, common/Save.h, common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h, common/Use.h, common/Wield.h, common/accountbase.cpp, common/accountbase.h, common/const.cpp, common/const.h, common/custom.cpp, common/debug.h, common/globals.cpp, common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp, common/inheritance.h, common/inheritance_impl.h, common/log.cpp, common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h, common/operations.cpp, common/operations.h, common/random.h, common/refno.h, common/serialno.cpp, common/serialno.h, common/system.cpp, common/system.h, common/terrain_utils.cpp, common/terrain_utils.h, common/type_utils.h, common/types.h, common/utility.cpp, common/utility.h, modules/DateTime.cpp, modules/DateTime.h, modules/Location.cpp, modules/Location.h, modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp, physics/BBox.h, physics/Collision.cpp, physics/Collision.h, physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp, physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp, rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h, rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h, rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp, rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h, rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp, rulesets/Entity.h, rulesets/EntityProperties.cpp, rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h, rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp, rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h, rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h, rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h, rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp, rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h, rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp, rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h, rulesets/Py_Location.cpp, rulesets/Py_Location.h, rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h, rulesets/Py_Operation.cpp, rulesets/Py_Operation.h, rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp, rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h, rulesets/Py_Property.cpp, rulesets/Py_Property.h, rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h, rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h, rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h, rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp, rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp, rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h, rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h, rulesets/PythonArithmeticScript.cpp, rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp, rulesets/PythonMindScript.h, rulesets/PythonScript.cpp, rulesets/PythonScript.h, rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp, rulesets/PythonWrapper.h, rulesets/Python_API.cpp, rulesets/Python_API.h, rulesets/Python_Script_Utils.h, rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp, rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h, rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h, rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp, rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h, rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h, rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp, rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h, rulesets/attributes.h, server/Account.cpp, server/Account.h, server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp, server/ArithmeticFactory.h, server/CommClient.cpp, server/CommClient.h, server/CommIdleSocket.cpp, server/CommIdleSocket.h, server/CommListener.cpp, server/CommListener.h, server/CommLocalClient.cpp, server/CommLocalClient.h, server/CommMDNSPublisher.cpp, server/CommMDNSPublisher.h, server/CommMaster.cpp, server/CommMaster.h, server/CommMetaClient.cpp, server/CommMetaClient.h, server/CommPSQLSocket.cpp, server/CommPSQLSocket.h, server/CommPeer.cpp, server/CommPeer.h, server/CommPeerListener.cpp, server/CommPeerListener.h, server/CommRemoteClient.cpp, server/CommRemoteClient.h, server/CommServer.cpp, server/CommServer.h, server/CommSlaveClient.cpp, server/CommSlaveClient.h, server/CommSlaveListener.cpp, server/CommSlaveListener.h, server/CommSocket.cpp, server/CommSocket.h, server/CommUnixListener.cpp, server/CommUnixListener.h, server/Connection.cpp, server/Connection.h, server/Connection_methods.h, server/EntityFactory.cpp, server/EntityFactory.h, server/ExternalMind.cpp, server/ExternalMind.h, server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h, server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h, server/Persistance.cpp, server/Persistance.h, server/PersistantThingFactory.cpp, server/PersistantThingFactory.h, server/PersistantThingFactory_impl.h, server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h, server/Player.cpp, server/Player.h, server/Restoration.cpp, server/Restoration.h, server/Restorer.cpp, server/Restorer.h, server/Restorer_impl.h, server/ScriptFactory.cpp, server/ScriptFactory.h, server/ServerRouting.cpp, server/ServerRouting.h, server/ServerRouting_methods.h, server/SlaveClientConnection.cpp, server/SlaveClientConnection.h, server/TaskFactory.cpp, server/TaskFactory.h, server/TrustedConnection.cpp, server/TrustedConnection.h, server/WorldRouter.cpp, server/WorldRouter.h, server/server.cpp, server/server.h, server/slave.cpp, tests/Areatest.cpp, tests/BaseEntitytest.cpp, tests/Charactertest.cpp, tests/Containertest.cpp, tests/Creatortest.cpp, tests/EntityExerciser.h, tests/EntityFactorytest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp, tests/IGEntityExerciser.h, tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp, tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp, tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h, tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp, tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp, tests/distancetest.cpp, tests/emergencetest.cpp, tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp, tests/systemtest.cpp, tests/transformtest.cpp, tests/type_utilstest.cpp, tests/utilitytest.cpp, tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp, tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp, tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp, tools/cywatchdog.cpp: Replace the copyright and license statements with new versions that include disclaimer of warranty, and permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
// Cyphesis Online RPG Server and AI Engine
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
// Copyright (C) 2000,2001 Alistair Riddoch
2006-01-19 Al Riddoch <alriddoch@zepler.org> * aiclient/ClientAccount.cpp, aiclient/ClientAccount.h, aiclient/ClientConnection.cpp, aiclient/ClientConnection.h, aiclient/client.cpp, aiclient/client.h, 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/ObserverClient.cpp, client/ObserverClient.h, client/Py_CreatorClient.cpp, client/Py_CreatorClient.h, client/client.cpp, client/define_world.cpp, client/define_world.h, common/Add.h, common/Affect.h, common/AtlasFileLoader.cpp, common/AtlasFileLoader.h, common/Attack.h, common/BaseEntity.cpp, common/BaseEntity.h, common/BaseWorld.cpp, common/BaseWorld.h, common/Burn.h, common/Chop.h, common/Connect.h, common/CustomOp.cpp, common/CustomOp.h, common/CustomOp_impl.h, common/Cut.h, common/Database.cpp, common/Database.h, common/Delve.h, common/Dig.h, common/Eat.h, common/FormattedXMLWriter.cpp, common/FormattedXMLWriter.h, common/Generic.h, common/Load.h, common/Monitor.h, common/Mow.h, common/Nourish.h, common/OOGThing.cpp, common/OOGThing.h, common/Property.cpp, common/Property.h, common/Property_impl.h, common/Save.h, common/Setup.h, common/Tick.h, common/Unseen.h, common/Update.h, common/Use.h, common/Wield.h, common/accountbase.cpp, common/accountbase.h, common/const.cpp, common/const.h, common/custom.cpp, common/debug.h, common/globals.cpp, common/globals.h, common/id.cpp, common/id.h, common/inheritance.cpp, common/inheritance.h, common/inheritance_impl.h, common/log.cpp, common/log.h, common/newid.cpp, common/nls.h, common/op_switch.h, common/operations.cpp, common/operations.h, common/random.h, common/refno.h, common/serialno.cpp, common/serialno.h, common/system.cpp, common/system.h, common/terrain_utils.cpp, common/terrain_utils.h, common/type_utils.h, common/types.h, common/utility.cpp, common/utility.h, modules/DateTime.cpp, modules/DateTime.h, modules/Location.cpp, modules/Location.h, modules/WorldTime.cpp, modules/WorldTime.h, physics/BBox.cpp, physics/BBox.h, physics/Collision.cpp, physics/Collision.h, physics/Quaternion.cpp, physics/Quaternion.h, physics/Vector3D.cpp, physics/Vector3D.h, physics/VectorPol.h, rulesets/Area.cpp, rulesets/Area.h, rulesets/AreaProperty.cpp, rulesets/AreaProperty.h, rulesets/ArithmeticScript.cpp, rulesets/ArithmeticScript.h, rulesets/BaseMind.cpp, rulesets/BaseMind.h, rulesets/CalendarProperty.cpp, rulesets/CalendarProperty.h, rulesets/Character.cpp, rulesets/Character.h, rulesets/Combat.cpp, rulesets/Combat.h, rulesets/Container.cpp, rulesets/Container.h, rulesets/Creator.cpp, rulesets/Creator.h, rulesets/Entity.cpp, rulesets/Entity.h, rulesets/EntityProperties.cpp, rulesets/Entity_getLocation.h, rulesets/Fell.cpp, rulesets/Fell.h, rulesets/Food.cpp, rulesets/Food.h, rulesets/Line.cpp, rulesets/Line.h, rulesets/LineProperty.cpp, rulesets/LineProperty.h, rulesets/MemEntity.cpp, rulesets/MemEntity.h, rulesets/MemMap.cpp, rulesets/MemMap.h, rulesets/MemMap_methods.h, rulesets/MindFactory.cpp, rulesets/MindFactory.h, rulesets/Missile.h, rulesets/Motion.cpp, rulesets/Motion.h, rulesets/Movement.cpp, rulesets/Movement.h, rulesets/Pedestrian.cpp, rulesets/Pedestrian.h, rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_BBox.cpp, rulesets/Py_BBox.h, rulesets/Py_EntityWrapper.h, rulesets/Py_Location.cpp, rulesets/Py_Location.h, rulesets/Py_Map.cpp, rulesets/Py_Map.h, rulesets/Py_Mind.cpp, rulesets/Py_Mind.h, rulesets/Py_Object.cpp, rulesets/Py_Object.h, rulesets/Py_Operation.cpp, rulesets/Py_Operation.h, rulesets/Py_Oplist.cpp, rulesets/Py_Oplist.h, rulesets/Py_Optime.cpp, rulesets/Py_Optime.h, rulesets/Py_Point3D.cpp, rulesets/Py_Point3D.h, rulesets/Py_Property.cpp, rulesets/Py_Property.h, rulesets/Py_Quaternion.cpp, rulesets/Py_Quaternion.h, rulesets/Py_RootEntity.cpp, rulesets/Py_RootEntity.h, rulesets/Py_Statistics.cpp, rulesets/Py_Statistics.h, rulesets/Py_Task.cpp, rulesets/Py_Task.h, rulesets/Py_Thing.cpp, rulesets/Py_Thing.h, rulesets/Py_Vector3D.cpp, rulesets/Py_Vector3D.h, rulesets/Py_World.cpp, rulesets/Py_World.h, rulesets/Py_WorldTime.cpp, rulesets/Py_WorldTime.h, rulesets/PythonArithmeticScript.cpp, rulesets/PythonArithmeticScript.h, rulesets/PythonMindScript.cpp, rulesets/PythonMindScript.h, rulesets/PythonScript.cpp, rulesets/PythonScript.h, rulesets/PythonThingScript.cpp, rulesets/PythonThingScript.h, rulesets/PythonWrapper.cpp, rulesets/PythonWrapper.h, rulesets/Python_API.cpp, rulesets/Python_API.h, rulesets/Python_Script_Utils.h, rulesets/Script.cpp, rulesets/Script.h, rulesets/Stackable.cpp, rulesets/Stackable.h, rulesets/Statistics.cpp, rulesets/Statistics.h, rulesets/StatisticsProperty.cpp, rulesets/StatisticsProperty.h, rulesets/Structure.cpp, rulesets/Structure.h, rulesets/Task.cpp, rulesets/Task.h, rulesets/TaskScript.cpp, rulesets/TaskScript.h, rulesets/TerrainProperty.cpp, rulesets/TerrainProperty.h, rulesets/Thing.cpp, rulesets/Thing.h, rulesets/ThingFactory.cpp, rulesets/ThingFactory.h, rulesets/World.cpp, rulesets/World.h, rulesets/attributes.h, server/Account.cpp, server/Account.h, server/Admin.cpp, server/Admin.h, server/ArithmeticFactory.cpp, server/ArithmeticFactory.h, server/CommClient.cpp, server/CommClient.h, server/CommIdleSocket.cpp, server/CommIdleSocket.h, server/CommListener.cpp, server/CommListener.h, server/CommLocalClient.cpp, server/CommLocalClient.h, server/CommMDNSPublisher.cpp, server/CommMDNSPublisher.h, server/CommMaster.cpp, server/CommMaster.h, server/CommMetaClient.cpp, server/CommMetaClient.h, server/CommPSQLSocket.cpp, server/CommPSQLSocket.h, server/CommPeer.cpp, server/CommPeer.h, server/CommPeerListener.cpp, server/CommPeerListener.h, server/CommRemoteClient.cpp, server/CommRemoteClient.h, server/CommServer.cpp, server/CommServer.h, server/CommSlaveClient.cpp, server/CommSlaveClient.h, server/CommSlaveListener.cpp, server/CommSlaveListener.h, server/CommSocket.cpp, server/CommSocket.h, server/CommUnixListener.cpp, server/CommUnixListener.h, server/Connection.cpp, server/Connection.h, server/Connection_methods.h, server/EntityFactory.cpp, server/EntityFactory.h, server/ExternalMind.cpp, server/ExternalMind.h, server/Idle.cpp, server/Idle.h, server/Lobby.cpp, server/Lobby.h, server/Master.cpp, server/Master.h, server/Peer.cpp, server/Peer.h, server/Persistance.cpp, server/Persistance.h, server/PersistantThingFactory.cpp, server/PersistantThingFactory.h, server/PersistantThingFactory_impl.h, server/Persistor.cpp, server/Persistor.h, server/Persistor_impl.h, server/Player.cpp, server/Player.h, server/Restoration.cpp, server/Restoration.h, server/Restorer.cpp, server/Restorer.h, server/Restorer_impl.h, server/ScriptFactory.cpp, server/ScriptFactory.h, server/ServerRouting.cpp, server/ServerRouting.h, server/ServerRouting_methods.h, server/SlaveClientConnection.cpp, server/SlaveClientConnection.h, server/TaskFactory.cpp, server/TaskFactory.h, server/TrustedConnection.cpp, server/TrustedConnection.h, server/WorldRouter.cpp, server/WorldRouter.h, server/server.cpp, server/server.h, server/slave.cpp, tests/Areatest.cpp, tests/BaseEntitytest.cpp, tests/Charactertest.cpp, tests/Containertest.cpp, tests/Creatortest.cpp, tests/EntityExerciser.h, tests/EntityFactorytest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp, tests/IGEntityExerciser.h, tests/Linetest.cpp, tests/Locationtest.cpp, tests/OOGThingtest.cpp, tests/Planttest.cpp, tests/Propertytest.cpp, tests/Stackabletest.cpp, tests/Structuretest.cpp, tests/Tasktest.cpp, tests/TestWorld.h, tests/Thingtest.cpp, tests/WorldTimetest.cpp, tests/Worldtest.cpp, tests/allOperations.h, tests/collisiontest.cpp, tests/consttest.cpp, tests/distancetest.cpp, tests/emergencetest.cpp, tests/inheritancetest.cpp, tests/logtest.cpp, tests/randomtest.cpp, tests/systemtest.cpp, tests/transformtest.cpp, tests/type_utilstest.cpp, tests/utilitytest.cpp, tools/AdminClient.cpp, tools/AdminClient.h, tools/cyaddrules.cpp, tools/cycmd.cpp, tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp, tools/cydbload.cpp, tools/cydumprules.cpp, tools/cyisoload.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp, tools/cywatchdog.cpp: Replace the copyright and license statements with new versions that include disclaimer of warranty, and permit distribution under later versions of the GPL.
2006-01-19 02:17:06 +00:00
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software Foundation,
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
// $Id$
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
#include "ObserverClient.h"
2002-08-30 Al Riddoch <alriddoch@zepler.org> * common/globals.cpp: Only persist this sessions command line options if the user is overriding the installation directory. * cyphesis.vconf, client/Py_CreatorClient.cpp, client/Py_CreatorClient.h, client/client.cpp: Add client functionality to allow diferent scripts to be run to perform different functions on the server. * client/CharacterClient.cpp: Add debug option. * rulesets/Character.h: Make mind operation functions virtual, so they can be overridden. * common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h: Add server functions to search for entities by name or type. * rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to specify a look without an id to search for entities with a given name or type. * client/CreatorClient.cpp, client/CreatorClient.h, client/ObserverClient.cpp, client/ObserverClient.h, client/Py_CreatorClient.cpp, rulesets/basic/editor.py, rulesets/mason/define_world.py: Add support for looking for entities in the world by name or type from client script, so client scripts can modify existing world. * rulesets/Entity.cpp, rulesets/Movement.cpp, rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp, server/CommServer.cpp, server/Connection.cpp, server/Player.cpp, server/ServerRouting.cpp, server/server.cpp, tools/cycmd.cpp, tools/cywatchdog.cpp: Code formatting cleanups. * rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now fires correctly.
2002-08-30 13:48:39 +00:00
#include "CreatorClient.h"
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
#include "common/sockets.h"
#include <iostream>
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
#include <unistd.h>
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
ObserverClient::ObserverClient()
{
}
ObserverClient::~ObserverClient()
{
}
int ObserverClient::setup()
{
if (connectLocal(client_socket_name) != 0) {
std::cerr << "WARNING: Could not make secure connection to:"
<< std::endl << client_socket_name << "."
<< std::endl;
return -1;
}
m_player = createSystemAccount();
if (!m_player.isValid()) {
return -1;
}
m_character = createCharacter("creator");
if (m_character == NULL) {
return -1;
}
return 0;
}
int ObserverClient::setup(const std::string & account,
const std::string & password)
{
if (connectLocal(client_socket_name) != 0) {
std::cerr << "WARNING: Could not make secure connection to:"
<< std::endl << client_socket_name << "."
<< std::endl;
if (connect(m_server, client_port_num) != 0) {
std::cerr << "WARNING: Could not make non-secure connection to: "
<< m_server << " port " << client_port_num
<< "." << std::endl;
return -1;
}
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
if (password.empty()) {
std::cerr << "WARNING: Made non secure connection to the server."
<< std::endl
<< "WARNING: Attempting to login with no password."
<< std::endl << std::flush;
}
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
}
m_player = createAccount(account, password);
if (!m_player.isValid()) {
return -1;
}
m_character = createCharacter("creator");
if (m_character == NULL) {
return -1;
}
return 0;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
}
2002-08-30 Al Riddoch <alriddoch@zepler.org> * common/globals.cpp: Only persist this sessions command line options if the user is overriding the installation directory. * cyphesis.vconf, client/Py_CreatorClient.cpp, client/Py_CreatorClient.h, client/client.cpp: Add client functionality to allow diferent scripts to be run to perform different functions on the server. * client/CharacterClient.cpp: Add debug option. * rulesets/Character.h: Make mind operation functions virtual, so they can be overridden. * common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h: Add server functions to search for entities by name or type. * rulesets/Creator.h, rulesets/Creator.cpp: Allow creator to specify a look without an id to search for entities with a given name or type. * client/CreatorClient.cpp, client/CreatorClient.h, client/ObserverClient.cpp, client/ObserverClient.h, client/Py_CreatorClient.cpp, rulesets/basic/editor.py, rulesets/mason/define_world.py: Add support for looking for entities in the world by name or type from client script, so client scripts can modify existing world. * rulesets/Entity.cpp, rulesets/Movement.cpp, rulesets/Py_Object.cpp, rulesets/Py_Operation.cpp, rulesets/Py_Oplist.cpp, rulesets/Python_API.cpp, rulesets/Stackable.cpp, rulesets/Thing.cpp, rulesets/World.cpp, server/Account.cpp, server/CommServer.cpp, server/Connection.cpp, server/Player.cpp, server/ServerRouting.cpp, server/server.cpp, tools/cycmd.cpp, tools/cywatchdog.cpp: Code formatting cleanups. * rulesets/basic/world/objects/tools/Bow.py: Fix up bow so it now fires correctly.
2002-08-30 13:48:39 +00:00
void ObserverClient::load(const std::string & package,
const std::string & function)
{
//DefineWorld::define(m_character);
m_character->runScript(package, function);
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
}
void ObserverClient::idle()
{
#ifdef HAVE_USLEEP
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
usleep(100);
#else // HAVE_SLEEP
Sleep(1);
#endif
// This is where we will put diagnostics, and maybe in future the AI code.
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
#if 0
// time.sleep(0.1);
if (not ObserverClient::display) {
return;
}
ObserverClient::map=ObserverClient::m_character.map;
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
wait=0.0;
xmin=-300.0;
xmax=-xmin;
ymin=-150.0;
ymax=-ymin;
sizex=49;
sizey=20;
goal_width=30;
screen = [None]*sizex;
for (/*i in range(sizex)*/) {
screen[i] = ['.'] * sizey;
}
house_list=[];
mind_list=[];
fire_list=[];
for (/*t in ObserverClient::map.things.values()*/) {
if (len(t.type)>=1) {
typething = string.split(t.type[0], ".");
if (string.find(typething[-1], "house")>=0) {
house_list.append(t);
}
else if (string.find(typething[-1], "farmer")>=0 or string.find(typething[-1], "smith")>=0 or string.find(typething[-1], "character")>=0 or string.find(typething[-1], "creator")>=0) {
mind_list.append(t);
}
else if (string.find(typething[-1], "fire")) {
fire_list.append(t);
}
}
else {
print "CHEAT!: somewhere is entity without type!:",t;
}
}
ObserverClient::time=str(ObserverClient::m_character.time);
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
status_str=ObserverClient::time+" Count of minds: "+`len(mind_list)`;
print chr(27)+"[H",status_str+" "*(sizex-len(status_str)-1);
for (/*t in house_list*/) {
(x,y,z)=t.get_xyz();
2002-05-18 Al Riddoch <alriddoch@zepler.org> * client/ObserverClient.cpp, server/Account.cpp, server/Connection.h, server/Routing.h: Formatting cleanup * client/Py_CreatorClient.cpp, rulesets/Area.cpp, rulesets/Area.h, rulesets/Character.cpp, rulesets/Character.h, rulesets/Entity.cpp, rulesets/Entity.h, rulesets/Line.cpp, rulesets/Line.h, rulesets/Plant.cpp, rulesets/Plant.h, rulesets/Py_Mind.cpp, rulesets/Py_Thing.cpp, rulesets/Stackable.cpp, rulesets/Stackable.h: Replace operator[] with get() method for querying attributes. Make this get() method const, and re-write the internals so that it more cleanly handles attributes. * common/BaseWorld.h: Re-write world.getObject() so that it no longer uses std::map::operator[], as the old method was inserting NULLs into the world dictionary when non-existant entities were queried. * rulesets/Character.cpp: Clean up outstanding issues when movement position is supplied, and is very close to being correct, and clarify comments about movement when neither destination nor source are provided. * rulesets/Character.cpp: Modify mind2body interface so that setting the TO of ops is done in the individual handlers, and copying the operation globally is avoided. * rulesets/MemMap_methods.h: Remove dodgy debug code. * rulesets/Pedestrian.cpp: Clarify movement fixme. * rulesets/Py_Operation.cpp: Clarify operation time handler fixme. * rulesets/Stackable.cpp: Clarify fixme's in combine and divide handlers. * server/CommServer.cpp: Remove redundant fixme. * server/Connection.cpp, server/ServerRouting.cpp, server/ServerRouting.h, server/ServerRouting_methods.h, server/server.cpp: Move inline ServerRouting::getObject into class header. * server/WorldRouter.cpp, server/WorldRouter.h: Clean up includes, and move updateTime into the main body of the file. Clean up code formatting when handling maps and dictionaries. Clarify error output and comments about NULL objects in the world dictionary.
2002-05-18 18:09:14 +00:00
screen[scx(x)][scy(y)] = t.name[0];
* client/client.cpp, client/ObserverClient.cpp, client/ObserverClient.h, client/ClientConnection.cpp, client/ClientConnection.h, client/define_world.cpp, client define_world.h: Started re-coding of python client code in C++. * common/accountbase.h: Database class used for simply accessing accounts. * common/OOGThing.cpp, common/OOGThing.h, server/Account.h, server/Routing.h: Moved OOGThing class into common as it is not server specific. * common/BaseWorld.cpp, common/BaseWorld.h, server/WorldRouter.cpp, server/WorldRouter.h, rulesets/Entity.h, rulesets/Py_World.cpp, rulesets/PythonThingScript.cpp, rulesets/Python_API.h, rulesets/Thing.cpp, rulesets/Thing.h: Added base class for WorldRouter so that code that previously used WorldRouter now used the interface defined by this new class. This means that the code in rulesets no longer has dependencies on code in server, so can be used in the client. * server/ExternalMind.cpp, server/ExternalMind.h, rulesets/Character.h, rulesets/Creator.cpp, server/Account.cpp: Moved ExternalMind class into server as it is server specific, so that there is no dependancy on server in rulesets. * server/Persistance.cpp. server/Persistance.h, server/Admin.cpp, server/ServerRouting.cpp, server/server.cpp: Moved high level server specific persistance class into server, so there is no dependency on server in common. * common/database.cpp, common/database.h, server/Admin.cpp, tools/cydbload.cpp, tools/cyisoload.cpp, tools/cypasswd.cpp: Increases efficiency of some interfaces by passing Object::MapType instead of MapType, when the value must be a map. * modules/WorldTime.cpp, modules/WorldTime.h, rulesets/Py_WorldTime.cpp, rulesets/Python_API.cpp: Brought the version of WorldTime in modules up to date, as this is the version now used. * rulesets/Character.cpp, server/WorldRouter.cpp, rulesets/Thing.cpp, server/Admin.cpp: Made world objects dictionary private. * rulesets/EntityFactory.cpp, rulesets/EntityFactory.h: Change newThing parameters so entity factory does not need to know about WorldRouter. * server/Lobby.cpp: Added support for people and rooms attributes of OOG room class. Al Riddoch <alriddoch@zepler.org>
2001-08-13 17:22:27 +00:00
}
yind=1;
goal_txt={};
for (/*m in mind_list*/) {
(x,y,z)=m.get_xyz();
x,y=scx(x),scy(y);
screen[x][y]=m.name[0];
screen[x+1][y]=m.name[-1];
if (hasattr(m,"goal")) {
goal_txt[yind]=(`m`+":"+m.goal+" "*goal_width)[:goal_width];
yind=yind+1;
}
}
for (/*t in fire_list*/) {
(x,y,z)=t.get_xyz();
screen[scx(x)][scy(y)]='F';
wait=0.2;
}
out=[];
for (/*y in range(sizey)*/) {
for (/*x in range(sizex)*/) {
out.append(screen[x][y]);
}
out.append(goal_txt.get(y," "*goal_width));
out.append('\n');
}
print string.join(out,'');
#endif
}