]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
Merge branch 'bones_was_here/improve-serverbench' into 'master'
authorMartin Taibr <taibr.martin@gmail.com>
Sun, 12 Apr 2020 22:52:54 +0000 (22:52 +0000)
committerMartin Taibr <taibr.martin@gmail.com>
Sun, 12 Apr 2020 22:52:54 +0000 (22:52 +0000)
Improve serverbench command WRT #273

- Use a temporary directory for the files previously created in the repo with -nohome (eg lock, data/data/defaultSVQC.cfg). This is better than just deleting the files as it will still work if the files created change, and won't annoy a user who is running their normal server or client with -nohome.
- Gitignore the temp directory, so it won't get committed if the serverbench was interrupted.
- Use dedicated instead of requiring it as an argument, previously without args it would run in threaded server mode which is considered unstable and doesn't run properly in this useage.

Resolves #273

See merge request xonotic/xonotic!62

.gitignore
misc/tools/all/xonotic.subr

index 4d858682ae70d59d4d988bcf40d56e579f1768de..9c8d3f41d598022127c0cad2749d8aee23099c87 100644 (file)
@@ -17,3 +17,4 @@
 
 .idea/
 /result*
+/.serverbench_temp
index 0938974ca9b46bcfa8fd36442cf7de74267d49b7..35ce643154553ff53f139592e02fdb35c977475d 100644 (file)
@@ -396,7 +396,9 @@ case "$cmd" in
                ;;
        serverbench)
                # TODO(rpolzer): Why does :anticheat: output differ? Total game time differs? Why?
-               verbose "$SELF" run "$@" -noconfig -nohome +exec serverbench.cfg |\
+               trap "rm -rf .serverbench_temp" 0 1 2 3 11 13 15
+               mkdir -p .serverbench_temp
+               verbose "$SELF" run dedicated "$@" -noconfig -userdir .serverbench_temp +exec serverbench.cfg |\
                        tee /dev/stderr |\
                        grep '^:' |\
                        grep -v '^:gamestart:' |\