Files
gus 2d3522e752 Allow multiple clients running WebView on a singular machine. (#5947)
* Multiple CEF instances on a single machine

* remove unused

* meh implementation

* cefextension

* me when partials, race conditions and extractiion of methods exists

* Change remote debugging handling

It now defaults to 9222 again. This doesn't seem to cause any issues when launching 3 clients. The debug port can be reconfigured via CVar if desired.

Also disabled debugging by default outside dev builds.

* Lower MaxAttempts to 15

100 was way too much and gave me anxiety idk.

* Fix non-TOOLS default of remote debug port

* Rewrite locking implementation.

It is much smaller, less complicated and probably more robust too. Should be fully atomic (the previous one wasn't).

* Undo unnecessary style changes

---------

Co-authored-by: PJB3005 <pieterjan.briers+git@gmail.com>
2025-09-16 02:19:59 +02:00

42 lines
1.4 KiB
C#

using Robust.Shared.Configuration;
namespace Robust.Client.WebView;
// ReSharper disable once InconsistentNaming
/// <summary>
/// CVars for <c>Robust.Client.WebView</c>
/// </summary>
[CVarDefs]
public static class WCVars
{
/// <summary>
/// Enable the <c>res://</c> protocol inside WebView browsers, allowing access to the Robust resources.
/// </summary>
public static readonly CVarDef<bool> WebResProtocol =
CVarDef.Create("web.res_protocol", true, CVar.CLIENTONLY);
/// <summary>
/// Overrides the default CEF user-agent when set to a non-empty string.
/// </summary>
public static readonly CVarDef<string> WebUserAgentOverride =
CVarDef.Create("web.user_agent", "", CVar.CLIENTONLY);
/// <summary>
/// If true, use headless WebView implementation even with graphical client (turn off CEF).
/// </summary>
public static readonly CVarDef<bool> WebHeadless =
CVarDef.Create("web.headless", false, CVar.CLIENTONLY);
#if TOOLS
private const int DefaultRemoteDebugPort = 9222;
#else
private const int DefaultRemoteDebugPort = 0;
#endif
/// <summary>
/// If not 0, the port number used for Chromium's remote debugging.
/// </summary>
public static readonly CVarDef<int> WebRemoteDebugPort =
CVarDef.Create("web.remote_debug_port", DefaultRemoteDebugPort, CVar.CLIENTONLY);
}