Resolve "Allow mods to add new maps to be preloaded"
Closes #466 (closed)
Allows mods to hook onBeforeGetMapList
and add an object. The map object should have a string name (becomes the thread's name as well) and a path. The path is from src/server
to the directory that holds the map directory.
Example: my mod is in src/server/mods/abcd
. My mod has a folder (src/server/mods/abcd/maps
) that has another folder (src/server/mods/abcd/maps/testmap
) which is a map. In my mod index.js
, I listen for onBeforeGetMapList
and append to the list this object:
{
name: 'testmap'
path: 'mods/abcd/maps' // the directory that holds all your maps, relative to src/server
}
Credit to googz for !293 (closed) and me !295 (closed)