RynthServers as of 2026-11-12 (internal 4db2369): release 2026.11.12.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
8547236e48
commit
df95f90611
3 changed files with 53 additions and 6 deletions
|
|
@ -14,9 +14,30 @@ internal static class DreamWeaveWeb
|
|||
{
|
||||
public const string SiteBase = "https://www.acdreamweave.com";
|
||||
|
||||
/// <summary>The only host the panel or the browser may be sent to.</summary>
|
||||
/// <summary>The only host the panel or the browser may be sent to on the live world.</summary>
|
||||
public static readonly string[] AllowedHosts = { "www.acdreamweave.com" };
|
||||
|
||||
/// <summary>
|
||||
/// The stage world's site. A launch code is minted in the shard of the world that answered
|
||||
/// "/weblogin", so it only redeems on that world's site: a stage code sent to the live site is
|
||||
/// "expired or already used". (market-stage.acdreamweave.com only 301s to www-stage.)
|
||||
/// </summary>
|
||||
public const string StageSiteBase = "https://www-stage.acdreamweave.com";
|
||||
|
||||
/// <summary>The only host the panel or the browser may be sent to on the stage world.</summary>
|
||||
public static readonly string[] StageAllowedHosts = { "www-stage.acdreamweave.com" };
|
||||
|
||||
/// <summary>The stage server's world name (ACE deploy/stage/Config.js.template).</summary>
|
||||
public const string StageWorldName = "DreamWeave-Stage";
|
||||
|
||||
/// <summary>True for the stage world. Anything else, unknown included, is the live site.</summary>
|
||||
public static bool IsStageWorld(string? worldName)
|
||||
=> worldName != null && string.Equals(worldName.Trim(), StageWorldName, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
public static string SiteBaseFor(string? worldName) => IsStageWorld(worldName) ? StageSiteBase : SiteBase;
|
||||
|
||||
public static string[] AllowedHostsFor(string? worldName) => IsStageWorld(worldName) ? StageAllowedHosts : AllowedHosts;
|
||||
|
||||
public const string PanelTitle = "DreamWeave";
|
||||
|
||||
public static readonly WebDestination[] Destinations =
|
||||
|
|
@ -70,6 +91,6 @@ internal static class DreamWeaveWeb
|
|||
}
|
||||
|
||||
/// <summary>The sign-in URL for a destination. The caller has already checked the code with LaunchWire.</summary>
|
||||
public static string LaunchUrl(string code, WebDestination d)
|
||||
=> SiteBase + "/launch?code=" + code + "&to=" + Uri.EscapeDataString(d.Path);
|
||||
public static string LaunchUrl(string code, WebDestination d, string? worldName = null)
|
||||
=> SiteBaseFor(worldName) + "/launch?code=" + code + "&to=" + Uri.EscapeDataString(d.Path);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,7 +193,8 @@ public sealed partial class ServerPackPlugin
|
|||
WebOpenFailed(d, generation, WebButtons.NotDreamWeave);
|
||||
return;
|
||||
}
|
||||
OpenLaunch(d, DreamWeaveWeb.LaunchUrl(launchCode, d), generation);
|
||||
string? world = WorldName(); // read once: the URL and the allowlist always name the same site
|
||||
OpenLaunch(d, DreamWeaveWeb.LaunchUrl(launchCode, d, world), world, generation);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -205,17 +206,21 @@ public sealed partial class ServerPackPlugin
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>The connected world's name, or null when the engine can't say (then the live site is used).</summary>
|
||||
private string? WorldName() => Host.TryGetWorldName(out string w) ? w : null;
|
||||
|
||||
/// <summary>
|
||||
/// Opens the launch URL (pump thread). <paramref name="generation"/> is the request the code answered;
|
||||
/// the open's answer replaces its "Opening X..." status (SetResult), so the card never stays on it.
|
||||
/// <paramref name="world"/> is the world the URL was built for; the allowlist comes from the same value.
|
||||
/// </summary>
|
||||
private void OpenLaunch(WebDestination d, string url, long generation)
|
||||
private void OpenLaunch(WebDestination d, string url, string? world, long generation)
|
||||
{
|
||||
int epoch = Volatile.Read(ref _webLoginEpoch);
|
||||
try
|
||||
{
|
||||
string? account = Host.TryGetAccountName(out string name) ? name : null;
|
||||
var request = new WebOpenRequest(url, DreamWeaveWeb.AllowedHosts,
|
||||
var request = new WebOpenRequest(url, DreamWeaveWeb.AllowedHostsFor(world),
|
||||
WebProfile.Key(Info.Id, account) ?? "", DreamWeaveWeb.PanelTitle);
|
||||
bool panel = PanelAvailable;
|
||||
WebBrowserWhy why = ServerWebOpen.Route(request, panel) != WebOpenRoute.Browser ? WebBrowserWhy.PanelFellBack
|
||||
|
|
|
|||
Loading…
Reference in a new issue