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
|
2001-04-16 16:26:44 +00:00
|
|
|
// Copyright (C) 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
|
2001-03-15 11:41:34 +00:00
|
|
|
|
2006-12-26 Al Riddoch <alriddoch@zepler.org>
* client/CharacterClient.cpp, client/ClientConnection.h,
rulesets/Character.cpp, rulesets/Character.h, tools/cyaddrules.cpp,
tools/cyconfig.cpp, tools/cyconvertrules.cpp, tools/cyctrl.cpp,
tools/cydumprules.cpp, tools/cyloadrules.cpp, tools/cypasswd.cpp:
Add inline documentation.
* client/CharacterClient.h, client/CharacterClient.cpp: Remove
overriden sight operation handlers, as they are no longer
present in the base class, and will never be called.
* client/ClientConnection.h: Remove obsolete unimplemented template
declaration.
* rulesets/Entity.cpp: Remove documentation for an argument that was
never there.
* tools/cyctrl.cpp: Mark as removed from the build.
* Add a FIXME about removing hard coded gender property
2006-12-26 18:24:24 +00:00
|
|
|
|
|
|
|
|
/// \page cypasswd_index
|
|
|
|
|
///
|
|
|
|
|
/// \section Introduction
|
|
|
|
|
///
|
|
|
|
|
/// cypasswd is an interactive commandline tool to manage account data in
|
|
|
|
|
/// the database. For information on the usage, please see the unix
|
|
|
|
|
/// manual page. The manual page is generated from docbook sources, so can
|
|
|
|
|
/// also be converted into other formats.
|
2006-10-26 00:48:00 +00:00
|
|
|
|
2002-07-01 10:21:14 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-04-20 20:03:30 +01:00
|
|
|
#include "common/Storage.h"
|
2003-03-07 00:22:12 +00:00
|
|
|
#include "common/globals.h"
|
2007-04-28 15:21:17 +00:00
|
|
|
#include "common/log.h"
|
2008-11-03 17:12:31 +00:00
|
|
|
#include "common/system.h"
|
2001-03-15 11:41:34 +00:00
|
|
|
|
2010-08-16 20:13:24 +01:00
|
|
|
#include <varconf/config.h>
|
|
|
|
|
|
2001-03-15 11:41:34 +00:00
|
|
|
#include <string>
|
2002-05-05 14:36:55 +00:00
|
|
|
#include <iostream>
|
2001-03-15 20:36:14 +00:00
|
|
|
|
2010-06-08 01:38:43 +05:30
|
|
|
#include <cstring>
|
|
|
|
|
|
2002-01-17 18:44:21 +00:00
|
|
|
#ifdef HAVE_TERMIOS_H
|
|
|
|
|
#include <termios.h>
|
2002-07-01 10:21:14 +00:00
|
|
|
#include <unistd.h>
|
2002-01-17 18:44:21 +00:00
|
|
|
#endif
|
2001-03-15 11:41:34 +00:00
|
|
|
|
|
|
|
|
// This is the currently very basic password management tool, which can
|
|
|
|
|
// be used to control the passwords of accounts in the main servers account
|
|
|
|
|
// database. This is the only way to create accounts on a server in
|
|
|
|
|
// restricted mode.
|
|
|
|
|
|
2002-05-02 16:40:22 +00:00
|
|
|
// TODO: Make sure the rest of the Object is preserved, rather than just
|
2001-03-15 11:41:34 +00:00
|
|
|
// blatting it with a new Object.
|
|
|
|
|
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
using Atlas::Message::MapType;
|
2001-07-04 02:00:11 +00:00
|
|
|
|
2001-03-15 11:41:34 +00:00
|
|
|
#define ADD 0
|
|
|
|
|
#define SET 1
|
|
|
|
|
#define DEL 2
|
2010-12-23 13:40:30 +00:00
|
|
|
#define MOD 3
|
2001-03-15 11:41:34 +00:00
|
|
|
|
2010-08-17 12:24:00 +05:30
|
|
|
#define ADMIN 0
|
|
|
|
|
#define PLAYER 1
|
|
|
|
|
#define SERVER 2
|
|
|
|
|
|
2007-04-24 12:59:26 +00:00
|
|
|
void usage(std::ostream & stream, char * n, bool verbose = false)
|
2001-03-15 11:41:34 +00:00
|
|
|
{
|
2007-04-24 12:59:26 +00:00
|
|
|
stream << "usage: " << n << std::endl;
|
2010-12-23 13:40:30 +00:00
|
|
|
stream << " " << n << " [ -a | -d ] [ -s | -r | -p ] account" << std::endl;
|
2007-04-24 12:59:26 +00:00
|
|
|
stream << " " << n << " -h" << std::endl;
|
2010-07-15 01:36:00 +05:30
|
|
|
|
2007-04-24 12:59:26 +00:00
|
|
|
if (!verbose) {
|
|
|
|
|
stream << std::flush;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2010-07-15 01:36:00 +05:30
|
|
|
|
2007-04-24 12:59:26 +00:00
|
|
|
stream << std::endl;
|
|
|
|
|
stream << "Help options" << std::endl;
|
|
|
|
|
stream << " -h Display this help" << std::endl;
|
|
|
|
|
stream << std::endl;
|
|
|
|
|
stream << "Managing accounts" << std::endl;
|
|
|
|
|
stream << " -a Add a new account" << std::endl;
|
|
|
|
|
stream << " -d Delete an account" << std::endl;
|
2010-06-08 01:38:43 +05:30
|
|
|
stream << " -s Make server account" << std::endl;
|
2010-12-23 13:40:30 +00:00
|
|
|
stream << " -r Make admin account" << std::endl;
|
|
|
|
|
stream << " -p Make player account (default)"
|
|
|
|
|
<< std::endl;
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|
|
|
|
|
|
2010-12-23 13:40:30 +00:00
|
|
|
static int get_password(const std::string & acname,
|
|
|
|
|
std::string & password,
|
|
|
|
|
std::string & password2)
|
|
|
|
|
{
|
|
|
|
|
// TODO Catch signals, and restore terminal
|
|
|
|
|
#ifdef HAVE_TERMIOS_H
|
|
|
|
|
termios termios_old, termios_new;
|
|
|
|
|
|
|
|
|
|
tcgetattr( STDIN_FILENO, &termios_old );
|
|
|
|
|
termios_new = termios_old;
|
|
|
|
|
termios_new.c_lflag &= ~(ICANON|ECHO);
|
|
|
|
|
tcsetattr( STDIN_FILENO, TCSADRAIN, &termios_new );
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
std::cout << "New " << acname << " password: " << std::flush;
|
|
|
|
|
std::cin >> password;
|
|
|
|
|
std::cout << std::endl << "Retype " << acname << " password: " << std::flush;
|
|
|
|
|
std::cin >> password2;
|
|
|
|
|
std::cout << std::endl << std::flush;
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_TERMIOS_H
|
|
|
|
|
tcsetattr( STDIN_FILENO, TCSADRAIN, &termios_old );
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2001-03-15 11:41:34 +00:00
|
|
|
int main(int argc, char ** argv)
|
|
|
|
|
{
|
2010-08-16 20:13:24 +01:00
|
|
|
varconf::Config * conf = varconf::Config::inst();
|
|
|
|
|
|
|
|
|
|
conf->setParameterLookup('a', "add");
|
|
|
|
|
conf->setParameterLookup('d', "del");
|
2010-12-23 13:40:30 +00:00
|
|
|
conf->setParameterLookup('p', "player");
|
|
|
|
|
conf->setParameterLookup('s', "server");
|
|
|
|
|
conf->setParameterLookup('r', "admin");
|
2010-08-16 20:13:24 +01:00
|
|
|
|
2007-11-14 22:40:17 +00:00
|
|
|
int config_status = loadConfig(argc, argv, USAGE_DBASE);
|
2007-04-28 15:21:17 +00:00
|
|
|
if (config_status < 0) {
|
|
|
|
|
if (config_status == CONFIG_VERSION) {
|
|
|
|
|
reportVersion(argv[0]);
|
|
|
|
|
return 0;
|
|
|
|
|
} else if (config_status == CONFIG_HELP) {
|
2010-12-23 13:40:30 +00:00
|
|
|
usage(std::cout, argv[0], true);
|
2007-04-28 15:21:17 +00:00
|
|
|
return 0;
|
|
|
|
|
} else if (config_status != CONFIG_ERROR) {
|
2010-08-16 20:13:24 +01:00
|
|
|
std::cerr << "Unknown error reading configuration." << std::endl;
|
2007-04-28 15:21:17 +00:00
|
|
|
}
|
2002-01-13 Al Riddoch <alriddoch@zepler.org>
* client/client.cpp, server/server.cpp, common/globals.cpp,
common/globals.h, tools/cycmd.cpp, tools/cydbload.cpp,
tools/cypasswd.cpp: Move code for handling loading of config
from the command line, user config and global config, into
globals.cpp, and make use of it in all tools.
* tools/cycmd.cpp: Fix objtype on server set commands.
* common/Database.cpp, common/Database.h: Implemented new database
interface to PostgreSQL to replace inadequate db3 code.
* common/database.cpp, common/database.h: Old code removed from the
build.
* common/accountbase.h, server/Admin.cpp, server/Persistance.cpp,
server/server.cpp, tools/cydbload.cpp: Fixed for minor changes
in the low level database API.
* common/globals.h, common/globals.cpp, rulesets/EntityFactory.cpp,
server/Admin.cpp, server/CommServer.cpp,
Remove varconf header from globals.h, and put in .cpp files
where it belongs.
2002-01-13 17:24:53 +00:00
|
|
|
// Fatal error loading config file
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 20:13:24 +01:00
|
|
|
int extra_arg_count = argc - config_status;
|
|
|
|
|
|
2001-08-02 14:27:06 +00:00
|
|
|
std::string acname;
|
2010-08-17 12:24:00 +05:30
|
|
|
int actype = PLAYER;
|
2010-08-16 20:13:24 +01:00
|
|
|
int action = SET;
|
2001-03-15 11:41:34 +00:00
|
|
|
|
2010-08-16 20:13:24 +01:00
|
|
|
if (global_conf->findItem("", "add")) {
|
|
|
|
|
action = ADD;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (global_conf->findItem("", "del")) {
|
|
|
|
|
if (action != SET) {
|
2007-04-24 12:59:26 +00:00
|
|
|
usage(std::cerr, argv[0]);
|
2002-07-01 10:21:14 +00:00
|
|
|
return 1;
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|
2010-08-16 20:13:24 +01:00
|
|
|
action = DEL;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-23 13:40:30 +00:00
|
|
|
if (global_conf->findItem("", "player")) {
|
|
|
|
|
if (action == SET) {
|
|
|
|
|
action = MOD;
|
|
|
|
|
}
|
|
|
|
|
actype = PLAYER;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (global_conf->findItem("", "server")) {
|
|
|
|
|
if (action == SET) {
|
|
|
|
|
action = MOD;
|
|
|
|
|
}
|
2010-08-17 12:24:00 +05:30
|
|
|
actype = SERVER;
|
|
|
|
|
}
|
|
|
|
|
|
2010-12-23 13:40:30 +00:00
|
|
|
if (global_conf->findItem("", "admin")) {
|
|
|
|
|
if (action == SET) {
|
|
|
|
|
action = MOD;
|
|
|
|
|
}
|
|
|
|
|
actype = ADMIN;
|
|
|
|
|
}
|
|
|
|
|
|
2010-08-16 20:13:24 +01:00
|
|
|
if (extra_arg_count == 0) {
|
|
|
|
|
if (action != SET) {
|
|
|
|
|
usage(std::cerr, argv[0]);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
acname = "admin";
|
2010-08-17 12:24:00 +05:30
|
|
|
actype = ADMIN;
|
2010-08-16 20:13:24 +01:00
|
|
|
} else if (extra_arg_count == 1) {
|
|
|
|
|
acname = argv[config_status];
|
2001-03-15 11:41:34 +00:00
|
|
|
} else {
|
2007-04-24 12:59:26 +00:00
|
|
|
usage(std::cerr, argv[0]);
|
2002-07-01 10:21:14 +00:00
|
|
|
return 1;
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|
|
|
|
|
|
2008-11-03 17:12:31 +00:00
|
|
|
if (security_init() != 0) {
|
|
|
|
|
log(CRITICAL, "Security initialisation Error. Exiting.");
|
|
|
|
|
return EXIT_SECURITY_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-20 20:10:53 +01:00
|
|
|
Storage db;
|
2001-03-15 11:41:34 +00:00
|
|
|
|
2004-10-03 01:50:49 +00:00
|
|
|
if (db.init() != 0) {
|
2003-08-25 16:54:58 +00:00
|
|
|
std::cerr << "Unable to connect to database" << std::endl << std::flush;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2001-07-04 02:00:11 +00:00
|
|
|
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
// MapType data;
|
2001-07-04 02:00:11 +00:00
|
|
|
|
2003-08-25 16:54:58 +00:00
|
|
|
// bool res = db->getAccount("admin", data);
|
|
|
|
|
|
|
|
|
|
// if (!res) {
|
|
|
|
|
// std::cout << "Admin account does not yet exist" << std::endl << std::flush;
|
|
|
|
|
// acname = "admin";
|
|
|
|
|
// action = ADD;
|
|
|
|
|
// }
|
2001-03-15 11:41:34 +00:00
|
|
|
if (action != ADD) {
|
2004-08-17 Al Riddoch <alriddoch@zepler.org>
* tests/Areatest.cpp, tests/Entitytest.cpp, tests/Foodtest.cpp,
tests/Linetest.cpp, tests/Planttest.cpp, tests/Stackabletest.cpp,
tests/Structuretest.cpp, tests/Thingtest.cpp, tests/Worldtest.cpp,
tests/inheritancetest.cpp, tests/utilitytest.cpp, tools/cycmd.cpp,
tools/cyconvertrules.cpp, tools/cydbload.cpp, tools/cyisoload.cpp,
tools/cyloadrules.cpp, tools/cypasswd.cpp: Convert code to using
Atlas Message typedefs as found in Atlas-C++ 0.6 to aid
conversion later.
2004-08-17 13:23:28 +00:00
|
|
|
MapType o;
|
2011-10-03 22:03:06 +01:00
|
|
|
int res = db.getAccount(acname, o);
|
|
|
|
|
if (res != 0) {
|
2002-01-14 19:10:16 +00:00
|
|
|
std::cout<<"Account "<<acname<<" does not yet exist"<<std::endl<<std::flush;
|
2010-12-23 13:40:30 +00:00
|
|
|
return 1;
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (action == DEL) {
|
2011-10-03 22:03:06 +01:00
|
|
|
int res = db.delAccount(acname);
|
|
|
|
|
if (res == 0) {
|
2002-01-14 19:10:16 +00:00
|
|
|
std::cout << "Account " << acname << " removed." << std::endl << std::flush;
|
2001-07-04 02:00:11 +00:00
|
|
|
}
|
2001-03-15 11:41:34 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
2002-01-17 18:44:21 +00:00
|
|
|
|
2010-12-23 13:40:30 +00:00
|
|
|
MapType amap;
|
|
|
|
|
if (action == MOD) {
|
|
|
|
|
std::string account_type("player");
|
|
|
|
|
if (actype == SERVER) {
|
|
|
|
|
account_type = "server";
|
|
|
|
|
} else if (actype == ADMIN) {
|
|
|
|
|
account_type = "admin";
|
|
|
|
|
}
|
|
|
|
|
amap["type"] = account_type;
|
|
|
|
|
std::cout << "Changing " << acname << " to a " << account_type
|
|
|
|
|
<< " account" << std::endl << std::flush;
|
|
|
|
|
} else {
|
|
|
|
|
std::string password, password2;
|
|
|
|
|
|
|
|
|
|
get_password(acname, password, password2);
|
2002-01-17 18:44:21 +00:00
|
|
|
|
2010-12-23 13:40:30 +00:00
|
|
|
if (password != password2) {
|
|
|
|
|
std::cout << "Passwords did not match. Account database unchanged."
|
|
|
|
|
<< std::endl << std::flush;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2001-07-04 02:00:11 +00:00
|
|
|
amap["password"] = password;
|
2010-12-23 13:40:30 +00:00
|
|
|
}
|
2001-07-04 02:00:11 +00:00
|
|
|
|
2011-09-29 12:11:15 +01:00
|
|
|
int res;
|
2010-12-23 13:40:30 +00:00
|
|
|
if (action == ADD) {
|
|
|
|
|
amap["username"] = acname;
|
|
|
|
|
if (actype == SERVER) {
|
|
|
|
|
std::cout << "Creating server account" << std::endl << std::flush;
|
|
|
|
|
amap["type"] = "server";
|
2001-07-04 02:00:11 +00:00
|
|
|
}
|
2010-12-23 13:40:30 +00:00
|
|
|
res = db.putAccount(amap);
|
2001-03-15 11:41:34 +00:00
|
|
|
} else {
|
2010-12-23 13:40:30 +00:00
|
|
|
res = db.modAccount(amap, acname);
|
|
|
|
|
}
|
2011-09-29 12:11:15 +01:00
|
|
|
if (res == 0) {
|
2010-12-23 13:40:30 +00:00
|
|
|
std::cout << "Account changed." << std::endl << std::flush;
|
|
|
|
|
return 0;
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|
2010-12-23 13:40:30 +00:00
|
|
|
return 1;
|
2001-03-15 11:41:34 +00:00
|
|
|
}
|