Skip to content

Commit

Permalink
ignore channel in uri entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Sep 8, 2023
1 parent 8948dfa commit 127777c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
13 changes: 4 additions & 9 deletions cmd/vinegar/binary.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ func SetupBinary(ver roblox.Version, dir string) {
func Binary(bt roblox.BinaryType, cfg *config.Config, pfx *wine.Prefix, args ...string) {
var appCfg config.Application
var ver roblox.Version
var channelOverride string
name := bt.String()

switch bt {
Expand Down Expand Up @@ -97,26 +96,22 @@ func Binary(bt roblox.BinaryType, cfg *config.Config, pfx *wine.Prefix, args ...
}
}

channel := appCfg.Channel
if strings.HasPrefix(strings.Join(args, " "), "roblox-player:1") {
args, channelOverride = bootstrapper.ParsePlayerURI(args[0])

if channelOverride != appCfg.Channel && channelOverride != "" {
log.Printf("Roblox is attempting to set channel to %s from launch URI, ignoring", channel)
}
if strings.HasPrefix(strings.Join(args, " "), "roblox-player:1") {
args = bootstrapper.ParsePlayerURI(args[0])
} else if strings.HasPrefix(strings.Join(args, " "), "roblox-studio:1") {
args = bootstrapper.ParseStudioURI(args[0])
}

if appCfg.ForcedVersion != "" {
log.Printf("WARNING: using forced version: %s", appCfg.ForcedVersion)

ver, err = roblox.NewVersion(bt, channel, appCfg.ForcedVersion)
ver, err = roblox.NewVersion(bt, appCfg.Channel, appCfg.ForcedVersion)
if err != nil {
log.Fatal(err)
}
} else {
ver, err = roblox.LatestVersion(bt, channel)
ver, err = roblox.LatestVersion(bt, appCfg.Channel)
if err != nil {
log.Fatal(err)
}
Expand Down
11 changes: 9 additions & 2 deletions roblox/bootstrapper/uri.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package bootstrapper

import (
"log"
"net/url"
"strings"
)
Expand All @@ -14,7 +15,7 @@ var PlayerURIKeyFlags = map[string]string{
"gameLocale": "--gloc",
}

func ParsePlayerURI(launchURI string) (args []string, channel string) {
func ParsePlayerURI(launchURI string) (args []string) {
// Roblox Client forces usage of the desktop app
args = append(args, "--app")

Expand All @@ -27,7 +28,7 @@ func ParsePlayerURI(launchURI string) (args []string, channel string) {
key, val := pair[0], pair[1]

if key == "channel" {
channel = val
log.Println("Roblox is attempting to set channel to %s from launch URI, ignoring", val)

continue
}
Expand Down Expand Up @@ -60,6 +61,12 @@ func ParseStudioURI(launchURI string) (args []string) {

key, val := pair[0], pair[1]

if key == "channel" {
log.Println("Roblox is attempting to set channel to %s from launch URI, ignoring", val)

continue
}

if key == "gameinfo" {
args = append(args,
"-url", "https://www.roblox.com/Login/Negotiate.ashx", "-ticket", val,
Expand Down

0 comments on commit 127777c

Please sign in to comment.