Skip to content

Commit 2584c7d

Browse files
committed
Merge origin/main into website redesign
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: da0c9d87-f2bf-4cb3-b656-7f17cd105012
2 parents a5f30a6 + ea53717 commit 2584c7d

151 files changed

Lines changed: 5056 additions & 2023 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
[*.gd]
9+
indent_style = tab
10+
max_line_length = 160
11+
gdscript_formatter_blank_lines_around_definitions = 1

.github/workflows/ci.yml

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
godot:
18+
name: Godot lint & tests
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- name: Setup Godot
25+
uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789
26+
with:
27+
version: 4.6.1
28+
use-dotnet: false
29+
include-templates: false
30+
31+
- name: Setup Python
32+
uses: actions/setup-python@v5
33+
with:
34+
python-version: "3.11"
35+
36+
- name: Install GDScript tooling
37+
run: pip install -r requirements-dev.txt
38+
39+
- name: Install GDScript formatter
40+
run: ./scripts/install-gdscript-formatter.sh
41+
42+
- name: Check formatting
43+
run: .tools/gdscript-formatter --check src tests
44+
45+
- name: Lint
46+
run: gdlint src tests
47+
48+
- name: Run Godot tests
49+
run: ./scripts/test-godot.sh
50+
51+
godot-e2e:
52+
name: Godot E2E
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 5
55+
steps:
56+
- name: Checkout
57+
uses: actions/checkout@v4
58+
59+
- name: Setup Godot
60+
uses: chickensoft-games/setup-godot@f166999204a4f2722c6fe042fbaa3b3ea0d9c789
61+
with:
62+
version: 4.6.1
63+
use-dotnet: false
64+
include-templates: false
65+
66+
- name: Setup Python
67+
uses: actions/setup-python@v5
68+
with:
69+
python-version: "3.11"
70+
71+
- name: Run Deathmatch E2E
72+
run: ./scripts/test-e2e.sh
73+
74+
- name: Upload E2E artifacts
75+
if: failure()
76+
uses: actions/upload-artifact@v4
77+
with:
78+
name: e2e-artifacts
79+
path: artifacts/e2e/
80+
81+
server:
82+
name: Server
83+
runs-on: ubuntu-latest
84+
defaults:
85+
run:
86+
working-directory: server
87+
steps:
88+
- name: Checkout
89+
uses: actions/checkout@v4
90+
91+
- name: Setup Node
92+
uses: actions/setup-node@v4
93+
with:
94+
node-version: 22
95+
96+
- name: Enable corepack
97+
run: corepack enable
98+
99+
- name: Install dependencies
100+
run: pnpm install --frozen-lockfile
101+
102+
- name: Quality
103+
run: pnpm quality
104+
105+
- name: Test
106+
run: pnpm test
107+
108+
- name: Build
109+
run: pnpm build
110+
111+
website:
112+
name: Website
113+
runs-on: ubuntu-latest
114+
defaults:
115+
run:
116+
working-directory: website
117+
steps:
118+
- name: Checkout
119+
uses: actions/checkout@v4
120+
121+
- name: Setup Node
122+
uses: actions/setup-node@v4
123+
with:
124+
node-version: 22
125+
126+
- name: Enable corepack
127+
run: corepack enable
128+
129+
- name: Install dependencies
130+
run: pnpm install --frozen-lockfile
131+
132+
- name: Build
133+
run: pnpm build

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
.godot/
2+
.venv/
3+
.tools/
24
/android/
35
godothost
46
bin
@@ -25,3 +27,4 @@ lerna-debug.log*
2527
build/
2628
steam/steam.env
2729
steam/output/
30+
artifacts/e2e/

.oxfmtrc.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"singleQuote": true,
6+
"printWidth": 80,
7+
"sortPackageJson": false,
8+
"ignorePatterns": ["**/node_modules/**", "**/dist/**", "**/generated/**"]
9+
}

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ Straif is a fast-paced 3D platforming shooter where you race through a variety o
55
It is heavily inspired by source engine games such as Counter Strike: Source, leaving a high skill ceiling for players to compete.
66

77
## Quick Links
8-
- [Website](#Website)
9-
- [Web Api](#Web-Api)
10-
- [Screenshots](#Screenshots)
11-
- [Local Setup](#Local-Setup)
12-
- [Steam Deployment](#Steam-Deployment)
8+
- [Website](#website)
9+
- [Web Api](#web-api)
10+
- [Screenshots](#screenshots)
11+
- [Local Setup](#local-setup)
12+
- [Steam Deployment](#steam-deployment)
1313

1414
## Website
1515

@@ -42,6 +42,10 @@ cd straif
4242
godot -e
4343
```
4444

45+
Requires Godot 4.6.1. Run `./scripts/setup-dev.sh` to install development
46+
dependencies and Git hooks. Run `./scripts/test-godot.sh` for the Godot test
47+
suite and `./scripts/test-e2e.sh` for the multi-process ENet test.
48+
4549
### Hosting a game server
4650

4751
The game executable can be ran as a game server as well by providing the following arguments.
@@ -106,9 +110,10 @@ To run the server directly against the Dockerized database:
106110
cd server
107111
cp .env.example .env
108112
docker compose up -d db
109-
npm install
110-
npx drizzle-kit push
111-
npm run dev
113+
corepack enable
114+
pnpm install --frozen-lockfile
115+
pnpm db:push
116+
pnpm dev
112117
```
113118

114119
## Steam Deployment

gdlintrc

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
class-definitions-order:
2+
- tools
3+
- classnames
4+
- extends
5+
- docstrings
6+
- signals
7+
- enums
8+
- consts
9+
- staticvars
10+
- exports
11+
- pubvars
12+
- prvvars
13+
- onreadypubvars
14+
- onreadyprvvars
15+
- others
16+
class-load-variable-name: (([A-Z][a-z0-9]*)+|_?[a-z][a-z0-9]*(_[a-z0-9]+)*)
17+
class-name: ([A-Z][a-z0-9]*)+
18+
class-variable-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
19+
comparison-with-itself: null
20+
constant-name: _?[A-Z][A-Z0-9]*(_[A-Z0-9]+)*
21+
disable:
22+
- class-definitions-order
23+
- function-arguments-number
24+
- max-public-methods
25+
- max-returns
26+
duplicated-load: null
27+
enum-element-name: '[A-Z][A-Z0-9]*(_[A-Z0-9]+)*'
28+
enum-name: ([A-Z][a-z0-9]*)+
29+
excluded_directories: !!set
30+
.git: null
31+
expression-not-assigned: null
32+
function-argument-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
33+
function-arguments-number: 10
34+
function-name: (_on_([A-Z][a-z0-9]*)+(_[a-z0-9]+)*|_?[a-z][a-z0-9]*(_[a-z0-9]+)*)
35+
function-preload-variable-name: ([A-Z][a-z0-9]*)+
36+
function-variable-name: '[a-z][a-z0-9]*(_[a-z0-9]+)*'
37+
load-constant-name: (([A-Z][a-z0-9]*)+|_?[A-Z][A-Z0-9]*(_[A-Z0-9]+)*)
38+
loop-variable-name: _?[a-z][a-z0-9]*(_[a-z0-9]+)*
39+
max-file-lines: 1000
40+
max-line-length: 160
41+
max-public-methods: 20
42+
max-returns: 6
43+
mixed-tabs-and-spaces: null
44+
no-elif-return: null
45+
no-else-return: null
46+
signal-name: '[a-z][a-z0-9]*(_[a-z0-9]+)*'
47+
sub-class-name: _?([A-Z][a-z0-9]*)+
48+
tab-characters: 1
49+
trailing-whitespace: null
50+
unnecessary-pass: null
51+
unused-argument: null

lefthook.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
pre-commit:
2+
piped: true
3+
commands:
4+
gdscript-format:
5+
priority: 1
6+
glob: "*.gd"
7+
exclude:
8+
- "addons/**/*"
9+
run: .tools/gdscript-formatter --safe {staged_files}
10+
stage_fixed: true
11+
gdlint:
12+
priority: 2
13+
glob: "*.gd"
14+
exclude:
15+
- "addons/**/*"
16+
run: .venv/bin/gdlint {staged_files}
17+
oxfmt:
18+
priority: 3
19+
glob: "*.{ts,tsx,js,jsx,vue}"
20+
run: server/node_modules/.bin/oxfmt {staged_files}
21+
stage_fixed: true
22+
oxlint:
23+
priority: 4
24+
glob: "*.{ts,tsx,js,jsx,vue}"
25+
run: server/node_modules/.bin/oxlint --deny-warnings --vue-plugin {staged_files}
26+
27+
pre-push:
28+
parallel: true
29+
commands:
30+
godot-suite:
31+
run: ./scripts/test-godot.sh && ./scripts/test-e2e.sh
32+
server-quality:
33+
run: cd server && pnpm quality && pnpm test && pnpm build
34+
website-build:
35+
run: cd website && pnpm build

requirements-dev.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
gdtoolkit==4.5.0
2+
lefthook==2.1.10

scripts/deploy-game-servers.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
11
#!/usr/bin/env bash
2-
#
3-
# Build the Straif Linux server binary locally, ship it to the droplet, and
4-
# (re)build + restart the dockerized game servers there.
5-
#
6-
# The droplet only copies the prebuilt binary into a tiny image, so it never has
7-
# to run a memory-hungry Godot export.
8-
#
9-
# Usage:
10-
# DROPLET_HOST=user@1.2.3.4 ./scripts/deploy-game-servers.sh [--skip-build]
11-
#
12-
# Config (env or flags):
13-
# DROPLET_HOST ssh target, e.g. root@1.2.3.4 (required)
14-
# DROPLET_PATH remote dir to sync into (default: ~/straif-game-servers)
15-
# --skip-build reuse an existing build/linux/ instead of re-exporting
162

173
set -euo pipefail
184

scripts/game-server-docker.sh

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
#!/usr/bin/env bash
2-
#
3-
# Launch a single ad-hoc Straif dedicated game server in Docker.
4-
#
5-
# Builds the game-server image (from the prebuilt build/linux/ binary) if needed,
6-
# then runs one named, UDP-port-mapped container. Use the compose file
7-
# (docker/game-servers.compose.yaml) instead when you want a managed fleet.
8-
#
9-
# Usage:
10-
# ./scripts/game-server-docker.sh <name> <port> <max_players> <mode>
11-
#
12-
# Example:
13-
# ./scripts/game-server-docker.sh DM-1 3005 8 deathmatch
142

153
set -euo pipefail
164

0 commit comments

Comments
 (0)