MCPcopy Create free account
hub / github.com/MaaXYZ/MaaFramework / parse

Method parse

source/MaaAdbControlUnit/EmulatorExtras/LDPlayerExtras.cpp:17–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17bool LDPlayerExtras::parse(const json::value& config)
18{
19 bool enable = config.get("extras", "ld", "enable", false);
20 if (!enable) {
21 LogInfo << "extras.ld.enable is false, ignore";
22 return false;
23 }
24
25 std::string lib = config.get("extras", "ld", "lib", "");
26 if (lib.empty()) {
27 std::string p = config.get("extras", "ld", "path", "");
28 lib_path_ = MAA_NS::path(p) / MAA_NS::path("ldopengl64");
29 }
30 else {
31 lib_path_ = MAA_NS::path(lib);
32 }
33
34 ld_index_ = config.get("extras", "ld", "index", 0);
35 ld_pid_ = config.get("extras", "ld", "pid", 0);
36
37 bool info_parsed = device_info_->parse(config);
38 LogInfo << VAR(lib_path_) << VAR(ld_index_) << VAR(ld_pid_) << VAR(info_parsed);
39 return info_parsed;
40}
41
42bool LDPlayerExtras::init()
43{

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected