2012-01-12 00:37:43 +00:00
|
|
|
// Cyphesis Online RPG Server and AI Engine
|
|
|
|
|
// Copyright (C) 2011 Alistair Riddoch
|
|
|
|
|
//
|
|
|
|
|
// 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef NDEBUG
|
|
|
|
|
#undef NDEBUG
|
|
|
|
|
#endif
|
|
|
|
|
#ifndef DEBUG
|
|
|
|
|
#define DEBUG
|
|
|
|
|
#endif
|
|
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
#include "TestBase.h"
|
2012-01-12 13:06:48 +00:00
|
|
|
#include "TestWorld.h"
|
2012-08-01 19:42:36 +01:00
|
|
|
#include "null_stream.h"
|
2012-01-12 13:06:48 +00:00
|
|
|
|
2012-01-12 18:25:39 +00:00
|
|
|
#include "server/Connection.h"
|
2012-01-12 19:59:00 +00:00
|
|
|
#include "server/Lobby.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
#include "server/Player.h"
|
|
|
|
|
#include "server/ServerAccount.h"
|
2012-01-12 13:06:48 +00:00
|
|
|
#include "server/ServerRouting.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
#include "server/SystemAccount.h"
|
|
|
|
|
|
2012-01-16 17:15:55 +00:00
|
|
|
#include "common/id.h"
|
|
|
|
|
#include "common/TypeNode.h"
|
2014-02-03 12:19:42 +01:00
|
|
|
#include "common/CommSocket.h"
|
2018-05-19 23:18:40 +02:00
|
|
|
#include "DatabaseNull.h"
|
2018-10-31 21:38:35 +01:00
|
|
|
#include "rules/simulation/Entity.h"
|
2012-01-16 17:15:55 +00:00
|
|
|
|
2012-01-12 19:59:00 +00:00
|
|
|
#include <Atlas/Objects/Anonymous.h>
|
|
|
|
|
#include <Atlas/Objects/Operation.h>
|
2012-01-12 18:25:39 +00:00
|
|
|
|
2012-01-12 00:37:43 +00:00
|
|
|
#include <cassert>
|
2018-05-19 23:18:40 +02:00
|
|
|
#include <server/Persistence.h>
|
2012-01-12 00:37:43 +00:00
|
|
|
|
2012-01-12 18:55:59 +00:00
|
|
|
using Atlas::Message::Element;
|
|
|
|
|
using Atlas::Message::ListType;
|
|
|
|
|
using Atlas::Message::MapType;
|
|
|
|
|
using Atlas::Objects::Root;
|
|
|
|
|
using Atlas::Objects::Entity::RootEntity;
|
|
|
|
|
using Atlas::Objects::Entity::Anonymous;
|
|
|
|
|
using Atlas::Objects::Operation::Create;
|
|
|
|
|
using Atlas::Objects::Operation::Get;
|
|
|
|
|
using Atlas::Objects::Operation::Imaginary;
|
|
|
|
|
using Atlas::Objects::Operation::Logout;
|
|
|
|
|
using Atlas::Objects::Operation::Look;
|
|
|
|
|
using Atlas::Objects::Operation::Set;
|
|
|
|
|
using Atlas::Objects::Operation::Talk;
|
|
|
|
|
using Atlas::Objects::Operation::Move;
|
2012-01-12 19:59:00 +00:00
|
|
|
using Atlas::Objects::smart_dynamic_cast;
|
2012-01-12 00:37:43 +00:00
|
|
|
|
2012-01-16 17:15:55 +00:00
|
|
|
class SpawningTestWorld : public TestWorld {
|
|
|
|
|
public:
|
2018-08-05 14:31:04 +02:00
|
|
|
SpawningTestWorld(Ref<Entity> gw) : TestWorld(gw) { }
|
2012-01-16 17:15:55 +00:00
|
|
|
|
2018-07-24 21:18:50 +02:00
|
|
|
Ref<LocatedEntity> addEntity(const Ref<LocatedEntity>& ent) override{
|
2018-08-17 22:04:07 +02:00
|
|
|
ent->m_location.m_parent = m_gw;
|
2012-01-16 17:15:55 +00:00
|
|
|
ent->m_location.m_pos = WFMath::Point<3>(0,0,0);
|
|
|
|
|
m_eobjects[ent->getIntId()] = ent;
|
|
|
|
|
return ent;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-24 21:18:50 +02:00
|
|
|
Ref<LocatedEntity> addNewEntity(const std::string & t,
|
|
|
|
|
const Atlas::Objects::Entity::RootEntity &) override {
|
2012-01-16 17:15:55 +00:00
|
|
|
std::string id;
|
|
|
|
|
long intId = newId(id);
|
|
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
Ref<Entity> e = new Entity(id, intId);
|
2012-01-16 17:15:55 +00:00
|
|
|
|
|
|
|
|
e->setType(new TypeNode(t));
|
|
|
|
|
return addEntity(e);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2014-02-03 12:19:42 +01:00
|
|
|
class TestCommSocket : public CommSocket
|
|
|
|
|
{
|
2012-01-12 00:37:43 +00:00
|
|
|
public:
|
2014-02-03 12:19:42 +01:00
|
|
|
TestCommSocket() : CommSocket(*(boost::asio::io_service*)0)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual void disconnect()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
virtual int flush()
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-12 00:37:43 +00:00
|
|
|
};
|
2012-01-12 18:25:39 +00:00
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
class AccountConnectionintegration : public Cyphesis::TestBase {
|
2012-01-12 18:25:39 +00:00
|
|
|
protected:
|
2018-05-19 23:18:40 +02:00
|
|
|
DatabaseNull m_database;
|
|
|
|
|
Persistence* m_persistence;
|
2018-08-05 14:31:04 +02:00
|
|
|
Ref<Entity> m_tlve;
|
2012-01-12 18:25:39 +00:00
|
|
|
BaseWorld * m_world;
|
|
|
|
|
ServerRouting * m_server;
|
|
|
|
|
Connection * m_connection;
|
|
|
|
|
public:
|
2012-12-04 21:04:33 +00:00
|
|
|
AccountConnectionintegration();
|
2012-01-12 18:25:39 +00:00
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
void setup();
|
|
|
|
|
void teardown();
|
2012-01-12 18:25:39 +00:00
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
void test_account_creation();
|
2012-01-12 18:25:39 +00:00
|
|
|
|
2012-01-12 19:59:00 +00:00
|
|
|
Connection * connection() const { return m_connection; }
|
|
|
|
|
ServerRouting * server() const { return m_server; }
|
2012-01-12 18:25:39 +00:00
|
|
|
};
|
2012-01-12 00:37:43 +00:00
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
AccountConnectionintegration::AccountConnectionintegration()
|
|
|
|
|
{
|
|
|
|
|
ADD_TEST(AccountConnectionintegration::test_account_creation);
|
|
|
|
|
}
|
2012-11-15 19:46:44 +00:00
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
void AccountConnectionintegration::setup()
|
2012-01-12 00:37:43 +00:00
|
|
|
{
|
2018-05-19 23:18:40 +02:00
|
|
|
m_persistence = new Persistence(m_database);
|
2012-12-04 21:04:33 +00:00
|
|
|
m_tlve = new Entity("0", 0);
|
2018-08-05 14:31:04 +02:00
|
|
|
m_world = new SpawningTestWorld(m_tlve);
|
2012-12-04 21:04:33 +00:00
|
|
|
m_server = new ServerRouting(*m_world,
|
|
|
|
|
"testrules",
|
|
|
|
|
"testname",
|
|
|
|
|
"1", 1, "2", 2);
|
2014-02-03 12:19:42 +01:00
|
|
|
m_connection = new Connection(*new TestCommSocket(),
|
2012-12-04 21:04:33 +00:00
|
|
|
*m_server,
|
|
|
|
|
"test_addr",
|
|
|
|
|
"3", 3);
|
|
|
|
|
}
|
2012-01-12 19:59:00 +00:00
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
void AccountConnectionintegration::teardown()
|
|
|
|
|
{
|
|
|
|
|
delete m_connection;
|
|
|
|
|
delete m_server;
|
|
|
|
|
delete m_world;
|
2018-05-19 23:18:40 +02:00
|
|
|
delete m_persistence;
|
2012-12-04 21:04:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static OpVector test_sent_ops;
|
|
|
|
|
|
|
|
|
|
void AccountConnectionintegration::test_account_creation()
|
|
|
|
|
{
|
2012-01-12 19:59:00 +00:00
|
|
|
// Basic player account creation
|
|
|
|
|
{
|
|
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_NOT_NULL(m_connection);
|
|
|
|
|
ASSERT_TRUE(m_connection->objects().empty());
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
Create op;
|
|
|
|
|
Anonymous create_arg;
|
2017-07-24 13:39:22 +02:00
|
|
|
create_arg->setParent("player");
|
2012-01-12 19:59:00 +00:00
|
|
|
create_arg->setAttr("username", "39d409ec");
|
|
|
|
|
create_arg->setAttr("password", "6a6e71bab281");
|
|
|
|
|
op->setArgs1(create_arg);
|
|
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(test_sent_ops.empty());
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
// Send the operation to create the account
|
2012-12-04 21:04:33 +00:00
|
|
|
m_connection->externalOperation(op, *m_connection);
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
// There should be a response op
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(!test_sent_ops.empty());
|
|
|
|
|
ASSERT_EQUAL(test_sent_ops.size(), 1u);
|
2012-01-12 19:59:00 +00:00
|
|
|
// and the account creation should have created an object bound
|
|
|
|
|
// to this connection.
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(!m_connection->objects().empty());
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
// Check the response is an info indicating successful account
|
|
|
|
|
// creation.
|
2012-11-15 19:46:44 +00:00
|
|
|
const Operation & reply = test_sent_ops.front();
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_EQUAL(reply->getClassNo(), Atlas::Objects::Operation::INFO_NO);
|
2012-01-12 19:59:00 +00:00
|
|
|
// The Info response should have an argument describing the created
|
|
|
|
|
// account
|
|
|
|
|
const std::vector<Root> & reply_args = reply->getArgs();
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(!reply_args.empty());
|
2012-01-12 19:59:00 +00:00
|
|
|
RootEntity account = smart_dynamic_cast<RootEntity>(reply_args.front());
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(account.isValid());
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
// The account ID should be provided
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(!account->isDefaultId());
|
2012-01-16 17:15:55 +00:00
|
|
|
const std::string account_id = account->getId();
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(!account_id.empty());
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
// Check the account has been registered in the server object
|
2012-12-04 21:04:33 +00:00
|
|
|
Router * account_router_ptr = m_server->getObject(account_id);
|
|
|
|
|
ASSERT_NOT_NULL(account_router_ptr);
|
2012-01-12 19:59:00 +00:00
|
|
|
|
|
|
|
|
// Check the account has been logged into the lobby
|
2018-10-27 13:13:45 +02:00
|
|
|
const auto & lobby_dict = m_server->m_lobby.getAccounts();
|
|
|
|
|
auto I = lobby_dict.find(account_id);
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_TRUE(I != lobby_dict.end());
|
2018-10-27 13:13:45 +02:00
|
|
|
auto account_ptr = I->second;
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_EQUAL(account_router_ptr, account_ptr);
|
2012-01-12 19:59:00 +00:00
|
|
|
|
2012-01-12 20:45:31 +00:00
|
|
|
// Basic login as now been established by account creation
|
|
|
|
|
|
|
|
|
|
// Set up some other account details
|
|
|
|
|
create_arg->setAttr("username", "89cae312");
|
|
|
|
|
create_arg->setAttr("password", "d730b8bd2d6c");
|
|
|
|
|
|
|
|
|
|
// and try an additional account creation, which should fail.
|
|
|
|
|
// Multiple logins are ok, but there is no reason to allow multiple
|
|
|
|
|
// account creations.
|
2012-11-15 19:46:44 +00:00
|
|
|
test_sent_ops.clear();
|
2012-12-04 21:04:33 +00:00
|
|
|
m_connection->externalOperation(op, *m_connection);
|
|
|
|
|
ASSERT_TRUE(!test_sent_ops.empty());
|
|
|
|
|
ASSERT_EQUAL(test_sent_ops.size(), 1u);
|
2012-01-16 11:37:59 +00:00
|
|
|
|
2012-11-15 19:46:44 +00:00
|
|
|
const Operation & error_reply = test_sent_ops.front();
|
2012-12-04 21:04:33 +00:00
|
|
|
ASSERT_EQUAL(error_reply->getClassNo(),
|
|
|
|
|
Atlas::Objects::Operation::ERROR_NO);
|
2012-01-16 17:15:55 +00:00
|
|
|
|
2012-01-12 20:45:31 +00:00
|
|
|
|
2012-01-12 19:59:00 +00:00
|
|
|
// TODO Character creation etc?
|
|
|
|
|
// TODO Lobby interaction?
|
|
|
|
|
// TODO Logout ?
|
|
|
|
|
}
|
2012-01-12 00:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
2012-12-04 21:04:33 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
AccountConnectionintegration t;
|
|
|
|
|
|
|
|
|
|
return t.run();
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-12 00:37:43 +00:00
|
|
|
// stubs
|
|
|
|
|
|
2012-09-11 22:53:15 +01:00
|
|
|
|
2012-09-06 13:48:40 +01:00
|
|
|
|
2018-11-03 16:43:33 +01:00
|
|
|
#include "rules/simulation/ExternalMind.h"
|
|
|
|
|
#include "rules/simulation/ExternalProperty.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
#include "server/Juncture.h"
|
|
|
|
|
#include "server/Persistence.h"
|
|
|
|
|
#include "server/Ruleset.h"
|
2013-07-26 20:14:33 +02:00
|
|
|
#include "server/PossessionAuthenticator.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
|
2012-01-12 13:06:48 +00:00
|
|
|
#include "common/const.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
#include "common/globals.h"
|
|
|
|
|
#include "common/log.h"
|
2012-01-12 13:06:48 +00:00
|
|
|
#include "common/Monitors.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
#include "common/PropertyManager.h"
|
2012-01-12 13:06:48 +00:00
|
|
|
#include "common/Variable.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
|
|
|
|
|
#include <cstdlib>
|
2016-01-20 16:14:21 +01:00
|
|
|
#include "stubs/server/stubBuildid.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
|
2012-01-12 13:06:48 +00:00
|
|
|
namespace consts {
|
|
|
|
|
const char * version = "test_build";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// globals - why do we have these again?
|
|
|
|
|
|
2013-11-15 00:16:17 +01:00
|
|
|
const char * const CYPHESIS = "cyphesisAccountConnectionintegration";
|
2012-01-12 13:06:48 +00:00
|
|
|
int timeoffset = 0;
|
|
|
|
|
std::string instance(CYPHESIS);
|
|
|
|
|
|
2012-08-01 19:42:36 +01:00
|
|
|
int CommSocket::flush()
|
2012-01-12 18:25:39 +00:00
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-12 13:06:48 +00:00
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
#define STUB_ExternalMind_connectionId
|
2012-01-12 13:06:48 +00:00
|
|
|
const std::string & ExternalMind::connectionId()
|
|
|
|
|
{
|
2018-02-08 21:46:49 +01:00
|
|
|
assert(m_link != 0);
|
|
|
|
|
return m_link->getId();
|
2012-01-12 13:06:48 +00:00
|
|
|
}
|
|
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
#define STUB_ExternalMind_linkUp
|
2012-08-13 22:08:22 +01:00
|
|
|
void ExternalMind::linkUp(Link * c)
|
2012-01-12 13:06:48 +00:00
|
|
|
{
|
2018-02-08 21:46:49 +01:00
|
|
|
m_link = c;
|
2012-01-12 13:06:48 +00:00
|
|
|
}
|
|
|
|
|
|
2018-11-03 16:43:33 +01:00
|
|
|
#include "stubs/rules/simulation/stubExternalMind.h"
|
|
|
|
|
#include "stubs/rules/simulation/stubExternalProperty.h"
|
|
|
|
|
#include "stubs/rules/simulation/stubMindsProperty.h"
|
|
|
|
|
#include "stubs/rules/simulation/stubAdminMind.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
#include "stubs/server/stubJuncture.h"
|
2012-11-15 19:46:44 +00:00
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
#define STUB_Link_send
|
2016-12-19 22:01:23 +01:00
|
|
|
void Link::send(const OpVector& opVector) const
|
|
|
|
|
{
|
|
|
|
|
for (const auto& op : opVector) {
|
|
|
|
|
test_sent_ops.push_back(op);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-15 19:46:44 +00:00
|
|
|
void Link::send(const Operation & op) const
|
|
|
|
|
{
|
|
|
|
|
test_sent_ops.push_back(op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2018-10-27 13:13:45 +02:00
|
|
|
#include "stubs/common/stubLink.h"
|
2018-05-10 00:21:30 +02:00
|
|
|
#include "server/PropertyRuleHandler.h"
|
|
|
|
|
#include "server/ArchetypeRuleHandler.h"
|
|
|
|
|
#include "server/EntityRuleHandler.h"
|
|
|
|
|
#include "server/OpRuleHandler.h"
|
|
|
|
|
#include "stubs/server/stubRuleset.h"
|
2018-05-19 23:18:40 +02:00
|
|
|
#include "stubs/common/stubDatabase.h"
|
2018-08-04 01:12:45 +02:00
|
|
|
#include "stubs/server/stubPossessionAuthenticator.h"
|
2018-05-19 21:47:24 +02:00
|
|
|
#include "stubs/server/stubPersistence.h"
|
2013-06-25 21:42:24 +02:00
|
|
|
|
2012-01-12 00:37:43 +00:00
|
|
|
void log(LogLevel lvl, const std::string & msg)
|
|
|
|
|
{
|
2012-01-12 19:59:00 +00:00
|
|
|
std::cout << msg << std::endl;
|
2012-01-12 00:37:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void logEvent(LogEvent lev, const std::string & msg)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2018-11-03 16:43:33 +01:00
|
|
|
#include "stubs/rules/simulation/stubThing.h"
|
|
|
|
|
#include "stubs/rules/simulation/stubEntity.h"
|
|
|
|
|
#include "stubs/rules/stubLocatedEntity.h"
|
2015-04-09 14:50:45 +02:00
|
|
|
#include "stubs/common/stubVariable.h"
|
|
|
|
|
#include "stubs/common/stubMonitors.h"
|
2015-05-23 16:47:45 +02:00
|
|
|
#include "stubs/server/stubExternalMindsManager.h"
|
|
|
|
|
#include "stubs/server/stubExternalMindsConnection.h"
|
|
|
|
|
#include "stubs/common/stubOperationsDispatcher.h"
|
2018-11-03 16:43:33 +01:00
|
|
|
#include "stubs/rules/stubLocation.h"
|
2018-04-25 20:09:14 +02:00
|
|
|
#include "stubs/common/stubPropertyManager.h"
|
2012-01-12 00:37:43 +00:00
|
|
|
|
|
|
|
|
long integerId(const std::string & id)
|
|
|
|
|
{
|
|
|
|
|
long intId = strtol(id.c_str(), 0, 10);
|
|
|
|
|
if (intId == 0 && id != "0") {
|
|
|
|
|
intId = -1L;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return intId;
|
|
|
|
|
}
|
|
|
|
|
|
2012-01-12 19:59:00 +00:00
|
|
|
static long idGenerator = 500;
|
2012-01-12 00:37:43 +00:00
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
|
|
|
|
|
|
long newId(std::string & id)
|
|
|
|
|
{
|
|
|
|
|
static char buf[32];
|
|
|
|
|
long new_id = ++idGenerator;
|
|
|
|
|
sprintf(buf, "%ld", new_id);
|
|
|
|
|
id = buf;
|
|
|
|
|
assert(!id.empty());
|
|
|
|
|
return new_id;
|
|
|
|
|
}
|
2012-01-12 13:06:48 +00:00
|
|
|
|
|
|
|
|
void encrypt_password(const std::string & pwd, std::string & hash)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int check_password(const std::string & pwd, const std::string & hash)
|
|
|
|
|
{
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool_config_register::bool_config_register(bool & var,
|
|
|
|
|
const char * section,
|
|
|
|
|
const char * setting,
|
|
|
|
|
const char * help)
|
|
|
|
|
{
|
|
|
|
|
}
|
2012-10-25 10:37:45 -04:00
|
|
|
void hash_password(const std::string & pwd, const std::string & salt,
|
|
|
|
|
std::string & hash)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#include <common/Shaker.h>
|
|
|
|
|
|
|
|
|
|
Shaker::Shaker()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string Shaker::generateSalt(size_t length)
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
2018-02-06 10:26:54 +01:00
|
|
|
std::string assets_directory = "";
|