Skip to content

Commit

Permalink
roblox: try to respect default channel
Browse files Browse the repository at this point in the history
  • Loading branch information
apprehensions committed Oct 23, 2023
1 parent 4c30631 commit 61e7aca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
4 changes: 2 additions & 2 deletions roblox/bootstrapper/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 "/"
}

Expand Down
25 changes: 8 additions & 17 deletions roblox/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package version

import (
"log"
"strings"

"github.com/vinegarhq/vinegar/roblox"
"github.com/vinegarhq/vinegar/roblox/api"
Expand All @@ -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,
Expand All @@ -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 {
Expand Down

0 comments on commit 61e7aca

Please sign in to comment.