Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
support gotv
Browse files Browse the repository at this point in the history
  • Loading branch information
timche committed Jun 25, 2020
1 parent c2024f8 commit 658b032
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
76 changes: 76 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,82 @@ Map group.

Sets `+mapgroup` in `srcds_run` parameters.

#### `CSGO_TV_ENABLED`

Default: `false`

Enable GOTV. Can be enabled with `true`.

#### `CSGO_TV_NAME`

Default: `GOTV`

Set GOTV name.

#### `CSGO_TV_PASSWORD`

Default: None

Set GOTV password.

#### `CSGO_TV_DELAY`

Default: `45`

Set GOTV broadcast delay in seconds.

#### `CSGO_TV_PORT`

Default: `27020`

Set GOTV port.

#### `CSGO_TV_DELAYMAPCHANGE`

Default: `1`

Delay the map change on game server until rest of buffered game has been broadcasted.

#### `CSGO_TV_DELTACACHE`

Default: `2`

#### `CSGO_TV_DISPATCHMODE`

Default: `1`

#### `CSGO_TV_MAXCLIENTS`

Default: `10`

Maximum client number for GOTV.

#### `CSGO_TV_MAXRATE`

Default: `0`

Maximum bandwidth spend per client in bytes/second.

#### `CSGO_TV_OVERRIDEMASTER`

Default: `0`

#### `CSGO_TV_SNAPSHOTRATE`

Default: `128`

World snapshots broadcasted per second by GOTV.

#### `CSGO_TV_TIMEOUT`

Default: `60`

#### `CSGO_TV_TRANSMITALL`

Default: `1`

By default entities and events outside of the auto-director view are removed from GOTV broadcasts to save bandwidth. If `tv_transmitall` is enabled, the whole game is transmitted and spectators can switch their view to any player they want. This option increases bandwidth requirement per spectator client by factor 2 to 3.

#### `CSGO_FORCE_NETSETTINGS`

Default: `false`
Expand Down
26 changes: 26 additions & 0 deletions base/server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,32 @@ start() {
additionalParams+=" +sv_minrate 786432 +sv_mincmdrate 128 +sv_minupdaterate 128"
fi

if [ "${CSGO_TV_ENABLE-"false"}" = "true" ]; then
additionalParams+=" +tv_enable 1"
additionalParams+=" +tv_delaymapchange ${CSGO_TV_DELAYMAPCHANGE-1}"
additionalParams+=" +tv_delay ${CSGO_TV_DELAY-45}"
additionalParams+=" +tv_deltacache ${CSGO_TV_DELTACACHE-2}"
additionalParams+=" +tv_dispatchmode ${CSGO_TV_DISPATCHMODE-1}"
additionalParams+=" +tv_maxclients ${CSGO_TV_MAXCLIENTS-10}"
additionalParams+=" +tv_maxrate ${CSGO_TV_MAXRATE-0}"
additionalParams+=" +tv_overridemaster ${CSGO_TV_OVERRIDEMASTER-0}"
additionalParams+=" +tv_snapshotrate ${CSGO_TV_SNAPSHOTRATE-128}"
additionalParams+=" +tv_timeout ${CSGO_TV_TIMEOUT-60}"
additionalParams+=" +tv_transmitall ${CSGO_TV_TRANSMITALL-1}"

if [ -n "${CSGO_TV_NAME}" ]; then
additionalParams+=" +tv_name ${CSGO_TV_NAME}"
fi

if [ -n "${CSGO_TV_PORT}" ]; then
additionalParams+=" +tv_port ${CSGO_TV_PORT}"
fi

if [ -n "${CSGO_TV_PASSWORD}" ]; then
additionalParams+=" +tv_password ${CSGO_TV_PASSWORD}"
fi
fi

set -x

exec $server_dir/srcds_run \
Expand Down

0 comments on commit 658b032

Please sign in to comment.