Skip to content

Commit

Permalink
Server hop support in link() (#2167)
Browse files Browse the repository at this point in the history
Co-authored-by: ike709 <ike709@github.com>
  • Loading branch information
ike709 and ike709 authored Jan 14, 2025
1 parent 7ed9f4d commit 80fd4a0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions OpenDreamClient/Interface/DreamInterfaceManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ internal sealed class DreamInterfaceManager : IDreamInterfaceManager {
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly ITimerManager _timerManager = default!;
[Dependency] private readonly IUriOpener _uriOpener = default!;
[Dependency] private readonly IGameController _gameController = default!;

private readonly ISawmill _sawmill = Logger.GetSawmill("opendream.interface");

Expand Down Expand Up @@ -267,11 +268,17 @@ private void RxLink(MsgLink message) {
return;
}

// TODO: This can be a topic call or a connection to another server
// TODO: This can be a topic call

if (uri.Scheme is "http" or "https") {
_uriOpener.OpenUri(message.Url);
} else if (uri.Scheme is "ss14" or "ss14s") {
if (_gameController.LaunchState.FromLauncher)
_gameController.Redial(message.Url, "link() used to connect to another server.");
else
_sawmill.Warning("link() only supports connecting to other servers when utilizing the launcher. Ignoring.");
} else {
_sawmill.Warning($"Received link \"{message.Url}\" which is being ignored because it's not http or https");
_sawmill.Warning($"Received link \"{message.Url}\" which is not supported. Ignoring.");
}
}

Expand Down

0 comments on commit 80fd4a0

Please sign in to comment.