初步修改

This commit is contained in:
2026-08-09 14:13:35 +08:00
parent 1e1e77e41a
commit 6fe0bed78e
26 changed files with 2007 additions and 681 deletions
+8 -4
View File
@@ -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();
}