#include "interface/module.h" #include "interface/server.h" #include "interface/fs.h" #include "interface/event.h" #include using interface::Event; namespace __loader { struct Module: public interface::Module { interface::Server *m_server; Module(interface::Server *server): m_server(server) { std::cout<<"__loader construct"<sub_event(this, Event::t("core:load_modules")); } ~Module() { std::cout<<"__loader destruct"<load_module("network", m_server->get_builtin_modules_path()+"/network"); sv_ load_list = {"test1", "test2"}; for(const ss_ &name : load_list){ m_server->load_module(name, m_server->get_modules_path()+"/"+name); } /*// TODO: Dependencies auto list = interface::getGlobalFilesystem()->list_directory(m_server->get_modules_path()); for(const interface::Filesystem::Node &n : list){ if(n.name == "__loader") continue; m_server->load_module(n.name, m_server->get_modules_path()+"/"+n.name); }*/ } }; extern "C" { EXPORT void* createModule___loader(interface::Server *server){ return (void*)(new Module(server)); } } }