cyphesis/client/BaseClient.cpp

119 lines
3.3 KiB
C++
Raw Normal View History

* 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
// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2000,2001 Alistair Riddoch
#include "CommClient.h"
* tools/cycmd.cpp: Ensure that login op is flushed after it is sent. * server/Player.cpp: Arg order of std::string.compare() is incompatable between recent libstdc++ versions. Switch back to old version, still in most common use. * rulesets/Thing.cpp: Set refno on ops handled in game. * rulesets/Python_API.cpp: Modify Entity() python constructor so that commonly used attributes from old atlas are translated to their modern equivalents. * rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate between previously identical error messages in several places. * rulesets/Py_Object.cpp: Rework conversion of python dict to Atlas map to be more efficient and clean. * rulesets/Py_Location.cpp: Rework setting of vector parts of location so that it can accept vectors from python in more formats, including lists and tuples. * rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h: Re-order virtual methods declarations to fit a convention. * common/stringstream.h: Hardcode use of local stringstream class, as the version provided with older libstdc++ seems to be broken. * common/database.cpp: Use the common header to pick the right stringstream implementation. * common/BaseWorld.cpp, server/Persistance.cpp: Removed unused stringstream include. * rulesets/Creator.cpp: Added extra debug output. * client/define_world.h, client/define_world.cpp, client/CommClient.h: Use CreatorClient to store Creators mind, instead of BaseMind. * client/client.cpp, client/ObserverClient.h, client/ObserverClient.cpp, client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp: Modify method names to fit capitalisation conventions. * client/CreatorClient.cpp: Implement creation of in-game entities, using creator entity. * client/CommClient.cpp: Added correct client side monitoring of creator entity. * client/ClientConnection.h, client/ClientConnection.cpp: Added pending method to establish if ops are in the queue. Switched send() method so we only send ops. Add setting of serialno of sent ops, starting with an offset of 512. * client/CharacterClient.h: Removed unused member, opFound. * client/CharacterClient.cpp: Debugged sendAndWait() method. Al Riddoch <alriddoch@zepler.org>
2001-08-16 17:39:42 +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/debug.h"
#include "common/BaseEntity.h"
#include <Atlas/Objects/Operation/Create.h>
#include <Atlas/Objects/Operation/Login.h>
static const bool debug_flag = false;
// This is a template which requires debug flag to be declared.
#include "rulesets/Entity_getLocation.h"
CommClient::CommClient()
{
}
CommClient::~CommClient()
* 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
{
}
MapType CommClient::createPlayer(const std::string & name,
const std::string & password)
* 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_playerName = name;
MapType player_ent;
player_ent["username"] = name;
* 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
player_ent["password"] = password;
player_ent["parents"] = ListType(1, "player");
* 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
debug(std::cout << "Loggin " << name << " in with " << password << " as 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
Login loginAccountOp;
loginAccountOp.setArgs(ListType(1,player_ent));
send(loginAccountOp);
* 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 (m_connection.wait()) {
Create createAccountOp;
createAccountOp.setArgs(ListType(1,player_ent));
send(createAccountOp);
if (m_connection.wait()) {
* 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
std::cerr << "ERROR: Failed to log into server" << std::endl
<< std::flush;
return MapType();
* 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
}
}
const MapType & ent = m_connection.getReply();
* 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
MapType::const_iterator I = ent.find("id");
if (I == ent.end() || !I->second.isString()) {
std::cerr << "ERROR: Logged in, but account has no id" << std::endl
<< std::flush;
} else {
m_playerId = I->second.asString();
}
* 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 (ent.find("characters") != ent.end()) {
//}
return ent;
}
* tools/cycmd.cpp: Ensure that login op is flushed after it is sent. * server/Player.cpp: Arg order of std::string.compare() is incompatable between recent libstdc++ versions. Switch back to old version, still in most common use. * rulesets/Thing.cpp: Set refno on ops handled in game. * rulesets/Python_API.cpp: Modify Entity() python constructor so that commonly used attributes from old atlas are translated to their modern equivalents. * rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate between previously identical error messages in several places. * rulesets/Py_Object.cpp: Rework conversion of python dict to Atlas map to be more efficient and clean. * rulesets/Py_Location.cpp: Rework setting of vector parts of location so that it can accept vectors from python in more formats, including lists and tuples. * rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h: Re-order virtual methods declarations to fit a convention. * common/stringstream.h: Hardcode use of local stringstream class, as the version provided with older libstdc++ seems to be broken. * common/database.cpp: Use the common header to pick the right stringstream implementation. * common/BaseWorld.cpp, server/Persistance.cpp: Removed unused stringstream include. * rulesets/Creator.cpp: Added extra debug output. * client/define_world.h, client/define_world.cpp, client/CommClient.h: Use CreatorClient to store Creators mind, instead of BaseMind. * client/client.cpp, client/ObserverClient.h, client/ObserverClient.cpp, client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp: Modify method names to fit capitalisation conventions. * client/CreatorClient.cpp: Implement creation of in-game entities, using creator entity. * client/CommClient.cpp: Added correct client side monitoring of creator entity. * client/ClientConnection.h, client/ClientConnection.cpp: Added pending method to establish if ops are in the queue. Switched send() method so we only send ops. Add setting of serialno of sent ops, starting with an offset of 512. * client/CharacterClient.h: Removed unused member, opFound. * client/CharacterClient.cpp: Debugged sendAndWait() method. Al Riddoch <alriddoch@zepler.org>
2001-08-16 17:39:42 +00:00
CreatorClient * CommClient::createCharacter(const std::string & type)
* 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
{
MapType character;
character["name"] = m_playerName;
character["parents"] = ListType(1,type);
* 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
Create createOp;
createOp.setFrom(m_playerId);
createOp.setArgs(ListType(1,character));
* 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
send(createOp);
if (m_connection.wait()) {
* 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
std::cerr << "ERROR: Failed to create character type: "
<< type << std::endl << std::flush;
return NULL;
}
const MapType & body = m_connection.getReply();
* 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
const std::string & id = body.find("id")->second.asString();
* tools/cycmd.cpp: Ensure that login op is flushed after it is sent. * server/Player.cpp: Arg order of std::string.compare() is incompatable between recent libstdc++ versions. Switch back to old version, still in most common use. * rulesets/Thing.cpp: Set refno on ops handled in game. * rulesets/Python_API.cpp: Modify Entity() python constructor so that commonly used attributes from old atlas are translated to their modern equivalents. * rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate between previously identical error messages in several places. * rulesets/Py_Object.cpp: Rework conversion of python dict to Atlas map to be more efficient and clean. * rulesets/Py_Location.cpp: Rework setting of vector parts of location so that it can accept vectors from python in more formats, including lists and tuples. * rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h: Re-order virtual methods declarations to fit a convention. * common/stringstream.h: Hardcode use of local stringstream class, as the version provided with older libstdc++ seems to be broken. * common/database.cpp: Use the common header to pick the right stringstream implementation. * common/BaseWorld.cpp, server/Persistance.cpp: Removed unused stringstream include. * rulesets/Creator.cpp: Added extra debug output. * client/define_world.h, client/define_world.cpp, client/CommClient.h: Use CreatorClient to store Creators mind, instead of BaseMind. * client/client.cpp, client/ObserverClient.h, client/ObserverClient.cpp, client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp: Modify method names to fit capitalisation conventions. * client/CreatorClient.cpp: Implement creation of in-game entities, using creator entity. * client/CommClient.cpp: Added correct client side monitoring of creator entity. * client/ClientConnection.h, client/ClientConnection.cpp: Added pending method to establish if ops are in the queue. Switched send() method so we only send ops. Add setting of serialno of sent ops, starting with an offset of 512. * client/CharacterClient.h: Removed unused member, opFound. * client/CharacterClient.cpp: Debugged sendAndWait() method. Al Riddoch <alriddoch@zepler.org>
2001-08-16 17:39:42 +00:00
EntityDict tmp;
* 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
CreatorClient * obj = new CreatorClient(id, type, m_connection);
* tools/cycmd.cpp: Ensure that login op is flushed after it is sent. * server/Player.cpp: Arg order of std::string.compare() is incompatable between recent libstdc++ versions. Switch back to old version, still in most common use. * rulesets/Thing.cpp: Set refno on ops handled in game. * rulesets/Python_API.cpp: Modify Entity() python constructor so that commonly used attributes from old atlas are translated to their modern equivalents. * rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate between previously identical error messages in several places. * rulesets/Py_Object.cpp: Rework conversion of python dict to Atlas map to be more efficient and clean. * rulesets/Py_Location.cpp: Rework setting of vector parts of location so that it can accept vectors from python in more formats, including lists and tuples. * rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h: Re-order virtual methods declarations to fit a convention. * common/stringstream.h: Hardcode use of local stringstream class, as the version provided with older libstdc++ seems to be broken. * common/database.cpp: Use the common header to pick the right stringstream implementation. * common/BaseWorld.cpp, server/Persistance.cpp: Removed unused stringstream include. * rulesets/Creator.cpp: Added extra debug output. * client/define_world.h, client/define_world.cpp, client/CommClient.h: Use CreatorClient to store Creators mind, instead of BaseMind. * client/client.cpp, client/ObserverClient.h, client/ObserverClient.cpp, client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp: Modify method names to fit capitalisation conventions. * client/CreatorClient.cpp: Implement creation of in-game entities, using creator entity. * client/CommClient.cpp: Added correct client side monitoring of creator entity. * client/ClientConnection.h, client/ClientConnection.cpp: Added pending method to establish if ops are in the queue. Switched send() method so we only send ops. Add setting of serialno of sent ops, starting with an offset of 512. * client/CharacterClient.h: Removed unused member, opFound. * client/CharacterClient.cpp: Debugged sendAndWait() method. Al Riddoch <alriddoch@zepler.org>
2001-08-16 17:39:42 +00:00
obj->merge(body);
obj->getLocation(body, tmp);
// obj = EntityFactory::instance()->newThing(type, body, tmp);
* 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
// FIXME Do we need to create a local entity for this as is done in
// the python version? If so, do we need to keep track of a full world
// model here, or just in the minds (when we become an AI client
return obj;
}
// I'm making this pure virtual, to see if that is desired.
//void CommClient::idle() {
// time.sleep(0.1);
//}
* tools/cycmd.cpp: Ensure that login op is flushed after it is sent. * server/Player.cpp: Arg order of std::string.compare() is incompatable between recent libstdc++ versions. Switch back to old version, still in most common use. * rulesets/Thing.cpp: Set refno on ops handled in game. * rulesets/Python_API.cpp: Modify Entity() python constructor so that commonly used attributes from old atlas are translated to their modern equivalents. * rulesets/Py_Thing.cpp, rulesets/Py_Mind.cpp: Differentiate between previously identical error messages in several places. * rulesets/Py_Object.cpp: Rework conversion of python dict to Atlas map to be more efficient and clean. * rulesets/Py_Location.cpp: Rework setting of vector parts of location so that it can accept vectors from python in more formats, including lists and tuples. * rulesets/Creator.h, rulesets/Character.h, common/BaseEntity.h: Re-order virtual methods declarations to fit a convention. * common/stringstream.h: Hardcode use of local stringstream class, as the version provided with older libstdc++ seems to be broken. * common/database.cpp: Use the common header to pick the right stringstream implementation. * common/BaseWorld.cpp, server/Persistance.cpp: Removed unused stringstream include. * rulesets/Creator.cpp: Added extra debug output. * client/define_world.h, client/define_world.cpp, client/CommClient.h: Use CreatorClient to store Creators mind, instead of BaseMind. * client/client.cpp, client/ObserverClient.h, client/ObserverClient.cpp, client/CreatorClient.h, client/CommClient.h, client/CommClient.cpp: Modify method names to fit capitalisation conventions. * client/CreatorClient.cpp: Implement creation of in-game entities, using creator entity. * client/CommClient.cpp: Added correct client side monitoring of creator entity. * client/ClientConnection.h, client/ClientConnection.cpp: Added pending method to establish if ops are in the queue. Switched send() method so we only send ops. Add setting of serialno of sent ops, starting with an offset of 512. * client/CharacterClient.h: Removed unused member, opFound. * client/CharacterClient.cpp: Debugged sendAndWait() method. Al Riddoch <alriddoch@zepler.org>
2001-08-16 17:39:42 +00:00
void CommClient::handleNet()
* 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
{
RootOperation * input;
while ((input = m_connection.pop()) != NULL) {
OpVector res;
m_character->operation(*input, res);
for (OpVector::const_iterator I = res.begin(); I != res.end(); I++) {
* 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
send(*(*I));
}
delete input;
* 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
}
}