File: game_sample.sh

package info (click to toggle)
warzone2100 4.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 660,320 kB
  • sloc: cpp: 676,209; ansic: 391,201; javascript: 78,238; python: 16,632; php: 4,294; sh: 4,094; makefile: 2,629; lisp: 1,492; cs: 489; xml: 404; perl: 224; ruby: 156; java: 89
file content (45 lines) | stat: -rw-r--r-- 1,163 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

## Game configuration values
## One file for each game type

## Warzone2100 configuration directory
## Leave commented to use the default one
## Required to randomize maps
## Snap default
#cfgdir="$HOME/snap/warzone2100/common/warzone2100"
## Flatpak default
#cfgdir="$HOME/.var/app/net.wz2100.wz2100/data/warzone2100/"
## Home default
#cfgdir="$HOME/.local/share/warzone2100"

## Map pool
## Leave commented to skip randomized maps or provide a list of map names.
## The autohost file will be updated each time with one of these values
#maps=("map1" "map2" "map3")

## Host file
## The name of the file in your 'autohost' directory inside cfgdir.
hostfile="my_game.json"

## Players
## The number of players required to start the game.
players=2


## Run script
## Do not edit below
DIR="${BASH_SOURCE%/*}"
if [[ ! -d "$DIR" ]]; then DIR="$PWD"; fi
if [ ! -f "$DIR/common.sh" ]; then
  echo "[ERROR] common.sh not found."
  exit 1
fi
if [ ! -f "$DIR/config.sh" ]; then
  echo "[ERROR] config.sh not found."
  echo "Copy 'config_sample.sh' to 'config.sh' and check if the file is readable."
  exit 1
fi
. "$DIR/common.sh"
. "$DIR/config.sh"
run_host