mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
Robust.Client.CEF Renamed to Robust.Client.WebView since CEF should really be an implementation detail. Content is no longer responsible for initializing and managing the module, this is done automatically by the engine. WebView is initialized by declaring it in a manifest.yml file in the game resources. In the future the launcher will read this same file to manage WebView module versions. CefManager has been made private and the content-visible API is now IWebViewManager.
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using System;
|
|
using Xilium.CefGlue;
|
|
|
|
namespace Robust.Client.WebView
|
|
{
|
|
public static class Program
|
|
{
|
|
// This was supposed to be the main entry for the subprocess program... It doesn't work.
|
|
public static int Main(string[] args)
|
|
{
|
|
// This is a workaround for this to work on UNIX.
|
|
var argv = args;
|
|
if (CefRuntime.Platform != CefRuntimePlatform.Windows)
|
|
{
|
|
argv = new string[args.Length + 1];
|
|
Array.Copy(args, 0, argv, 1, args.Length);
|
|
argv[0] = "-";
|
|
}
|
|
|
|
var mainArgs = new CefMainArgs(argv);
|
|
|
|
// This will block executing until the subprocess is shut down.
|
|
var code = CefRuntime.ExecuteProcess(mainArgs, null, IntPtr.Zero);
|
|
|
|
if (code != 0)
|
|
{
|
|
System.Console.WriteLine($"CEF Subprocess exited unsuccessfully with exit code {code}! Arguments: {string.Join(' ', argv)}");
|
|
}
|
|
|
|
return code;
|
|
}
|
|
}
|
|
}
|