diff --git a/Essentials/EssentialsPlugin.cs b/Essentials/EssentialsPlugin.cs index 6f1453f..17204ac 100644 --- a/Essentials/EssentialsPlugin.cs +++ b/Essentials/EssentialsPlugin.cs @@ -278,13 +278,10 @@ public void SendMotd(MyPlayer player, bool onSessionChanged) { long playerId = player.Identity.IdentityId; - var motdUrl = MyGuiSandbox.IsUrlWhitelisted(Config.MotdUrl) - ? Config.MotdUrl - : $"https://steamcommunity.com/linkfilter/?url={Config.MotdUrl}"; - if (!string.IsNullOrEmpty(Config.MotdUrl) && !Config.NewUserMotdUrl) { - MyVisualScriptLogicProvider.OpenSteamOverlay(motdUrl, playerId); + var url = MakeUrl(Config.MotdUrl); + MyVisualScriptLogicProvider.OpenSteamOverlay(url, playerId); return; } @@ -301,7 +298,8 @@ public void SendMotd(MyPlayer player, bool onSessionChanged) if (!string.IsNullOrEmpty(Config.MotdUrl) && isNewUser && Config.NewUserMotdUrl) { - MyVisualScriptLogicProvider.OpenSteamOverlay(motdUrl, playerId); + var url = MakeUrl(Config.MotdUrl); + MyVisualScriptLogicProvider.OpenSteamOverlay(url, playerId); return; } @@ -327,6 +325,12 @@ public void SendMotd(MyPlayer player, bool onSessionChanged) } } + static string MakeUrl(string url) + { + if (MyGuiSandbox.IsUrlWhitelisted(url)) return url; + return $"https://steamcommunity.com/linkfilter/?url={url}"; + } + static string GetDefaultMotdText() { try