Skip to content

Commit

Permalink
Version 1.02: add experimental support for limiting "capping" FPS
Browse files Browse the repository at this point in the history
  • Loading branch information
syncore committed Jul 5, 2017
1 parent d5ddd33 commit 359b743
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
12 changes: 8 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func Launch() error {
}
logger.Debugw("Game code", "gameCode.GameCode", gameCode.Gamecode)
finalArgs := strings.Replace(exArgs, gameCodeTempl, gameCode.Gamecode, -1)
logger.Debugw("Final arguments", "finalArgs", finalArgs)
logger.Debug("Launching....")
return runQC(qcOpts.QCFilePath, finalArgs)
}

Expand Down Expand Up @@ -397,16 +395,22 @@ func formatUnexpectedResponse(event string) error {
func runQC(qcPath, qcArgs string) error {
qc := exec.Command(qcPath)
qc.Dir = filepath.Dir(qcPath)
a := qcArgs
allArgs := []string{qcArgs}
if ConfAppendCustomArgs != "" {
a = fmt.Sprintf("%s %s", qcArgs, ConfAppendCustomArgs)
allArgs = append(allArgs, ConfAppendCustomArgs)
}
if ConfMaxFPS != 0 {
allArgs = append(allArgs, fmt.Sprintf("--set /Config/CONFIG/maxFpsValue %d", ConfMaxFPS))
}
a := strings.Join(allArgs, " ")
logger.Debugf("Final arguments: %s", a)
// Handle arg quote-escaping manually (see golang issue #15566)
qc.SysProcAttr = &syscall.SysProcAttr{
HideWindow: false,
CmdLine: fmt.Sprintf(` %s`, a),
CreationFlags: 0,
}
logger.Debug("Launching....")
if err := qc.Start(); err != nil {
logger.Errorw("runQC: error starting QC", "error", err)
return err
Expand Down
1 change: 1 addition & 0 deletions cmd/qclauncher/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ func init() {
flag.Int64Var(&qclauncher.ConfUpdateInterval, "updateinterval", 86400, "Time in seconds between checking for launcher updates") // 24 hours (86400)
flag.BoolVar(&qclauncher.ConfSkipUpdates, "skipupdates", false, "Skip checking for QC and launcher updates")
flag.BoolVar(&qclauncher.ConfEnforceHash, "enforcehash", true, "Enforce QC game hash checking (disabling is not recommended)")
flag.IntVar(&qclauncher.ConfMaxFPS, "maxfps", 0, "Max value to limit FPS to (experimental)")
}

func main() {
Expand Down
3 changes: 2 additions & 1 deletion conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const (
bDefBase = "buildinfo.cdp.bethesda.net"
sDefBase = "services.bethesda.net"
defTimeout = 10
version = 1.01
version = 1.02
)

var (
Expand All @@ -29,6 +29,7 @@ var (
ConfUpdateInterval int64
ConfSkipUpdates bool
ConfEnforceHash bool
ConfMaxFPS int
ConfBaseSvc string
ConfBaseBi string
ConfSrcFp string
Expand Down
2 changes: 1 addition & 1 deletion resources/qcl_latest_version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"latest":1.01,"date":"2017-07-04T12:00:00Z","url":"https://github.com/syncore/qclauncher/releases"}
{"latest":1.02,"date":"2017-07-04T12:30:00Z","url":"https://github.com/syncore/qclauncher/releases/tag/v1.02"}
2 changes: 1 addition & 1 deletion resources/qclauncher.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="QCLauncher" processorArchitecture="*" type="win32" version="1.0.1.0"/>
<assemblyIdentity name="QCLauncher" processorArchitecture="*" type="win32" version="1.0.2.0"/>
<description>QCLauncher</description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
Expand Down
8 changes: 4 additions & 4 deletions resources/versioninfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"FileVersion": {
"Major": 1,
"Minor": 0,
"Patch": 1,
"Patch": 2,
"Build": 0
},
"ProductVersion": {
"Major": 1,
"Minor": 0,
"Patch": 1,
"Patch": 2,
"Build": 0
},
"FileFlagsMask": "3f",
Expand All @@ -24,14 +24,14 @@
"Comments": "Quake Champions Launcher",
"CompanyName": "syncore",
"FileDescription": "Quake Champions Launcher",
"FileVersion": "1.01",
"FileVersion": "1.02",
"InternalName": "qclauncher",
"LegalCopyright": "© syncore, 2017",
"LegalTrademarks": "",
"OriginalFilename": "qclauncher.exe",
"PrivateBuild": "",
"ProductName": "QCLauncher",
"ProductVersion": "v1.0.1.0",
"ProductVersion": "v1.0.2.0",
"SpecialBuild": ""
},
"VarFileInfo":
Expand Down

0 comments on commit 359b743

Please sign in to comment.