fixing mingw errors
VoidLoader/VoidLoaderCore/pipeline/head There was a failure building this commit
VoidLoader/VoidLoaderCore/pipeline/head There was a failure building this commit
Signed-off-by: Faumaray <faumaray@gmail.com>
This commit is contained in:
2 files changed
+29
-30
No files matched your search
+16
-17
@@ -17,18 +17,17 @@ namespace vl::Agent {
|
||||
auto currentPath = std::filesystem::current_path();
|
||||
if (!args.contains("gameDir"))
|
||||
{
|
||||
args["gameDir"] = currentPath;
|
||||
args["gameDir"] = currentPath.string();
|
||||
}
|
||||
auto gameDir = args["gameDir"];
|
||||
auto dataDir = args["gameDir"] + std::filesystem::path::preferred_separator + "data";
|
||||
auto logDir = args["gameDir"] + std::filesystem::path::preferred_separator + "logs";
|
||||
auto modsDir = args["gameDir"] + std::filesystem::path::preferred_separator + "mods";
|
||||
m_context = {
|
||||
.gameDir = std::move(gameDir),
|
||||
.dataDir = std::move(dataDir),
|
||||
.logDir = std::move(logDir),
|
||||
.apiVersion = {1,0,0},
|
||||
};
|
||||
std::filesystem::path gameDir = args["gameDir"];
|
||||
std::filesystem::path dataDir = gameDir / "data";
|
||||
std::filesystem::path logDir = gameDir / "logs";
|
||||
std::filesystem::path modsDir = gameDir / "mods";
|
||||
m_context = {}; // if defaultable
|
||||
m_context.gameDir = std::move(gameDir);
|
||||
m_context.dataDir = std::move(dataDir);
|
||||
m_context.logDir = std::move(logDir);
|
||||
m_context.apiVersion = {1,0,0};
|
||||
auto mods = findMods(modsDir);
|
||||
if (!mods.contains("VoidLoaderApi.vlmod"))
|
||||
{
|
||||
@@ -58,7 +57,7 @@ namespace vl::Agent {
|
||||
std::unordered_map<std::string, std::filesystem::path> result;
|
||||
for (auto& entry : std::filesystem::directory_iterator(dir)) {
|
||||
if (entry.path().extension() == ".vlmod") {
|
||||
result.emplace(entry.path().filename(), std::filesystem::absolute(entry.path()));
|
||||
result.emplace(entry.path().filename().string(), std::filesystem::absolute(entry.path()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
@@ -81,7 +80,7 @@ extern "C" JNIEXPORT jint JNICALL Java_nativeAgentInit(JNIEnv* env, jclass clazz
|
||||
|
||||
auto& instance = vl::Agent::Agent::getInstance(argsMap);
|
||||
try {
|
||||
auto coreLogDir = std::string(instance.m_context.logDir) + std::filesystem::path::preferred_separator + "VoidLoader";
|
||||
auto coreLogDir = (instance.m_context.logDir / "VoidLoader").string();
|
||||
vl::logging::init_voidloader_logger();
|
||||
instance.m_logger = vl::logging::LoggerManager::instance().createCombined("VoidLoader", coreLogDir.c_str(), 512'000, vl::logging::Level::Trace);
|
||||
vl::logging::LoggerManager::instance().createConsole("VoidLoader")->setLevel(vl::logging::Level::Info);
|
||||
@@ -104,9 +103,9 @@ extern "C" JNIEXPORT jint JNICALL Java_nativeAgentInit(JNIEnv* env, jclass clazz
|
||||
instance.m_jni = env;
|
||||
|
||||
jvmtiEventCallbacks callbacks = {0};
|
||||
callbacks.ClassFileLoadHook = &instance.m_transformer->classFileLoadHook;
|
||||
callbacks.VMInit = &instance.vmInit;
|
||||
callbacks.VMDeath = &instance.vmDeath;
|
||||
callbacks.ClassFileLoadHook = &ClassTransformer::classFileLoadHook; // provide a static thunk
|
||||
callbacks.VMInit = &vl::Agent::Agent::vmInit; // static
|
||||
callbacks.VMDeath = &vl::Agent::Agent::vmDeath; // static
|
||||
|
||||
auto cerror = instance.m_jmti->SetEventCallbacks(&callbacks, sizeof(callbacks));
|
||||
if (cerror != JVMTI_ERROR_NONE) {
|
||||
@@ -134,7 +133,7 @@ extern "C" JNIEXPORT jint JNICALL Java_nativeAgentStart(JNIEnv* env, jclass claz
|
||||
for (auto& [name, path] : instance.m_mods)
|
||||
{
|
||||
instance.m_logger->trace("Loading mod: {}", name);
|
||||
loaded += instance.m_modloader->loadModule(path, instance.m_context, false);
|
||||
loaded += instance.m_modloader->loadModule(path.string(), instance.m_context, false);
|
||||
}
|
||||
instance.m_logger->info("Mods loaded: {}, Starting", loaded);
|
||||
|
||||
|
||||
Reference in new issue
Block a user