- // As the module doesn't tell us what ServiceProviders it has, let's iterate all (yay ...) the ServiceProviders
- // Good thing people don't run loading and unloading those all the time
- for (std::multimap<std::string, ServiceProvider*>::iterator i = ServerInstance->Modules->DataProviders.begin(); i != ServerInstance->Modules->DataProviders.end(); ++i)
- {
- ServiceProvider* provider = i->second;
-
- // Does the service belong to the new mod?
- // In the case this is our first run (mod == NULL, continue anyway)
- if (mod && provider->creator != mod)
- continue;
-
- // Check if it's a hash provider
- if (provider->name.compare(0, 5, "hash/"))
- continue;
-
- HashProvider* hp = static_cast<HashProvider*>(provider);
-
- if (hp->IsKDF())
- continue;
-
- bool has_prov = false;
- for (std::vector<PBKDF2Provider*>::const_iterator j = providers.begin(); j != providers.end(); ++j)
- {
- if ((*j)->provider == hp)
- {
- has_prov = true;
- break;
- }
- }
- if (has_prov)
- continue;
+ // Check if it's a hash provider
+ if (provider.name.compare(0, 5, "hash/"))
+ return;
- newProv = true;
+ HashProvider* hp = static_cast<HashProvider*>(&provider);
+ if (hp->IsKDF())
+ return;
- PBKDF2Provider* prov = new PBKDF2Provider(this, hp);
- providers.push_back(prov);
- ServerInstance->Modules->AddService(*prov);
- }
+ PBKDF2Provider* prov = new PBKDF2Provider(this, hp);