mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
parent
03428d9825
commit
f4a01f3a5d
37 changed files with 527 additions and 272 deletions
|
@ -3882,25 +3882,6 @@ PlayerSAO* Server::emergePlayer(const char *name, session_t peer_id, u16 proto_v
|
|||
return playersao;
|
||||
}
|
||||
|
||||
bool Server::registerModStorage(ModMetadata *storage)
|
||||
{
|
||||
if (m_mod_storages.find(storage->getModName()) != m_mod_storages.end()) {
|
||||
errorstream << "Unable to register same mod storage twice. Storage name: "
|
||||
<< storage->getModName() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
m_mod_storages[storage->getModName()] = storage;
|
||||
return true;
|
||||
}
|
||||
|
||||
void Server::unregisterModStorage(const std::string &name)
|
||||
{
|
||||
std::unordered_map<std::string, ModMetadata *>::const_iterator it = m_mod_storages.find(name);
|
||||
if (it != m_mod_storages.end())
|
||||
m_mod_storages.erase(name);
|
||||
}
|
||||
|
||||
void dedicated_server_loop(Server &server, bool &kill)
|
||||
{
|
||||
verbosestream<<"dedicated_server_loop()"<<std::endl;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue