Basic .Net Core POC successful

This commit is contained in:
Antoine Pilote
2023-10-13 00:23:30 -04:00
parent 702e5bf76a
commit cb804085ed
4 changed files with 70 additions and 5 deletions

View File

@@ -24,6 +24,11 @@ namespace Nuake
return instance;
}
void Log(Coral::NativeString string)
{
Logger::Log(string.ToString(), ".net", VERBOSE);
}
void ScriptingEngineNet::Initialize()
{
auto coralDir = "";
@@ -36,5 +41,13 @@ namespace Nuake
hostInstance.Initialize(settings);
auto loadContext = hostInstance.CreateAssemblyLoadContext("NuakeEngineContext");
auto& assembly = loadContext.LoadAssembly("NuakeNet.dll");
assembly.AddInternalCall("Nuake.Net.Engine", "LoggerLogIcall", reinterpret_cast<void*>(&Log));
assembly.UploadInternalCalls();
auto& engineType = assembly.GetType("Nuake.Net.Engine");
auto engineInstance = engineType.CreateInstance();
engineInstance.InvokeMethod("Log");
}
}