Skip to content

Commit 8a332b6

Browse files
authored
Merge pull request #25 from schwarper/1.9
fix: Fix server crash fix: Fix baseadminsql not inserting to database
2 parents d82be14 + e6bb62d commit 8a332b6

52 files changed

Lines changed: 180 additions & 190 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.

.github/workflows/build.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Build & Publish cs2-admin
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- 'README.md'
9+
- '.github/workflows/**'
10+
11+
jobs:
12+
setup:
13+
permissions:
14+
contents: write
15+
runs-on: ubuntu-latest
16+
outputs:
17+
buildnumber: ${{ steps.buildnumber.outputs.build_number }}
18+
steps:
19+
- name: Generate build number
20+
id: buildnumber
21+
uses: onyxmueller/build-tag-number@v1
22+
with:
23+
token: ${{ secrets.GITHUB_TOKEN }}
24+
25+
build:
26+
needs: setup
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: write
30+
steps:
31+
- name: Prepare Environment Variables
32+
shell: bash
33+
run: |
34+
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
35+
echo "BUILD_NUMBER=${{ needs.setup.outputs.buildnumber }}" >> $GITHUB_ENV
36+
37+
- name: Checkout Repository
38+
uses: actions/checkout@v3
39+
40+
- name: Setup .NET
41+
uses: actions/setup-dotnet@v3
42+
with:
43+
dotnet-version: '8.0.x'
44+
45+
- name: Restore Dependencies
46+
run: dotnet restore
47+
48+
- name: Build
49+
run: |
50+
dotnet build cs2-admin.sln -c Release --no-restore /p:Version=1.${{ env.BUILD_NUMBER }}
51+
52+
- name: Create Release Artifact (ZIP) from BuildOutput
53+
run: |
54+
mkdir -p release
55+
cd BuildOutput
56+
zip -r ../cs2-admin-v1.${{ env.BUILD_NUMBER }}.zip .
57+
58+
- name: Create GitHub Release
59+
id: create_release
60+
uses: actions/create-release@v1
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
with:
64+
tag_name: v1.${{ env.BUILD_NUMBER }}
65+
release_name: v1.${{ env.BUILD_NUMBER }}
66+
draft: false
67+
prerelease: false
68+
body: |
69+
## Release Notes for v1.${{ env.BUILD_NUMBER }}
70+
71+
### Changes:
72+
- ${{ github.event.head_commit.message }}
73+
74+
### Feedback:
75+
- If you encounter any issues, please report them [here](https://github.com/${{ github.repository }}/issues).
76+
77+
- name: Upload Release Asset
78+
uses: actions/upload-release-asset@v1
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
with:
82+
upload_url: ${{ steps.create_release.outputs.upload_url }}
83+
asset_path: ./cs2-admin-v1.${{ env.BUILD_NUMBER }}.zip
84+
asset_name: cs2-admin-v1.${{ env.BUILD_NUMBER }}.zip
85+
asset_content_type: application/zip

adminhelp/adminhelp.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.290" />
11+
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.333" />
1212
<PackageReference Include="Source2Framework.SDK" Version="1.0.16" />
1313
</ItemGroup>
1414

adminhelp/src/adminhelp.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
using CounterStrikeSharp.API;
1+
using System.Reflection;
2+
using System.Text;
3+
using CounterStrikeSharp.API;
24
using CounterStrikeSharp.API.Core;
35
using CounterStrikeSharp.API.Core.Attributes.Registration;
46
using CounterStrikeSharp.API.Core.Commands;
57
using CounterStrikeSharp.API.Core.Translations;
68
using CounterStrikeSharp.API.Modules.Admin;
79
using CounterStrikeSharp.API.Modules.Commands;
810
using Source2Framework.Models;
9-
using System.Reflection;
10-
using System.Text;
1111

1212
namespace AdminHelp;
1313

1414
public class AdminHelp : BasePlugin, IPluginConfig<Config>
1515
{
1616
public override string ModuleName => "Admin Help";
17-
public override string ModuleVersion => "1.8";
17+
public override string ModuleVersion => "1.9";
1818
public override string ModuleAuthor => "schwarper & KillStr3aK";
1919
public override string ModuleDescription => "Display command information";
2020

adminhelp/src/config/config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using CounterStrikeSharp.API.Core;
21
using System.Text.Json.Serialization;
2+
using CounterStrikeSharp.API.Core;
33

44
namespace AdminHelp;
55

antiflood/antiflood.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.290" />
11+
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.333" />
1212
</ItemGroup>
1313

1414
<ItemGroup>

antiflood/src/antiflood.cs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
using System.Collections.Concurrent;
12
using CounterStrikeSharp.API;
23
using CounterStrikeSharp.API.Core;
34
using CounterStrikeSharp.API.Core.Attributes.Registration;
45
using CounterStrikeSharp.API.Core.Translations;
56
using CounterStrikeSharp.API.Modules.Admin;
67
using CounterStrikeSharp.API.Modules.Commands;
78
using CounterStrikeSharp.API.Modules.Cvars;
8-
using CounterStrikeSharp.API.Modules.Memory;
99
using CounterStrikeSharp.API.Modules.Utils;
10-
using Microsoft.Extensions.Localization;
11-
using System.Collections.Concurrent;
1210

1311
namespace AntiFlood;
1412

1513
public class AntiFlood : BasePlugin, IPluginConfig<Config>
1614
{
1715
public override string ModuleName => "Anti-Flood";
18-
public override string ModuleVersion => "1.8";
16+
public override string ModuleVersion => "1.9";
1917
public override string ModuleAuthor => "schwarper";
2018
public override string ModuleDescription => "Protects against chat flooding";
2119

@@ -137,10 +135,6 @@ public HookResult Command_Say_Handler(CCSPlayerController? player, CommandInfo i
137135

138136
public void SendMessageToPlayer(CCSPlayerController player, HudDestination destination, string messageKey, params object[] args)
139137
{
140-
using (new WithTemporaryCulture(player.GetLanguage()))
141-
{
142-
LocalizedString message = Localizer[messageKey, args];
143-
VirtualFunctions.ClientPrint(player.Handle, destination, Config.Tag + message, 0, 0, 0, 0);
144-
}
138+
player.PrintToChat(Config.Tag + Localizer.ForPlayer(player, messageKey, args));
145139
}
146140
}

antiflood/src/config/config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using CounterStrikeSharp.API.Core;
21
using System.Text.Json.Serialization;
2+
using CounterStrikeSharp.API.Core;
33

44
namespace AntiFlood;
55

baseadmin/baseadmin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.290" />
11+
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.333" />
1212
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
1313
</ItemGroup>
1414

baseadmin/src/baseadmin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace BaseAdmin;
1212
public class BaseAdmin : BasePlugin, IPluginConfig<Config>
1313
{
1414
public override string ModuleName => "Base Admin";
15-
public override string ModuleVersion => "1.8";
15+
public override string ModuleVersion => "1.9";
1616
public override string ModuleAuthor => "schwarper";
1717
public override string ModuleDescription => "Basic Admin Manager Plugin";
1818

baseadmin/src/config/config.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using CounterStrikeSharp.API.Core;
21
using System.Text.Json.Serialization;
2+
using CounterStrikeSharp.API.Core;
33

44
namespace BaseAdmin;
55

0 commit comments

Comments
 (0)