diff --git a/roblox/bootstrapper/manifest.go b/roblox/bootstrapper/manifest.go index 862aad57..e9c4e2da 100644 --- a/roblox/bootstrapper/manifest.go +++ b/roblox/bootstrapper/manifest.go @@ -20,8 +20,8 @@ func channelPath(channel string) string { // ClientSettings it will be lowercased, but not on the deploy mirror. channel = strings.ToLower(channel) - // Roblox CDN only accepts no channel if its live - if channel == "" || channel == "live" { + // Roblox CDN only accepts no channel if its the default channel + if channel == "" || channel == version.DefaultChannel { return "/" } diff --git a/roblox/version/version.go b/roblox/version/version.go index e5c958c0..88b7bd25 100644 --- a/roblox/version/version.go +++ b/roblox/version/version.go @@ -2,7 +2,6 @@ package version import ( "log" - "strings" "github.com/vinegarhq/vinegar/roblox" "github.com/vinegarhq/vinegar/roblox/api" @@ -24,20 +23,12 @@ type Version struct { GUID string } -func ChannelPath(channel string) string { - // Ensure that the channel is lowercased, since internally in - // ClientSettings it will be lowercased, but not on the deploy mirror. - channel = strings.ToLower(channel) - - if channel == DefaultChannel { - return "/" +func New(bt roblox.BinaryType, channel string, GUID string) Version { + if channel == "" { + channel = DefaultChannel } - return "/channel/" + channel + "/" -} - -func New(bt roblox.BinaryType, channel string, GUID string) Version { - log.Printf("Got %s version %s", bt.BinaryName(), GUID) + log.Printf("Got %s version %s with channel %s", bt.BinaryName(), GUID, channel) return Version{ Type: bt, @@ -47,11 +38,11 @@ func New(bt roblox.BinaryType, channel string, GUID string) Version { } func Fetch(bt roblox.BinaryType, channel string) (Version, error) { - c := "" - if c != "" { - c = "for channel " + channel + if channel == "" { + channel = DefaultChannel } - log.Printf("Fetching latest version of %s %s", bt.BinaryName(), c) + + log.Printf("Fetching latest version of %s for channel %s", bt.BinaryName(), channel) cv, err := api.GetClientVersion(bt, channel) if err != nil {