cyphesis/server/ServerRouting.cpp
Al Riddoch 488f35b52f * Complete re-write of python script interface to allow other
script types to be cleanly dropped in.

	* Re-work on server and communication related classes to use
	  references where they are apropriate. Code is now much more
	  robust.

	* Huge cleanup of header files removing redundant includes.

	* server/WorldRouter.h: Removed is_object_deleted because it
	  is broken and not used.

	* server/Connection.h: Removed unused disconnect() methods.

	* rulesets/Entity.*: Added new in game base class from which
	  all mind and object classes are derived. This removes
	  clutter of Thing class from mind classes.

	* aiclient/*: Progress with creating AI client for mind handling.

	* common/globals.*: Moved some globals out of server specific files.

	* rulesets/Makefile.am: Separated rulesets code into 3 almost stand
	  alone packages; entities, mind and python interface code.


Acorn may well not work now, but I would apreciate it if people could
test the code on their setups. Lots of code has changed, and almost
everything is now cleaner.

Al Riddoch  <alriddoch@zepler.org>
2001-04-10 19:05:14 +00:00

40 lines
1.2 KiB
C++

// This file may be redistributed and modified only under the terms of
// the GNU General Public License (See COPYING for details).
// Copyright (C) 2000 Alistair Riddoch
#include <Atlas/Message/Object.h>
#include <Atlas/Objects/Root.h>
#include <Atlas/Objects/Operation/Login.h>
#include "ServerRouting_methods.h"
#include "CommServer.h"
#include <common/persistance.h>
ServerRouting::ServerRouting(CommServer * server, const string & name) :
comm_server(server), svr_name(name)
{
fullid = name;
id_dict[fullid] = this;
world=new WorldRouter(this); //game world;
BaseEntity * obj=add_object((BaseEntity*)Persistance::load_admin_account());
//obj->server=this;
obj->world=world;
}
void ServerRouting::addObject(Object * obj) const
{
Object::MapType & omap = obj->AsMap();
omap["server"] = "cyphesis";
omap["ruleset"] = svr_name;
Object::ListType plist(1, "server");
omap["parents"] = plist;
omap["clients"] = comm_server->numClients();
omap["uptime"] = world->upTime();
if (Persistance::restricted) {
omap["restricted"] = "true";
}
// We could add all sorts of stats here, but I don't know exactly what yet.
}