Skip to content

Commit 1f9f7e0

Browse files
authored
Merge pull request #99 from swiftly-solution/beta
2 parents 1c252ba + 772a1bf commit 1f9f7e0

File tree

2,477 files changed

+59228
-25714
lines changed

Some content is hidden

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

2,477 files changed

+59228
-25714
lines changed

.clang-format

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
# Base style
3+
BasedOnStyle: LLVM
4+
5+
# Indentation settings
6+
IndentWidth: 4
7+
UseTab: Never
8+
TabWidth: 4
9+
10+
# Access modifier offset
11+
AccessModifierOffset: -4
12+
13+
# Brace breaking style
14+
BreakBeforeBraces: Allman
15+
16+
# Pointer and reference alignment
17+
PointerAlignment: Left
18+
ReferenceAlignment: Left
19+
20+
# Space settings
21+
SpaceBeforeParens: ControlStatements
22+
SpaceBeforeAssignmentOperators: true
23+
SpaceBeforeRangeBasedForLoopColon: true
24+
SpaceInEmptyParentheses: false
25+
SpacesInAngles: false
26+
SpacesInContainerLiterals: true
27+
SpacesInParentheses: false
28+
SpacesInSquareBrackets: false
29+
30+
# Column limit
31+
ColumnLimit: 256
32+
33+
# Namespace indentation
34+
NamespaceIndentation: All
35+
36+
# Keep short statements on single line
37+
AllowShortBlocksOnASingleLine: Empty
38+
AllowShortFunctionsOnASingleLine: Empty
39+
AllowShortIfStatementsOnASingleLine: Never
40+
AllowShortLoopsOnASingleLine: false
41+
42+
# Constructor initializer list
43+
ConstructorInitializerIndentWidth: 4
44+
BreakConstructorInitializers: BeforeColon
45+
46+
# Binary operator line breaking
47+
BreakBeforeBinaryOperators: None
48+
49+
# Comment alignment
50+
AlignTrailingComments: true
51+
52+
# Consecutive assignment alignment
53+
AlignConsecutiveAssignments: false
54+
AlignConsecutiveDeclarations: false

.editorconfig

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Visual Studio generated .editorconfig file with C++ settings.
22
root = true
33

4+
[*]
5+
indent_style = space
6+
indent_size = 4
7+
charset = utf-8
8+
49
[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
510

611
# Visual C++ Code Style settings
@@ -12,7 +17,7 @@ cpp_generate_documentation_comments = xml
1217
cpp_indent_braces = false
1318
cpp_indent_multi_line_relative_to = innermost_parenthesis
1419
cpp_indent_within_parentheses = indent
15-
cpp_indent_preserve_within_parentheses = true
20+
cpp_indent_preserve_within_parentheses = false
1621
cpp_indent_case_contents = true
1722
cpp_indent_case_labels = false
1823
cpp_indent_case_contents_when_block = false
@@ -60,7 +65,7 @@ cpp_space_remove_around_member_operators = true
6065
cpp_space_before_inheritance_colon = true
6166
cpp_space_before_constructor_colon = true
6267
cpp_space_remove_before_semicolon = true
63-
cpp_space_after_semicolon = true
68+
cpp_space_after_semicolon = false
6469
cpp_space_remove_around_unary_operator = true
6570
cpp_space_around_binary_operator = insert
6671
cpp_space_around_assignment_operator = insert
@@ -167,8 +172,6 @@ csharp_style_unused_value_expression_statement_preference = discard_variable
167172
dotnet_diagnostic.IDE0058.severity = warning
168173
csharp_style_unused_value_assignment_preference = discard_variable
169174
dotnet_diagnostic.IDE0059.severity = warning
170-
171-
indent_style = space
172175
csharp_indent_case_contents = true
173176
csharp_indent_switch_labels = true
174177
csharp_new_line_before_open_brace = types, object_collection, methods, control_blocks, lambdas

.github/workflows/build.yml

Lines changed: 97 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Setup .NET
4646
uses: actions/setup-dotnet@v4
4747
with:
48-
dotnet-version: '8.0.x'
48+
dotnet-version: '10.0.x'
4949
- name: Build managed
5050
run: |
5151
cd managed
@@ -231,14 +231,14 @@ jobs:
231231
run: |
232232
mkdir -p ./linux-runtimes
233233
cd ./linux-runtimes
234-
wget https://builds.dotnet.microsoft.com/dotnet/Runtime/8.0.20/dotnet-runtime-8.0.20-linux-x64.tar.gz
234+
wget https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.0/dotnet-runtime-10.0.0-linux-x64.tar.gz
235235
mkdir -p content
236-
tar -xzf dotnet-runtime-8.0.20-linux-x64.tar.gz -C content
236+
tar -xzf dotnet-runtime-10.0.0-linux-x64.tar.gz -C content
237237
cd ..
238238
mkdir -p ./windows-runtimes
239239
cd ./windows-runtimes
240-
wget https://builds.dotnet.microsoft.com/dotnet/Runtime/8.0.20/dotnet-runtime-8.0.20-win-x64.zip
241-
unzip dotnet-runtime-8.0.20-win-x64.zip -d content
240+
wget https://builds.dotnet.microsoft.com/dotnet/Runtime/10.0.0/dotnet-runtime-10.0.0-win-x64.zip
241+
unzip dotnet-runtime-10.0.0-win-x64.zip -d content
242242
cd ..
243243
244244
- name: Create package
@@ -262,8 +262,8 @@ jobs:
262262
cp -r linux-runtimes/content/ ${{ env.LINUX_FOLDER }}-with-runtimes/swiftlys2/bin/managed/dotnet
263263
cp -r windows-runtimes/content/ ${{ env.WINDOWS_FOLDER }}-with-runtimes/swiftlys2/bin/managed/dotnet
264264
265-
cp linux-runtimes/content/host/fxr/8.0.20/libhostfxr.so ${{ env.LINUX_FOLDER }}-with-runtimes/swiftlys2/bin/linuxsteamrt64/libhostfxr.so
266-
cp windows-runtimes/content/host/fxr/8.0.20/hostfxr.dll ${{ env.WINDOWS_FOLDER }}-with-runtimes/swiftlys2/bin/win64/hostfxr.dll
265+
cp linux-runtimes/content/host/fxr/10.0.0/libhostfxr.so ${{ env.LINUX_FOLDER }}-with-runtimes/swiftlys2/bin/linuxsteamrt64/libhostfxr.so
266+
cp windows-runtimes/content/host/fxr/10.0.0/hostfxr.dll ${{ env.WINDOWS_FOLDER }}-with-runtimes/swiftlys2/bin/win64/hostfxr.dll
267267
268268
mkdir -p ${{ env.LINUX_FOLDER }}/addons/
269269
mkdir -p ${{ env.WINDOWS_FOLDER }}/addons/
@@ -334,6 +334,95 @@ jobs:
334334
tag_name: ${{ env.TAG_NAME }}
335335
name: Release v${{ needs.versioning.outputs.semVer }}
336336
body: ${{ needs.versioning.outputs.semVer }}
337+
338+
- name: Get commit summary for beta
339+
if: github.ref == 'refs/heads/beta'
340+
id: beta_commits
341+
run: |
342+
# Get the previous tag
343+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
344+
345+
# Get commits since previous tag, or last 10 if no previous tag
346+
if [ -n "$PREV_TAG" ]; then
347+
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"• %s (\`%h\`)" | head -c 900)
348+
else
349+
COMMITS=$(git log -10 --pretty=format:"• %s (\`%h\`)" | head -c 900)
350+
fi
351+
352+
# If commits are empty, set a default message
353+
if [ -z "$COMMITS" ]; then
354+
COMMITS="No commit information available"
355+
fi
356+
357+
echo "summary<<EOF" >> $GITHUB_OUTPUT
358+
echo "$COMMITS" >> $GITHUB_OUTPUT
359+
echo "EOF" >> $GITHUB_OUTPUT
360+
361+
- name: Send Discord notification (Beta)
362+
if: github.ref == 'refs/heads/beta'
363+
uses: tsickert/[email protected]
364+
with:
365+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_BETA }}
366+
embed-title: "🚀 New Beta Release"
367+
embed-description: |
368+
**SwiftlyS2** v${{ needs.versioning.outputs.semVer }} has been released!
369+
370+
**📦 Version:** `${{ needs.versioning.outputs.semVer }}`
371+
**🔖 Tag:** `${{ env.TAG_NAME }}`
372+
373+
**📝 Recent Commits:**
374+
${{ steps.beta_commits.outputs.summary }}
375+
376+
**📥 Download:** [View Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.TAG_NAME }})
377+
embed-color: 65261
378+
embed-timestamp: ${{ github.event.head_commit.timestamp }}
379+
embed-footer-text: "Beta Release • SwiftlyS2"
380+
content: <@&1438068022706311279>
381+
382+
- name: Get commit summary for master
383+
if: github.ref == 'refs/heads/master'
384+
id: master_commits
385+
run: |
386+
# Get the previous tag
387+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
388+
389+
# Get commits since previous tag, or last 15 if no previous tag
390+
if [ -n "$PREV_TAG" ]; then
391+
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"• %s (\`%h\`)" | head -c 900)
392+
else
393+
COMMITS=$(git log -15 --pretty=format:"• %s (\`%h\`)" | head -c 900)
394+
fi
395+
396+
# If commits are empty, set a default message
397+
if [ -z "$COMMITS" ]; then
398+
COMMITS="No commit information available"
399+
fi
400+
401+
echo "summary<<EOF" >> $GITHUB_OUTPUT
402+
echo "$COMMITS" >> $GITHUB_OUTPUT
403+
echo "EOF" >> $GITHUB_OUTPUT
404+
405+
- name: Send Discord notification (Master)
406+
if: github.ref == 'refs/heads/master'
407+
uses: tsickert/[email protected]
408+
with:
409+
webhook-url: ${{ secrets.DISCORD_WEBHOOK_MASTER }}
410+
embed-title: "✨ New Stable Release"
411+
embed-description: |
412+
**SwiftlyS2** v${{ needs.versioning.outputs.semVer }} is now available!
413+
414+
**📦 Version:** `${{ needs.versioning.outputs.semVer }}`
415+
**🔖 Tag:** `${{ env.TAG_NAME }}`
416+
417+
**📝 Changelog Summary:**
418+
${{ steps.master_commits.outputs.summary }}
419+
420+
**📥 Download:** [View Release](https://github.com/${{ github.repository }}/releases/tag/${{ env.TAG_NAME }})
421+
embed-color: 65261
422+
embed-timestamp: ${{ github.event.head_commit.timestamp }}
423+
embed-footer-text: "Stable Release • SwiftlyS2"
424+
content: <@&1438068068587933706>
425+
337426
nuget:
338427
if: ${{ github.event_name == 'push' && github.repository_owner == 'swiftly-solution' }}
339428
needs: [versioning, releasing]
@@ -346,7 +435,7 @@ jobs:
346435
- name: Setup .NET
347436
uses: actions/setup-dotnet@v4
348437
with:
349-
dotnet-version: '8.0.x'
438+
dotnet-version: '10.0.x'
350439
- name: Publish to nuget
351440
run: |
352441
cd managed

README.md

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,29 @@
77

88
SwiftlyS2 is a powerful scripting framework for Source 2 games, built in C++ with C# plugin support. It provides developers with a comprehensive API to create plugins for Source 2-based games like Counter-Strike 2.
99

10-
> [!warning]
11-
> The framework is under a **BETA** release.
12-
13-
## Features
14-
15-
- **C# Plugin Development**: Write plugins in C# with full .NET support
16-
- **Comprehensive API**: Access to game events, player management, and server control
17-
- **High Performance**: Native C++ core with optimized plugin execution
18-
- **Memory Safety**: Built-in memory management and thread-safe operations
19-
- **Hot Reload**: Reload plugins without restarting the server
20-
- **Cross-Platform**: Supports Windows and Linux
21-
- **Source 2 Ready**: Designed specifically for Source 2 engine games
10+
# Why should you choose SwifltyS2?
11+
12+
SwifltyS2 is built with developers in mind, providing an extensive suite of scripting features that make plugin development faster and more efficient.
13+
14+
We're preventing memory leaks when working with the game's SDK and functions, having active maintenance and faster execution speeds through natives which are calling directly Native (core) code.
15+
16+
A list of features:
17+
- **Commands**: Handles custom console commands or chat-based commands in the game.
18+
- **Convars**: Manages console variables (cvars) to control game behavior and configuration.
19+
- **Database**: Provides access to a centralized space to store your database credentials.
20+
- **Entity System**: Handles creation, management, and interaction of game entities.
21+
- **Events**: Manages event hooks, allowing scripts to react to in-game occurrences.
22+
- **GameEvents**: Handles triggering and listening for in-game events. All fields are typed.
23+
- **Memory**: Provides low-level memory manipulation tools for advanced scripting.
24+
- **Menus**: Provides a easy Menu API with tons of customization, from colors to options and much more.
25+
- **Hooks**: A hooking system to hook functions, net messages, entity outputs and more.
26+
- **NetMessages**: Facilitates sending and receiving network messages via protobuf to clients.
27+
- **Profiler**: Tools for performance analysis and debugging of scripts.
28+
- **ProtobufDefinitions**: Types for NetMessages received or sent by the server.
29+
- **Scheduler**: Provides timers and scheduling functionality for deferred or repeated tasks.
30+
- **SchemaDefinitions**: Defines the SDK Schema classes and enums.
31+
- **Schemas**: Schema class helpers for working with Game's SDK.
32+
- **Sounds**: Provides tools for playing and managing audio within the game.
2233

2334
## Supported Games
2435

@@ -29,7 +40,7 @@ SwiftlyS2 is a powerful scripting framework for Source 2 games, built in C++ wit
2940
### Prerequisites
3041

3142
- **Windows**: Visual Studio 2022 with C++ and .NET workloads
32-
- **Linux**: GCC 11+ and .NET 8.0 SDK
43+
- **Linux**: GCC 11+ and .NET 10.0 SDK
3344
- **XMake**
3445

3546
### Building SwiftlyS2

devtools/cloc.exe

11.6 MB
Binary file not shown.

0 commit comments

Comments
 (0)