Skip to content

Commit

Permalink
0.11
Browse files Browse the repository at this point in the history
Prepare 0.11
  • Loading branch information
nickdnk authored Nov 3, 2022
2 parents ebab955 + 179aeea commit cc481b6
Show file tree
Hide file tree
Showing 65 changed files with 4,182 additions and 1,810 deletions.
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
time: "11:00"
28 changes: 28 additions & 0 deletions .github/workflows/auto_formatter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Auto Format Code On Master Merge

on:
push:
branches:
- master

jobs:
auto-formatter-on-master:
name: Auto Format Code On Master Merge
runs-on: ubuntu-latest
steps:
- name: Install Clang format
run: |
sudo apt install clang-format
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- run: python ./misc/format.py

- uses: EndBug/[email protected]
with:
committer_name: GitHub Actions
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
message: 'Run automatic format script as code does not match clang format rules.'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:

- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v3.0.0
uses: metcalfc/changelog-generator@v4.0.1
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:

- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v3.0.0
uses: metcalfc/changelog-generator@v4.0.1
with:
myToken: ${{ secrets.GITHUB_TOKEN }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.zip
*.tar.gz
builds
build
.vscode/
.idea
documentation/site
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN tar xfz $(basename ${SMPACKAGE})
RUN chmod +x /get5/addons/sourcemod/scripting/spcomp
ENV PATH "$PATH:/get5/addons/sourcemod/scripting:/root/.local/bin"
WORKDIR /get5/addons/sourcemod/scripting/include
RUN wget https://raw.githubusercontent.com/KyleSanderson/SteamWorks/master/Pawn/includes/SteamWorks.inc
RUN wget https://raw.githubusercontent.com/PhlexPlexico/SteamWorks/master/Pawn/includes/SteamWorks.inc
WORKDIR /get5

VOLUME /get5/builds
Expand Down
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
get5
===========================
# splewis/get5

[![Build Status](https://github.com/splewis/get5/actions/workflows/build.yml/badge.svg)](https://github.com/splewis/get5/actions/workflows/build.yml)
[![Downloads](https://img.shields.io/github/downloads/splewis/get5/total.svg?&label=Downloads)](https://github.com/splewis/get5/releases/latest)
[![Discord Chat](https://img.shields.io/discord/926309849673895966.svg)](https://discord.gg/zmqEa4keCk)
[![Discord Chat](https://img.shields.io/discord/926309849673895966?label=Discord)](https://discord.gg/zmqEa4keCk)
[![Downloads](https://img.shields.io/github/downloads/splewis/get5/total?label=Downloads)](https://github.com/splewis/get5/releases/latest)

**Status: Supported, actively developed.**
## Status: Supported, actively developed.

Get5 is a standalone SourceMod plugin for CS:GO servers for running matches.

Please visit https://splewis.github.io/get5 for documentation.
### Documentation

### Discord Chat
### [splewis.github.io/get5](https://splewis.github.io/get5)

A [Discord](https://discord.gg/zmqEa4keCk) channel is available for general discussion.
---

### Reporting bugs
### Latest versions

Please make a [github issue](https://github.com/splewis/get5/issues) and fill out as much information as possible. Reproducible steps and a clear version number will help tremendously!
#### Stable
If you don't know which one you need, this is the one you need.

### Contributions
[![Latest version](https://img.shields.io/github/v/release/splewis/get5?label=Latest)](https://github.com/splewis/get5/releases/latest)

Pull requests are welcome. Please follow the general coding formatting style as much as possible.
#### Prerelease
:warning: Pre-releases are meant for development and testing only.

### Building
[![Latest version](https://img.shields.io/github/v/release/splewis/get5?include_prereleases&label=Latest)](https://github.com/splewis/get5/releases)

You can use Docker to Build get5. First you need to build the container image locally: Go to the repository folder and run:
---

docker build . -t get5build:latest
### Discord

Afterwards you can build get5 with the following command: (specify /path/to/your/build/output and /path/to/your/get5src)
A Discord server is available for general discussion.

docker run --rm -v /path/to/your/get5src:/get5src -v /path/to/your/build/output:/get5/builds get5build:latest

[![Discord](https://dcbadge.vercel.app/api/server/zmqEa4keCk?style=flat)](https://discord.gg/zmqEa4keCk)

---

### Reporting bugs

Please file a [GitHub issue](https://github.com/splewis/get5/issues) and fill out as much information as possible.
Reproducible steps and a clear version number will help tremendously. The Get5 version can be displayed
with [`get5_status`](https://splewis.github.io/get5/latest/commands/#get5_status).

### Contributions

Pull requests are welcome. Please follow the general coding formatting style as much as possible.
59 changes: 33 additions & 26 deletions documentation/docs/backup.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,59 @@

Get5 ships with a backup system built on top of
CS:GO's [built-in round restore system](https://totalcsgo.com/command/mpbackuprestoreloadfile), which can be used to
either replay a round using the [`!stop`](../commands/#stop) command, or to simply restore an entire match's state on
any server using the [`get5_loadbackup`](../commands/#get5_loadbackup) command.
either replay a round using the [`!stop`](../commands#stop) command, or to simply restore an entire match's state on
any server using the [`get5_loadbackup`](../commands#get5_loadbackup) command.

As Get5's backup system sits on top of CS:GO's, it contains everything a normal CS:GO round backup would, but also
the entire [match configuration](../match_schema) and the match series score for already-played maps.

The backup system must be [enabled](../configuration/#get5_backup_system_enabled) for this to work.
The backup system can be enabled or disabled
with [`get5_backup_system_enabled`](../configuration#get5_backup_system_enabled).

### How does it work?
### How does it work? {: #how-to }

Every time a round starts, CS:GO automatically writes a round backup file into the root of the `csgo` directory based on
the value of `mp_backup_round_file`. The default value for this is `backup`. Get5 reads this file and copies it into its
own file called `get5_backup_match%s_map%d_round%d.cfg`, where the arguments are `matchid`, `mapnumber`
and `roundnumber`, respectively. A special backup called `get5_backup_match%s_map%d_prelive.cfg` is created and should
be used if you want to restore to the beginning of the map, before the knife round.
the value of [`mp_backup_round_file`](https://totalcsgo.com/command/mpbackuproundfile), which Get5 will [automatically
adjust to prevent file collisions](../configuration#get5_server_id). Get5 reads this file, copies it into its
own file called `get5_backup%d_match%s_map%d_round%d.cfg`, where the arguments
are [`get5_server_id`](..configuration/#get5_server_id), `matchid`, `mapnumber` and `roundnumber`, respectively, and
then deletes the original backup file. A special backup
called `get5_backup%d_match%s_map%d_prelive.cfg` is created and should be used if you want to restore to the beginning
of the map, before the knife round.

### Example

When in a match, you can call [`get5_listbackups`](../commands/#get5_listbackups) to view all backups for the current
When in a match, you can call [`get5_listbackups`](../commands#get5_listbackups) to view all backups for the current
match. Note that all rounds and map numbers start at 0.

They print in the format `filepath date time team1 team2 map team1_score team2_score`.
They print in the format `filepath timestamp team1 team2 map team1_score team2_score`.

```
> get5_listbackups
get5_backup_match1844_map0_prelive.cfg 2022-07-26 18:51:25 "Team A" "Team B"
get5_backup_match1844_map0_round30.cfg 2022-07-26 19:13:41 "Team A" "Team B" de_dust2 2 28
get5_backup_match1844_map0_round4.cfg 2022-07-26 18:55:01 "Team A" "Team B" de_dust2 2 2
get5_backup_match1844_map0_round10.cfg 2022-07-26 18:59:25 "Team A" "Team B" de_dust2 2 8
get5_backup_match1844_map0_round23.cfg 2022-07-26 19:08:13 "Team A" "Team B" de_dust2 2 21
get5_backup_match1844_map0_round12.cfg 2022-07-26 19:00:26 "Team A" "Team B" de_dust2 2 10
get5_backup_match1844_map0_round17.cfg 2022-07-26 19:03:39 "Team A" "Team B" de_dust2 2 15
get5_backup4_match1844_map0_prelive.cfg 2022-07-26 18:51:25 "Team A" "Team B"
get5_backup4_match1844_map0_round30.cfg 2022-07-26 19:13:41 "Team A" "Team B" de_dust2 2 28
get5_backup4_match1844_map0_round4.cfg 2022-07-26 18:55:01 "Team A" "Team B" de_dust2 2 2
get5_backup4_match1844_map0_round10.cfg 2022-07-26 18:59:25 "Team A" "Team B" de_dust2 2 8
get5_backup4_match1844_map0_round23.cfg 2022-07-26 19:08:13 "Team A" "Team B" de_dust2 2 21
get5_backup4_match1844_map0_round12.cfg 2022-07-26 19:00:26 "Team A" "Team B" de_dust2 2 10
get5_backup4_match1844_map0_round17.cfg 2022-07-26 19:03:39 "Team A" "Team B" de_dust2 2 15
...
```

To load at the beginning of round 13 of the first map of match ID 1844, all players should be connected to the server,
and you use the [`get5_loadbackup`](../commands/#get5_loadbackup) command:
!!! example "Loading a backup"

`get5_loadbackup get5_backup_match1844_map0_round12.cfg`.
To load at the beginning of round 13 of the first map of match ID 1844 from a backup created on a
[server with ID 4](../configuration#get5_server_id), run [`get5_loadbackup`](../commands#get5_loadbackup):

The game should restore in a paused state and both teams must [`!unpause`](../commands/#unpause) to continue.
`get5_loadbackup get5_backup4_match1844_map0_round12.cfg`

### Pauses in backups
After loading a backup, the game state is restored and the game is [paused](../pausing#backup). Both teams
must [`!unpause`](../commands#unpause) to continue.

When restoring from a backup, the [consumed pauses](pausing.md) are reset to the state they were in at the beginning
### Consumed pauses in backups {: #pauses }

When restoring from a backup, the [consumed pauses](../pausing) are reset to the state they were in at the beginning
of the round you restore to, but only if the game state is not currently live. This means that using
the [`!stop`](../commands/#stop) command or the [`get5_loadbackup`](../commands/#get5_loadbackup) command **for the same
match and map** would retain the currently used pauses. If restarting the server or loading the backup from scratch, the
pauses from the backup file will be used.
the [`!stop`](../commands#stop) command or the [`get5_loadbackup`](../commands#get5_loadbackup) command **for the same
match and map while the game is live** will retain the currently used pauses. If restarting the server or loading the
backup from scratch, the consumed pauses defined in the backup file will be set.
40 changes: 21 additions & 19 deletions documentation/docs/coaching.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,55 +7,57 @@ few ["minor" bugs](https://en.wikipedia.org/wiki/Counter-Strike_coaching_bug_sca
### Server requirements {: #requirements }

1. [`sv_coaching_enabled`](https://totalcsgo.com/command/svcoachingenabled) must be set to 1.
2. [`coaches_per_team`](../match_schema/#schema) in your match configuration
or [scrim](../getting_started/#scrims) template must be larger than 0.
2. [`coaches_per_team`](../match_schema#schema) in your match configuration
or [scrim](../getting_started#scrims) template must be larger than 0.
3. The [`-maxplayers_override`](https://developer.valvesoftware.com/wiki/Maxplayers)
launch parameter must be defined on your server to allow for the number of connected clients you expect, including
all players, spectators and coaches.

### Becoming a coach {: #howto }

Due to internal conflicts with how [backups](backup.md) and auto-assignment to teams works in Get5, the default
Due to internal conflicts with how [backups](../backup) and auto-assignment to teams works in Get5, the default
[`coach`](https://counterstrike.fandom.com/wiki/Coaching) console command is disabled. You can become a coach in one of
three ways:

1. Use the [`!coach`](../commands/#coach) chat command during warmup.
2. Be defined as a coach in the [match configuration](../match_schema/#schema) or
via [`get5_addcoach`](../commands/#get5_addcoach).
3. Join a game where the team is already full (determined by [`players_per_team`](../match_schema/#schema)) and where a
1. Use the [`!coach`](../commands#coach) chat command during warmup.
2. Be defined as a coach in the [match configuration](../match_schema#schema) or
via [`get5_addcoach`](../commands#get5_addcoach).
3. Join a game where the team is already full (determined by [`players_per_team`](../match_schema#schema)) and where a
coach slot is available.

!!! warning "Coaching is permanent after warmup"

Once a game begins (goes past the warmup-phase), you cannot enter or leave the coach slot unless you are removed
from coaching using [`get5_removeplayer`](../commands/#get5_removeplayer).
from coaching using [`get5_removeplayer`](../commands#get5_removeplayer).

If the current number of coaches exceeds or equals [`coaches_per_team`](../match_schema/#schema), including if it is
If the current number of coaches exceeds or equals [`coaches_per_team`](../match_schema#schema), including if it is
zero, additional players will be kicked from the match. However, if a connecting player is defined
in [`players`](../match_schema/#schema), the team is full and a coach slot is open, they will be moved to coaching for
in [`players`](../match_schema#schema), the team is full and a coach slot is open, they will be moved to coaching for
the series and can only stop coaching if the game is still in warmup.

This behavior allows you to define as many coaches and players in the match configuration as you want: As long as the
number of players and coaches on the server don't exceed [`players_per_team`](../match_schema/#schema)
and [`coaches_per_team`](../match_schema/#schema), respectively, Get5 will fill the
game's slots with the appropriate number of players and coaches and kick the rest. Being in
the [`coaches`](../match_schema/#schema) section takes precedence over [`players`](../match_schema/#schema).
number of players and coaches on the server don't exceed [`players_per_team`](../match_schema#schema)
and [`coaches_per_team`](../match_schema#schema), respectively, Get5 will fill the
game's slots with the appropriate number of players and coaches and kick the rest. Being defined
in [`coaches`](../match_schema#schema) takes precedence over being defined
in [`players`](../match_schema#schema). If [`sv_coaching_enabled`](https://totalcsgo.com/command/svcoachingenabled) is
disabled, anyone defined as a coach will be considered a regular player for the team instead.

!!! note "Decreasing the number of players"

If a match configuration with [`players_per_team`](../match_schema/#schema) or
[`coaches_per_team`](../match_schema/#schema) set to a number *lower* than the number of players **already connected
If a match configuration with [`players_per_team`](../match_schema#schema) or
[`coaches_per_team`](../match_schema#schema) set to a number *lower* than the number of players **already connected
to the server**, the entire team's players or coaches (whichever is exceeded) will be kicked and must reconnect.

### Coaching in scrims {: #scrims }

When in [scrim mode](../getting_started/#scrims), you cannot set the [`coaches`](../match_schema/#schema) key, and
When in [scrim mode](../getting_started#scrims), you cannot set the [`coaches`](../match_schema#schema) key, and
players are never _locked_ to the coaching slot. This means that to become a coach in a scrim, you must always
call [`!coach`](../commands/#coach) or join a team that already has [`players_per_team`](../match_schema/#schema)
call [`!coach`](../commands#coach) or join a team that already has [`players_per_team`](../match_schema#schema)
players (i.e. is full).

!!! danger "`players_per_team` matters!"

Do not set [`players_per_team`](../match_schema/#schema) in your scrim template to a value larger than the number of
Do not set [`players_per_team`](../match_schema#schema) in your scrim template to a value larger than the number of
players you expect. If you do this, a coach - or any player defined in your scrim template - (re)connecting after
warmup will be put on the team and won't be able to become a coach.
Loading

0 comments on commit cc481b6

Please sign in to comment.