mirror of
https://github.com/worldforge/cyphesis
synced 2026-08-13 12:26:04 -04:00
which prevents users from being able to create accounts. * server/ServerRouting.cpp: Added restricted flag to the server Object passed to client as result of a Get operation, so the client can report it to the user. * tools/cypasswd.cpp: Added tool to administrate password database table. * server/server.*: Added exit flag to ensure that of exit is requested database is shutdown properlly. * server/WorldRouter.cpp: Maintenance shutdown is now done cleanly. * server/Connection.cpp: Added code to handle accounts using the persistance system. Accounts would now be handled by the database if the persistance code was complete. * common/persistance.*: More work on database code. Al
40 lines
1.2 KiB
C++
40 lines
1.2 KiB
C++
// This file may be redistributed and modified only under the terms of
|
|
// the GNU Lesser 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.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.
|
|
}
|