Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
2f12703
[DB] Add Transactions (#12)
tslashd Jan 29, 2024
07b9eff
small patch
tslashd Jan 31, 2024
958fcf8
Change hook methods for OnTriggerStart/EndTouch
1zc Feb 7, 2024
c8be7de
don't start timer after `!s <X>`
tslashd Feb 7, 2024
c06c6cb
reset `IsStageMode`
tslashd Feb 7, 2024
3cc7038
Merge branch 'main' into dev
1zc Feb 14, 2024
dfbdd4d
hi
tslashd Nov 3, 2024
755921b
bonus replays
tslashd Nov 4, 2024
9450674
readme + todo
tslashd Nov 4, 2024
c7c985a
Update README.md
tslashd Dec 28, 2024
cb93b14
Update README.md
tslashd Dec 28, 2024
b42d46b
Update README.md
tslashd Dec 28, 2024
571b455
Latest "update" and reworks (#17)
tslashd Dec 28, 2024
47c6c9e
Merge branch 'CS2Surf:dev' into dev
tslashd Dec 28, 2024
7817c8d
Add Logging
tslashd May 27, 2025
2ed468c
Add Localization; Move chat messages to lang file
tslashd May 28, 2025
259e74e
Implemented Fix Vector Leak
Slumey Jun 2, 2025
e4c0d7f
Players in spec can use restart and teleport commands
Slumey Jun 2, 2025
da6622f
Cleanup for replay indexing; Fixed threading error with FormatBotName()
Slumey Jun 2, 2025
98ac825
feat: set player collision to debris for no block
Slumey Jun 5, 2025
51db553
chore(player.cs): removed unecessary namespaec ref
Slumey Jun 5, 2025
cec7084
fix(TriggerStartTouch..cs): swap Y and Z velocity components
Slumey Jun 5, 2025
c4bb65d
RunStats, IDataAccessService, Models, API
tslashd Jul 7, 2025
b5e0087
Fix POST MapTime for Map runs and Stage PBs; Change POST and PUT methods
tslashd Jul 7, 2025
7a38871
Merge pull request #11 from Slumey/dev
tslashd Jul 7, 2025
6a02752
Merge branch 'reworks' into dev
tslashd Jul 7, 2025
3e0021b
Merge pull request #12 from tslashd/dev
tslashd Jul 7, 2025
7c2033b
small fixes to !spec PR
tslashd Jul 7, 2025
88b4171
fix respawn from spec; minArgs
tslashd Jul 9, 2025
9508974
constructors for models;formatting;credits
tslashd Jul 9, 2025
65a416e
chore: summaries, cleanup
tslashd Jul 10, 2025
64ddd08
dev: TriggerStartTouch separate zone handlers, missing values in Models
tslashd Jul 10, 2025
90d97cc
dev: ZoneEventHandlers.cs, CS# version bump, disable some logs
tslashd Jul 10, 2025
04234aa
feat(commands): amt, amn, amr, tier colors
tslashd Jul 28, 2025
63bdbd7
fix: invalid signature for MapTier command
tslashd Jul 28, 2025
598bbcd
feat: PingAccessService
tslashd Jul 28, 2025
c16119c
dev: switch to .net api;cs# version bump;public classes;prop rename;s…
tslashd Aug 8, 2025
f63a9d1
Update project structure and build configurations
tslashd Aug 8, 2025
0a1e34b
Refactor data models and update API interactions
tslashd Aug 10, 2025
99b7802
Cleanup, error handling refactoring, naming convention.
tslashd Aug 12, 2025
78ea1a2
Refactor map and stage handling in SurfTimer
tslashd Aug 18, 2025
d01e2b0
Refactor PlayerHUD
tslashd Aug 26, 2025
43afca3
fix wrong data being supplied to log message OnMapEnd
tslashd Aug 26, 2025
bc6f6ae
Moved `GetVelocityFromController` for reusability
tslashd Aug 26, 2025
59522cc
Update README, refactor code
tslashd Aug 27, 2025
0895446
Improve formatting and readability in Comms.cs with CSharpier
tslashd Sep 11, 2025
10eb5de
This commit includes significant refactoring and improvements across …
tslashd Sep 11, 2025
ebca671
Add GitHub Actions workflow for SurfTimer.Plugin release
tslashd Sep 11, 2025
0a76920
release workflow
tslashd Sep 11, 2025
e1fc88f
release wf
tslashd Sep 11, 2025
0fa37b1
release wf
tslashd Sep 11, 2025
8612c09
- Build now includes all DLLs required by the Timer to run properly o…
tslashd Sep 11, 2025
290f92d
Remove binary files
tslashd Sep 12, 2025
5ea9184
update readme
tslashd Sep 12, 2025
a036729
Add Dependabot config and bump package versions
tslashd Sep 12, 2025
25b5d7c
Update README.md with dependencies
tslashd Sep 12, 2025
7531047
Update README
tslashd Sep 12, 2025
e22e616
Merge upstream/main into reworks (keep reworks)
tslashd Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

# .github/dependabot.yml
# Keep GitHub Actions up to date and open a SINGLE PR that aggregates all updates.

version: 2
updates:
- package-ecosystem: "github-actions" # manage versions of actions used in .github/workflows
directory: "/" # repo root (covers .github/workflows)
schedule:
interval: "weekly" # run once a week
day: "monday" # every Monday
time: "04:00" # at 04:00 local time
timezone: "Europe/Sofia"
target-branch: "main" # PRs will target this branch
open-pull-requests-limit: 10 # safety cap (not really needed with grouping)
commit-message:
prefix: "chore" # e.g., "chore: bump actions/*"
include: "scope"
groups:
all-actions: # SINGLE PR with everything inside
patterns: ["*"] # match all actions
update-types: ["major", "minor", "patch"] # include all types of bumps

- package-ecosystem: "nuget" # manage NuGet packages in .csproj/.sln files
directory: "/" # Dependabot discovers projects recursively
schedule:
interval: "weekly" # run once a week
day: "monday" # every Monday
time: "04:00" # at 04:00 local time
timezone: "Europe/Sofia"
target-branch: "main" # PRs will target this branch
open-pull-requests-limit: 10 # safety cap (not really needed with grouping)
commit-message:
prefix: "chore" # e.g., "chore: bump MySqlConnector"
include: "scope"
groups:
all-nuget: # SINGLE PR with everything inside
patterns: ["*"] # match all packages
update-types: ["major", "minor", "patch"] # include all types of bumps
166 changes: 166 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
name: Release SurfTimer.Plugin

on:
push:
tags:
- "v*.*.*" # auto trigger on tags like v1.2.3
workflow_dispatch:
inputs:
tag:
description: "Tag to release (e.g., v1.2.3)"
required: true
default: "v0.0.0"

permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Resolve release tag
id: vars
shell: bash
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
else
TAG="${{ github.ref_name }}"
fi
if ! echo "$TAG" | grep -Eq '^v[0-9]'; then
echo "Tag must start with 'v' (e.g., v1.2.3). Got: $TAG"
exit 1
fi
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV
echo "tag=$TAG" >> $GITHUB_OUTPUT

# Checkout plugin repo at the tag
- name: Checkout plugin repository (Timer)
uses: actions/checkout@v4
with:
path: Timer
ref: ${{ env.RELEASE_TAG }}

# Checkout SurfTimer.Shared as sibling folder (ProjectReference resolves via ../../SurfTimer.Shared)
- name: Checkout SurfTimer.Shared
uses: actions/checkout@v4
with:
repository: tslashd/SurfTimer.Shared
path: SurfTimer.Shared
# If private:
# token: ${{ secrets.SHARED_REPO_PAT }}
# Optionally pin to a tag/commit:
# ref: vX.Y.Z

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

# From Timer/src, ProjectReference ../../SurfTimer.Shared/... resolves correctly
- name: Restore (plugin)
working-directory: Timer/src
run: dotnet restore SurfTimer.Plugin.csproj

- name: Build (Release)
working-directory: Timer/src
run: dotnet build SurfTimer.Plugin.csproj -c Release --no-restore

- name: Prepare package layout
id: prep
shell: bash
env:
OUT_ROOT: out
run: |
set -euo pipefail

BIN="Timer/src/bin/Release/net8.0"
PKG="$OUT_ROOT"
ADDONS="$PKG/addons/SurfTimer.Plugin"
CFGDST="$PKG/cfg/SurfTimer"

mkdir -p "$ADDONS/data/GeoIP" "$ADDONS/lang" "$CFGDST"

echo "Build output listing (should contain only selected DLLs):"
ls -la "$BIN"

# Required artifacts (these should exist thanks to your KeepOnlySelectedDlls target)
for f in SurfTimer.Plugin.dll SurfTimer.Shared.dll Dapper.dll MaxMind.Db.dll MaxMind.GeoIP2.dll MySqlConnector.dll; do
test -f "$BIN/$f" || { echo "Missing $f in $BIN"; exit 1; }
done

# Copy all dlls that remain after your KeepOnlySelectedDlls pruning
cp -v "$BIN"/*.dll "$ADDONS/"

# data/GeoIP
SRC_MMDB="Timer/data/GeoIP/GeoLite2-Country.mmdb"
test -f "$SRC_MMDB" || { echo "Missing $SRC_MMDB"; exit 1; }
cp -v "$SRC_MMDB" "$ADDONS/data/GeoIP/"

# lang/en.json
SRC_LANG="Timer/lang/en.json"
test -f "$SRC_LANG" || { echo "Missing $SRC_LANG"; exit 1; }
cp -v "$SRC_LANG" "$ADDONS/lang/"

# cfg/SurfTimer (copy entire folder)
test -d "Timer/cfg/SurfTimer" || { echo "Missing Timer/cfg/SurfTimer"; exit 1; }
cp -vr "Timer/cfg/SurfTimer/." "$CFGDST/"

echo "PKG_PATH=$PKG" >> $GITHUB_OUTPUT

- name: Create ZIP
shell: bash
env:
PKG_NAME: SurfTimer.Plugin-${{ env.RELEASE_TAG }}
run: |
cd out
# zip the *contents* so archive root is addons/ and cfg/
zip -r "${PKG_NAME}.zip" addons cfg
sha256sum "${PKG_NAME}.zip" > "${PKG_NAME}.zip.sha256"
ls -la

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SurfTimer.Plugin-${{ env.RELEASE_TAG }}
path: |
out/SurfTimer.Plugin-${{ env.RELEASE_TAG }}.zip
out/SurfTimer.Plugin-${{ env.RELEASE_TAG }}.zip.sha256

release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Determine tag
id: vars
shell: bash
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
TAG="${{ github.event.inputs.tag }}"
else
TAG="${{ github.ref_name }}"
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "RELEASE_TAG=$TAG" >> $GITHUB_ENV

- name: List artifacts
run: ls -R ./artifacts

- name: Create GitHub Release and upload assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.vars.outputs.tag }}
name: SurfTimer.Plugin ${{ steps.vars.outputs.tag }}
draft: false
prerelease: ${{ contains(steps.vars.outputs.tag, '-rc') || contains(steps.vars.outputs.tag, '-beta') || contains(steps.vars.outputs.tag, '-alpha') }}
files: |
artifacts/SurfTimer.Plugin-${{ env.RELEASE_TAG }}/SurfTimer.Plugin-${{ env.RELEASE_TAG }}.zip
artifacts/SurfTimer.Plugin-${{ env.RELEASE_TAG }}/SurfTimer.Plugin-${{ env.RELEASE_TAG }}.zip.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
src/bin/Debug/*
src/bin/Release/*
src/obj/*
src/SurfTimer.csproj
src/SurfTimer.csproj
*.puml
out/uml/include/full.png
4 changes: 2 additions & 2 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/SurfTimer.csproj",
"${workspaceFolder}/src/SurfTimer.Plugin.csproj",
"/property:Configuration=Debug"
],
"problemMatcher": "$msCompile"
Expand All @@ -18,7 +18,7 @@
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/SurfTimer.csproj",
"${workspaceFolder}/src/SurfTimer.Plugin.csproj",
"/property:Configuration=Release"
],
"problemMatcher": "$msCompile"
Expand Down
14 changes: 13 additions & 1 deletion CS2SurfTimer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ VisualStudioVersion = 17.5.002.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A9962DB7-AE8A-4370-B381-19529A91B7EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SurfTimer", "src\SurfTimer.csproj", "{98841535-B479-49B7-8D35-03786D4C31B9}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SurfTimer.Plugin", "src\SurfTimer.Plugin.csproj", "{98841535-B479-49B7-8D35-03786D4C31B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SurfTimer.Api", "..\SurfTimer.Api\SurfTimer.Api.csproj", "{F53C6067-0A4E-18EF-53CB-69AB97901241}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SurfTimer.Shared", "..\SurfTimer.Shared\SurfTimer.Shared.csproj", "{6FA80551-EAFE-9030-69AA-1CEE7BEC44FB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -17,6 +21,14 @@ Global
{98841535-B479-49B7-8D35-03786D4C31B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{98841535-B479-49B7-8D35-03786D4C31B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{98841535-B479-49B7-8D35-03786D4C31B9}.Release|Any CPU.Build.0 = Release|Any CPU
{F53C6067-0A4E-18EF-53CB-69AB97901241}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F53C6067-0A4E-18EF-53CB-69AB97901241}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F53C6067-0A4E-18EF-53CB-69AB97901241}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F53C6067-0A4E-18EF-53CB-69AB97901241}.Release|Any CPU.Build.0 = Release|Any CPU
{6FA80551-EAFE-9030-69AA-1CEE7BEC44FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6FA80551-EAFE-9030-69AA-1CEE7BEC44FB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6FA80551-EAFE-9030-69AA-1CEE7BEC44FB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6FA80551-EAFE-9030-69AA-1CEE7BEC44FB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# DEVELOPMENT IS NOT ACTIVE

## EVERYONE IS WELCOME TO BUILD UP ON THIS PROJECT AND CONTRIBUTE. ISSUES ARE DISABLED FOR THE TIME BEING
# EVERYONE IS WELCOME TO BUILD UP ON THIS PROJECT AND CONTRIBUTE. ISSUES ARE DISABLED FOR THE TIME BEING
## Please join the Discord: https://discord.cs.surf

# Timer
Expand Down Expand Up @@ -162,11 +160,16 @@ Core plugin for CS2 Surf Servers. This project is aimed to be fully open-source
</details>
</br>

## 🔗 Dependencies
- [`CounterStrikeSharp`](https://github.com/roflmuffin/CounterStrikeSharp) - **required** minimum version [v1.0.337](https://github.com/roflmuffin/CounterStrikeSharp/releases/tag/v1.0.337).
- [`SurfTimer.Shared`](https://github.com/tslashd/SurfTimer.Shared) – **required** shared library for DTOs, entities, and database integration.
- [`SurfTimer.Api`](https://github.com/tslashd/SurfTimer.Api) – *optional* REST API for faster, centralized communication with the database.

# Main list with tasks (more details can be found [here](https://github.com/CS2Surf/Timer/blob/dev/TODO)):
*Note: This is not definitive/complete and simply serves as a reference for what we should try to achieve. Subject to change.*
Bold & Italics = being worked on.
- [ ] Database
- [X] MySQL database schema ([Design Diagram](https://dbdiagram.io/d/CS2Surf-Timer-DB-Schema-6560b76b3be1495787ace4d2))
- [X] MySQL database schema ([Design Diagram](https://dbdiagram.io/d/Copy-of-CS2Surf-Timer-DB-Schema-6582e6e456d8064ca06328b9))
- [ ] Plugin auto-create tables for easier setup?
- [X] Base database class implementation
- [X] Maps
Expand Down Expand Up @@ -207,12 +210,12 @@ Bold & Italics = being worked on.
- [ ] Stretch goal: sub-tick timing
- [ ] Player Data
- [X] Base player class
- [ ] Player stat classes
- [ ] Profile implementation (DB)
- [X] Player stat classes
- [X] Profile implementation (DB)
- [ ] Points/Skill Groups (DB)
- [ ] Player settings (DB)
- [x] Replays
- [x] Personal Best
- [x] Personal Best - Data for the PB replays is saved but no functionality to replay them yet is available
- [x] Map Record
- [X] Stage Record
- [X] Bonus Record
Expand All @@ -222,4 +225,4 @@ Bold & Italics = being worked on.
- [X] Bonus Record
- [ ] Style implementation (SW, HSW, BW)
- [ ] Paint (?)
- [ ] API Integration (Repo can be found [here](https://github.com/CS2Surf/CS2-Surf-API))
- [x] API Integration (Repo can be found [here](https://github.com/tslashd/SurfTimer.Api))
18 changes: 10 additions & 8 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
- Re-add the MySQL queries in code and make it switch between API and DB functions
- Map Time is NOT being saved with API
- Replay Bot Scoreboard names NOT changing when setting new recs

+ Re-add the MySQL queries in code and make it switch between API and DB functions
+ Map Time is NOT being saved with API
- Make configs generate themselves inside the `./configs/plugins/...` folder
- Fix loading MapTimes for each type (stage, bonus, maps)
- API
- DB
- Change `DB_QUERY_MAP_GET_RUNS` query with `DB_QUERY_MAP_GET_RECORD_RUNS_AND_COUNT` in API and edit code in plugin
- Change `DB_QUERY_PB_GET_RUNTIME` query in API
+ Fix loading MapTimes for each type (stage, bonus, maps)
+ API
+ DB
+ Change `DB_QUERY_MAP_GET_RUNS` query with `DB_QUERY_MAP_GET_RECORD_RUNS_AND_COUNT` in API and edit code in plugin
+ Change `DB_QUERY_PB_GET_RUNTIME` query in API

- Double check the Start/End velocities for End Zone,Checkpoints, Stages, Bonuses
+ Maps
Expand All @@ -14,7 +16,7 @@
- Try and get the Start/End velocity values from the Checkpoint object in Map Run
+ Bonuses

- Using `!spec` from any start zone and going back to CT starts your timer
- Using `!spec` from any start zone and going back to CT starts your timer - Will be in a PR

- Try and determine Left/Right side for Bonuses (surf_ace)
- Try and determine Left/Right side for Maps
Expand Down
4 changes: 4 additions & 0 deletions cfg/SurfTimer/api_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"api_url": "API_URL_HERE",
"api_enabled": false
}
5 changes: 4 additions & 1 deletion cfg/SurfTimer/timer_settings.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{}
{
"replays_enabled": true,
"replays_pre": 64
}
Loading
Loading