Beispiel #1
0
	EventReturn OnSerializableGetId(Serialize::ID &id) override
	{
		std::vector<Anope::string> args = { "INCR", "id" };

		auto f = [&](const Reply &r)
		{
			id = r.i;
		};

		FInterface inter(this, f);
		redis->SendCommand(&inter, args);
		while (redis->BlockAndProcess());
		return EVENT_ALLOW;
	}
Beispiel #2
0
	EventReturn OnLoadDatabase() override
	{
		if (!redis)
			return EVENT_STOP;

		for (Serialize::TypeBase *type : Serialize::TypeBase::GetTypes())
			this->OnSerializeTypeCreate(type);

		while (redis->BlockAndProcess());

		redis->Subscribe(&this->sl, "anope");

		return EVENT_STOP;
	}
Beispiel #3
0
	EventReturn OnLoadDatabase() override
	{
		if (!redis)
			return EVENT_STOP;

		const std::map<Anope::string, Serialize::TypeBase *> &types = Serialize::TypeBase::GetTypes();
		for (const std::pair<Anope::string, Serialize::TypeBase *> &p : types)
			this->OnSerializeTypeCreate(p.second);

		while (redis->BlockAndProcess());

		redis->Subscribe(&this->sl, "anope");

		return EVENT_STOP;
	}