初步修改
This commit is contained in:
@@ -98,17 +98,21 @@ void read(MLAT_Data* buf, std::uint16_t* len) {
|
||||
MLAT_Config::MLAT_Config() {
|
||||
}
|
||||
void MLAT_Config::from_json(const Psc::JSON* that_json, bool not_exist_use_default_value) {
|
||||
MLAT_Config_Data::from_base_json(that_json, not_exist_use_default_value);
|
||||
if (enable) {
|
||||
auto value = settings.snapshot();
|
||||
value.from_base_json(that_json, not_exist_use_default_value);
|
||||
settings.write([&](auto& target) {
|
||||
target = value;
|
||||
});
|
||||
if (value.enable) {
|
||||
{
|
||||
auto r = Psc::try_load_library(Psc::get_abs_path(library_path));
|
||||
auto r = Psc::try_load_library(Psc::get_abs_path(value.library_path));
|
||||
if (!r) {
|
||||
Psc::fail_fast();
|
||||
}
|
||||
lib = r.value();
|
||||
}
|
||||
{
|
||||
auto r = Psc::try_load_function(lib, function_name);
|
||||
auto r = Psc::try_load_function(lib, value.function_name);
|
||||
if (!r) {
|
||||
Psc::fail_fast();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user