Core/Build: Fixed dynamic mode build
Core can now be built in dynamic mode, enabling the hotswap system to be used. Hotswap works fine on Windows. Didnt work for me on Debian, the rebuild and reload process happens but the old version of the module remains for some reason. Cant figure it out right now
This commit is contained in:
1 parent
2d46fcbfc8
commit
a54adfd894
21 files changed
+100
-53
No files matched your search
@@ -25,11 +25,13 @@
|
||||
|
||||
using namespace boost::property_tree;
|
||||
|
||||
bool ConfigMgr::LoadInitial(std::string const& file, std::string& error)
|
||||
bool ConfigMgr::LoadInitial(std::string const& file, std::vector<std::string> args,
|
||||
std::string& error)
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_configLock);
|
||||
|
||||
_filename = file;
|
||||
_args = args;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -65,7 +67,7 @@ ConfigMgr* ConfigMgr::instance()
|
||||
|
||||
bool ConfigMgr::Reload(std::string& error)
|
||||
{
|
||||
return LoadInitial(_filename, error);
|
||||
return LoadInitial(_filename, std::move(_args), error);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <list>
|
||||
#include <vector>
|
||||
#include <mutex>
|
||||
#include <boost/property_tree/ptree.hpp>
|
||||
|
||||
@@ -35,7 +36,8 @@ class TC_COMMON_API ConfigMgr
|
||||
|
||||
public:
|
||||
/// Method used only for loading main configuration files (authserver.conf and worldserver.conf)
|
||||
bool LoadInitial(std::string const& file, std::string& error);
|
||||
bool LoadInitial(std::string const& file, std::vector<std::string> args,
|
||||
std::string& error);
|
||||
|
||||
static ConfigMgr* instance();
|
||||
|
||||
@@ -47,10 +49,12 @@ public:
|
||||
float GetFloatDefault(std::string const& name, float def) const;
|
||||
|
||||
std::string const& GetFilename();
|
||||
std::vector<std::string> const& GetArguments() const { return _args; }
|
||||
std::list<std::string> GetKeysByString(std::string const& name);
|
||||
|
||||
private:
|
||||
std::string _filename;
|
||||
std::vector<std::string> _args;
|
||||
boost::property_tree::ptree _config;
|
||||
std::mutex _configLock;
|
||||
|
||||
|
||||
Reference in new issue
Block a user