diff options
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | docs/manaserv.xml.example | 1 | ||||
-rw-r--r-- | scripts/CMakeLists.txt | 1 | ||||
-rw-r--r-- | scripts/lua/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/common/resourcemanager.cpp | 10 |
5 files changed, 15 insertions, 5 deletions
@@ -47,7 +47,6 @@ Default option values: gameServerAddress localhost gameServerPort 9604 - serverPath . worldDataPath example diff --git a/docs/manaserv.xml.example b/docs/manaserv.xml.example index 4a203d1..ef220a6 100644 --- a/docs/manaserv.xml.example +++ b/docs/manaserv.xml.example @@ -65,7 +65,6 @@ Set here the different paths used by both the server to find data. --> <!-- Paths to data files --> - <option name="serverPath" value="." /> <option name="worldDataPath" value="example" /> <!-- end of paths configuration ******************************************* --> diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt new file mode 100644 index 0000000..b0e653e --- /dev/null +++ b/scripts/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(lua) diff --git a/scripts/lua/CMakeLists.txt b/scripts/lua/CMakeLists.txt new file mode 100644 index 0000000..ba58be5 --- /dev/null +++ b/scripts/lua/CMakeLists.txt @@ -0,0 +1,7 @@ +SET (FILES + libmana-constants.lua + libmana.lua + npclib.lua + ) + +INSTALL(FILES ${FILES} DESTINATION ${PKG_DATADIR}/scripts/lua/) diff --git a/src/common/resourcemanager.cpp b/src/common/resourcemanager.cpp index edff1e0..45735b4 100644 --- a/src/common/resourcemanager.cpp +++ b/src/common/resourcemanager.cpp @@ -38,17 +38,21 @@ #include <physfs.h> +#ifndef PKG_DATADIR +#define PKG_DATADIR "." +#endif + void ResourceManager::initialize() { PHYSFS_permitSymbolicLinks(1); - const std::string serverPath = - Configuration::getValue("serverPath", "."); const std::string worldDataPath = Configuration::getValue("worldDataPath", "example"); - PHYSFS_addToSearchPath(serverPath.c_str(), 1); + // world first to allow overriding of server's libraries PHYSFS_addToSearchPath(worldDataPath.c_str(), 1); + PHYSFS_addToSearchPath(".", 1); + PHYSFS_addToSearchPath(PKG_DATADIR, 1); } /** |