]> 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

1  2 
.gitignore
misc/tools/all/xonotic.subr

diff --combined .gitignore
index 4d858682ae70d59d4d988bcf40d56e579f1768de,8a322326a9b61433998471b8b2cacd865ba01b50..9c8d3f41d598022127c0cad2749d8aee23099c87
@@@ -1,5 -1,5 +1,5 @@@
  /build/
 -/daemon
 +/daemon-glue
  /darkplaces
  /gmqcc
  /div0-gittools
@@@ -12,8 -12,8 +12,9 @@@
  /data.old/
  /xonstat/
  /xonstatdb/
 +/xonotic.org
  /wiki
  
  .idea/
  /result*
+ /.serverbench_temp
index 0938974ca9b46bcfa8fd36442cf7de74267d49b7,cb3b67537fadc1955d7908e9cd3e8452891e03db..35ce643154553ff53f139592e02fdb35c977475d
@@@ -8,10 -8,9 +8,10 @@@ case "$cmd" i
                        msg "Usage: ./all compile-map mapname1 mapname2 mapname3"
                        msg "For example: ./all compile-map dance xoylent"
                fi
 -              if ! [ -f "netradiant/install/q3map2" ] ; then
 -                      msg "q3map2 needed! Building netradiant..."
 -                      make -C netradiant BUILD=native install/q3map2
 +              if ! [ -f "netradiant/build/q3map2" ] ; then
 +                      msg "q3map2 needed! Building q3map2..."
 +                      cmake -H'netradiant' -B'netradiant/build' -G'Unix Makefiles' -D'CMAKE_BUILD_TYPE=Release' -DBUILD_RADIANT=OFF -DDOWNLOAD_GAMEPACKS=OFF
 +                      cmake --build 'netradiant/build' -- q3map2
                fi
                for mapfile in "$@"; do
                        mapfile="data/xonotic-maps.pk3dir/maps/$mapfile.map"
                ;;
        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:' |\