Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
edd8906
Sync Dev with Main (#18)
tslashd Dec 28, 2024
604eee0
Update README.md
tslashd Apr 23, 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
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,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 @@ -205,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 @@ -220,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))
8 changes: 4 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
- 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
+ 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
+ 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

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