Skip to content

Commit abbc1d8

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix-leak
2 parents 246cb3c + 60db1df commit abbc1d8

File tree

115 files changed

+95419
-70081
lines changed

Some content is hidden

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

115 files changed

+95419
-70081
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
managed/CounterStrikeSharp.API/Generated/**/*.cs text eol=crlf

.github/workflows/sync-schema.yaml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Synchronize - Schema
2+
3+
on:
4+
schedule:
5+
- cron: '0 8 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
update-schema:
10+
runs-on: ubuntu-latest
11+
if: github.repository == 'roflmuffin/CounterStrikeSharp'
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
20+
- name: Setup .NET
21+
uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: '8.0.x'
24+
25+
- name: Install lftp
26+
run: sudo apt-get update && sudo apt-get install -y lftp
27+
28+
- name: Run schema update script
29+
env:
30+
GS_HOST: ${{ secrets.GS_HOST }}
31+
GS_PORT: ${{ secrets.GS_PORT }}
32+
GS_PASS: ${{ secrets.GS_PASS }}
33+
SFTP_HOST: ${{ secrets.SFTP_HOST }}
34+
SFTP_USER: ${{ secrets.SFTP_USER }}
35+
SFTP_PASS: ${{ secrets.SFTP_PASS }}
36+
run: |
37+
mkdir -p ~/.lftp
38+
echo "set sftp:auto-confirm yes" >> ~/.lftp/rc
39+
echo "set ssl:verify-certificate no" >> ~/.lftp/rc
40+
chmod +x eng/update-schema.sh
41+
chmod +x eng/rcon
42+
./eng/update-schema.sh
43+
44+
- name: Get patch version
45+
id: version
46+
run: |
47+
PATCH_VERSION=$(jq -r ".game_info.PatchVersion" managed/CounterStrikeSharp.SchemaGen/Schema/server.json)
48+
echo "patch_version=$PATCH_VERSION" >> $GITHUB_OUTPUT
49+
50+
- name: Check for changes
51+
id: changes
52+
run: |
53+
if [[ -n $(git status --porcelain managed/CounterStrikeSharp.API/Generated/) ]]; then
54+
echo "has_changes=true" >> $GITHUB_OUTPUT
55+
echo "Changes detected in Generated folder:"
56+
git status --porcelain managed/CounterStrikeSharp.API/Generated/
57+
else
58+
echo "has_changes=false" >> $GITHUB_OUTPUT
59+
fi
60+
61+
- name: Create Pull Request
62+
if: steps.changes.outputs.has_changes == 'true'
63+
uses: peter-evans/create-pull-request@v7
64+
with:
65+
token: ${{ secrets.AUTOMATED_PR_PAT }}
66+
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
67+
commit-message: "chore: update schema definitions to ${{ steps.version.outputs.patch_version }}"
68+
title: "chore: Update Schema Definitions to ${{ steps.version.outputs.patch_version }}"
69+
body: |
70+
This PR was automatically generated by the schema update workflow.
71+
72+
## Changes
73+
- Updated schema definitions from the game server
74+
- Regenerated schema code using `CounterStrikeSharp.SchemaGen`
75+
- Patch Version: `${{ steps.version.outputs.patch_version }}`
76+
77+
---
78+
*This is an automated PR. Please review the changes before merging.*
79+
branch: chore/automated/schema-update
80+
delete-branch: true
81+
82+
- name: No changes detected
83+
if: steps.changes.outputs.has_changes == 'false'
84+
run: echo "::notice::No schema changes detected. No PR will be created."

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.env
2+
13
.ccls-cache/
24
.cmake/
35
cmake-build-*/

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
## What's Changed in v1.0.361
2+
* fix: setup server next frame listeners at startup ([dc138c1](https://github.com/roflmuffin/CounterStrikeSharp/commit/dc138c16f3e63ce2fb8f364da5c1d418a3214d84))
3+
4+
## What's Changed in v1.0.360
5+
* fix: update windows signatures for CCSPlayerPawnBase and CCSGameRules by [@K4ryuu](https://github.com/K4ryuu) in [#1199](https://github.com/roflmuffin/CounterStrikeSharp/pull/1199) ([9841c92](https://github.com/roflmuffin/CounterStrikeSharp/commit/9841c92e2da1d1f389f2374e4fb0f556f2a3e1a5))
6+
7+
## What's Changed in v1.0.359
8+
* fix: update set state changed offset for linux ([3262827](https://github.com/roflmuffin/CounterStrikeSharp/commit/326282757fe094cc2eabfcb32fc8e86f6db9aabe))
9+
10+
## What's Changed in v1.0.358
11+
* fix: CPlayerPawnComponent pawn reference ([1614e5c](https://github.com/roflmuffin/CounterStrikeSharp/commit/1614e5c50c8f80063902fe282b28dafd46ad0135))
12+
13+
## What's Changed in v1.0.357
14+
* fix(schema): update schema after followup update ([c1d6bf4](https://github.com/roflmuffin/CounterStrikeSharp/commit/c1d6bf4f838de75382e91f8232bbe2f9b96d2b0f))
15+
* fix: bump sdk & update gamedata for patch 1.41.3.x in [#1187](https://github.com/roflmuffin/CounterStrikeSharp/pull/1187) ([fe3e32f](https://github.com/roflmuffin/CounterStrikeSharp/commit/fe3e32f37984da992c6ec331525252eadc18c509))
16+
* fix(schema): update schema for 1.41.3.0 ([f9617b9](https://github.com/roflmuffin/CounterStrikeSharp/commit/f9617b9a7e52d30d5c5c4433aa8c7ce0e3ad7e16))
17+
118
## What's Changed in v1.0.356
219
* feat: adds configurable limit to `NextFrame` tasks allowed to execute per frame ([925fec0](https://github.com/roflmuffin/CounterStrikeSharp/commit/925fec04801fc09ce294051055b761069fcb733f))
320
* chore(deps): bump libraries/hl2sdk-cs2 from `6e735c1` to `aba345d` by [@dependabot[bot]](https://github.com/dependabot[bot]) in [#1170](https://github.com/roflmuffin/CounterStrikeSharp/pull/1170) ([2eea759](https://github.com/roflmuffin/CounterStrikeSharp/commit/2eea759a2c8cc61bd2679157b78a6e4fb1f51a0e))

configs/addons/counterstrikesharp/gamedata/gamedata.json

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,28 @@
2222
},
2323
"CCSPlayerController_ChangeTeam": {
2424
"offsets": {
25-
"windows": 109,
26-
"linux": 108
25+
"windows": 102,
26+
"linux": 101
2727
}
2828
},
2929
"CCSPlayerController_Respawn": {
3030
"offsets": {
31-
"windows": 277,
32-
"linux": 279
31+
"windows": 272,
32+
"linux": 274
3333
}
3434
},
3535
"CBasePlayerController_SetPawn": {
3636
"signatures": {
3737
"library": "server",
3838
"windows": "44 88 4C 24 ? 53 57",
39-
"linux": "55 48 8D 87 ? ? ? ? 48 89 E5 41 57 41 56 41 89 CE 41 55 45 89 CD"
39+
"linux": "55 48 8D 87 ? ? ? ? 48 89 E5 41 57 41 89 CF"
4040
}
4141
},
4242
"CCSPlayerPawnBase_PostThink": {
4343
"signatures": {
4444
"library": "server",
45-
"windows": "48 ? ? 55 53 56 57 41 ? 48 ? ? ? 48 ? ? ? ? ? ? 4C 89 68",
46-
"linux": "55 48 89 E5 41 56 41 55 41 54 53 48 89 FB 48 83 EC 40 E8 ? ? ? ? F3 0F 10 83"
45+
"windows": "48 8B C4 55 53 56 57 41 54 48 8D 68 ? 48 81 EC ? ? ? ? 4C 89 68 ? 48 8B F9",
46+
"linux": "55 48 89 E5 41 57 49 89 FF 41 56 41 55 41 54 53 48 81 EC ? ? ? ? E8 ? ? ? ? 41 80 BF"
4747
}
4848
},
4949
"CGameEventManager_Init": {
@@ -92,37 +92,37 @@
9292
"signatures": {
9393
"library": "server",
9494
"windows": "48 89 5C 24 ? 57 48 83 EC ? 33 FF 4C 8B CA 8B D9",
95-
"linux": "55 31 D2 48 89 E5 41 56 41 55 41 54"
95+
"linux": "55 31 D2 48 89 E5 41 57 41 56 41 55 41 54 41 89 FC"
9696
}
9797
},
9898
"CCSPlayer_ItemServices_GiveNamedItem": {
9999
"offsets": {
100-
"windows": 18,
101-
"linux": 19
100+
"windows": 19,
101+
"linux": 20
102102
}
103103
},
104104
"CCSPlayer_ItemServices_DropActivePlayerWeapon": {
105105
"offsets": {
106-
"windows": 21,
107-
"linux": 22
106+
"windows": 22,
107+
"linux": 23
108108
}
109109
},
110110
"CCSPlayer_ItemServices_RemoveWeapons": {
111111
"offsets": {
112-
"windows": 22,
113-
"linux": 23
112+
"windows": 23,
113+
"linux": 24
114114
}
115115
},
116116
"CGameSceneNode_GetSkeletonInstance": {
117117
"offsets": {
118118
"windows": 8,
119-
"linux": 8
119+
"linux": 9
120120
}
121121
},
122122
"CCSGameRules_TerminateRound": {
123123
"signatures": {
124124
"library": "server",
125-
"windows": "48 8B C4 4C 89 48 ? 48 89 48 ? 55 56",
125+
"windows": "48 8B C4 4C 89 48 ? 48 89 48 ? 55 56 41 56",
126126
"linux": "55 48 89 E5 41 57 41 56 49 89 FE 41 55 41 54 53 48 81 EC ? ? ? ? 48 8D 05 ? ? ? ? F3 0F 11 85"
127127
}
128128
},
@@ -168,8 +168,8 @@
168168
},
169169
"CBaseEntity_IsPlayerPawn": {
170170
"offsets": {
171-
"windows": 174,
172-
"linux": 173
171+
"windows": 168,
172+
"linux": 167
173173
}
174174
},
175175
"CEntitySystem_AddEntityIOEvent": {
@@ -182,14 +182,14 @@
182182
"LegacyGameEventListener": {
183183
"signatures": {
184184
"library": "server",
185-
"windows": "48 8B 15 ? ? ? ? 48 85 D2 74 ? 83 F9 ? 77 ? 48 63 C1 48 C1 E0",
185+
"windows": "48 8B 15 ? ? ? ? 48 85 D2 74 ? 83 F9 ? 77",
186186
"linux": "48 8B 05 ? ? ? ? 48 85 C0 74 ? 83 FF ? 77 ? 48 63 FF 48 C1 E7 ? 48 8D 44 38"
187187
}
188188
},
189189
"CBasePlayerPawn_CommitSuicide": {
190190
"offsets": {
191-
"windows": 408,
192-
"linux": 408
191+
"windows": 400,
192+
"linux": 400
193193
}
194194
},
195195
"CBasePlayerPawn_RemovePlayerItem": {
@@ -201,15 +201,15 @@
201201
},
202202
"CBaseEntity_Teleport": {
203203
"offsets": {
204-
"windows": 168,
205-
"linux": 167
204+
"windows": 162,
205+
"linux": 161
206206
}
207207
},
208208
"CBaseEntity_TakeDamageOld": {
209209
"signatures": {
210210
"library": "server",
211211
"windows": "40 55 41 54 41 55 41 56 41 57 48 81 EC ? ? ? ? 48 8D 6C 24 ? 48 89 9D ? ? ? ? 45 33 ED",
212-
"linux": "55 48 89 E5 41 57 41 56 49 89 F6 41 55 41 54 49 89 FC 53 48 89 D3 48 83 EC ? 48 85 D2"
212+
"linux": "55 48 89 E5 41 57 41 56 41 55 49 89 FD 41 54 49 89 F4 53 48 89 D3 48 83 EC ? 48 85 D2"
213213
}
214214
},
215215
"CBaseTrigger_StartTouch": {
@@ -242,7 +242,7 @@
242242
"signatures": {
243243
"library": "server",
244244
"windows": "4C 89 4C 24 ? 48 89 4C 24 ? 53 56",
245-
"linux": "55 48 89 E5 41 57 49 89 FF 41 56 41 55 41 54 49 89 D4 53 48 89 F3"
245+
"linux": "55 48 89 E5 41 57 49 89 FF 41 56 41 55 41 54 49 89 D4 53 48 89 F3 48 83 EC ? 48 8D 05"
246246
}
247247
},
248248
"IGameSystem_InitAllSystems_pFirst": {
@@ -280,8 +280,8 @@
280280
},
281281
"SetStateChanged": {
282282
"offsets": {
283-
"windows": 25,
284-
"linux": 26
283+
"windows": 27,
284+
"linux": 28
285285
}
286286
},
287287
"ISource2GameEntities::CheckTransmit": {

eng/rcon

6.43 MB
Binary file not shown.

eng/update-schema.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/bash
2+
3+
HERE=`dirname $0`
4+
5+
set -a
6+
[ -f .env ] && source .env
7+
set +a
8+
9+
set -e
10+
set -u
11+
12+
# Game server RCON details - must come from the environment
13+
: "${GS_HOST:?GS_HOST env var is required}"
14+
: "${GS_PORT:?GS_PORT env var is required}"
15+
: "${GS_PASS:?GS_PASS env var is required}"
16+
17+
# SFTP connection details - must come from the environment
18+
: "${SFTP_HOST:?SFTP_HOST env var is required}"
19+
: "${SFTP_USER:?SFTP_USER env var is required}"
20+
: "${SFTP_PASS:?SFTP_PASS env var is required}"
21+
22+
OUTPUT=$($HERE/rcon -a $GS_HOST:$GS_PORT -p $GS_PASS "dump_schema all")
23+
FILEPATH=$(echo "$OUTPUT" | grep -oP 'Wrote file output to \K.*')
24+
TRIMMED_PATH="${FILEPATH#/home/container}"
25+
26+
lftp -u "$SFTP_USER,$SFTP_PASS" "$SFTP_HOST" <<EOF
27+
set xfer:clobber on
28+
get "$TRIMMED_PATH" -o "$HERE/../managed/CounterStrikeSharp.SchemaGen/Schema/server.json"
29+
bye
30+
EOF
31+
32+
dotnet run --project $HERE/../managed/CounterStrikeSharp.SchemaGen/CounterStrikeSharp.SchemaGen.csproj -- "$HERE/../managed/CounterStrikeSharp.API/Generated/Schema"

0 commit comments

Comments
 (0)