Files
galaxy-game/client/loader/download.go
T
2026-03-15 20:40:25 +02:00

20 lines
536 B
Go

package loader
import (
"galaxy/connector"
"galaxy/util"
)
func (l *loader) newerVersion(version string) bool {
return util.CompareSemver(util.MustParseSemver(l.client.Version()), util.MustParseSemver(version)) > 0
}
// downloadVersion fetches given version artifact, when newer to the current version,
// and stores at the App's local storage with a pre-defined name with semver suffix
func (l *loader) downloadVersion(v connector.VersionInfo) {
if !l.newerVersion(v.Version) {
return
}
l.connector.DownloadVersion(v.URL)
}