Add usermods/ to mod search paths and print out the paths at server startup
authorPerttu Ahola <celeron55@gmail.com>
Sat, 3 Dec 2011 01:43:20 +0000 (03:43 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Sat, 3 Dec 2011 01:43:20 +0000 (03:43 +0200)
data/mods/default/init.lua
src/server.cpp

index ae917a03637a6ecf4901914cbb77e6db7fd97928..ebb116e291e24c77af4752c5fb439238bb766a9d 100644 (file)
@@ -2,6 +2,23 @@
 -- dump2(obj, name="_", dumped={})
 -- dump(obj, dumped={})
 --
+-- Mod load path
+-- -------------
+-- Generic:
+-- $path_data/mods/
+-- $path_userdata/usermods/
+-- $mapdir/worldmods/
+--
+-- On a run-in-place version (eg. the distributed windows version):
+-- minetest-0.4.x/mods/
+-- minetest-0.4.x/usermods/
+-- minetest-0.4.x/world/worldmods/
+--
+-- On an installed version on linux:
+-- /usr/share/minetest/mods/
+-- ~/.minetest/usermods
+-- ~/.minetest/world/worldmods
+--
 -- Naming convention for registered textual names
 -- ----------------------------------------------
 -- "modname_<whatever>"
index 032b57e3ca003c5db33adb35e99701e9f99d8323..873198d1e5f11d6e383fb5b5825e90dc5a0c4176 100644 (file)
@@ -875,16 +875,24 @@ Server::Server(
        JMutexAutoLock envlock(m_env_mutex);
        JMutexAutoLock conlock(m_con_mutex);
 
-       infostream<<"m_nodedef="<<m_nodedef<<std::endl;
-       
        // Path to builtin.lua
        std::string builtinpath = porting::path_data + DIR_DELIM + "builtin.lua";
 
        // Add default global mod search path
        m_modspaths.push_front(porting::path_data + DIR_DELIM + "mods");
        // Add world mod search path
-       m_modspaths.push_front(mapsavedir + DIR_DELIM + "mods");
-
+       m_modspaths.push_front(mapsavedir + DIR_DELIM + "worldmods");
+       // Add user mod search path
+       m_modspaths.push_front(porting::path_userdata + DIR_DELIM + "usermods");
+       
+       // Print out mod search paths
+       infostream<<"Mod search paths:"<<std::endl;
+       for(core::list<std::string>::Iterator i = m_modspaths.begin();
+                       i != m_modspaths.end(); i++){
+               std::string modspath = *i;
+               infostream<<"    "<<modspath<<std::endl;
+       }
+       
        // Initialize scripting
        
        infostream<<"Server: Initializing scripting"<<std::endl;