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; }
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; }
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; }