Documentation
¶
Overview ¶
Package bepinex installs a BepInEx 5 (or 6) pack into a profile folder for a Unity game and describes how Doorstop starts it: the Doorstop files that belong beside the game executable, the launch flags, and the Unity base libraries an IL2CPP game needs. It knows no game catalogue and no profile model; the caller passes plain paths.
Index ¶
- func DoorstopFiles(profileRoot, fallback string) []string
- func Entry(profileRoot string) string
- func HasCLR(profileRoot string) bool
- func HostPath(profileRoot, rel string, proton bool) string
- func LaunchArgs(profileRoot string, doorstopMajor int, proton bool) []string
- func PlaceUnityLibs(ctx context.Context, gameDir, profileDir, cacheDir string) error
- func Proxies() []string
- func Proxy(profileRoot, fallback string) string
- func UnityVersion(gameDir string) string
- func VanillaArgs() []string
- func WriteAbsoluteConfig(profileRoot, dst string, doorstopMajor int, proton bool) error
- type Installed
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoorstopFiles ¶
DoorstopFiles lists, relative to profileRoot and with forward slashes, the files that must sit next to the game executable: doorstop_config.ini and the pack's Doorstop proxy (fallback names the proxy to look for when none is installed). Absent ones are left out. Everything else of the pack stays in the profile.
func Entry ¶
Entry is the entry assembly of the pack installed in profileRoot, relative to it and in the host's separators; the BepInEx 5 preloader when no entry assembly is installed.
func HasCLR ¶
HasCLR reports whether the pack in profileRoot ships the .NET runtime an IL2CPP pack starts through.
func HostPath ¶
HostPath is rel under profileRoot as an absolute path, in the Wine Z: form when proton is set.
func LaunchArgs ¶
LaunchArgs are the Doorstop flags that start the game with BepInEx rooted in profileRoot, with an IL2CPP pack's .NET runtime. Doorstop 3 and 4 spell the flags differently (doorstopMajor is Installed.Doorstop); proton gives the paths in the Wine Z: form.
func PlaceUnityLibs ¶
PlaceUnityLibs puts the game's Unity base libraries in the profile's BepInEx/unity-libs, so an IL2CPP game's first start needs no network. The zip is downloaded once into cacheDir/unity-libs and copied from there into each later profile. A game with no readable Unity version is a no-op; on any error BepInEx fetches the libraries itself at launch, so a caller may treat the error as non-fatal.
func Proxies ¶
func Proxies() []string
Proxies are the file names a pack gives its Doorstop proxy library, the usual one first.
func Proxy ¶
Proxy is the Doorstop proxy library the pack in profileRoot ships; fallback before it holds a pack.
func UnityVersion ¶
UnityVersion is the Unity version of the game in gameDir (2022.3.21), read from its *_Data folder, or "".
func VanillaArgs ¶
func VanillaArgs() []string
VanillaArgs start the game with Doorstop switched off, even while its files sit in the game folder. A vanilla start has no profile to read the Doorstop version from, and the proxy left in the folder may be either, so both spellings are passed; each proxy ignores the other's.
func WriteAbsoluteConfig ¶
WriteAbsoluteConfig writes the profile's doorstop_config.ini to dst with its target assembly set to the profile's entry (added, in the spelling of the Doorstop major version, when the config names none) and the pack's runtime paths made absolute. Doorstop reads relative paths from the game folder, where the profile's files are not, so the copy in the game folder loads the profile's BepInEx even when a start cannot pass Doorstop's flags. A path in the config that leaves the profile is left as written. The file's line endings are kept; proton gives paths in the Wine Z: form.
Types ¶
type Installed ¶
type Installed struct {
// Manifest is the pack's manifest.json as the archive holds it (at most 1 MiB), or nil when it has none or it is
// larger. It is untrusted input for the caller to parse.
Manifest []byte
// Doorstop is the major version of the Doorstop proxy, from .doorstop_version; 3 when the pack has none.
Doorstop int
}
Installed is what InstallPack found in the pack.
func InstallPack ¶
InstallPack lays the pack zip's root folder out into profileRoot, replacing files already there: a folder named anything that holds an entry assembly (BepInExPack/, BepInExPack_Valheim/), or the zip itself when it has BepInEx/ at its top. The zip is extracted by go-archive under its default caps, so a name that climbs out, a link or a special file fails the install before profileRoot is touched.
Files of a previous pack are cleared first (see the Doorstop files and core libraries it owns); BepInEx/plugins, patchers and a core folder of a mod stay, and an existing BepInEx/config file is never overwritten.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package logline reads and writes the lines of BepInEx's LogOutput.log: a header naming a level and a source, then the message, optionally behind the timestamp a logger mod adds.
|
Package logline reads and writes the lines of BepInEx's LogOutput.log: a header naming a level and a source, then the message, optionally behind the timestamp a logger mod adds. |
|
Package plugins reads which BepInEx plugins the compiled assemblies in a folder declare, through go-dotnet, and orders them the way BepInEx 5's chainloader loads them.
|
Package plugins reads which BepInEx plugins the compiled assemblies in a folder declare, through go-dotnet, and orders them the way BepInEx 5's chainloader loads them. |
|
Package wineoverride edits a Wine or Proton prefix's user.reg so Wine loads a loader's proxy library natively, and writes host paths the way a game under Wine reads them.
|
Package wineoverride edits a Wine or Proton prefix's user.reg so Wine loads a loader's proxy library natively, and writes host paths the way a game under Wine reads them. |