common

package
v0.0.0-...-60cf890 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: GPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BinPath string
View Source
var CountryCodeMap map[string]string
View Source
var DotSlash string
View Source
var LocalAppData string
View Source
var RobloxAppData string

Functions

func AssertShortcuts

func AssertShortcuts()

func AutoResize

func AutoResize(img *image.RGBA, win *nucular.Window) (*image.RGBA, int)

func CalcWidth

func CalcWidth(win *nucular.Window) int

func ChangesMade

func ChangesMade() bool

func DefineEnvs

func DefineEnvs()

func DeleteShortcut

func DeleteShortcut(sType shortcut.ShortcutType) error

func Error

func Error(err error)

func ErrorStr

func ErrorStr(err string)

func FatalError

func FatalError(err error)

func FatalErrorStr

func FatalErrorStr(err string)

func GetCountry

func GetCountry(code string) string

func GetFiles

func GetFiles(reader io.ReaderAt, size int64) (map[string][]byte, error)

func InitCountryCodeMap

func InitCountryCodeMap()

func LPath

func LPath(p string) string

func LoadConfiguration

func LoadConfiguration() (foundConfig bool)

func LoadImageUI

func LoadImageUI(ba []byte, width int, height int) *image.RGBA

func LoadState

func LoadState()

func Must

func Must[T any](obj T, err error) T

Only use for writing debugging code

func Notification

func Notification(text string)

func PerformUpdate

func PerformUpdate(link string, signature []byte)

func QueryAndUnmarshal

func QueryAndUnmarshal(url string, resultPtr any)

func RegisterProtocolHandler

func RegisterProtocolHandler()

func RemoveAsProtocolHandler

func RemoveAsProtocolHandler()

func ResizeImage

func ResizeImage(img *image.RGBA, width int, height int) *image.RGBA

func SetWindowStyle

func SetWindowStyle()

work in progress

func UnzipAt

func UnzipAt(reader io.ReaderAt, size int64, dest string) error

func WriteConfiguration

func WriteConfiguration() error

func WriteState

func WriteState() error

func YesNo

func YesNo(text string) bool

Types

type Configuration

type Configuration struct {
	UI struct {
		DisableWelcomeScreen bool
		ErrorStyle           int //0=dialog, 1=notification
		Theme                int //0=default, 1=white, 2=red, 3=dark
		BootstrapperImage    int //0=random cat, 1=rblxutils logo
	}
	Misc struct {
		DisableLaunchNotification bool
		DesktopShortcutEnabled    bool
		DisableStartmenuShortcut  bool
		InmanStayAlive            bool
		DebugOptions              []string
	}
	DiscordRPC struct {
		Enabled         bool
		ShowUserProfile bool
		AllowJoin       bool
	}

	ServerHistoryEnabled bool
	Mods                 []Mod
}
var Config Configuration
var ConfigFileState Configuration

type GameData

type GameData struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	MaxPlayers  int    `json:"maxPlayers"`
	RootPlaceId int    `json:"rootPlaceId"`
	Creator     struct {
		Name     string `json:"name"`
		Verified bool   `json:"hasVerifiedBadge"`
	} `json:"creator"`
	Thumbnail *image.RGBA
	IconURL   string
}

type Inman

type Inman struct {
	Conn                *websocket.Conn
	LaunchBootstrapperF func(newProcess bool, robloxArgs string)
	KeepAlive           bool //seperate from config keepalive
	// contains filtered or unexported fields
}

func (*Inman) AllocateInstance

func (i *Inman) AllocateInstance() *Instance

func (*Inman) GetInstances

func (i *Inman) GetInstances() []*Instance

type Instance

type Instance struct {
	LogFileName string
	ServerData  ServerData

	AllocationTime time.Time
	// contains filtered or unexported fields
}

func (*Instance) Close

func (i *Instance) Close()

Close shuts down the instance process, then it calls MarkAsClosed

func (*Instance) MarkAsClosed

func (i *Instance) MarkAsClosed()

updates inman's record to declare this instance as closed, and exits rblxutils if no more instances are alive

func (*Instance) QueryPlaceInfo

func (i *Instance) QueryPlaceInfo()

func (*Instance) QueryServerLocation

func (i *Instance) QueryServerLocation()

func (*Instance) SetProcess

func (i *Instance) SetProcess(p *os.Process)

SetProcess set Instance.process, then calls WaitForInstance in a new goroutine

func (*Instance) WaitForInstance

func (i *Instance) WaitForInstance()

WaitForInstance waits for the instance process to exit, then calls MarkAsClosed.

type Mod

type Mod struct {
	Name    string //Extracted from filename on import
	Enabled bool
	Binary  []byte
}

type ProxyStats

type ProxyStats struct {
	AvgRewriteDelayNs                     int
	AvgModifyResponseAssetDeliveryDelayNs int
	AvgModifyResponseCdnDelayNs           int
}

type RcmfData

type RcmfData struct {
	Blob  []byte `json:"blob"`  //Blob describes a binary object to replace the Sources with.
	Key   string `json:"key"`   //Key describes a part of a xml or json document to modify. If the Sources are xml documents, key should be an XPath expression. If the Sources are json, a dot-seperated path should be used. Key should be empty when Blob is set.
	Value string `json:"value"` //Value describes the value to set a part of a xml or json document to when Key is set.
}

type RcmfFile

type RcmfFile struct {
	Spec  string     `json:"spec"`  //spec defines what RCMF spec to use. It should be a link to a document describing the spec. For this implementation, it should be set to "https://rcmf.axell.me/v1"
	Rules []RcmfRule `json:"rules"` //Rules describes the rules of this mod
}

type RcmfRule

type RcmfRule struct {
	Sources Sources  `json:"sources"` //Sources describes the sources of this rule
	Data    RcmfData `json:"data"`    //Data describes the data of this rule
}

type ServerData

type ServerData struct {
	JobId         string
	PlaceId       int
	UDMUXAddress  string
	RCCAddress    string
	ServerAddress string //actual server ip, if unprotected it's RCCAddress, if protected its UDMUXAddress
	UniverseId    int
	UserId        int
	GameData      GameData
	JoinTime      time.Time
	LeaveTime     time.Time
	Location      ServerLocationInfo
	HeadshotURL   string
	User          User
}

type ServerLocationInfo

type ServerLocationInfo struct {
	City    string `json:"city"`
	Region  string `json:"region"`
	Country string `json:"country"`
	Loc     string `json:"loc"`
	Bogon   bool   `json:"bogon"`
}

type SocketMessage

type SocketMessage struct {
	Type  string
	Error string //an error of "" should be interpreted as success
	DataB []byte //generic byte array that may be used for data
	Stats ProxyStats
}

type Sources

type Sources struct {
	Expressions []string `json:"expressions"` //This is reserved for future use. This can be ignored.
	Ids         []int    `json:"ids"`         //Ids describes roblox asset ids to modify.
	Types       []int    `json:"types"`       //Types describes asset types to modify in the form of asset type ids.
	Files       []string `json:"files"`       //Files describes files on the disk to modify. These strings can either be a path relative to the Roblox install directory (eg. version-xxxxxxxxxx), or it can be a special string that points to another path not in the roblox install directory. Special strings are "GlobalBasicSettings_13.xml" and "GlobalSettings_13.xml"
}

type StateT

type StateT struct {
	RequiresModApplication bool //this reports if the last action was a change to mods in config rather than a mod application
	ServerHistory          []ServerData
}
var State StateT

type Thumbnail

type Thumbnail struct {
	ImageUrl string `json:"imageUrl"`
}

type UpdateResponse

type UpdateResponse struct {
	Title    string
	Text     string
	TextCols int
	Upgrade  struct {
		Version   int
		Download  string
		Signature []byte
	}
}

func CheckForUpdates

func CheckForUpdates() UpdateResponse

Checks and performs any updates, then returns Uresp

type User

type User struct {
	Name        string `json:"name"`
	DisplayName string `json:"displayName"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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