ut4updater

package module
v0.0.0-...-74934bf Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

README

This project is incomplete and has been abandoned

Unreal Tournament 4 updater

An incremental updater for Unreal Tournament 4 on Linux

Build Status Go Report Card Coverage Status Current Version Godoc Reference

About

Unreal Tournament 4 is available on Linux. Currently, no incremental updater exists which requires you to download the full game (around 10GB) for every patch release.

This updater aims to make life a bit simpler by only applying files that have been added, removed or modified since the previous version - allowing for much faster and smaller updates to the game.

How it works

  1. When the launcher (either cli or GUI) is opened the updater checks for a new release against https://ut4.donovansolms.com (the ut4-update-server is also open source)
  2. If an update is available you can download and install, download and install in the background (while playing) or simply ignore
  3. If you decide to install, the upgrader will create a clone of the current installation and apply the updates to the cloned version only.
  4. The updater keeps track of installed versions. The option version allows you to specify the version to run, the default it to run the latest version available.
Options
  • InstallPath (required)

InstallPath is the base path for creating new installations. Must be specified. If the path doesn't exist, it will be created.

  • Versioning.Keep (Defaults to 2 in the launcher)

Keep specifies the clones to keep. Warning if set to 0, the updates will be applied to your current version which could break the game and cause you to download the full game again.

  • Versioning.Run (Defaults to latest in the launcher)

Run allows you to run any previously downloaded version. This is handy in case something is broken or you need to check performance between versions

  • SendStats (Defaults to true in the launcher)

Basic information is collected to improve the updater and display stats about Unreal Tournament players using Linux

GUI and CLI Launchers

Privacy

I respect your privacy. The updater collects the following information to improve the updater:

  1. Your installed Unreal Tournament 4 versions
  2. Your public IP is saved by the update server for country install stats
  3. Kernel version and Distribution using /etc/*-release and uname -r. Only used for stats

You can disable Kernel version, distribution and installed Unreal Tournament version collection by setting the SendStats option to false.

Contact

You can get in contact on Twitter @donovansolms or by creating an issue

Documentation

Overview

Package ut4updater implements the Unreal Tournament 4 updater for Linux

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(source string, dest string) (err error)

CopyDir copies a directory and all contents while preserving permissions

func CopyFile

func CopyFile(source string, dest string) (err error)

CopyFile copies afile from source to destination and preserves permissions

Types

type ByVersion

type ByVersion []UT4Version

ByVersion allows for sorting by the build version number

func (ByVersion) Len

func (a ByVersion) Len() int

func (ByVersion) Less

func (a ByVersion) Less(i, j int) bool

func (ByVersion) Swap

func (a ByVersion) Swap(i, j int)

type DownloadProgressEvent

type DownloadProgressEvent struct {
	Filename  string
	Mbps      float64
	ETA       float64
	Percent   float64
	Completed bool
}

DownloadProgressEvent contains information about an ongoing download

type HashJob

type HashJob struct {
	// contains filtered or unexported fields
}

HashJob is the structure that will be passed for processing of hashes

func (HashJob) Process

func (job HashJob) Process()

Process is an implementation of Job.Process()

type HashProgressEvent

type HashProgressEvent struct {
	Filename string
	Filepath string
	Error    string
	// MB/s processed
	Mbps float64
	// The estimated time to complete in seconds
	ETA       float64
	Percent   float64
	Completed bool
	Hash      string
}

HashProgressEvent contains the progress event

type OSDistribution

type OSDistribution struct {
	KernelVersion          string
	DistributionID         string
	Distribution           string
	DistributionVersion    string
	DistributionPrettyName string
}

OSDistribution contains information about the OS and distribution

type ProgressTracker

type ProgressTracker struct {
	// contains filtered or unexported fields
}

ProgressTracker implements a writer for tracking the progress of hash generation and file downloads

func (ProgressTracker) Write

func (pt ProgressTracker) Write(data []byte) (int, error)

type UT4Updater

type UT4Updater struct {
	// contains filtered or unexported fields
}

UT4Updater is the main executor for the updater

func New

func New(installPath string,
	keepVersions uint,
	runVersion string,
	sendStats bool,
	updateURL string) (*UT4Updater, error)

New creates aand initializes a new instance of UT4Updater

func (*UT4Updater) CheckForUpdate

func (updater *UT4Updater) CheckForUpdate() (bool, string, error)

CheckForUpdate checks if an update is available

func (*UT4Updater) GenerateHashes

func (updater *UT4Updater) GenerateHashes(
	fileList []string,
	maxHashers int,
	updateFeedbackChan chan HashProgressEvent) (map[string]string, error)

GenerateHashes generates SHA256 hashes for the given file list and returns the file list with the file hash

func (*UT4Updater) GetLatestVersion

func (updater *UT4Updater) GetLatestVersion() (UT4Version, error)

GetLatestVersion returns the latest version installed

func (*UT4Updater) GetOSDistribution

func (updater *UT4Updater) GetOSDistribution() OSDistribution

GetOSDistribution retrieves the kernel and distribution versions

func (*UT4Updater) GetVersionList

func (updater *UT4Updater) GetVersionList() ([]UT4Version, error)

GetVersionList returns the available installed versions as [version]path

func (*UT4Updater) GetVersionPath

func (updater *UT4Updater) GetVersionPath(
	version string, mustNotExist bool) (string, error)

GetVersionPath returns the path to the version, setting mustNotExist to true will return an error if the path exists

func (*UT4Updater) Update

func (updater *UT4Updater) Update(feedback chan []byte) (UT4Version, error)

Update creates a backup and the current game, determines the files to be updated, downloads the files and applies the updates. Returns the new latest version. The provided feedback channel will return JSON data with the status updates. This is safe to run in a goroutine.

type UT4Version

type UT4Version struct {
	VersionMap
	Path string
}

UT4Version holds information about an installed UT4 version

type UpdateCheckRequest

type UpdateCheckRequest struct {
	ClientID       string         `json:"client_id"`
	OS             OSDistribution `json:"os"`
	Versions       []string       `json:"versions"`
	CurrentVersion string         `json:"current_version"`
}

UpdateCheckRequest holds the information for update requests

type UpdateCheckResponse

type UpdateCheckResponse struct {
	CurrentVersion  string `json:"current_version"`
	LatestVersion   string `json:"latest_version"`
	UpdateAvailable bool   `json:"update_available"`
}

UpdateCheckResponse is the response for update check requests

type VersionMap

type VersionMap struct {
	Version     string    `json:"version"`
	SemVer      string    `json:"semver"`
	ReleaseDate time.Time `json:"released"`
}

VersionMap is the structure for mapping a UT4 build version to the symantic version number

type VersionMaps

type VersionMaps []VersionMap

VersionMaps is an declaration for operations on a list of version maps

func (VersionMaps) GetVersionMapByVersionNumber

func (versionMaps VersionMaps) GetVersionMapByVersionNumber(
	version string) VersionMap

GetVersionMapByVersionNumber retrieves the version map information based on the build version

Jump to

Keyboard shortcuts

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