diff --git a/Bloxstrap/Bootstrapper.cs b/Bloxstrap/Bootstrapper.cs index 6214e2e..a0befdf 100644 --- a/Bloxstrap/Bootstrapper.cs +++ b/Bloxstrap/Bootstrapper.cs @@ -313,7 +313,11 @@ namespace Bloxstrap { _launchCommandLine = _launchCommandLine.Replace("LAUNCHTIMEPLACEHOLDER", DateTimeOffset.Now.ToUnixTimeMilliseconds().ToString()); - _launchCommandLine += " -channel "; + + if (_launchCommandLine.StartsWith("roblox-player:1")) + _launchCommandLine += "+channel:"; + else + _launchCommandLine += " -channel "; if (App.Settings.Prop.Channel.ToLowerInvariant() == RobloxDeployment.DefaultChannel.ToLowerInvariant()) _launchCommandLine += "production"; diff --git a/Bloxstrap/ProtocolHandler.cs b/Bloxstrap/ProtocolHandler.cs index 06ca30c..d1f78a7 100644 --- a/Bloxstrap/ProtocolHandler.cs +++ b/Bloxstrap/ProtocolHandler.cs @@ -9,51 +9,19 @@ namespace Bloxstrap { private const string RobloxPlaceKey = "Roblox.Place"; - // map uri keys to command line args - private static readonly IReadOnlyDictionary UriKeyArgMap = new Dictionary() - { - // excluding roblox-player and launchtime - { "launchmode", "--" }, - { "gameinfo", "-t " }, - { "placelauncherurl", "-j "}, - { "launchtime", "--launchtime=" }, - { "browsertrackerid", "-b " }, - { "robloxLocale", "--rloc " }, - { "gameLocale", "--gloc " }, - { "channel", "-channel " }, - // studio - { "task", "-task " }, - { "placeId", "-placeId " }, - { "universeId", "-universeId " }, - { "userId", "-userId " } - }; - public static string ParseUri(string protocol) { - string[] keyvalPair; - string key; - string val; + var args = new Dictionary(); bool channelArgPresent = false; - StringBuilder commandLine = new(); - foreach (var parameter in protocol.Split('+')) { if (!parameter.Contains(':')) continue; - keyvalPair = parameter.Split(':'); - key = keyvalPair[0]; - val = keyvalPair[1]; - - if (!UriKeyArgMap.ContainsKey(key) || string.IsNullOrEmpty(val)) - continue; - - if (key == "launchmode" && val == "play") - val = "app"; - - if (key == "placelauncherurl") - val = HttpUtility.UrlDecode(val); + var kv = parameter.Split(':'); + string key = kv[0]; + string val = kv[1]; // we'll set this before launching because for some reason roblox just refuses to launch if its like a few minutes old so ??? if (key == "launchtime") @@ -68,13 +36,14 @@ namespace Bloxstrap continue; } - commandLine.Append(UriKeyArgMap[key] + val + " "); + args.Add(key, val); } if (!channelArgPresent) EnrollChannel(RobloxDeployment.DefaultChannel); - return commandLine.ToString(); + var pairs = args.Select(x => x.Key + ":" + x.Value).ToArray(); + return String.Join("+", pairs); } public static void ChangeChannel(string channel)