rbxbin

package module
v0.0.0-...-bb26c00 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2024 License: GPL-3.0 Imports: 16 Imported by: 1

README

rbxbin

Godoc Reference

Go package providing routines to deploy, install and fetch Roblox programs (referred to as Binary) Package log/slog is used by some routines for logging purposes.

Binaries WindowsStudio, MacPlayer and MacStudio do not have guranteed support, as this package is directed towards Windows support. Feel free to contribute.

Packages fetcher example
package main

import (
	"log"

	"github.com/apprehensions/rbxbin"
	cs "github.com/apprehensions/rbxweb/clientsettings"
)

func main() {
	d, err := rbxbin.GetDeployment(cs.WindowsPlayer, "LIVE")
	if err != nil {
		log.Fatalln("failed to get deployment:", err)
	}

	ps, err := rbxbin.DefaultMirror.GetPackages(d)
	if err != nil {
		log.Fatalln("failed to get packages:", err)
	}

	for _, p := range ps {
		log.Println("Package:", p.Name)
	}
}

Documentation

Overview

Package rbxbin implements various routines and types to install or bootstrap a Roblox Binary.

Index

Constants

View Source
const AppSettings = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" +
	"<Settings>\r\n" +
	"        <ContentFolder>content</ContentFolder>\r\n" +
	"        <BaseUrl>http://www.roblox.com</BaseUrl>\r\n" +
	"</Settings>\r\n"

Contains necessary application settings required for Roblox to run.

View Source
const DefaultRenderer = "D3D11"

DefaultRenderer is used as the default renderer when no explicit named renderer argument has been given.

Variables

View Source
var (
	ErrNoMirrorFound = errors.New("no accessible deploy mirror found")

	// As of 2024-02-03:
	//   setup-cfly.rbxcdn.com = roblox-setup.cachefly.net
	//   setup.rbxcdn.com = setup-ns1.rbxcdn.com = setup-ak.rbxcdn.com
	//   setup-hw.rbxcdn.com = setup-ll.rbxcdn.com = does not exist
	Mirrors = []Mirror{
		DefaultMirror,
		Mirror("https://roblox-setup.cachefly.net"),
		Mirror("https://s3.amazonaws.com/setup.roblox.com"),
	}
)
View Source
var (
	ErrInvalidPkgManifest      = errors.New("package manifest is invalid")
	ErrUnhandledPkgManifestVer = errors.New("unhandled package manifest version")
)
View Source
var ErrBadChannel = errors.New("deployment channel is invalid or unauthorized")

ErrBadChannel indicates if the mentioned deployment channel does not exist or out of permission scope for the current authenticated user.

View Source
var ErrInvalidRenderer = errors.New("invalid renderer given")
View Source
var PlayerDirectories = PackageDirectories{

	"content-avatar.zip":            "content/avatar",
	"content-sky.zip":               "content/sky",
	"content-sounds.zip":            "content/sounds",
	"content-textures2.zip":         "content/textures",
	"content-platform-fonts.zip":    "PlatformContent/pc/fonts",
	"WebView2.zip":                  ".",
	"content-configs.zip":           "content/configs",
	"content-terrain.zip":           "PlatformContent/pc/terrain",
	"shaders.zip":                   "shaders",
	"WebView2RuntimeInstaller.zip":  "WebView2RuntimeInstaller",
	"extracontent-textures.zip":     "ExtraContent/textures",
	"ssl.zip":                       "ssl",
	"content-fonts.zip":             "content/fonts",
	"content-models.zip":            "content/models",
	"content-textures3.zip":         "PlatformContent/pc/textures",
	"extracontent-luapackages.zip":  "ExtraContent/LuaPackages",
	"extracontent-translations.zip": "ExtraContent/translations",
	"extracontent-models.zip":       "ExtraContent/models",
	"RobloxApp.zip":                 ".",
	"extracontent-places.zip":       "ExtraContent/places",
}
View Source
var StudioDirectories = PackageDirectories{

	"extracontent-scripts.zip":        "ExtraContent/scripts",
	"extracontent-luapackages.zip":    "ExtraContent/LuaPackages",
	"LibrariesQt5.zip":                ".",
	"Plugins.zip":                     "Plugins",
	"StudioFonts.zip":                 "StudioFonts",
	"content-sounds.zip":              "content/sounds",
	"content-textures2.zip":           "content/textures",
	"content-platform-fonts.zip":      "PlatformContent/pc/fonts",
	"WebView2.zip":                    ".",
	"content-models.zip":              "content/models",
	"content-api-docs.zip":            "content/api_docs",
	"extracontent-models.zip":         "ExtraContent/models",
	"content-studio_svg_textures.zip": "content/studio_svg_textures",
	"Qml.zip":                         "Qml",
	"content-avatar.zip":              "content/avatar",
	"content-configs.zip":             "content/configs",
	"content-sky.zip":                 "content/sky",
	"WebView2RuntimeInstaller.zip":    "WebView2RuntimeInstaller",
	"ApplicationConfig.zip":           "ApplicationConfig",
	"content-textures3.zip":           "PlatformContent/pc/textures",
	"BuiltInPlugins.zip":              "BuiltInPlugins",
	"redist.zip":                      ".",
	"shaders.zip":                     "shaders",
	"ssl.zip":                         "ssl",
	"extracontent-textures.zip":       "ExtraContent/textures",
	"content-qt_translations.zip":     "content/qt_translations",
	"extracontent-translations.zip":   "ExtraContent/translations",
	"content-terrain.zip":             "PlatformContent/pc/terrain",
	"BuiltInStandalonePlugins.zip":    "BuiltInStandalonePlugins",
	"RobloxStudio.zip":                ".",
	"Libraries.zip":                   ".",
	"content-fonts.zip":               "content/fonts",
}

Functions

func ValidRenderer

func ValidRenderer(renderer string) bool

ValidRenderer determines if the named renderer is part of the available supported Roblox renderer backends, used in SetRenderer.

func WriteAppSettings

func WriteAppSettings(dir string) error

WriteAppSettings writes AppSettings to a AppSettings.xml file in a binary's deployment directory.

Types

type Deployment

type Deployment struct {
	Type    clientsettings.BinaryType
	Channel string
	GUID    string
}

Deployment is a representation of a Binary's deployment or version.

Channel can either be a given channel, or empty - in which Roblox will consider the 'default' channel.

In all things related to the Roblox API, the default channel is empty, or 'live'/'LIVE' on clientsettings. On the Client/Studio, the default channel is (or can be) 'production'. This behavior is undocumented, so it is reccomended to simply provide an empty string for the channel.

func GetDeployment

func GetDeployment(bt clientsettings.BinaryType, channel string) (Deployment, error)

FetchDeployment returns the latest deployment information for the given Roblox binary type with the given deployment channel.

type FFlags

type FFlags map[string]interface{}

FFlags is Roblox's Fast Flags implemented in map form.

func (FFlags) Apply

func (f FFlags) Apply(versionDir string) error

Apply creates and compiles the FFlags file and directory in the named versionDir.

func (FFlags) SetRenderer

func (f FFlags) SetRenderer(renderer string) error

SetRenderer sets the named renderer to the FFlags, by disabling all other unused renderers.

type Job

type Job rbxdhist.Job

Job represents a deployment build.

func ParseJobs

func ParseJobs(js []byte) (jobs []*Job)

ParseJobs is a wrapper that returns a list of deployments, parsed from the stream of bytes.

See rbxdhist.Lex for more information.

type Mirror

type Mirror string

Mirror represents a Roblox deployment mirror.

const DefaultMirror Mirror = "https://setup.rbxcdn.com"

DefaultMirror is the default deployment mirror that can be used in situations where mirror fallbacks are undesired.

func GetMirror

func GetMirror() (Mirror, error)

Mirror returns an available deployment mirror from Mirrors.

Deployment mirrors may go down, or be blocked by ISPs.

func (Mirror) GetJobs

func (m Mirror) GetJobs() ([]*Job, error)

Jobs returns the available deployment builds for the mirror.

func (Mirror) GetPackages

func (m Mirror) GetPackages(d Deployment) ([]Package, error)

PackageManifest returns a list of packages for the named deployment.

func (Mirror) PackageURL

func (m Mirror) PackageURL(d Deployment, pkg string) string

Package returns a URL to a package given a package name and a Deployment, relative to the mirror.

func (Mirror) URL

func (m Mirror) URL(channel string) string

URL returns the mirror's URL with the given optional deployment channel.

type Package

type Package struct {
	Name     string
	Checksum string
	Size     int64
	ZipSize  int64
}

Package is a representation of a Binary package.

func ParsePackages

func ParsePackages(b []byte) ([]Package, error)

ParsePackages returns a list of packages parsed from the named package manifest.

func (*Package) Extract

func (p *Package) Extract(src, dir string) error

Extract extracts the named package source file to a given destination directory.

func (*Package) Verify

func (p *Package) Verify(src string) error

Verify checks the named package source file against it's checksum

type PackageDirectories

type PackageDirectories map[string]string

PackageDirectories is a map of where binary deployment packages should go.

func BinaryDirectories

func BinaryDirectories(bt clientsettings.BinaryType) PackageDirectories

BinaryDirectories retrieves the PackageDirectories for the given binary.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL