Documentation
¶
Index ¶
- Constants
- Variables
- func EnsureReleaseArchive(ctx context.Context, release Release, options ReleaseOptions) (path string, err error)
- func IsX64PE(path string) (isX64 bool, err error)
- func RelativeToRoot(root string, path string) (relative string, err error)
- func ResolveWithinRoot(root string, relativePath string) (resolved string, err error)
- func UpdateManagedINI(contents []byte, config ManagedConfig) (updated []byte, err error)
- type Action
- type ApplyResult
- type Candidate
- type Drift
- type GraphicsAPI
- type ManagedConfig
- type ManagedFile
- type Manager
- func (m *Manager) Apply(ctx context.Context, gameRoot string, request Request, previewHash string) (result ApplyResult, err error)
- func (m *Manager) Discover(ctx context.Context, gameRoot string, gameID int64) (candidates []Candidate, err error)
- func (m *Manager) Preview(ctx context.Context, gameRoot string, request Request) (preview Preview, err error)
- func (m *Manager) RecoveryState() (state RecoveryState, err error)
- func (m *Manager) RollbackRecovery(journalID string) (result ApplyResult, err error)
- func (m *Manager) StableRelease(ctx context.Context, refresh bool) (release Release, err error)
- type ManagerOptions
- type Manifest
- type Operation
- type Ownership
- type Package
- type PackageFile
- type Preview
- type RecoveryState
- type Release
- type ReleaseOptions
- type Request
- type Store
Constants ¶
View Source
const ( ManifestVersion = 1 JournalVersion = 1 WarningVersion = "online-anticheat-v1" )
View Source
const DefaultReleasesURL = thirdparty.DefaultManifestURL
Variables ¶
View Source
var SupportedProxyFilenames = []string{
"dxgi.dll",
"winmm.dll",
"d3d12.dll",
"dbghelp.dll",
"version.dll",
"wininet.dll",
"winhttp.dll",
"OptiScaler.asi",
}
Functions ¶
func EnsureReleaseArchive ¶
func ResolveWithinRoot ¶
func UpdateManagedINI ¶
func UpdateManagedINI(contents []byte, config ManagedConfig) (updated []byte, err error)
Types ¶
type ApplyResult ¶
type Candidate ¶
type Candidate struct {
TargetRelativePath string `json:"targetRelativePath"`
ExecutableRelativePath string `json:"executableRelativePath"`
ExecutableName string `json:"executableName"`
Architecture string `json:"architecture"`
Evidence []string `json:"evidence"`
Managed bool `json:"managed"`
HasOptiScaler bool `json:"hasOptiScaler"`
HasReShade bool `json:"hasReShade"`
}
type GraphicsAPI ¶
type GraphicsAPI string
const ( GraphicsAPIDirectX GraphicsAPI = "directx" GraphicsAPIVulkan GraphicsAPI = "vulkan" )
type ManagedConfig ¶
type ManagedFile ¶
type ManagedFile struct {
RelativePath string `json:"relativePath"`
SHA256 string `json:"sha256"`
SizeBytes int64 `json:"sizeBytes"`
BackupPath string `json:"backupPath,omitempty"`
BackupSHA256 string `json:"backupSha256,omitempty"`
BackupSize int64 `json:"backupSizeBytes,omitempty"`
Ownership string `json:"ownership,omitempty"`
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(store Store, options ManagerOptions) *Manager
func (*Manager) RecoveryState ¶
func (m *Manager) RecoveryState() (state RecoveryState, err error)
func (*Manager) RollbackRecovery ¶
func (m *Manager) RollbackRecovery(journalID string) (result ApplyResult, err error)
type ManagerOptions ¶
type ManagerOptions struct {
DataDir string
CacheDir string
ReleasesURL string
ReleaseManifest []byte
HTTPClient *http.Client
Now func() time.Time
PreparePackage func(context.Context) (Release, Package, error)
InspectOwnership func(string) (Ownership, error)
ExecuteOperation func(Operation) error
RollbackSnapshots func([]journalSnapshot) error
}
type Manifest ¶
type Manifest struct {
Version int `json:"version"`
Files []ManagedFile `json:"files"`
Config ManagedConfig `json:"config"`
OriginalReShadeProxy *string `json:"originalReShadeProxy,omitempty"`
HasPreAdoptionRollbackData bool `json:"hasPreAdoptionRollbackData"`
}
type Package ¶
type Package struct {
Root string `json:"root"`
Files []PackageFile `json:"files"`
}
type PackageFile ¶
type Preview ¶
type Preview struct {
Request Request `json:"request"`
Release Release `json:"release"`
Operations []Operation `json:"operations"`
ConfigurationChanges []string `json:"configurationChanges"`
Warnings []string `json:"warnings"`
Conflicts []string `json:"conflicts"`
Drift []Drift `json:"drift"`
PreviewHash string `json:"previewHash"`
CanApply bool `json:"canApply"`
}
type RecoveryState ¶
type RecoveryState struct {
Required bool `json:"required"`
JournalID string `json:"journalId,omitempty"`
GameID int64 `json:"gameId,omitempty"`
TargetPath string `json:"targetPath,omitempty"`
Action Action `json:"action,omitempty"`
StartedAt time.Time `json:"startedAt,omitempty"`
Error string `json:"error,omitempty"`
}
type Release ¶
type Release struct {
Tag string `json:"tag"`
Version string `json:"version"`
AssetName string `json:"assetName"`
URL string `json:"url"`
Digest string `json:"digest"`
Size int64 `json:"size"`
Error string `json:"error,omitempty"`
}
func DiscoverStableRelease ¶
func DiscoverStableRelease(ctx context.Context, options ReleaseOptions) (release Release, err error)
type ReleaseOptions ¶
type Request ¶
type Request struct {
Action Action `json:"action"`
GameID int64 `json:"gameId"`
TargetRelativePath string `json:"targetRelativePath"`
ExecutableRelativePath string `json:"executableRelativePath"`
GraphicsAPI GraphicsAPI `json:"graphicsApi"`
ProxyFilename string `json:"proxyFilename"`
DXGISpoofing bool `json:"dxgiSpoofing"`
ProcessFilter *string `json:"processFilter"`
AcknowledgeWarning bool `json:"acknowledgeWarning"`
BackupAndContinue bool `json:"backupAndContinue"`
EnableReShadeCoexistence bool `json:"enableReShadeCoexistence"`
}
type Store ¶
type Store interface {
GetOptiScalerTarget(context.Context, int64, string) (dbtypes.OptiScalerTarget, bool, error)
ListOptiScalerTargets(context.Context, int64) ([]dbtypes.OptiScalerTarget, error)
SaveOptiScalerTarget(context.Context, dbtypes.SaveOptiScalerTargetInput) (dbtypes.OptiScalerTarget, error)
DeleteOptiScalerTarget(context.Context, int64, string) error
}
Click to show internal directories.
Click to hide internal directories.