| 302 | }; |
| 303 | |
| 304 | MOD_EXPORT void _INIT_() { |
| 305 | json def = json({}); |
| 306 | def["hostname"] = "localhost"; |
| 307 | def["port"] = 5555; |
| 308 | def["devices"] = json::object(); |
| 309 | config.setPath(options::opts.root + "/spyserver_config.json"); |
| 310 | config.load(def); |
| 311 | config.enableAutoSave(); |
| 312 | |
| 313 | // Check config in case a user has a very old version |
| 314 | config.acquire(); |
| 315 | bool corrected = false; |
| 316 | if (!config.conf.contains("hostname") || !config.conf.contains("port") || !config.conf.contains("devices")) { |
| 317 | config.conf = def; |
| 318 | corrected = true; |
| 319 | } |
| 320 | config.release(corrected); |
| 321 | } |
| 322 | |
| 323 | MOD_EXPORT ModuleManager::Instance* _CREATE_INSTANCE_(std::string name) { |
| 324 | return new SpyServerSourceModule(name); |
nothing calls this directly
no test coverage detected