Compatibility for in memory scripts that used GameMain.LuaCs
This commit is contained in:
@@ -561,8 +561,11 @@ public class PluginManagementService : IAssemblyManagementService
|
|||||||
|
|
||||||
CancellationToken token = CancellationToken.None;
|
CancellationToken token = CancellationToken.None;
|
||||||
|
|
||||||
|
string sourceCode = loadRes.Value;
|
||||||
|
sourceCode = DoSourceCodeTextCompatibilityPass(sourceCode);
|
||||||
|
|
||||||
syntaxTreesBuilder.Add(SyntaxFactory.ParseSyntaxTree(
|
syntaxTreesBuilder.Add(SyntaxFactory.ParseSyntaxTree(
|
||||||
text: loadRes.Value,
|
text: sourceCode,
|
||||||
options: ScriptParseOptions,
|
options: ScriptParseOptions,
|
||||||
path: null,
|
path: null,
|
||||||
encoding: Encoding.Default,
|
encoding: Encoding.Default,
|
||||||
@@ -613,6 +616,11 @@ public class PluginManagementService : IAssemblyManagementService
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string DoSourceCodeTextCompatibilityPass(string sourceCode)
|
||||||
|
{
|
||||||
|
return sourceCode.Replace("GameMain.LuaCs", "LuaCsSetup.Instance");
|
||||||
|
}
|
||||||
|
|
||||||
private IntPtr OnAssemblyLoaderResolvingUnmanaged(Assembly arg1, string arg2)
|
private IntPtr OnAssemblyLoaderResolvingUnmanaged(Assembly arg1, string arg2)
|
||||||
{
|
{
|
||||||
// TODO: Implement extern assembly lookup for Native/Unmanaged Assemblies.
|
// TODO: Implement extern assembly lookup for Native/Unmanaged Assemblies.
|
||||||
|
|||||||
Reference in New Issue
Block a user