Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server hop support in link() #2167

Merged
merged 2 commits into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading