// Lock environment
JMutexAutoLock envlock(m_env_mutex);
+ // Load mapgen params from Settings
+ m_emerge->loadMapgenParams();
+
+ // Create the Map (loads map_meta.txt, overriding configured mapgen params)
+ ServerMap *servermap = new ServerMap(path_world, this, m_emerge);
+
// Initialize scripting
infostream<<"Server: Initializing Lua"<<std::endl;
std::string scriptpath = getBuiltinLuaPath() + DIR_DELIM "init.lua";
- if (!m_script->loadScript(scriptpath)) {
+ if (!m_script->loadScript(scriptpath))
throw ModError("Failed to load and run " + scriptpath);
- }
-
// Print 'em
infostream<<"Server: Loading mods: ";
// Apply item aliases in the node definition manager
m_nodedef->updateAliases(m_itemdef);
+ m_nodedef->setNodeRegistrationStatus(true);
+
// Perform pending node name resolutions
m_nodedef->runNodeResolverCallbacks();
- // Load the mapgen params from global settings now after any
- // initial overrides have been set by the mods
- m_emerge->loadMapgenParams();
-
// Initialize Environment
- ServerMap *servermap = new ServerMap(path_world, this, m_emerge);
m_env = new ServerEnvironment(servermap, m_script, this, m_path_world);
m_clients.setEnv(m_env);
- // Run some callbacks after the MG params have been set up but before activation
- m_script->environment_OnMapgenInit(&m_emerge->params);
-
// Initialize mapgens
m_emerge->initMapgens();
u8 client_max = data[2];
u8 our_max = SER_FMT_VER_HIGHEST_READ;
// Use the highest version supported by both
- u8 deployed = std::min(client_max, our_max);
+ int deployed = std::min(client_max, our_max);
// If it's lower than the lowest supported, give up.
if(deployed < SER_FMT_VER_LOWEST)
deployed = SER_FMT_VER_INVALID;
<<"tried to connect from "<<addr_s<<" "
<<"but it was disallowed for the following reason: "
<<reason<<std::endl;
- DenyAccess(peer_id, narrow_to_wide(reason.c_str()));
+ DenyAccess(peer_id, narrow_to_wide(reason));
return;
}
}